Example 8.10.mw
Example 8.10 Heat Transfer in a Rectangle
Equation (8.1.26) is solved in Maple below:
| > |
restart:with(inttrans):with(plots): |
| > |
eq:=diff(u(x,t),t)=diff(u(x,t),x$2); |
 |
(1) |
 |
(2) |
 |
(3) |
 |
(4) |
| > |
eqs:=subs(laplace(u(x,t),t,s)=U(x),eqs); |
 |
(5) |
| > |
bc1:=subs(laplace(u(x,t),t,s)=U(x),bc1); |
 |
(6) |
| > |
bc2:=subs(laplace(u(x,t),t,s)=U(x),bc2); |
 |
(7) |
 |
(8) |
| > |
U(x):=c[1]*cosh(s^(1/2)*x)+c[2]*sinh(s^(1/2)*x)+1/s; |
![`+`(`*`(c[1], `*`(cosh(`*`(`^`(s, `/`(1, 2)), `*`(x))))), `*`(c[2], `*`(sinh(`*`(`^`(s, `/`(1, 2)), `*`(x))))), `/`(1, `*`(s)))](images/Example 8.10_9.gif) |
(9) |
| > |
eq0:=eval(subs(x=0,bc1)): |
| > |
eq1:=eval(subs(x=1,bc2)): |
| > |
con:=solve({eq0,eq1},{c[1],c[2]}): |
 |
(10) |
| > |
U(x):=factor(combine(simplify(U(x)))); |
 |
(11) |
 |
(12) |
 |
(13) |
 |
(14) |
| > |
_EnvAllSolutions := true; |
 |
(15) |
 |
(16) |
s = 0 is repeated twice (one root coming from 2 and the other coming from the sine term in q(s)). The roots are (where n goes from 1 to infinity):
 |
(17) |
 |
(18) |
The coefficients B2 and B1 are found as (equation (8.1.22) and (8.1.24)):
| > |
b[2]:=(s-mu0)^2*P(s)/Q(s); |
 |
(19) |
 |
(20) |
 |
(21) |
For this problem the contribution from the repeated root s = 0 is zero. This is not always true as shown in the next example.
| > |
A(s):=P(s)/diff(Q(s),s): |
| > |
A[n]:=simplify(subs(s=mu,A(s))); |
 |
(22) |
| > |
A[n]:=simplify(subs(mu^(1/2)=I*n*Pi,mu=-n^2*Pi^2,A[n])): |
| > |
vars:={cos(n*Pi)=(-1)^n,sin(n*Pi)=0}; |
 |
(23) |
| > |
A[n]:=simplify(subs(vars,A[n])): |
| > |
A[n]:=simplify(subs(vars,expand(A[n]))); |
 |
(24) |
| > |
b1s:=B[1]*subs(mu0=0,1/(s-mu0)); |
 |
(25) |
| > |
b1t:=invlaplace(b1s,s,t); |
 |
(26) |
| > |
b2s:=B[2]*subs(mu0=0,1/(s-mu0)^2); |
 |
(27) |
| > |
b2t:=invlaplace(b2s,s,t); |
 |
(28) |
 |
(29) |
| > |
unt:=invlaplace(uns,s,t); |
 |
(30) |
| > |
unt:=subs(mu=-n^2*Pi^2,unt); |
 |
(31) |
The solution is obtained and plotted as:
| > |
U:=b1t+b2t+Sum(unt,n=1..infinity); |
 |
(32) |
| > |
u:=piecewise(t=0,1,t>0,subs(infinity=20,U)): |
| > |
plot3d(u,x=0..1,t=0..0.5,axes=boxed,title="Figure Exp. 8.18.",labels=[x,t,"u"],orientation=[45,60]); |
| > |
plot([subs(t=0,u),subs(t=0.01,u),subs(t=0.05,u),subs(t=0.1,u)],x=0..1,axes=boxed,title="Figure Exp. 8.19.",thickness=5,labels=[x,"u"]); |