MATLAB: Laplace Equation with pdepe command

MATLABpdepe laplace equation

Hi, I am learning to solve PDEs with pdepe command. First, I try to solve a Laplace equation (1D) setting zero the right coefficients in the PDE. I am expecting the solution to be e.g. y=m*x + b. However I get curves and not lines and I do not know why. I attach the M-files below.
Thanks.

Best Answer

Setting s=1, the solution is of the form u(x)=-1/2*x^2+a*x+b.
Best wishes
Torsten.
Related Question