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);

| (1)

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

| (2)

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

| (3)

> | bc2:=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);

| (5)

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

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

| (6)

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

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

| (7)

The governing equation in the Laplace domain is solved as:

> | dsolve(eqs,U(x));

| (8)

The governing equation is solved with the boundary conditions as:

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

| (9)

The solution obtained is converted to the time domain as:

> | u:=invlaplace(U(x),s,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([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"]);

> |

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.