2.1.3 First Order Irreversible Series Reactions

Consider the first order series reactions[4](). The governing equations for this reaction scheme can be written as

=

(2.8)

=

where k1 and k2 are rate constants and the initial conditions are CA(0) = 1 mol/l, CB(0) = 0, and CC(0) = 0. The concentration of species C (CC(t)) at any time is given by the material balance:

CC (t) = 1 mol/1 - CA(t) - CB(t) (2.9)

A Maple procedure for solving equations subject to the initial conditions is presented below. This procedure is useful for developing the correct coefficient matrix A to avoid “by hand” errors.

Procedure

1. Start the Maple program with a 'restart' command to clear all variables.

2. Call Maple's linear algebra package by using the 'with(linalg)' command.

3. Call Maple's plotting package by using the 'with(plots)' command.

4. Use Maple to enter the governing equations.

5. Name the variable vars.

6. Name the right hand side of the equations eqs.

7. Next, use Maple to generate the coefficient matrix (A) using Maple's genmatrix command.

8. Store the initial conditions for the dependent variables in the vector Y0. The first row of Y0 corresponds to the initial condition for the first dependent variable (CA). The second row of Y0 corresponds to the initial condition for the second variable (CB).

9. Find the matrix exponential of A (i.e., exp(At)) as a function of the parameters (rate constants) and the independent variable (t) using the Maple command 'exponential(A,t)'. Call this matrix mat.

10. Next, find the solution (sol) by multiplying mat by Y0 using Maple's 'evalm' command.

11. The first row of the sol vector corresponds to CA(t) and the second row corresponds to CB(t).

12. Note that the analytical solutions for CA and CB are obtained as functions of the parameters (rate constants) and the independent variable, t. Lower case letters are used for these variables with k1 and k2 as parameters.

13. For a given set of rate constants, plot the concentration profiles.

Example 2.1 Irreversible Series Reactions

> | restart:

> | with(linalg):

> | with(plots):

Enter the governing equations as follows:

> | eq[1]:=diff(C[A](t),t)=-k1*C[A](t);

| (1)

> | eq[2]:=diff(C[B](t),t)=k1*C[A](t)-k2*C[B](t);

Store the variables in vars:

| (2)

> | vars:=[C[A](t),C[B](t)];

| (3)

Next, store the right hand sides of equations 1 and 2 in eqs.

> | eqs:=[rhs(eq[1]),rhs(eq[2])];

| (4)

Now use the 'genmatrix' Maple command to produce the coefficient matrix A.

> | A:=genmatrix(eqs,vars);

| (5)

Specify the initial conditions.

> | Y0:=matrix(2,1,[1,0]);

| (6)

Use Maple's 'exponential(A,t)' command to produce the exponential (At) matrix.

> | mat:=exponential(A,t);

| (7)

Obtain the solution vector using Maple's 'evalm' command and matrix multiplication (&*).

> | sol:=evalm(mat&*Y0);

| (8)

The first row of 'sol' is the solution for the concentration of species A (CA) and the second row is for the concentration of species B (CB).

> | ca:=sol[1,1];

| (9)

> | cb:=sol[2,1];

| (10)

The concentration of species C is obtained from the material balance equation.

> | cc:=1-ca-cb;

| (11)

Note that the concentrations of the species are obtained as functions of the rate constants (k1 and k2) and

> | pars:={k1=2,k2=1};

| (12)

Next, substitute these values for the rate constants into the concentrations store as CA, BB, and CC.

> | Ca:=subs(pars,ca);

| (13)

> | Cb:=subs(pars,cb);

| (14)

> | Cc:=subs(pars,cc);

| (15)

Plot the concentration profiles for these values of the rate constants as shown in Figure Exp. 2.1.1.

> | p1:=plot(Ca,t=0..10,thickness=3,color=blue,labels=["t(min)","Concentration (mols/l)"],labeldirections=[horizontal, vertical],legend='C[A]'):

> | p2:=plot(Cb,t=0..10,linestyle=1,thickness=3,labels=["t(min)","Concentration (mols/l)"],labeldirections=[horizontal, vertical],legend='C[B]'):

> | p3:=plot(Cc,t=0..10,linestyle=1,thickness=3,color=green,labels=["t(min)","Concentration (mols/l)"],labeldirections=[horizontal, vertical],legend='C[C]'):

> | p4:=textplot([6,.9,k1=2.0*Unit(min^(-1))]):

> | p5:=textplot([6,.7,k2=1.0*Unit(min^(-1))]):

> | display([p1,p2,p3,p4,p5],title="Figure Exp. 2.1.1 Concentrations of A, B, and C as functions of time.");

> | Ca:=subs(k1=1,ca);

| (16)

> | Cb:=subs(k1=1,cb);

| (17)

> |

| (18)

Next, the 'limit' command is applied for :

> | Cb:=limit(Cb,k2=1);

| (19)

> | Cc:=limit(Cc,k2=1);

| (20)

We can use these results to plot the concentration profiles for the case when k

> | p1:=plot(Ca,t=0..10,thickness=3,color=blue,labels=["t(min)","Concentration (mol/l)"],labeldirections=[horizontal, vertical],legend='C[B]'):

> | p2:=plot(Cb,t=0..10,linestyle=1,thickness=3,color=red,labels=["t(min)","Concentration (mol/l)"],labeldirections=[horizontal, vertical],legend='C[B]'):

> | p3:=plot(Cc,t=0..10,linestyle=1,thickness=3,color=green,labels=["t(min)","Concentration (mol/l)"],labeldirections=[horizontal, vertical],legend='C[C]'):

> | p4:=textplot([6,.8,(k1=1.0*Unit(min^(-1)))]):

> | p5:=textplot([6,.6,(k2=1.0*Unit(min^(-1)))]):

> | display([p1,p2,p3,p4,p5],title="Figure Exp. 2.1.2 Concentrations of A, B, and C as functions of time.");

We can solve for the time at which B is at its maximum by differentiating cb with respect to t:

> | Eqmax:=diff(cb,t);

| (21)

Next solve 'eqmax' to find the time at which cb is at a maximum in terms of the rate constants

> | tmax:=solve(Eqmax,t);

| (22)

Substitute this value for time into the concentration equation for B(cb(t)) to find the maximum value of Cb as a function of the rate constants

> | cbmax:=subs(t=tmax,cb);

| (23)

The equation for 'cbmax' can be simplified further by using Maple's 'simplify' command.

> | cbmax:=simplify(cbmax);

| (24)

A maximum for the concentration of B(cbmax) for the special case of

> |

| (25)

The time needed for the concentration of B to reach a maximum, for the case when k= k can be found as

> | limit(tmax,k2=k1);

| (26)

Note that when k1 = k2, 'cbmax' is independent of the rate constants, the time taken to reach this maximum value e-1 is inversely proportional to the rate constant k1.