Consider the Problem from Monday’s Lecture:

 

A CSTR with two reactants feeds and one product outlet, shown schematically:

 

 

We have the following set of algebraic equations governing steady-state mass and mole balances, as follows:

 

(i)                                 Overall Mass Balance

(ii)                Mole Balance, Species A

(iii)               Mole Balance, Species B

(iv)                          Mole Balance, Species C

 

We recognize that, given inlet conditions, kinetics and reactor volume, there are three unknowns: Ca, Cb, and Cc. The latter term, Cc, can be calculated once Ca and Cc are solved for. Thus, we have two equations (ii, iii) and two unknowns.

 

If we rewrite equation (ii) in terms of Cb,

 

(ii)’      

 

and substituting into equation (iii) yields:

 

(iii)’     

 

At this point, we can iteratively guess a value for Cb which satisfies the above equation. Please download, read and run the following matlab program, supp_1.m.

 

We can also perform this iterative solution using a spreadsheeting program, such as excel. Please download, read and run the following excel program, supp_1_spreadsheet.xls.

 

Or, we can do this the old-fashioned way and rely upon algebra to solve this problem.

 

(iii)’     

 

The solution to this quadratic equation is then:

 

 

If we repeat the same mass and mole balancing act, only without using the steady-state assumption, we obtain the following set of first-order differential equations:

 

 

This set of differential equations can be solved numerically employing a marching technique, as posed. You could manually program integration in a spreadsheet, but we'll use PolyMath to numerically solve this equation. You can access the polymath primer page here, or follow the instructions below to program this system of ordinary differential equations below.

 

(insert screen clips of me programming polymath)

 

Alternate Software: Matlab (for advanced programmers)

 

A more powerful programming package is Matlab. Matlab is a robust programming language with a myriad of pre-programmed routines and 2- and 3-dimensional plotting software. It can be a valuable research tool. The above problem was also solved employing Matlab’s built-in ode45 solver routine.

 

Download, read and run the following pair of programs in Matlab. supp_2.m, supp_2_eqns.m. The first file is the main program, the second file contains the differential equations to be solved. The solution should look something like this:

 

 

From this solution, we see that at long times, concentrations are constant and equal to the steady-state solution.