Example 8.15.mw
Example 8.15 Heat Conduction in a Rectangle with a Time Dependent Boundary Condition
Equation (8.1.35) is solved in Maple below for a general time dependent function, w(t), and plots are obtained for a particular step function.
| > |
 |
| > |
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),laplace(w(t),t,s)=W(s),bc1); |
 |
(6) |
| > |
bc2:=subs(laplace(u(x,t),t,s)=U(x),laplace(w(t),t,s)=W(s),bc2); |
 |
(7) |
 |
(8) |
| > |
U(x):=c[1]*cosh(s^(1/2)*x)+c[2]*sinh(s^(1/2)*x); |
![`+`(`*`(c[1], `*`(cosh(`*`(`^`(s, `/`(1, 2)), `*`(x))))), `*`(c[2], `*`(sinh(`*`(`^`(s, `/`(1, 2)), `*`(x))))))](images/Example 8.15_10.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) |
Next U1(x) is written as a product of two functions (see equations (8.1.31) and (8.1.33)):
| > |
U1(x):=simplify(U(x)/W(s)/s); |
 |
(12) |
U1(x) is chosen so that q(s) is a higher order than p(s) (see equation (8.1.32)):
 |
(13) |
where W(s) is the Laplace transform of the time dependent boundary condition w(t) in equation (8.11.35.). Next, U1(X) is inverted to the time domain as illustrated in section 8.1.7 to obtain f(t) as:
 |
(14) |
 |
(15) |
 |
(16) |
| > |
_EnvAllSolutions := true; |
 |
(17) |
 |
(18) |
 |
(19) |
 |
(20) |
| > |
b[2]:=(s-mu0)^2*P(s)/Q(s); |
 |
(21) |
 |
(22) |
 |
(23) |
| > |
A(s):=P(s)/diff(Q(s),s): |
| > |
A[n]:=simplify(subs(s=mu,A(s))); |
 |
(24) |
| > |
A[n]:=simplify(subs(mu^(1/2)=I*n*Pi,mu^(3/2)=-I*n^3*Pi^3,mu=-n^2*Pi^2,A[n])): |
 |
(25) |
| > |
A[n]:=simplify(subs(vars,A[n])): |
| > |
A[n]:=simplify(subs(vars,expand(A[n]))); |
 |
(26) |
| > |
b1s:=B[1]*subs(mu0=0,1/(s-mu0)); |
 |
(27) |
| > |
b1t:=invlaplace(b1s,s,t); |
 |
(28) |
| > |
b2s:=B[2]*subs(mu0=0,1/(s-mu0)^2); |
 |
(29) |
| > |
b2t:=invlaplace(b2s,s,t); |
 |
(30) |
 |
(31) |
| > |
unt:=invlaplace(uns,s,t); |
 |
(32) |
| > |
unt:=subs(mu=-n^2*Pi^2,unt); |
 |
(33) |
| > |
f(t):=b1t+b2t+Sum(unt,n=1..infinity); |
 |
(34) |
Next, a step function is chosen for w(t) and plotted:
| > |
w(t):=Heaviside(t-1)-1/2*Heaviside(t-2); |
 |
(35) |
| > |
plot(w(t),t=0..5,thickness=3,title="Figure Exp. 8.28.",axes=boxed); |
The Laplace transform of w(t) is:
| > |
W(s):=laplace(w(t),t,s); |
 |
(36) |
The function g(t) is obtained by inverting G(s):
 |
(37) |
| > |
g(t):=invlaplace(G(s),s,t); |
 |
(38) |
Next, the convolution integral is carried out to obtain the final time domain solution as:
| > |
gtau:=subs(t=tau,g(t)); |
 |
(39) |
| > |
ftau:=subs(t=t-tau,f(t)); |
 |
(40) |
| > |
U:=int(ftau*gtau,tau=0..t); |

 |
(41) |
| > |
u:=piecewise(t=0,0,t>0,subs(infinity=20,U)): |
| > |
plot3d(simplify(u),x=0..1,t=0..5,axes=boxed,title="Figure Exp. 8.29.",labels=[x,t,"u"],orientation=[135,45]); |
The dimensionless temperature at different points inside the rectangle are plotted as:
| > |
plot([simplify(subs(x=1,u)),simplify(subs(x=0.75,u)),simplify(subs(x=0.5,u)),simplify(subs(x=0.25,u)),simplify(subs(x=0.0,u))],t=0..5.,thickness=3,axes=boxed,title="Figure Exp. 8.30.",labels=[t,"u"]); |