Sei sulla pagina 1di 6

SIMULATION AND CONTROL OF A CONTINUOUS STIRRED TANK

REACTOR
J. Vojtesek
*
, P. Dostal
*
, R. Haber
**
* Department of Control Theory, Institute of Information Technologies
Tomas Bata University in Zlin
Nam. TGM 275, 762 72 Zlin, Czech Republic
fax : +420 57603 3333, e-mail:vojtesek@ft.utb.cz
** Department of Plant and Process Engineering, Laboratory of Process Control,
University of Applied Science Cologne,
Betzdorfer Str. 2, D-50679 Kln, Germany,
fax.: +49 221 8275 2836, e-mail: robert.haber@fh-koeln.de
Abstract: Simulation is the technical discipline which shows the behavior and reactions
of any system on its model. Most chemical processes have nonlinear properties.
Simulation is one way to examine the behaviour of these systems. The behaviour is
obtained by steady-state and dynamic analysis of the model which is usually
represented by a set of differential equations. The next step after dynamic analysis is
choosing of a suitable control strategy and finally design the controller. The paper
shows two main steps dynamic analysis and adaptive control of a nonlinear process
represented by a continuous stirred tank reactor (CSTR).
Keywords: CSTR, steady-state and dynamic analysis, pole-placement, adaptive control
1 INTRODUCTION
Stirred tank reactors are units very often used in
industry, especially in chemical and biochemical
divisions. Continuous Stirred Tank Reactor (CSTR)
is widely used for control because input flow of the
reactant or cooling liquid can be controlled easily.
From the system engineering point of view CSTR
belong to the class of the nonlinear systems with
continuous distributed parameters. Mathematical
models of these reactors are described by a set of
nonlinear ordinary differential equations (ODEs).
Computer simulation is very often used at present as
it has advantages over an experiment on a real
system, which is sometimes not feasible and can be
dangerous or time and money demanding. Some
simplifications, modeling and simulation can be
found in (Ingham at al. 2000).
The goal of this work is to simulate the behaviour
and control of a real reactor taken from (Chen at al.
1995). Steady-state and dynamic behaviour is
examined by numerically solving of the
mathematical model which is represented by four
ODEs. The simple differential method and the
standard Runge-Kuttas method were used to solve
this set of ODEs. The simple differential method is
presented by many authors, e.g. (Lyuben, 1989).
Runge-Kuttas integration method used for dynamic
analysis can be found in (Ralston, 1979).
Simulation results are than used for control, in our
case adaptive control. The first step is to find
appropriate control method. The paper presents two
control strategies; one degree-of-freedom (1DOF)
and two degrees-of-freedom (2DOF) control
schemes described for example in (Grimble 1994)
with polynomial and pole-placement methods
(Kucera, 1993; Dostal at al., 2003). These modern
methods provide regulators which fulfil control
conditions, such as control quality, stability and error
compensation. Recursive least squares method with
delta models described in (Bobal at. al., 1999) were
used for the parameter estimation.
This paper shows the application of numerical
modeling, simulation and control on a model of a
real chemical reactor using the Matlab mathematical
software.
2 MODEL OF THE PLANT
The first step in the problem solution is to design a
model of the system. This model comes from the
knowledge of the system behavior and chemical
reactions inside the system. In this reactor the main
reaction is given by the conversion of
cyclopentadiene to the product cyclopentenol with an
unwanted parallel reaction in which the by-product
dicyclopentadiene arise. Graphical diagram of CSTR
reactor is shown in Fig. 1.
q
r
,c
ri
,T
r
q
r
,c
ri0
,T
r0
Q
c
,T
c
Q
c
,T
c0
V
r
,c
ri
,T
r

m
c
,T
c
A
r

U

Fig. 1. Continuous Stirred Tank Reactor (CSTR)
The so called van der Vusse reaction can be
described by the following reaction scheme:

1 2
3
2
k k
k
A B C
A D

(1)
The dynamics of the reactor can be described by the
following nonlinear differential equations that are
derived from component balances for substances A
and B and from energy balances for the reactor and
cooling jacket:

( )
2
0 1 3
A r
A A A A
r
dc q
c c k c k c
dt V
=
(2)

1 2
B r
B A B
r
dc q
c k c k c
dt V
= +
(3)

( ) ( )
0
r r r r
r r c r
r r pr r r pr
dT q h AU
T T T T
dt V c V c
= +
(4)

( ) ( )
1
c
c r r c
c pc
dT
Q AU T T
dt m c
= +
(5)
for
0, 0
A B
c c
.
In equations (2) (5) t is the time, c are
concentrations, T represents temperatures, c
p
is used
for specific heat capacities, q represents volumetric
flow rate, Q
c
is heat removal, V are volumes,
represents densities, A
r
is surface of the heat
exchange and U is heat transfer coefficient. Indexes
()
A
and ()
B
belong to compounds A and B, ()
r

denotes the reactant mixture, ()
c
cooling liquid, ()
0
is
feed (inlet) values and ()
s
represents steady-state.
The reaction rates (k
j
) are nonlinear functions
expressed via Arrhenius law:

( )
0
exp , for 1, 2, 3
j
j r j
r
E
k T k j
RT
| |
= =
|
\ .
(6)
where k
0
represents pre-exponential factors and E are
activation energies.
The reaction heat (h
r
) is a nonlinear function:

2
1 1 2 2 3 3 r A B A
h h k c h k c h k c = + +
(7)
where h means reaction enthalpies.
The reactor has real background (Chen at al. 1995)
and its constant parameters and initial values are
shown in Table 1.
TABLE 1. Parameters of the reactor
k
01
= 2.14510
10
min
-1

k
03
= 1.507210
8
min
-1

E
2
/R = 9758.3 K
h
1
=-4200 kJ.kmol
-1

h
3
= 41850 kJ.kmol
-1

V
r
= 0.01 m
3

c
pr
= 3.01 kJ.kg
-1
.K
-1

c
pc
= 2.0 kJ.kg
-1
.K
-1

U = 67.2 kJ.min
-1
m
-2
K
-1

c
A0
= 5.1 kmol.m
-3

T
r0
= 387.05 K
k
02
= 2.14510
10
min
E
1
/R = 9758.3 K
E
3
/R = 8560 K
h
2
= 11000 kJ.kmol
-1

r
= 934.2 kg.m
-3

q
r
= 2.36510
-3
m
3
min
-1
Q
c
= -18.5583 kJ.min
-1
A
r
= 0.215 m
2

c
B0
= 0 kmol.m
-3

m
c
= 5 kg
3 SIMULATION RESULTS
3.1 Steady-state Analysis
Steady-state characteristics were obtained through
solving equations (2) to (5) under condition
()/t = 0. A simple iteration method was used to
solve this problem. The behaviour for various flow
rates of reactive compound and heat removal are
surveyed in the following plots.

Fig. 2. Steady-state values of concentration c
B
for
various heat removal 500 kJ.min
-1
< Q
c
< 1000
kJ.min
-1

Fig. 3. Steady-state values of concentration c
B
for
various flow rate q
r
s
< 0.03 m
3
.min
-1

Fig. 2 shows steady-state analysis for various values
of heat removal, Q
c
, which is a typical nonlinear
behaviour of the system. The curve has one
maximum being the maximum value chosen as a
working point for dynamic analysis. The second
analysis, represented by Fig. 3, shows similar results
with nonlinear behaviour and one maximum, as well.
The steady-state values of the variables, at working
point, are chosen as follows:

3 3
2.1403 . 1.0903 .
387.3397 386.0551
s s
A B
s s
r c
c kmol m c kmol m
T K T K

= =
= =
(8)
3.2 Dynamic Analysis
The dynamic analysis examines the behaviour to a
step change of input quantity. Computed steady-state
values in Eq. (8) are used as an input for the dynamic
study. Runge-Kuttas standard method with fixed
step was used for solving equations (2) to (5). This
method was used because of its simplicity. There will
be better to use other Runge-Kuttas algorithms for
more accurate results. Output values y
1
and y
2

illustrate the difference of variables c
B
and T
r
from
their steady state values c
B
s
and T
r
s
:

1 2
;
s s
B B r r
y c c y T T = =
(9)

Fig. 4. The output y
1
time responses to input step
changes of the heat removal Q
c
.
The first analysis were done for step changes of a
steady state value of heat removal,
Q
c
[kJ.min
-1
] = -20% (1), -10% (2), 10% (3) and
20% (4) of a steady state value of Q
c
s
. The
results are shown in Figs. 4 and 5.

Fig. 5. The output y
2
time responses to input step
changes of the heat removal Q
c

Output variable y
1
in Fig. 4 has non-minimum phase
behaviour and changing sign of gain and this are
negative properties for control. On the other hand,
output y
2
, in Fig. 5, can be expressed with a second-
order linear model. This output was used as
controlled variable in the control section.

Fig. 6. The output y
1
time responses to input step
changes of reactive flow rate q
r
.
The second analysis were done again for step
changes, but this time it was a step change of the
reactive flow rate q
r
[m
3
.min
-1
] = -20% (1),
-10% (2), 10% (3) and 20% (4) of a q
r
.

Fig. 7. The output y
2
time responses to input step
changes of reactive flow rate q
r
.
As it is seen, both outputs have non-minimum phase
behaviour and changing sign of static gain.
Maximum of the variables is decreasing with the
value of input step change.
4 CONTROL OF THE REACTOR
4.1 Parameter Estimation
Delta models with recursive least squares method
were used for parameter estimation from
(Bobal at. al. 1999). Simulation of the dynamic
behaviour shows that controlled output could be
replaced by alternate transfer function of a second
order. As the system has non-minimum phase
behaviour the relative order of the system is one.
This transfer function has the general expression:

( )
( )
( )
1 0
2
1 0
b s b s b
G s
a s s a s a
+
= =
+ +
(10)
The transformation relation for forward model is

1
v
z
T


=
(11)
where z and are complex variables, T
v
is sampling
period. The differential equation of this system is
given by

( ) ( ) ( )
( ) ( )
1 0
1 0
1 2
1 2
y k a y k a y k
b u k b u k


= +
+ +
(12)
where

2
( ) 2 ( 1) ( 2)
( )
( 1) ( 2)
( 1)
( 2) ( 2)
( 1) ( 2)
( 1)
( 2) ( 2)
v
v
v
y k y k y k
y k
T
y k y k
y k
T
y k y k
u k u k
u k
T
u k u k

+
=

=
=

=
=
(13)
The data vector
( ) ( ) ( ) ( ) ( ) 1 1 , 2 , 1 , 2
T
k y k y k u k u k

= (

(14)
and the vector of estimated parameters

( )
1 0 1 0

, , ,
T
k a a b b
(
=

(15)
could be computed from the ARX-model

( ) ( ) ( )

1
T
y k k k

=
(16)
by the recursive least squares method.
4.2 Controller Design
We consider two control systems shown in Fig. 8 and
9. The first, 1DOF (one degree-of-freedom)
configuration has regulator only in feedback. On the
other hand, regulator in 2DOF (two degrees-of-
freedom) configuration has feedback and
feedforward parts. Both controllers work in
continuous time.

Fig. 8. 1DOF control scheme
In both schemes G is an approximate transfer
function from (10), F is an integrator, Q is feedback,
R is feedforward part of controller. Signal w is a
reference signal, u is a control variable, e is error, u
is unfiltered control variable and y represents an
output variable. Disturbance v is not mentioned.

Fig. 9. 2DOF control scheme
The transfer functions of the feedback (Q) and
feedforward (R) parts of the controller are given with
the compensator (F) in polynomial expression

( ) ( ) ( )
( )
( )
( ) ( ) ( )
( )
( )
q s
Q s Q s F s
s p s
r s
R s R s F s
s p s
= =

= =

(17)
where q, p and r are polynomials in s. A demand for
a stable controller is fulfilled if polynomial p in the
denominators of Eq. (17) is a stable polynomial.
4.3 Application of a Polynomial Method
One of the advantages of a polynomial method
related with the pole placement method is that one
can fulfil requirements for the control quality,
stability and error compensation. Polynomial
methods described in (Kucera 1993) were used for
computing of coefficients of the polynomials in Eq.
(17) in both configurations. The first polynomial
method for computing of coefficients of the
controller p and q has following form:

( ) ( ) ( ) ( ) ( ) a s s p s b s q s d s + =
(18)
where polynomials a and b are known from the
identification and polynomial d on the right side is
the stable polynomial. Polynomial r in the
q
Q
p
=
b
G
a
=

w e
u y
-
1
F
s
=

u
q
Q
p
=
b
G
a
=

y
-
r
R
p
=
u
1
F
s
=

u
w
feedforward part is computed from the second
polynomial equation

( ) ( ) ( ) ( ) t s s b s r s d s + =
(19)
where t an additive stable polynomial with random
coefficients, because these coefficients are not used
for computing of coefficients of the polynomial r. All
these equations are valid for step changes of the
reference and disturbance signals.
The polynomial on the right side of Eqs. (18) and
(19) ensures the stability, load disturbance
attenuation and asymptotic tracking for both
configurations. Polynomial d for the transfer function
Eq. (10) is of the fourth degree and it could be
chosen from a pole placement method such as

( ) ( ) ( ) d s n s m s =
(20)
Polynomial n is a stable polynomial obtained from
spectral factorization

( ) ( ) ( ) ( )
* *
n s n s a s a s =
(21)
The stable polynomial m could be chosen similar as
in (Dostal at. al., 2003)

( ) ( )
2
m s s = +
, for 0 > (22)
where > 0 is optional double, always real pole.
Degrees of polynomials q, r and p are computed as

deg 2; deg 1; deg 0 q p r = = =
(23)
The feedback and feedforward parts of the regulator
are obtained as

( )
( )
( ) ( )
( )
( )
( ) ( )
2
2 1 0
0
0
0
q s q s q s q
Q s
s p s s s p
r s r
R s
s p s s s p
+ +
= =
+
= =
+

(24)
The parameters of the polynomials q, p and r are
computed from Eqs. (18) and (19) depending on the
coefficients of the polynomial d. The value of the
parameter influences the output response and the
quality of a regulation.
4.4 Control Simulation Results
In adaptive control of this reactor we suppose
manipulated variable u(t) and controlled output y(t)
as

( ) ( ) ( ) ( )
( ) ( )
( )
; 10
s
c c s
r r s
c
q t q t
y t T t T t u t
q t

= =

(25)
The simulation took 450 min and three changes of
the reference value were made during this time. The
reference value was w(t) = 1[1-exp(-0.1t)] K in the
time domain 0<t<150 min, w(t) = -2 K in the interval
150<t<300 min and w(t) = 2 K in the last interval
300<t<450 min. Proportional regulator, with gain
k = -1, was used for first 15 steps because of
identification, because the parameter estimation
which does not work well with oscillated values in
the beginning. The sampling period for the
identification and the control action value was
T
v
= 0.2 min.

Fig. 10: Comparison of controlled output with 1DOF
and 2DOF control configuration for = 0.15.
Two types of control analysis were done by
simulation. First both control strategies (1DOF and
2DOF) were compared for one value of . The
results are shown in Fig. 10. The 2DOF control
configuration output response oscillates a little bit at
the beginning of the simulation but it has a smooth
course after next two step changes according to
1DOF.

Fig. 11. Course of parameter estimation in 1DOF
control configuration for = 0.15.

Fig. 12. Course of parameter estimation in 2DOF
control configuration for = 0.15.
Fig. 11 and 12 represents the course of parameter
estimation and as it can be seen from the plots, the
identification in both control configurations has only
small problems at the beginning of the simulation
because of the starting identification. In the next
course they did not change a lot.

Fig. 13. Output responses for various values of in
1DOF control configuration
The second control analysis was done for various
values of root . As it can be seen in Figs. 13 and 14,
this parameter affects mainly the overshoot and
speed of the control. With increasing value of
parameter the output response is quicker and the
overshoot smaller, but increasing cannot be infinite
because of limitation of the action variable. Value of
the action variable is increasing with increasing value
of . The main advantage of the 2DOF control
scheme is better disturbance compensation which
cannot be clearly seen in Figs. 13 and 14 because no
disturbance was simulated.

Fig. 14. Output responses for various values of in
2DOF control configuration
5 CONCLUSION
The paper shows results of the static and dynamic
analysis of a nonlinear process represented by a
continuous stirred tank reactor (CSTR) and
subsequent adaptive control of this reactor. At the
first part the model of the investigated reactor is
described, the second part presents simulation
experiments which were done on the model of this
reactor. The third part deals with adaptive control,
that means with pole placement method and delta
domain identification. Finally, the fourth part shows
some control simulation results. Results from
dynamic analysis were used for the selection of an
external linear model and then the controller is
designed for this model. Moreover, two control
strategies (1DOF, 2DOF) were introduced and
verified by simulation examples. The dynamic
analysis, presented, showed good control results
although the system has negative control properties
such as non-minimum phase behaviour and changing
sign of gain. The results demonstrate the usability of
this control method represented by a good quality
and stability of the output response.
ACKNOWLEDGMENT
This work was supported by the Grant Agency of the
Czech Republic under grant No. 102/03/0070 and by
the Ministry of Education of the Czech Republic
under grant MSM 2811 00001. The last author
(R.H.) acknowledges the financial support of the
University of Applied Science Cologne. The
cooperation between the two Universities was
supported by the program of EU Socrates.
6 REFERENCES
Bobal, V., Bhm, J., Prokop, P., Fessl, J. (1999):
Practical Aspects of the Self-tuning Regulators:
Algorithms and Implementation (in Czech), VUT
Brno
Chen, H., Kremling, A., Allgwer, F. (1995):
Nonlinear Predictive Control of a Benchmark
CSTR, Proceedings of 3rd European Control
Conference. Rome, Italy
Dostal, P., Bobal, V., Gazdos, F. (2003): Design of
controllers for unstable time delay systems using
polynomial method. In: 11th IEEE Mediterranean
Conference on Control and Automation MED
2003, Rhodes, Greece, June 18-20.
Grimble, M. J. (1994). Robust industrial control.
Optimal design approach for polynomial systems.
Prentice Hall, London.
Ingham, J., Dunn, I. J., Heinzle, E., Penosil, J. E.
(2000): Chemical Engineering Dynamics.
Modelling with PC Simulation. VCH
Verlagsgesellshaft, Weinheim.
Kucera, V. (1993). Diophantine equations in control
A survey. Automatica, 29, 1361-1375.
Luyben, W. L. (1989): Process Modelling,
Simulation and Control for Chemical Engineers.
McGraw-Hill, New York.
Ralston, A. (1979): Numerical Mathematical Basics
(in Czech). Praha, Academia.

Potrebbero piacerti anche