Example 8.13 Heat Conduction in a Slab with Radiation Boundary Conditions
Equation (8.1.29) is solved in Maple below:
| > | restart:with(inttrans):with(plots): |
| > | eq:=diff(u(x,t),t)=diff(u(x,t),x$2); |
| (1) |
| > | u(x,0):=1; |
| (2) |
| > | bc1:=diff(u(x,t),x)=0; |
| (3) |
| > | bc2:=diff(u(x,t),x)+u(x,t)=0; |
| (4) |
| > | eqs:=laplace(eq,t,s): |
| > | eqs:=subs(laplace(u(x,t),t,s)=U(x),eqs); |
| (5) |
| > | bc1:=laplace(bc1,t,s): |
| > | bc1:=subs(laplace(u(x,t),t,s)=U(x),bc1); |
| (6) |
| > | bc2:=laplace(bc2,t,s): |
| > | bc2:=subs(laplace(u(x,t),t,s)=U(x),bc2); |
| (7) |
| > | dsolve(eqs,U(x)); |
| (8) |
| > | U(x):=c[1]*cosh(s^(1/2)*x)+c[2]*sinh(s^(1/2)*x)+1/s; |
| (9) |
| > | eq0:=eval(subs(x=0,bc1)): |
| > | eq1:=eval(subs(x=1,bc2)): |
| > | con:=solve({eq0,eq1},{c[1],c[2]}): |
| > | U(x):=subs(con,U(x)): |
| > | U(x):=factor(simplify(U(x))); |
| (10) |
| > | P(s):=numer(U(x)); |
| (11) |
| > | Q(s):=denom(U(x)); |
| (12) |
Maple cannot find the eigenvalues directly.
| > | solve(Q(s),s); |
| (13) |
| > | eig:=sinh(s^(1/2))*s^(1/2)+cosh(s^(1/2)); |
| (14) |
For convenience s=-λ2 is substituted to find the eigenvalues.
| > | eiglambda:=simplify(subs(s^(1/2)=I*lambda,s=-lambda^2,eig)); |
| (15) |
| > | plot(eiglambda,lambda=0..20,thickness=3,title="Figure 8.23.",axes=boxed); |
![]() |
The roots are:
| > | 0,0,-lambda^2; |
| (16) |
| > | fsolve(eiglambda,lambda=1); |
| (17) |
The first 20 eigenvalues are obtained numerically.
| > | N:=20; |
| (18) |
| > | l[1]:=fsolve(eiglambda,lambda=0..2); |
| (19) |
| > | for i from 2 to N do l[i]:=fsolve(eiglambda,lambda=l[i-1]..l[i-1]+4);od: |
| > | seq(l[i],i=1..N); |
| (20) |
| > | mu0:=0; |
| (21) |
| > | b[2]:=(s-mu0)^2*P(s)/Q(s); |
| (22) |
| > | B[2]:=limit(b[2],s=0); |
| (23) |
| > | b[1]:=diff(b[2],s): |
| > | B[1]:=limit(b[1],s=0); |
| (24) |
| > | A(s):=P(s)/diff(Q(s),s): |
| > | A[n]:=simplify(subs(s=mu,A(s))); |
| (25) |
| > | A[n]:=simplify(subs(mu^(1/2)=I*lambda,mu^(3/2)=-I*lambda^3,mu=-lambda^2,A[n])); |
| (26) |
| > | vars:={cos(lambda)=lambda*sin(lambda)}; |
| (27) |
| > | A[n]:=simplify(subs(vars,expand(A[n]))); |
| (28) |
| > | b1s:=B[1]*subs(mu0=0,1/(s-mu0)); |
| (29) |
| > | b1t:=invlaplace(b1s,s,t); |
| (30) |
| > | b2s:=B[2]*subs(mu0=0,1/(s-mu0)^2); |
| (31) |
| > | b2t:=invlaplace(b2s,s,t); |
| (32) |
| > | uns:=A[n]/(s-mu); |
| (33) |
| > | unt:=invlaplace(uns,s,t); |
| (34) |
| > | unt:=subs(mu=-l[n]^2,lambda=l[n],unt); |
![]() |
(35) |
The solution obtained can then be plotted.
| > | U:=b1t+b2t+Sum(unt,n=1..infinity); |
![]() |
(36) |
| > | u:=piecewise(t=0,1,t>0,subs(infinity=20,U)): |
| > | u:=evalf(u): |
| > | plot3d(u,x=0..1,t=0..0.5,axes=boxed,title="Figure 8.24.",labels=[x,t,"u"],orientation=[45,60]); |
![]() |
| > | plot([subs(t=0,u),subs(t=0.1,u),subs(t=0.2,u),subs(t=0.5,u)],x=0..1,title="Figure 8.25.",axes=boxed,thickness=5,labels=[x,"u"]); |
![]() |
| > |