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: 

 

Typesetting:-mrow(Typesetting:-mo(Typesetting:-mrow(Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-mo( 

 

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

diff(u(x, t), t) = `*`(alpha, `*`(diff(diff(u(x, t), x), x))) (1)
 

Enter the initial condition here: 

> u(x,0):=1;
 

1 (2)
 

The boundary condition at x = 0 is entered here: 

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

u(0, t) = 0 (3)
 

Enter the second boundary condition here: 

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

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

`+`(`*`(s, `*`(laplace(u(x, t), t, s))), `-`(1)) = `*`(alpha, `*`(diff(diff(laplace(u(x, t), t, s), x), x))) (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);
 

`+`(`*`(s, `*`(U(x))), `-`(1)) = `*`(alpha, `*`(diff(diff(U(x), x), x))) (6)
 

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

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

laplace(u(0, t), t, s) = 0 (7)
 

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

U(0) = 0 (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)));
 

`+`(`*`(exp(`/`(`*`(`^`(s, `/`(1, 2)), `*`(x)), `*`(`^`(alpha, `/`(1, 2))))), `*`(_C2)), `-`(`/`(`*`(exp(`+`(`-`(`/`(`*`(`^`(s, `/`(1, 2)), `*`(x)), `*`(`^`(alpha, `/`(1, 2))))))), `*`(`+`(`*`(_C2, `*... (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 Typesetting:-mrow(Typesetting:-mi( becomes ∞ as x tends to ∞.  Hence, in the above expression, the coefficient of Typesetting:-mrow(Typesetting:-mfenced(Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-mi( 

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

_C2 (10)
 

> _C2:=solve(eqc,_C2);
 

0 (11)
 

This simplifies the solution since: 

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

`+`(`-`(`/`(`*`(exp(`+`(`-`(`/`(`*`(`^`(s, `/`(1, 2)), `*`(x)), `*`(`^`(alpha, `/`(1, 2)))))))), `*`(s))), `/`(1, `*`(s))) (12)
 

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

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

`+`(`-`(invlaplace(`/`(`*`(exp(`+`(`-`(`/`(`*`(`^`(s, `/`(1, 2)), `*`(x)), `*`(`^`(alpha, `/`(1, 2)))))))), `*`(s)), s, t)), 1) (13)
 

This solution can be further simplified since: 

> u:=convert(u,erf);
 

`+`(`-`(invlaplace(`/`(`*`(exp(`+`(`-`(`/`(`*`(`^`(s, `/`(1, 2)), `*`(x)), `*`(`^`(alpha, `/`(1, 2)))))))), `*`(s)), s, t)), 1) (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]);
 

Plot
 

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

Plot
 

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

PLOT(CURVES([[0., 0.], [0.5449288540e-2, 0.969820238e-1], [0.1089857708e-1, .1925365108], [0.1634786562e-1, .2852986527], [0.2179715416e-1, .3740245283], [0.2653855098e-1, .4470999194], [0.3127994780e... (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"]]);
 

PLOT(TEXT([.12, `+`(`-`(`*`(1., `*`(invlaplace(`/`(`*`(exp(`+`(`-`(`*`(2.529822128, `*`(`^`(s, `/`(1, 2)))))))), `*`(s)), s, 1)))), 1.)], (16)
 

> display({pfs,pts});
 

Plot_2d
 

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

 

Plot_2d
 

>