Example 3.2.1 Series Solution for Diffusion with a Second Order Reaction

Consider diffusion with a second order reaction in a rectangular pellet.[18] The dimensionless concentration is governed by:

with the boundary condiitons:

and

where Φ is the Thiele modulus. This boundary value problem is solved in Maple below for different values of Φ. The unknown initial condition c(0) is taken as an unknown constant cl.

> | restart:

> | with(plots):

Enter the governing equation:

> | eq:=diff(c(x),x$2)=Phi^2*c(x)^2;

| (1)

Enter the boundary condition at x = 1"

> | bc:=c(x)-1;

| (2)

The series solutions are obtained assuming that c(0) = cl:

> | sol:=dsolve({eq,c(0)=c1,D(c)(0)=0},{c(x)},type=series);

| (3)

The order of the series is increased to get more accurate solutions:

> | Order:=8;

| (4)

> | sol:=dsolve({eq,c(0)=c1,D(c)(0)=0},{c(x)},type=series);

| (5)

The solution obtained is converted to polynomial form and stored in ca:

> | ca:=convert(rhs(sol),polynom);

| (6)

We observe that the series solution obtained is a function of Φ and cl. Now the boundary condition is evaluated using the solution obtained and substituting x = 1:

> | eqc:=subs(c(x)=ca,bc);

| (7)

> | eqc:=subs(x=1,eqc);

| (8)

This is a nonlinear equation and cannot be solved explicitly:

> | solve(eqc,c1);

| (9)

However, the solution can be obtained for a particular value of Φ:

> | solve(subs(Phi=0.1,eqc));

| (10)

The 'solve' command takes too long to solve and gives complex roots. Hence, the 'fsolve' command is used to solve for the real values.

> | fsolve(subs(Phi=0.1,eqc),c1=1);

| (11)

Next, the constant cl is solved for different values of Φ:

> | cc[1]:=fsolve(subs(Phi=0.1,eqc),c1=1)[2];

| (12)

> | cc[2]:=fsolve(subs(Phi=1,eqc),c1=1)[2];

| (13)

> | cc[3]:=fsolve(subs(Phi=2,eqc),c1=1)[2];

| (14)

> | cc[4]:=fsolve(subs(Phi=5,eqc),c1=1)[2];

| (15)

Next, plots are made by substituting the values for c1 and Φ:

> | p1:=plot(subs(c1=cc[1],Phi=0.1,ca),x=0..1,thickness=3,color=red,axes=boxed):

> | p2:=plot(subs(c1=cc[2],Phi=1,ca),x=0..1,thickness=3,color=green,axes=boxed):

> | p3:=plot(subs(c1=cc[3],Phi=2,ca),x=0..1,thickness=3,color=gold,axes=boxed):

> | p4:=plot(subs(c1=cc[4],Phi=5,ca),x=0..1,thickness=3,color=blue,axes=boxed):

> | display({p1,p2,p3,p4},labels=[x,c],title="Figure Exp. 3.2.1.");

We observe that as Φ increases, the concentration profiles become steeper. We have obtained the series solution for the given nonlinear boundary value problem. There is no guarantee ht the solution has converged. Accuracy of the solution can be analyzed by increasing the number of terms in the series solution and checking the values for cl:

> | Order:=10;

| (16)

> | sol:=dsolve({eq,c(0)=c1,D(c)(0)=0},{c(x)},type=series);

| (17)

> | ca:=convert(rhs(sol),polynom);

| (18)

> | eqc:=subs(c(x)=ca,bc);

| (19)

> | eqc:=subs(x=1,eqc);

| (20)

> | fsolve(subs(Phi=0.1,eqc),c1=1);

| (21)

We observe that there are three different solutions of which only the last one makes sense:

> | cc2[1]:=fsolve(subs(Phi=0.1,eqc),c1=1)[3];

| (22)

> | fsolve(subs(Phi=1,eqc),c1=1);

| (23)

For higher values of Φ, 'fsolve' produces only the correct solution:

> | cc2[2]:=fsolve(subs(Phi=1,eqc),c1=1);

| (24)

> | cc2[3]:=fsolve(subs(Phi=2,eqc),c1=1);

| (25)

> | cc2[4]:=fsolve(subs(Phi=5,eqc),c1=1);

| (26)

The constants c1 obtained using eight terms and ten terms in the series are compared:

> | for i to 4 do print(cc[i],cc2[i]);od;

| (27)

For Φ=0.1 and 1, we observe that the solution has converged to the third digit. For Φ=2, the solution has converged to the first two digits. For Φ=5, we observe that the solution has not converged. Hence, more terms are required in the series for higher values of Φ. The series solution obtained using Maple may or may not converge. The convergence of the solution depends on the parameters (as illustrated in this example), and the nonlinearity of the problem. In the next example the non-isothermal reaction in a rectangular pellet is analyzed.

> |