Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: PDE Toolbox is solving my parabolic equation incorrectly.
Replies: 1   Last Post: Nov 11, 2013 5:53 PM

 Messages: [ Previous | Next ]
 Catherine Posts: 1 Registered: 11/11/13
PDE Toolbox is solving my parabolic equation incorrectly.
Posted: Nov 11, 2013 3:27 PM

Hello all,

I'm having a problem with getting parabolic to return the correct solutions.

I'm working with the equation:
u_t = u_xx + u_yy +nu for any c value
on the domain [-1, 1] x [-1, 1]

From the analytic solution, I know that with an initial condition of sin(pi*x)*sin(pi*y), the solution should be
u=e^(n-2pi^2)*t)*sin(pi*x)*sin(pi*y)
so if n < 2pi^2, then u should go to 0 over time. (e is raised to a negative exponent)
If n=2pi^2, then u should go to sin(pi*x)*sin(pi*y) (e is raised to 0)
and if n > 2pi^2, then u should go to positive infinity over time. (e is raised to a positive exponent)

I tried to simulate these results using PDE Toolbox and the parabolic function, but the results are far from what they're supposed to be as indicated by the analytic solution. Most of the solutions go to negative infinity, regardless of the n value. Can anyone tell me where I'm going wrong in my code/logic and why I'm getting wacky results?

I use the gui to define the boundaries and the mesh from x = -1:1 and y= -1:1, then I export decomposed geometry as p, e, and t.

Then, here's the MATLAB code I'm using to solve and plot:

tlist=0:.1:1; %Set tspan
c=1;
a=-(n); % I input actual values for n before I run the code.
f=0;
d=1;
u0='sin(pi*x).*sin(pi*y)';
u1=parabolic(u0,tlist,'squareb1',p,e,t,c,a,f,d);
pdemesh(p,e,t,u1(:,end))

*I'm using the raw code instead of the pde toolbox gui to solve simply because I prefer the raw code. I get the same results if I use the pde toolbox gui.

Any suggestions or comments are greatly appreciated!

Date Subject Author
11/11/13 Catherine
11/11/13 Bill Greene