4.6.3 1) heat2-2.mws 1-D Heat Equation plane steel wall - both sides are insulated (Neumann BC) L=0.1 m
> | restart; |
> | u[0](x):=10000*(x-L/3)^2+100; |
Eigenfuctions:
> | X[n]:=cos(n*Pi*x/L); |
> | T[n]:=exp(-n^2*Pi^2*t/L^2/a^2); |
Fourier coefficients:
> | b[0]:=simplify(factor(int(u[0](x),x=0..L)/L)); |
> | b[n]:=2*int(u[0](x)*X[n],x=0..L)/L; |
> | b[n]:=simplify(factor(subs({sin(n*Pi)=0,cos(n*Pi)=(-1)^n},b[n]))); |
> | L:=0.1;a:=500; |
> | u(x,t):=b[0]+sum(b[n]*X[n]*T[n],n=1..10): |
> | plot3d(u(x,t),x=0..L,t=0..600,axes=boxed,projection=0.85); |
> | with(plots): |
Warning, the name changecoords has been redefined
ua = veraged temperature of the wall:
> | ua:=value(int(u[0](x),x=0..L)/L); |
> | animate({ua,u(x,t),u[0](x)},x=0..L,t=0..1200,frames=500,axes=boxed,color=black); |
> |
> | u0:=subs(t=0,u(x,t)): |
> | u1:=subs(t=60,u(x,t)): |
> | u2:=subs(t=300,u(x,t)): |
> | u3:=subs(t=600,u(x,t)): |
> | plot({ua,u[0](x),u0,u1,u2,u3},x=0..L,axes=boxed,color=black); |
> |
> |
> |