Example4.2 rev 1.mw
Example 4.2 Heat Conduction with Transient Boundary Conditions
Heat condition with a constant boundary condition at x =0 was considered in example 4.1. The same technique can be applied for time dependent boundary conditions. Consider the transient heat conduction problem in a slab.[4] The governing equation is:
=α
u(x,0) = 1
u(0,t) =
and u(∞,t) is defined (4.1.2)
| > |
restart:with(linalg):with(inttrans):with(plots): |
| > |
eq:=diff(u(x,t),t)=alpha*diff(u(x,t),x$2); |
 |
(1) |
 |
(2) |
 |
(3) |
| > |
bc2:=u(infinity,t)=defined; |
 |
(4) |
The governing equation in the Laplace domain is:
| > |
eqs:=subs(laplace(u(x,t),t,s)=U(x),eqs); |
 |
(5) |
 |
(6) |
The boundary condition in the Laplace domain is:
| > |
bc1:=subs(laplace(u(0,t),t,s)=U(0),bc1); |
 |
(7) |
| > |
U(x):=rhs(dsolve({eqs,bc1},U(x))); |
 |
(8) |
| > |
eqc:=coeff(U(x),exp(1/alpha^(1/2)*s^(1/2)*x)); |
 |
(9) |
 |
(10) |
The dimensionless temperature in the Laplace domain is:
 |
(11) |
Next, the solution is inverted to the time domain:
| > |
u:=invlaplace(U(x),s,t); |
 |
(12) |
Maple is not able to invert the solution in the Laplace domain. This can be solved by using dummy variables for x and α and defining them to be positive:
| > |
U(x):=subs(x=x1,alpha=alpha1,U(x)); |
 |
(13) |
| > |
u:=invlaplace(U(x),s,t); |
 |
(14) |
| > |
u:=subs(x1=x,alpha1=alpha,u); |
 |
(15) |
Hence, the final solution is:
| > |
pars:={alpha=0.001,k=1}; |
 |
(16) |
| > |
plot3d(subs(pars,u),x=1..0,t=300..0,axes=boxed,title="Figure Exp. 4.1.5.",labels=[x,t,"u"],orientation=[45,45]); |
| > |
plot([subs(pars,t=1,u),subs(pars,t=10,u),subs(pars,t=100,u),subs(pars,t=200,u)],x=0..1,axes=boxed,title="Figure Exp. 4.1.6.",thickness=5,labels=[x,"u"],legend=["t=1","t=10","t=100","t=200"]); |
| > |
animate(subs(pars,u),x=0..1,t=1..100,thickness=5,title="Figure Exp. 4.1.6.",axes=boxed,labels=[x,"u"]);
|
You can make an animation using the command illustrated in example 4.1.