I am trying to solve set of PDE's by using Gelarkin Finite element method for gaseous phase adsorption of VOCs on activated carbon for drawing breakthrough curves. I have used a quadratic polynomial as a basis function. I have taken 5 elements (i.e. 11 nodes). I have a made a program in MATLAB. When I run the program it gives absurd results like it says matrix is close to singular and badly scaled. Now my question is whether 5 elements are sufficient or should I increase the no. of elements? and how to get rid of this error.