Example4.7rev 1.mw
Example 4.7 Unsteady State Diffusion with a First-Order Reacton
Consider the transient diffusion problem.[6] The governing equation is
=D
u(x,0) = 0 (4.1.7)
(0,t) = 1 and u(∞,t) is defined
where D is the diffusivity (m2/s) and k is the rate constant (s-1) . Equation (4.1.7) is solved in Maple below using the Laplace transform technique:
| > |
restart:with(linalg):with(inttrans):with(plots): |
| > |
eq:=diff(u(x,t),t)=D*diff(u(x,t),x$2)-k*u(x,t); |
 |
(1) |
 |
(2) |
 |
(3) |
| > |
bc2:=u(infinity,t)=defined; |
 |
(4) |
 |
(5) |
| > |
eqs:=subs(laplace(u(x,t),t,s)=U(x),eqs); |
 |
(6) |
 |
(7) |
| > |
bc1:=subs(laplace(u(0,t),t,s)=U(0),bc1); |
 |
(8) |
| > |
U(x):=rhs(dsolve({eqs,bc1})); |
 |
(9) |
| > |
eqc:=coeff(U(x),exp(1/D^(1/2)*(s+k)^(1/2)*x)); |
 |
(10) |
 |
(11) |
 |
(12) |
Here again Maple cannot find the inverse Laplace transform:
 |
(13) |
From the poperty of the laplace transform,[7] we n=know that
 |
(14) |
Again, Maple cannot invert U1 directly:
 |
(15) |
Another formula[7] is used:
 |
(16) |
The inverse transform for U2 is:
| > |
U2:=subs({D=D1,x=x1},U2); |
 |
(17) |
| > |
u2:=invlaplace(U2,s,t); |
 |
(18) |
| > |
u2:=subs({D1=D,x1=x},u2); |
 |
(19) |
The inverse transform for U1 iS:
 |
(20) |
 |
(21) |
| > |
I1:=simplify(changevar(t=x^2/4/D/T^2,I1,T)); |
 |
(22) |
| > |
I1:=subs(T=T1,x=x1,D=D1,I1); |
 |
(23) |

 |
(24) |
| > |
I1:=subs({x1=x,T1=T,D1=D},I1); |
 |
(25) |
 |
(26) |
| > |
I2:=eval(subs(T=infinity,I1)); |
 |
(27) |
 |
(28) |
| > |
u:=collect(u,exp(x/D^(1/2)*k^(1/2))); |
 |
(29) |
 |
(30) |
| > |
u:=subs(T=x/2/(D*t)^(1/2),u); |
 |
(31) |
| > |
convert(expand(simplify(eval(subs(k=0,u)))),erfc); |
 |
(32) |
| > |
expand(D*(expand(-eval(subs(x=0,diff(u,x)))))); |
 |
(33) |
 |
(34) |
| > |
plot3d(subs(pars,u),x=1e-3..0,t=10..0,axes=boxed,labels=[x,t,"u"],orientation=[-60,60]); |
| > |
plot([subs(pars,t=0.01,u),subs(pars,t=0.1,u),subs(pars,t=1,u),subs(pars,t=2,u)],x=0..1e-3,axes=boxed,thickness=5,labels=[x,"u"]); |