Example4 1 Rev.mw

Example 4.1 Heat Conduction in a Rectangular Slab

Consider the following transient heat conduction problem in a slab.[1-3] The governing equation is:

=α

u(x,0) = 1

u(0,t) = 0 and u(∞,t) is defined (4.1.1)

where α is the thermal diffusivity (m2/s). Equation (4.1.1) is solved below using Maple:

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

The governing equation is stored in the equation:

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

| (1)

Enter the initial condition here:

> | u(x,0):=1;

| (2)

The boundary condition at x = 0 is entered here:

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

| (3)

Enter the second boundary condition here:

> | bc2:=u(infinity,t)=defined;

| (4)

The governing equation and the boundary condition at x = 0 are converted to the Laplace domain:

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

| (5)

The given partial differential equation is transformed to an ordinary differential equation in the Laplace domain since

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

| (6)

where U(x) is the dependent variable in the Laplace domain:

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

| (7)

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

| (8)

Next, the dependent variable in the Laplace domain is solved using the 'dsolve' command since (see chapter 3.1.6):

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

| (9)

The constant _C2 is found using the boundary condition at x = ∞. The dependent variable U(x) is defined at x = ∞. In the above expression becomes ∞ as x tends to ∞. Hence, in the above expression, the coefficient of

> | eqc:=coeff(U(x),exp(1/alpha^(1/2)*s^(1/2)*x));

| (10)

> | _C2:=solve(eqc,_C2);

| (11)

This simplifies the solution since:

> | U(x):=eval(U(x));

| (12)

The solution obtained in the Laplace domain is converted to the time domain since:

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

| (13)

This solution can be further simplified since:

> | u:=convert(u,erf);

| (14)

The solution obtained can be plotted for a particular value of the parameter α since:

> | plot3d(subs(alpha=0.001,u),x=1..0,t=500..0,axes=boxed,title="Figure Exp. 4.1.1.",labels=[x,t,"u"],orientation=[120,60]);

The same plot is made for a different value of α here:

> | plot3d(subs(alpha=0.1,u),x=1..0,t=50..0,axes=boxed,title="Figure Exp. 4.1.2.",labels=[x,t,"u"],orientation=[120,60]);

Next, the dimensionless temperature u is plotted versus x for different values of time as shown below:

> | pfs:=plot([subs(alpha=0.001,t=1,u),subs(alpha=0.001,t=10,u),subs(alpha=0.001,t=100,u),subs(alpha=0.001,t=200,u)],x=0..1,axes=boxed,title="Figure Exp. 4.1.3.",thickness=4,labels=[x,"u"]);

| (15)

> | pts:=textplot([[0.12,evalf(subs(alpha=0.001,t=1,x=0.08,u)),"t=1"],[0.25,evalf(subs(alpha=0.001,t=10,x=0.2,u)),"t=10"],[0.58,evalf(subs(alpha=0.001,t=100,x=0.5,u)),"t=100"],[0.69,evalf(subs(alpha=0.001,t=200,x=0.6,u)),"t=200"]]);

| (16)

> | display({pfs,pts});

An animation in time can be made since:

> | animate(subs(alpha=0.001,u),x=0..1,t=1..500,thickness=4,title="Figure Exp. 4.1.4.",axes=boxed,labels=[x,"u"]);

> |