Example 8.3.mw

Example 8.3 Heat Transfer in a Rectangle 

Example (8.1.3) is solved in Maple below: 

> restart:with(inttrans):with(plots):
 

> eq:=diff(u(x,t),t)=diff(u(x,t),x$2);
 

diff(u(x, t), t) = diff(diff(u(x, t), x), x) (1)
 

> u(x,0):=sin(Pi*x);
 

sin(`*`(Pi, `*`(x))) (2)
 

> bc1:=u(x,t)=0;
 

u(x, t) = 0 (3)
 

> bc2:=u(x,t)=0;
 

u(x, t) = 0 (4)
 

The governing equation and the boundary conditions are converted to the Laplace domain: 

> eqs:=laplace(eq,t,s):
 

> eqs:=subs(laplace(u(x,t),t,s)=U(x),eqs);
 

`+`(`*`(s, `*`(U(x))), `-`(sin(`*`(Pi, `*`(x))))) = diff(diff(U(x), x), x) (5)
 

> bc1:=laplace(bc1,t,s):
 

> bc1:=subs(laplace(u(x,t),t,s)=U(0),bc1);
 

U(0) = 0 (6)
 

> bc2:=laplace(bc2,t,s):
 

> bc2:=subs(laplace(u(x,t),t,s)=U(1),bc2);
 

U(1) = 0 (7)
 

The governing equation in the Laplace domain is solved as: 

> dsolve(eqs,U(x));
 

U(x) = `+`(`*`(exp(`*`(`^`(s, `/`(1, 2)), `*`(x))), `*`(_C2)), `*`(exp(`+`(`-`(`*`(`^`(s, `/`(1, 2)), `*`(x))))), `*`(_C1)), `/`(`*`(sin(`*`(Pi, `*`(x)))), `*`(`+`(s, `*`(`^`(Pi, 2)))))) (8)
 

The governing equation is solved with the boundary conditions as: 

> U(x):=rhs(dsolve({eqs,bc1,bc2},U(x)));
 

`/`(`*`(sin(`*`(Pi, `*`(x)))), `*`(`+`(s, `*`(`^`(Pi, 2))))) (9)
 

The solution obtained is converted to the time domain as: 

> u:=invlaplace(U(x),s,t);
 

`*`(sin(`*`(Pi, `*`(x))), `*`(exp(`+`(`-`(`*`(`^`(Pi, 2), `*`(t))))))) (10)
 

> plot3d(u,x=1..0,t=0..0.2,axes=boxed,title="Figure Exp. 8.5.",labels=[x,t,"u"],orientation=[120,60]);
 

Plot
 

> plot([subs(t=0,u),subs(t=0.05,u),subs(t=0.1,u),subs(t=0.2,u)],x=0..1,title="Figure 8.6.",axes=boxed,thickness=5,labels=[x,"u"]);
 

Plot_2d
 

>
 

In all the examples previously discussed, the boundary conditions did not involve derivatives until now.  When there is a derivative in the boundary condition it has to be taken care of while applying the Laplace transform as shown in the next example.