Computer Simulation of Opposing Reaction Kinetics: Chemical Engineering
Computer Simulation of Opposing Reaction Kinetics: Chemical Engineering
Computer Simulation of Opposing Reaction Kinetics: Chemical Engineering
A publication of
Firstly, based on the mass action law, the kinetics equation of the opposing reaction was established in the
form of first-order ordinary differential equations and it was solved by the fourth order Runge-Kutta method to
calculate the concentration of each substance at any time for the opposing reaction; Secondly, the equilibrium
concentration of every substances can be calculated by chord secant method, the differential model of the
reaction time on the change of the concentration of the substance was established and it was solved by
Runge-Kutta method to calculate the equilibrium time; Finally, the software was developed by using VB
programming tool and it can simulate the process of the opposing reaction in the form of graphics. The
opposing liquid phase reaction was calculated and simulated as an example and the satisfactory calculation
results were obtained. The software can be applied to assisted instruction in physical chemistry or chemical
kinetics, and it can also be used as a calculation tool to study the opposing reaction kinetics.
1. Introduction
Opposing reaction is an important complex chemical reaction. By solving the opposing reaction kinetics
equations, we may get the changes of substance concentration over time and the equilibrium time and the
equilibrium concentration to provide important reference data for the design of reactors. The current physical
chemistry textbooks such as Hu (2007) and Peter A (2010) prepared only give the analytical solution for a few
simple opposing reaction kinetics equation through separation of variables or elimination or laplace
transformation. However, most opposing reaction kinetics equations are first-order ordinary differential
equations that are difficult to obtain general analytical solutions and can only obtain numerical solutions.
Huang (2014), Zhong (2011), Fan (2007), Yao (2005), Dai (2007), Qi (2008), Ma (2008), Huang (2005), Qu
(2011) reported the numerical simulation of the chemical reaction by Monte Carlo method or using Matlab. In
this paper, the VB programming tool is used to design calculation software to calculate the opposing reaction
kinetics equations and simulate the reaction process. According to the basic principle of reaction kinetics, the
reaction kinetics equations are influenced by temperature, pressure, the concentration of the relevant
substance and catalyst, ect; in order to simplify the model and facilitate the discussion, the opposing reaction
discussed in this paper are limited to homogeneous and the reaction is carried out in a batch reactor, its
reaction conditions such as temperature and catalyst are certain.
aA + bB 1
k
cC + dD
k −1
Where k1 and k2 are reaction rate constants defined according to the extent of reaction. At the initial time,
set the concentration of each substance as following
cA = cA0 , cB = cB0 , cC = cC0 , cD = cD0
(1)
Please cite this article as: Huang X.Z., Liu Y., 2015, Computer simulation of opposing reaction kinetics, Chemical Engineering Transactions,
46, 115-120 DOI:10.3303/CET1546020
116
According to the law of mass action, we may get the following reaction rate equations:
dcA
vA = − = ak1cAa cBb − ak−1cCc cDd
dt (2)
dcB
vB = − = bk1cAa cBb − bk−1cCc cDd
dt (3)
dcC
vC = = −ck1cAa cBb + ck−1cCc cDd
dt (4)
dcD
vD = = − dk1cAa cBb + dk−1cCc cDd (5)
dt
We may construct a first-order ordinary differential equation system by combining Formula (1), Formula (2),
Formula (3), Formula (4) and Formula (5) and calculate the concentrations of various substances at any time
by solving it with the fourth-order Runge-Kutta method. The calculation steps are as follows (which was
confirmed by Deng (2000), He (2001))
1
ci , n +1 = ci ,n + 6 (ki1 + 2ki 2 + 2ki 3 + ki 4 )
ki1 = hfi (tn , c1,n , , cm ,n )
h 1 1
ki 2 = hfi (tn + , c1,n + k11 , , cm ,n + km1 ) i = 1, 2, , m
2 2 2 (6)
h 1 1
ki 3 = hfi (tn + 2 , c1,n + 2 k12 , , cm, n + 2 km 2 )
ki 4 = hfi (tn + h, c1,n + k13 , , cm,n + km3 )
In equation (6), h is the integration step, tn represents the nth time point, with the value tn = t0 + nh , and
ci , n represents the concentration of Ai at time point tn .
2.2 Calculation of the equilibrium concentration and the equilibrium time
When the reaction time is t, set the concentration of A as following
cA = cA0 − ax
(7)
At this time, the concentration of each substance is
cB = cB0 − bx
(8)
cC = cC0 − cx
(9)
cD = cD0 − dx
(10)
When the reaction reaches equilibrium, the reaction rate is zero, that is
dcA
vA = − = ak1cAa cBb − ak−1cCc cDd = 0
dt (11)
By putting Formula (7), Formula (8), Formula (9), Formula (10) into Formula (11), we will get
The value of xe in Formula (12) can be calculated by chord secant method. Put value of xe into Formula (7),
Formula (8), Formula (9) and Formula (10), we will get the equilibrium concentration of each substance.
By putting Formula (7), Formula (8), Formula (9), Formula (10) into Formula (2), we will evolve the following
formulas:
dx
= k1 (cA0 − axe ) a (cB0 − bxe )b − k−1 (cC0 + cxe )c (cD0 + dxe ) d
dt (13)
By transforming Formula (13), we will get
dt
= ( k1 (cA0 − axe ) a (cB0 − bxe )b − k−1 (cC0 + cxe )c (cD0 + dxe ) d ) −1
dx (14)
Under the initial conditions of t=0 and x=0, by solving Formula (14) with the fourth-order Runge-Kutta method,
we can calculate the reaction time when x = xe , that is the equilibrium time.
Original data input are mainly initial concentrations of each substance, rate constant of forward reaction and
reverse reaction, stoichiometric number of each substance, which also include initial time of reaction (default
is 0), terminal time of reaction, and the calculation point numbers (which represents the number of calculation
points between initial time and specified time, its value defaults to 1000). Click the button Calculate the button
Calculate the Concentration on main interface of the software, then it can calculate concentrations of relevant
substance at terminal time. Click the button Save Calculation Results to a File, then it can generate a text file,
which is used to save data on concentrations of every substance vary with time. The calculation results are
imported to Origin Software so that it can draw curve that concentrations of various substances change with
time. Click the button Graphics Simulation, then the software will draw graph that concentrations of various
substances change with time.
3.2 Realization of software function
The software uses Visual Basic 6.0 as the development tool and employs modular programming technology to
define the corresponding ordinary differential equations, the Runge-Kutta method and chord secant method as
subprogram modules and then call subprograms to calculate the return value of ci ,n +1 according to the initial
conditions of ordinary differential equations. Software drawing mainly uses “line” function to realize. Limited by
the length of this paper, we do not provide detailed VB code here.
118
CH 3COCH 3 +HCN 1
k
(CH3 ) 2 CCNOH
k 2
Hereinto, the initial concentrations of CH 3COCH 3 and HCN were 0.1164 and 0.0785, respectively, the
rate constants of the forward and backward reactions at 15 were k1 = 0.00934(mol ⋅ dm -3 ) −1 ⋅ min −1
and k2 = 0.000608 min −1 respectively (The reaction rate constants were reported by Ying and Zhang
(2001)). Calculate the concentrations of these substances at reaction time 73.2 minutes and the reaction
reached equilibrium; simulate the reaction process.
Figure 1 The main interface of the opposing reaction kinetics calculation software
For the convenience of express, A represents HCN, B represents CH3COCH3, C represents (CH3)2CCNOH.
Run the software to enter into the main interface and input initial data of this reaction. Click the button
Calculate the Concentration, input the reaction time 73.2 min; then the software will calculate the
concentration of A at 73.2 min is 0.0728 mol ⋅ dm . Click the button Equilibrium time and Equilibrium
-3
Concentration, then the equilibrium time and equilibrium concentration can be calculated. The main interface
of the software is shown as Figure 1.
From Figure 1, when the reaction time is 4098.157min, the reaction reaches equilibrium, at this time, Click the
button Graphic Simulation, then it will enter into “Plotting interface”. On this interface, set coordinate interval
and calibration interval, and then click buttons of Draw the coordinate and Curve drawing separately. Graph
on concentration changes of substances within 5000 minutes can be drawn. It is shown as Figure 2.
119
The calculation results vs. the experimental results of HCN concentration are shown as Figure 3. It can be
seen form Figure 3 that the calculation results agree well with the experimental results; we can conclude that
the calculation results of the software are accurate and reliable.
Simulation curve
experimental data
0.080
0.075
0.070
c/mol⋅dm-3
0.065
0.060
0.055
0.050
0 100 200 300 400 500
t/min
Figure 3: Concentrations- time plot for calculation and experimental data of HCN concentration
120
4. Conclusions
In this paper, the VB visual language programming tool and numerical calculation are used to solve the
calculation problem of opposing reaction kinetics. The software may be used to predict the change trend of the
concentration of opposing reacting substances over time and calculate the equilibrium time and equilibrium
concentration. The software can be used as a computational tool in studying the opposing reaction kinetics; it
can also assist the teaching of physical chemistry and chemical reaction kinetics, etc. to make it easy for
beginners to deeply understand the characteristics of the opposing reaction through visualized computer
simulation of the opposing reaction process.
Acknowledgments
Project supported by the scientific research key project of Henan province education bureau (No. 12B150020).
References
Atkins P., de Paula P., 2010, Physical Chemistry (9rd. Edit), New York: Oxford University Press.
Dai W.B., Zhang Y.T., 2007, Development of Monte Carlo Program for Chemical Kinetics and Its Application,
Journal of China West North University (Natural Sciences), 28(1), 103-107, doi: 10.3969/j.issn.1673-
5072.2007.01.023.
Deng J.Z., Ge Ren-jie, 2000, Calculation Method, Xian: Xian Jiao tong University Press.
Fan Y.H., Zhang T.T., Wu M.X., 2007, Computer Simulation of the Opposite Reaction Kinetics Process,
Experiment Science and Technology, 5(5), 78-79, doi: 10.3969/j.issn.1672-4550.2007.05.028.
He G.Y., 2001, Visual Basic Common Algorithms Assembly, Xian: Xidian University Press.
Hu Y., 2007, Physical Chemistry (2rd. Edit), Beijing: Higher Education Press.
Huang X.Z., Zhang C.Q., 2005, The Calculation and Computer Simulation for the Consecutive first –order
reaction, Computer and Applied Chemistry, 21(3), doi: 10.3969/j.issn.1001-4160.2005.03.008.
Huang Z.H., Ren C.B., 2014, Computer Simulation of the Complex Chemical Kinetics. Computer and Applied
Chemistry, 31(5): 615-618.
Ma Z.P., Zhao J.H., 2008, Simulation of Dynamic Process of the Horseradish Peroxidase. Journal of Hebei
University (Natural Science Edition) 28(6), 646-651, doi: 10.3969/j.issn.1000-1565.2008.06.021.
Qi B., Wang Z.Q., 2008, Numerical Simulation of Chemical Kinetics for the Complex Gas-phase Reactions.
Computer and Applied Chemistry, 25(8): 993-995, doi: 10.3969/j.issn.1001-4160.2008.08.018.
Qu Y.X., 2011, Numerical Simulation and Software of Chemical Process, Beijing: Chemical Industry Press.
Yao J.T., Wang A.H., Jin B., Guo Y.Q., 2005, The Kinetics of Consecutive Second-order Reaction by
Computer Simulating Method, Journal of Zhengzhou University (Natural Science Edition), 37(2), 85-87,
doi: 10.3969/j.issn.1671-6841.2005.02.023.
Ying X.G., Zhang G.Z., 2001, Computational Physical Chemistry. Beijing: Science Press.
Zhong W., Tian Z., 2011, Numerical Simulation for Some Kinds of Complex Chemical Reaction Kinetic,
Chemical Engineering (China), 39(8), 82-85, doi: 10.3969/j.issn.1005-9954.2011.08.020.