[ Team LiB ] Previous Section Next Section

Appendix 2.2: Integrating Ordinary Differential Equations

The Euler integration method often requires very small integration step sizes to obtain a desired level of accuracy. Note that x is a vector of n state variables at each time step. For example, if there are two states (two differential equations)

graphics/02equ117.gif


we have left the inputs and parameters out of the function variable list for convenience. An example is shown next.

Example 2.2: An Isothermal Chemical Reactor, continued

Consider the ethylene glycol reactor problem in Example 2.2. We use k1 to represent the reaction rate constant, so that it is not confused with the time-step index. The Euler integration algorithm results in the following two equations, where k represents the time-step index.

graphics/02equ118.gif


For CA(0) = 0.1 and CP(0) = 0.4, and a space velocity (F/V) = 0.0816 min-1 we find, for the first time step,

graphics/02equ119.gif


Substituting the numerical values for an integration step size of 0.5 minutes, we find

graphics/02equ120.gif


resulting in the concentration values at t = 0.5 minutes

graphics/02equ120a.gif


Values can be obtained at future times by continuing to march forward in time. MATLAB has a suite of routines for integrating differential equations. These are covered in Module 3.

    [ Team LiB ] Previous Section Next Section