Example 3.3
Consider diffusion with a first order reaction in a semi-infinite plane:
C
where C is the dimensionless concentration, D1 is the diffusion and k is the rate constant. This equation is solved below using the procedure described above.
| > |
with(linalg):with(plots): |
 |
(1) |
| > |
eq:=diff(C(x),x$2)-k/D1*C(x); |
 |
(2) |
| > |
A:=matrix(N,N,[0,1,k/D1,0]); |
 |
(3) |
 |
(4) |
| > |
Y0:=matrix(N,1,[1,c[1]]); |
 |
(5) |
 |
(6) |
 |
(7) |
This can be rewritten as
| > |
C:=collect(C,exp(1/D1*(D1*k)^(1/2)*x)); |
![`+`(`*`(`+`(`/`(1, 2), `/`(`*`(`/`(1, 2), `*`(D1, `*`(c[1]))), `*`(`^`(`*`(D1, `*`(k)), `/`(1, 2))))), `*`(exp(`/`(`*`(`^`(`*`(D1, `*`(k)), `/`(1, 2)), `*`(x)), `*`(D1))))), `*`(`/`(1, 2), `*`(exp(`+`...](images/Example3.3 Rev 1_10.gif) |
(8) |
| > |
C:=collect(C,exp(-1/D1*(D1*k)^(1/2)*x)); |
![`+`(`*`(`+`(`/`(1, 2), `-`(`/`(`*`(`/`(1, 2), `*`(D1, `*`(c[1]))), `*`(`^`(`*`(D1, `*`(k)), `/`(1, 2)))))), `*`(exp(`+`(`-`(`/`(`*`(`^`(`*`(D1, `*`(k)), `/`(1, 2)), `*`(x)), `*`(D1))))))), `*`(`+`(`/`...](images/Example3.3 Rev 1_11.gif) |
(9) |
Since C is finite as x tends to infinity, the second parenthesis must go to zero because exp(x) goes to infinity as x goes to infinity. Consequently, the equation for c1 can be found by setting the coefficient of the second term equal to zero:
| > |
eqbc:=coeff(C,exp(1/D1*(D1*k)^(1/2)*x)); |
![`+`(`/`(1, 2), `/`(`*`(`/`(1, 2), `*`(D1, `*`(c[1]))), `*`(`^`(`*`(D1, `*`(k)), `/`(1, 2)))))](images/Example3.3 Rev 1_12.gif) |
(10) |
| > |
c[1]:=solve(eqbc,c[1]); |
 |
(11) |
Thus, the desired solution for C is simply:
 |
(12) |
Plots can be made by substituting values for the parameters D1 and k:
 |
(13) |
| > |
plot(subs(pars,C),x=0..1e-2,labels=[x,"C"],thickness=4,axes=boxed,title="Figure Exp. 3.1.6."); |
New plots can be made by substituting different values for the paramters.
 |
(14) |
| > |
plot(subs(pars,C),x=0..1e-2,labels=[x,"C"],thickness=4,axes=boxed,color=black,title="Figure Exp. 3.1.7."); |
We observe that as the diffusion coefficient decreases mass transfer limitations increase the length of the diffusion layer (distance required for C to drop to approximately 0) which decreases as expected.