Simulation Study of The CSTR Reactor For Control Purposes
Simulation Study of The CSTR Reactor For Control Purposes
Ivan Zelinka, Jiri Vojtesek and Zuzana Oplatkova Faculty of Applied Informatics Tomas Bata University in Zlin Nad Stranemi 4511, 762 72 Zlin, Czech Republic E-mail: {zelinka,vojtesek,oplatkova}@fai.utb.cz
KEYWORDS CSTR, Steady-state, Dynamics, Iteration method, Runge-Kuttas method ABSTRACT Simulation is very important and popular tool nowadays, when computation speed of computers increases exponentially every day. Simulations on mathematical models has several advantages over the experiment on a real model or system. It is save, cheaper and less time demanging. This paper delas with basic simulation studies on of the common used devices in chemical industry Continuous Stirred Tank Reactor (CSTR). The mathematical model is developed from material balances. Numerical mathematics is used for steady-state analysis and dynamic analysis. Simulation results are used for choosing of an optimal working point and an external linear model of this nonlinear plant. INTRODUCTION There are several types of stirred reactors used in chemical or biochemical industry. Continuous Stirred Tank Reactors (CSTR) are common used because of their technological paramers. Reaction inside flows continuously and we can control this reaction by for example volumetric flow rate of the reactant (Ingham et al. 2000). The first step is introducing of the mathematical model which describes relations between state variables in the mathematical way. This mathematical model comes from material or heat balances inside the reactor. In our case of isothermal reactor with complex reaction (Russell and Denn 1972) is mathematical model the set of ordinary differential equations (ODE). Simulation usually consist of steady-state analysis which observes behaviour of the system in steady-state and dynamic analysis which shows dynamic behaviour after the step change of the input quantity (Ingham et al. 2000, Luyben 1989). This paper deals with simulation experiments on one type of nonlinear systems, CSTR reactor. This simulations results in optimal working point, external linear model and they will be later used for choosing of an optimal working point and mainly for control purpose.
Proceedings 20th European Conference on Modelling and Simulation Wolfgang Borutzky, Alessandra Orsoni, Richard Zobel ECMS, 2006 ISBN 0-9553018-0-7 / ISBN 0-9553018-1-5 (CD)
MODEL OF THE REACTOR Reactor under the consideration is Isothermal reactor with complex reaction (Ingham et al. 2000). Reactions inside the reactor can be described by following reactions:
k1 A + B X k2 B + X Y
(1)
B + Y Z
k3
This reaction has sequential (A X Y Z) as well as parallel characteristics (B X, B Y, B Z). Mathematical description of all variables is of course very complicated. Therefore there must be introduced some simplifications before we start to build the mathematical model of the plant. We expect, that reactant inside the tank is perfectly mixed and volume of the reactant is constant during the reaction. The mathematical model of the system is then derived from the material balances insde the reactor:
dc A q = ( cA0 cA ) k1 cA cB dt V
dcB q = ( cB 0 cB ) k1 c A cB dt V k2 cB c X k3 cB cY
(2)
(3)
dc X q = ( c X 0 c X ) + k1 c A cB k2 cB c X dt V
dcY q = ( cY 0 cY ) + k2 cB c X k3 cB cY dt V
dcZ q = ( cZ 0 cZ ) + k3 cB cY dt V
This set of nonlinear ODE describes behaviour of the state variables which are in this case concentrations of components A, B, X, Y and Z cA, cB, cX, cY and cZ in time t. We can say, that this CSTR belongs to the class of nonlinear lumped-parameters systems. In the set (2) (6) q denotes volumetric flow rate, V is volume of the tank, k means rate constants and c are concentrations. Numerical subscripts 1, 2 and 3 represent reaction steps. Some technological parameters and conctans are shown in Table 1.
Table 1: Parameters of the reactor k1 = 510-4 m3.kmol-1.s-1 k3 = 210-2 m3.kmol-1.s-1 cA0 = 0.4 kmol.m-3 cX0 = 0 kmol.m-3 cZ0 = 0 kmol.m-3 SIMULATION RESULTS There were done two basic simulation studies steadystate analysis and dynamic analysis. Boths analyses use numerical methods for computation. Steady-state analysis Steady-state analysis means computation of the state variables in time t , where we expect that the value of this quantity is stable. From the computation point of view it means, that all derivatives with respect to time are equal to zero, i.e. d()/dt = 0. The set of ODE (2) (6) are then rewritten in the form
s cA =
cX(i),cY(i) [kmol.m ]
-3
cY(i)
0.002 0.000 2 4 6 8 10 i [- ] 12 14 16 18
Figure 2: Values of the computed steady-state values of the concentrations cXs and cYs for iterations i The first two Figures 1 and 2 represent course of the computed steady-state values of the state variables. As it can been seen, value is computed value is stable nearly around the tenth iteration. Table 2: Maximum values of steady-state concentrations q [m3.s-1] 0.0100 0.0100 0.0025 0.0011 0.0000 c-s [kmol.m-3] 0.3888 0.5760 0.0033 0.0071 0.1896
q c A0 q + V k1 cB
s cB =
q cB 0 q + V k1 c A + V k2 c X + V k3 cY
s cX =
q c X 0 + V k1 cA cB q + V k 2 cB q cY 0 + V k2 cB cX q + V k3 cB q cZ 0 + k3 cB cY q
s cY =
s cZ =
There were used well known Simple iteration method for solving of this problem. The only one quantity which can be easily changed is in this case volumetric flow rate of the reactant, q. This flow rate is usually expressed by the twist of the valve in the technical praxis.
0.4
The second analysis were done for various flow rate in the range q = <0; 0.01> m3.s-1. Both figures 3 and 4 show nonlinear properties of the plant. The main goal of the static analysis is to find optimal volumetric flow rate. Optimal in this case means point where products concentration is maximal. Only concentrations cXs and cYs has maximum in this case, concentration cZs has decreasing progress which is not very relevant for us. Maximum values of all concentrations and appropriate volumetric flow rate q are shown in Table 2.
0.6 cA(q),cB(q),cZ(q) [kmol.m ] cB(q) 0.5 0.4 0.3 0.2 0.1 cA(q)
s s -3
cA(i),cB(i),cZ(i) [kmol.m ]
-3
0.0 2 4 6 8 10 i [- ] 12 14 16 18
0.0 0.000
Figure 1: Values of the computed steady-state values of the concentrations cAs, cBs and cZs for iterations i
Figure 3: Steady-state values of the concentrations cAs, cBs and cZs for different volumetric flow rate q
0.007 cX(q),cY(q)[kmol.m ]
-3
cY-MAX
cY(i) cX(i)
s
0.002
0.004 3 -1 0.006 q [m .s ]
0.008
0.010
Figure 4: Steady-state values of the concentrations cXs and cYs for different volumetric flow rate q Figure 4 and Table 2 shows, that optimal working point is for volumetric flow rate of the reactant q = 0.001 m3.s-1. This flow rate is used lately for the dynamic analysis. Steady-state values of the state variables [kmol.m-3] in this working point are:
s cA = 0.2407 kmol.m 3 s cB = 0.1324 kmol.m 3
where h in equation (14) denotes integration step which can is in this case fixed. In the case of build-in Matlab fuction is this step recomputed in each computation step from the actual error. Simulation took time t = <0; 20 000> s and integration step was h = 10 s. Steady-state values of the state variables cAs, cBs, cXs, cYs and cZs computed from the previous steady-state analysis for this concreat working point were used as initial conditions. There were done four step changes of the input variable volumetric flow rate of the reactant, q, -50% of its steady-state value (i.e. -0.0005 m3.s-1); -25% (-0.00025 m3.s-1); 25% (-0.00025 m3.s-1) and 50% (-0.0005 m3.s-1). Outputs y1-3 in Figures 5-6 illustrates difference between actual value of the output and its initial value:
s y1 ( t ) = cX ( t ) cX s y2 ( t ) = cY ( t ) cY
(15)
y3 ( t ) = cZ ( t ) c
s Z
This difference is made only because of better display of outputs they started in zero point.
0.00015
q = 25 % q = 50 %
c = 0.0024 kmol.m
s X s Z
c = 0.0057 kmol.m
s Y 3
(12)
y1 [kmol.m ]
-3
c = 0.1513 kmol.m
Dynamic analysis The next step after the steady-state analysis is usually dynamic analysis which observes behaviour of the system after the step change of the input variable. In this case is input variable step change of the volumetric flow rate q. Mathematicly dynamic analysis means numerical solving of the set of ODE with some convenient method. Runge Kuttas standard method was used for solving of this problem (Shampire 1994). This method belongs to the class of the high-order, it is self-started and should be used both for computing of initial assessments and final solutions too. Despite the fact, that in Matlab, which is used for solving, is RungeKuttas method build-in function ode23, ode45 etc., computation was done with the general description of Runge-Kuttas standard method. This method uses first four parts of Taylor series
1 y ( k + 1) = y ( k ) + ( g1 + 2 g 2 + 2 g3 + g 4 ) 6
q = -25 %
q = -50 %
15000
20000
Figure 5: Time response of the output y1 for various ster changes of the input volumetric flow rate q
0.0003 0.0002 y2 [kmol.m ]
-3
q = 25 % q = 50 %
0.0001 0.0000
q = -25 %
(13)
q = -50 %
15000
20000
(14)
Figure 6: Time response of the output y2 for various ster changes of the input volumetric flow rate q Both outputs y1 and y2 in Figure 5 and 6 has nonminimum phase behaviour which is one of negative properties from the control point of view. As it can been seen, both outputs has big time concstants too which
can be seen at time axis, where the the output variable approaches to the final value nearly at 15000 s, which is about 4 h and 10 min. Transfer function in continuous time G(s) for the non-minimum phase systems can be compiled as
G( s) = b(s) a (s) = b1 s + b0 a2 s + a1 s + a0
2
(16)
Y has its maximum. The second, dynamic, analysis results in two different external linear models of this nonlinear system second order transfer function with relative order one for outputs y1 and y2 which has nonmimum phase behaviour and first or second order transfer function with relative order one or two for output y3. All simulation results will be lately used for control purpose. REFERENCES
Ingham, J., Dunn, I. J., Heinzle, E., Penosil, J. E. (2000). Chemical Engineering Dynamics. An Introduction to Modeling and Computer Simulation. Second, Completely Revised Edition, VCH Verlagsgesellshaft, Weinheim. Luyben, W. L. (1989). Process Modelling, Simulation and Control for Chemical Engineers. McGraw-Hill, New York. Shampine, L. F. (1994). Numerical Solution of Ordinary Differential Equations, Chapman & Hall, New York. Vojtesek, J., Dostal, P. (2005). From steady-state and dynamic analysis to adaptive control of the CSTR reactor. In: Proc. of 19th European Conference on Modelling and Simulation ESM 2005. Riga, Latvia, p. 591-598
where s is complex variable, a0,1,2 and b1,0 are coefficients and b0, b1 differs in sign for non-minimum phase systems. Relative order of the G(s) (16) is
deg a ( s ) deg b ( s ) = 2 1 = 1
0.020 0.016 y3 [kmol.m ]
-3
(17)
q = -50 %
q = 25 % q = 50 %
ACKNOWLEDGMENT This work was supported by the grant NO. MSM 7088352101 of the Ministry of Education of the Czech republic and by grants of Grant Agency of Czech Republic GACR 102/06/1132 and GACR 102/05/0271. AUTHOR BIOGRAPHIES IVAN ZELINKA was born in Czech Republic, and went to the Technical University of Brno, where he studied technical cybernetics and obtained his degree in 1995. He obtained Ph.D. degree in technical cybernetics in 2001 at Tomas Bata University in Zlin. Now he is associated professor (artificial intelligence, theory of information) and head of department. His e-mail address is: [email protected] and his Web-page can be found at http://www.ft.utb.cz/people/zelinka/hp JIRI VOJTESEK was born in Zlin, Czech Republic and went to Tomas Bata University in Zlin, where he got his master degree in chemical and process engineering in 2002. Now he is about to finish his Ph.D. which is focused on Modern methods for control of chemical reactors. You can conctact him on email address [email protected]. ZUZANA OPLATKOVA was born in Czech Republic, and went to the Tomas Bata University in Zlin, where she studied technical cybernetics and obtained her degree in 2003. She is now Ph.D. student and lecturer (artificial intelligence) at the same university. Her [email protected] mail address is:
15000
20000
Figure 7: Time response of the output y3 for various ster changes of the input volumetric flow rate q On the other hand, course of the output variable y3 in Figure 7 can be expressed by the first or second order transfer function with relative order for example in form:
G (s) = b (s) a (s) = b0 a1 s + a0
b0 G( s) = = a ( s ) a2 s 2 + a1 s + a0
b(s)
(18)
Which implies that relative order is equal to one for first order G(s) and equal to two for second order G(s). All transfer functions in equations (17) and (18) will be later used as External Linear Model of this nonlinear system for choosing of a control strategy and designing of the controller, similar as e.g. in (Vojtesek and Dostal 2005). CONCLUSION Paper deals with simulation of the CSTR which is typical nonlinear system with lumped parameters. Mathematical model of the plant comes from material balances inside the reactor which results in the set of nonlinear ODE. Simple iteration method was used for solving of a steady-state. The steady-state analysis for different value of input volumentric flow rate shows nonlinear properties of the system and the optimal working point is for volumetric flow rate q = 0.001 m3.s-1 where the concentration of the product