Example 8.9 Heat Conduction with the Time Dependent Boundary Conditions
Equation (8.1.19) is solved by slightly modifying the Maple program used for example 8.7 as:
| > |
| > | eq:=diff(u(x,t),t)=diff(u(x,t),x$2); |
| (1) |
| > | u(x,0):=0; |
| (2) |
| > | bc1:=diff(u(x,t),x)=0; |
| (3) |
| > | bc2:=u(x,t)=exp(-t); |
| (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); |
| (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)); |
| (10) |
| > | P(s):=numer(U(x)); |
| (11) |
| > | Q(s):=denom(U(x)); |
| (12) |
| > | A(s):=P(s)/diff(Q(s),s); |
![]() |
(13) |
| > | solve(Q(s),s); |
| (14) |
| > | _EnvAllSolutions := true: |
| > | solve(Q(s),s): |
The roots are:
| > | -1,-((2*n-1)*Pi/2)^2; |
| (15) |
| > | A[n]:=simplify(subs(s=mu,A(s))); |
| (16) |
| > | A[0]:=subs(mu^(1/2)=I,mu=-1,A[n]): |
| > | A[0]:=simplify(A[0]); |
| (17) |
| > | A[n]:=simplify(subs(mu^(1/2)=I*(2*n-1)/2*Pi,mu=-((2*n-1)*Pi/2)^2,A[n])): |
| > | vars:={cos(1/2*(2*n-1)*Pi)=0,sin(1/2*(2*n-1)*Pi)=(-1)^(n-1)}: |
| > | A[n]:=simplify(subs(vars,A[n])); |
| (18) |
| > | u0s:=A[0]*subs(mu=-1,1/(s-mu)); |
| (19) |
| > | u0t:=invlaplace(u0s,s,t); |
| (20) |
| > | uns:=A[n]/(s-mu); |
| (21) |
| > | unt:=invlaplace(uns,s,t); |
| (22) |
| > | unt:=subs(mu=-((2*n-1)/2*Pi)^2,unt); |
![]() |
(23) |
| > | U:=u0t+Sum(unt,n=1..infinity); |
![]() |
(24) |
| > | u:=piecewise(t=0,0,t>0,subs(infinity=20,U)): |
The following plots are obtained:
| > | plot3d(u,x=0..1,t=0..1,axes=boxed,title="Figure 8.16.",labels=[x,t,"u"],orientation=[-150,50]); |
![]() |
The dimensionless temperature at the surface x =0 reaches a maximum and then decreases as a function of time:
| > | plot(subs(x=0,u),t=0..2,thickness=3,axes=boxed,title="Figure Exp. 8.17.",labels=[t,"u(0,t)"]); |
![]() |
| > |
| > |