Example4.4 rev 1.mw

Example 4.4 

In the previous examples, the initial condition was a constant and independent of x.  The same technique can be applied for the case where there is an initial temperature profile.  Consider the transient heat conduction problem in a slab 

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

 

                                                                            u(x,0) =sin(πx) 

                                                                              

                                                   

                                                                           Typesetting:-mrow(Typesetting:-mi((0,t) = 0 and u(∞,t) is defined                                  (4.1.4) 

 

Equation (4.1.4) is solved in Maple below.  The programs given for the previous examples have to be modified to solve equation (4.1.4) by only changing the initial condition: 

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

> 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):=sin(Pi*x);
 

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

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

u(0, t) = 0 (3)
 

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

u(infinity, t) = defined (4)
 

The following solution and plots are obtained: 

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

`+`(`*`(s, `*`(laplace(u(x, t), t, s))), `-`(sin(`*`(Pi, `*`(x))))) = `*`(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))), `-`(sin(`*`(Pi, `*`(x))))) = `*`(alpha, `*`(diff(diff(U(x), x), x))) (6)
 

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

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

`+`(`*`(exp(`/`(`*`(`^`(s, `/`(1, 2)), `*`(x)), `*`(`^`(alpha, `/`(1, 2))))), `*`(_C2)), `-`(`*`(_C2, `*`(exp(`+`(`-`(`/`(`*`(`^`(s, `/`(1, 2)), `*`(x)), `*`(`^`(alpha, `/`(1, 2)))))))))), `/`(`*`(sin... (9)
 

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

_C2 (10)
 

> _C2:=solve(eqc,_C2);
 

0 (11)
 

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

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

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

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

> pars:={alpha=0.001};
 

{alpha = 0.1e-2} (14)
 

> plot3d(subs(pars,u),x=10..0,t=100..0,axes=boxed,title="Figure Exp. 4.1.9.",labels=[x,t,"u"],orientation=[-60,60]);
 

Plot
 

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

Plot_2d
 

>