Example4.6 rev1.mw

Example 4.6 

Consider the transient heat conduction problem in a slab.[4]  The governing equation in dimensionless form is 

 

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

 

                                                                            u(x,0) = 1                                                    (4.1.6) 

 

                                                                                                                                 

                                                                          Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-mo( (0,t) = h*u(0,t) and u(∞,t) is defined        

 

where α is the thermal diffusivity (m2/s) and h is the heat transfer coefficient (m-1).  Carslaw and Jaeger[4] presented solutions for this problem after transforming the governing equation and boundary conditions to a form convenient for similarity transformation.  Equation (4.1.6) is solved in Maple below using the Laplace transform technique (note that the transformation is not necessary with this approach):               

 

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

The governing equation is entered here: 

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

> u(x,0):=1;
 

1 (2)
 

Enter the boundary condition here: 

> bc1:=diff(u(x,t),x)-h*u(x,t)=0;
 

`+`(diff(u(x, t), x), `-`(`*`(h, `*`(u(x, t))))) = 0 (3)
 

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

u(infinity, t) = defined (4)
 

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

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

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

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

`+`(diff(laplace(u(x, t), t, s), x), `-`(`*`(h, `*`(laplace(u(x, t), t, s))))) = 0 (7)
 

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

`+`(diff(U(x), x), `-`(`*`(h, `*`(U(x))))) = 0 (8)
 

> bc1:=convert(bc1,D);
 

`+`((D(U))(x), `-`(`*`(h, `*`(U(x))))) = 0 (9)
 

The boundary condition in the Laplace domain is: 

> bc1:=subs(x=0,bc1);
 

`+`((D(U))(0), `-`(`*`(h, `*`(U(0))))) = 0 (10)
 

U is solved as: 

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

`+`(`/`(`*`(`/`(1, 2), `*`(exp(`/`(`*`(`^`(s, `/`(1, 2)), `*`(x)), `*`(`^`(alpha, `/`(1, 2))))), `*`(`+`(`*`(`^`(s, `/`(1, 2)), `*`(h, `*`(_C1, `*`(`^`(alpha, `/`(1, 2)))))), `*`(_C1, `*`(s)), `-`(1))... (11)
 

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

`+`(`/`(`*`(`/`(1, 2), `*`(`+`(`*`(`^`(s, `/`(1, 2)), `*`(h, `*`(_C1, `*`(`^`(alpha, `/`(1, 2)))))), `*`(_C1, `*`(s)), `-`(1)))), `*`(s))) (12)
 

> coef:=solve(eqc,{_C1});
 

{_C1 = `/`(1, `*`(`+`(`*`(`^`(s, `/`(1, 2)), `*`(h, `*`(`^`(alpha, `/`(1, 2))))), s)))} (13)
 

The temperature profile in the Laplace domain is: 

> U(x):=evala(subs(coef,U(x)));
 

`+`(`-`(`/`(`*`(exp(`+`(`-`(`/`(`*`(`^`(s, `/`(1, 2)), `*`(x)), `*`(`^`(alpha, `/`(1, 2))))))), `*`(alpha, `*`(h))), `*`(`+`(`*`(h, `*`(alpha)), `*`(`^`(alpha, `/`(1, 2)), `*`(`^`(s, `/`(1, 2))))), `*... (14)
 

Maple cannot find the inverse of the Laplace transform: 

> invlaplace(U(x),s,t);
 

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

The above expression is split into two terms U1 and U2 as shown below: 

> U1:=1/(s);
 

`/`(1, `*`(s)) (16)
 

> u1:=invlaplace(U1,s,t);
 

1 (17)
 

> U2:=U(x)-U1;
 

`+`(`-`(`/`(`*`(exp(`+`(`-`(`/`(`*`(`^`(s, `/`(1, 2)), `*`(x)), `*`(`^`(alpha, `/`(1, 2))))))), `*`(alpha, `*`(h))), `*`(`+`(`*`(h, `*`(alpha)), `*`(`^`(alpha, `/`(1, 2)), `*`(`^`(s, `/`(1, 2))))), `*... (18)
 

The inverse of U2 is: 

> U2:=subs({x=x1,alpha=alpha1},U2);
 

`+`(`-`(`/`(`*`(exp(`+`(`-`(`/`(`*`(`^`(s, `/`(1, 2)), `*`(x1)), `*`(`^`(alpha1, `/`(1, 2))))))), `*`(alpha1, `*`(h))), `*`(`+`(`*`(h, `*`(alpha1)), `*`(`^`(alpha1, `/`(1, 2)), `*`(`^`(s, `/`(1, 2))))... (19)
 

> assume(x1>0,alpha1>0);
 

> u2:=invlaplace(U2,s,t);
 

`+`(`-`(erfc(`+`(`/`(`*`(`/`(1, 2), `*`(x1)), `*`(`^`(`*`(alpha1, `*`(t)), `/`(1, 2))))))), `*`(exp(`*`(h, `*`(`+`(`*`(h, `*`(alpha1, `*`(t))), x1)))), `*`(erfc(`+`(`/`(`*`(`/`(1, 2), `*`(`+`(x1, `*`(... (20)
 

> u2:=subs({x1=x,alpha1=alpha},u2);
 

`+`(`-`(erfc(`+`(`/`(`*`(`/`(1, 2), `*`(x)), `*`(`^`(`*`(alpha, `*`(t)), `/`(1, 2))))))), `*`(exp(`*`(h, `*`(`+`(`*`(h, `*`(alpha, `*`(t))), x)))), `*`(erfc(`+`(`/`(`*`(`/`(1, 2), `*`(`+`(x, `*`(2, `*... (21)
 

 

Finally, the temperature distribution is given by: 

> u:=u1+u2;
 

`+`(1, `-`(erfc(`+`(`/`(`*`(`/`(1, 2), `*`(x)), `*`(`^`(`*`(alpha, `*`(t)), `/`(1, 2))))))), `*`(exp(`*`(h, `*`(`+`(`*`(h, `*`(alpha, `*`(t))), x)))), `*`(erfc(`+`(`/`(`*`(`/`(1, 2), `*`(`+`(x, `*`(2,... (22)
 

> pars:={alpha=1e-3,h=0.01};
 

{h = 0.1e-1, alpha = 0.1e-2} (23)
 

> plot3d(subs(pars,u),x=1..0,t=500..0,axes=boxed,title="Figure Exp. 4.1.13.",labels=[x,t,"u"],orientation=[110,60]);
 

Plot
 

> plot([subs(pars,t=10,u),subs(pars,t=100,u),subs(pars,t=200,u),subs(pars,t=500,u)],x=0..1,axes=boxed,title="Figure Exp. 4.1.14.",thickness=5,labels=[x,"u"]);
 

Plot_2d
 

> us:=eval(subs(x=0,u));
 

`*`(exp(`*`(`^`(h, 2), `*`(alpha, `*`(t)))), `*`(erfc(`/`(`*`(h, `*`(alpha, `*`(t))), `*`(`^`(`*`(alpha, `*`(t)), `/`(1, 2))))))) (24)
 

>