Heat equation with Neumann B.C. in Maple

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 3K views
lolly
Messages
1
Reaction score
0
Hello!
I have written the code in Maple for Heat equation with Neumann B.C. Could anyone check it? I will be very grateful!

Heat equation: diff(u(x,t),t)=diff(u(x,t),x,x);
Initial condition: U(x,0)=2*x;
Boundary conditions: Ux(0,t)=0; Ux(L,t)=0;
I use centered difference approximation for the Neumann conditions. For my case:
ec9a874377a5.jpg

The code:
7f770ce86447.jpg


I really do not know about my mistakes. I know how to solve it with Dirichle B.C. But I do not know how to write the code in Maple for Neumann B.C.
Thank You!
 
Physics news on Phys.org
</code>My suggestion would be to use the pdsolve command in Maple. This command allows you to solve Partial Differential Equations (PDE). You can specify the boundary conditions and initial conditions in the command and it will generate the solution to your PDE. For example, for the Heat equation with Neumann B.C., the following command could be used: pdsolve(diff(u(x,t),t)=diff(u(x,t),x,x),u(x,0)=2*x,u(0,t)=0,u(L,t)=0);Hope this helps!