Example4.5 rev1.mw

Example 4.5  Heat Conduction with a Source Term 

The technique illustrated in the previous examples can be applied for the case where there is a source term (this source term can be a function of x and t).  Consider the transient heat conduction problem in a slab[5] 

 

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

 

                                                                            u(x,0) =0                                                          (4.1.5) 

                                                                              

                                                   

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

 

Equation (4.1.5) is solved in Maple below.  The programs given for the previous example can be modified to solve equation (4.1.5).  

 

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

Only the governing equation has to be changed since: 

> eq:=diff(u(x,t),t)=alpha*diff(u(x,t),x$2)+sin(x)*exp(-t);
 

diff(u(x, t), t) = `+`(`*`(alpha, `*`(diff(diff(u(x, t), x), x))), `*`(sin(x), `*`(exp(`+`(`-`(t)))))) (1)
 

> u(x,0):=0;
 

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

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

`*`(s, `*`(U(x))) = `+`(`*`(alpha, `*`(diff(diff(U(x), x), x))), `/`(`*`(sin(x)), `*`(`+`(1, s)))) (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(x)), `*`(`+`(1, s), `*`(`+`(s, alpha)))) (12)
 

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

`/`(`*`(sin(x), `*`(`+`(exp(`+`(`-`(t))), `-`(exp(`+`(`-`(`*`(alpha, `*`(t))))))))), `*`(`+`(`-`(1), alpha))) (13)
 

> pars:={alpha=1/5};
 

{alpha = `/`(1, 5)} (14)
 

> plot3d(subs(pars,u),t=5..0,x=10..0,axes=boxed,title="Figure Exp. 4.1.11.",labels=[x,t,"u"]);
 

Plot
 

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

Plot_2d
 

> animate(subs(pars,u),x=0..10,t=0..5,thickness=5,axes=boxed,labels=[x,"u"]);

 

Plot_2d
 

>