Adpt PP CSTR Matlab
Adpt PP CSTR Matlab
r
= 934.2 kg.m
-3
c
pc
= 2.0 kJ.kg
-1
.K
-1
A
r
= 0.215 m
2
c
B0
= 0 kmol.m
-3
m
c
= 5 kg
The set of ordinary differential equations (ODE) then
together with simplifications described in the previous
part then mathematically represents examined CSTR
reactor. The model of the reactor belongs to the class of
lumped-parameter nonlinear systems. Nonlinearity can
be found in reaction rates (k
j
) which are described via
Arrhenius law:
( )
0
exp , for 1, 2, 3
j
j r j
r
E
k T k j
RT
| |
= =
|
\ .
where k
0
represent pre-exponential factors and E are
activation energies.
The reaction heat (h
r
) in equation (3) is expressed as:
2
1 1 2 2 3 3 r A B A
h h k c h k c h k c = + +
where h
i
means reaction enthalpies.
Parameters of the reactor are given in Table 1 (Chen at
al. 1995).
3. Simulation and validity of the model
Two simulation studies were performed steady-state
analysis and dynamic analysis.
Steady-state analysis
Steady-state analysis for stable systems involves
computing values of state variables in time t , when
changes of these variables are equal to zero. That
means, that the set of ODEs (1) (4) is solved with the
condition c()/ct = 0. A simple iteration method was
used to solve this problem. Steady values of quantities
were examined for various rates of the volumetric flow
of the reactant, q
r
, and heat removal of the cooling
liquid, Q
c
. The first study for volumetric flow rate of the
reactant q
r
[m
3
.min
-1
] = <510
-4
; 310
-2
> and heat
removal Q
c
= -18.56 kJ.min
-1
displayed in Figure 3
shows strong nonlinear course of steady-state values of
both concentrations c
A
and c
B
. Maximal concentration
of the product, c
B
= 1.09 kmol.m
-3
, was obtained for
flow rate q
r
= 2.36510
-3
m
3
.min
-1
. Curves of steady-
state temperatures T
r
and T
c
are displayed in Figure 4.
Figure 3: Steady-state values of concentrations c
A
and
c
B
for various flow rate q
r
Figure 4: Steady-state values of temperatures T
r
and T
c
for various flow rate q
r
Simulation for different heat removal of cooling liquid
Q
c
[kJ.min
-1
] = <-500; 500> and flow rate q
r
= 2.36510
-3
m
3
.min
-1
has similar nonlinear behaviour as
in the previous study see Figure 5. This course has
again a maximal value of products concentration, c
B
, in
this case, the maximal concentration is achieved
approximately for heat removal Q
c
= -18.56 kJ.min
-1
.
Figure 6 shows steady values of temperatures T
r
and T
c
.
Figure 5: Steady-state values of concentrations c
A
and
c
B
for various heat removal Q
c
Figure 6: Steady-state values of temperatures T
r
and T
c
for various heat removal Q
c
The goal of the steady-state study is to find an optimal
working point, where the products concentration is
maximal and this point was found for volumetric flow
rate q
r
s
= 2.36510
-3
m
3
.min
-1
and heat removal
Q
c
s
= -18.56 kJ.min
-1
. Steady values of the quantities are
following
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
= =
= =
(5)
Dynamic analysis
The next step after steady-state study is dynamic study.
For this nonlinear lumped-parameter system dynamic
analysis involves solving the set of nonlinear ODE.
Computed steady-state values of (5) are used as an input
for the dynamic study and Runge-Kuttas standard
method with a fixed step was used for solving equations
(1) to (4). The behaviour of the system was obtained
after a step change of the input quantities q
r
and Q
c
.
Simulation took 30 minutes and the integration step was
set to 0.1 min. Output step responses of the values y
1
and y
2
in next figures illustrate the difference of
variables c
B
and T
r
from their steady state values c
B
s
and
T
r
s
, i.e.
1 2
;
s s
B B r r
y c c y T T = =
The first study for four values of step changes of
volumetric flow rate q
r
[m
3
.min
-1
] = -1.1810
-3
(-50%
of its steady-state value q
r
s
), -0.5910
-3
(-25%),
0.5910
-3
(25%), 1.1810
-3
(50%) shows that both outputs
y
1
and y
2
has negative properties from the control point
of view non-minimum phase behaviour and the
changing sign of gain. Step responses of these output
variables are displayed in Figure 7 and Figure 8.
Figure 7: Course of output concentration c
B
(y
1
) for
various step changes of flow rate q
r
Figure 8: Course of output temperature T
r
(y
2
) for
various step changes of flow rate q
r
Figure 9 shows step responses for different step changes
of cooling heat removal Q
c
[kJ.min
-1
] = 9.28 (-50% of
its steady value Q
c
s
), 4.64 (-25%), -4.64 (25%) and -
9.28 (50%).
Figure 9: Course of output concentration c
B
(y
1
) for
various step changes of heat removal Q
c
Figure 10: Course of output temperature T
r
(y
1
) for
various step changes of heat removal Q
c
Again, the output product concentration c
B
(output y
1
)
has non-minimum phase behaviour and changes the
sign of gain.
On the other hand, the output reactive temperature T
r
(output y
2
) in Figure 10 could be expressed with a
second-order linear model. This output was used as the
controlled variable in the control section and a change
of the heat removal was considered as a manipulated
variable.
We did not have a real model of this plant at our
disposal, there was no chance to check the validity of
the model and we supposed that the model is
satisfactory.
4. Control strategy and controller design
The adaptive control with usage of polynomial
synthesis and pole-placement method was used for
control of this reactor. This method could be used for
systems with negative control properties such as non-
minimum phase behaviour or transport delay.
External continuous-time linear model
We used a continuous-time (CT) external linear model
(ELM) as a description or the relation between the
output and the input signals. The CT model is in time
domain generally described by a differential equation
( ) ( ) ( ) ( ) a y t b u t o o = (6)
where = d/dt is the differentiation operator and if
initial conditions are equal to zero it si possible to
transform equation (6) to the complex domain using the
Laplace transform (L-transform):
1
( ) ( ) ( ) ( ) ( ) a s Y s b s U s o s = + (7)
with s as a complex variable and o
1
(s) denoting initial
conditions.
Polynomials a(s) and b(s) have the following form
deg deg
0 0
( ) , ( )
a b
i j
i j
i j
a s a s b s b s
= =
= =
_ _
If the initial values are equal to zero, we can introduce a
transfer function
( )
( )
( )
( )
( )
Y s b s
G s
U s a s
= = (8)
This transfer function must be proper, i.e.
deg deg b a s (9)
Parameter estimation
It is clear that the equation (6) could not be used
directly for parameter estimation because of derivatives
of the input and output variables. It is necessary to
introduce filtered variables u
f
and y
f
which are
computed from differential equations
( ) ( ) ( )
( ) ( ) ( )
f
f
c u t u t
c y t y t
o
o
=
=
(10)
where c() is a stable polynomial which satisfies
condition deg deg c a s .
The L-transform of (10) to complex domain yields
2
3
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
f
f
c s U s U s o s
c s Y s Y s o s
= +
= +
(11)
where o
1
, o
2
are polynomials which take into account
initial conditions of filtered variables. If we substitute
the equation (11) into the equation (7), the result is
( )
( ) ( ) ( )
( )
f f
b s
Y s U s s
a s
= + +
Where (s) is a rational function in s which takes into
account initial conditions of filtered and non-filtered
variables.
Dynamics of filters (10) must be faster then dynamics of
the controlled process. The selection of filter parameters
is problematic and it is closely connected with the
knowledge about the system behaviour. If we do not
have any knowledge about the system it is good to set
these parameters a priory small.
Values of filtered variables were acquired in discrete
time moments t
k
= kT
v
for k = 0,1,2 , where T
v
denotes a sampling period and the regression vector for
n = deg a and m = deg b has the following form
( ) ( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
1 1
1
, , , ,
, , , ,1
n T
k f k f k f k
m
f k f k f k
t y t y t y t
u t u t u t
!
!
The vector of parameters is
( ) | |
0 1 1 0 1
, , , , , , ,
T
k n m
t a a a b b b
= u ! !
Then, parameters of polynomials a and b can be
estimated in discrete time intervals from
( )
( ) ( ) ( ) ( )
n T
f k k k k
y t t t t = + + u
Adaptivity of the process is fulfilled by recursive
parameter estimation during the control. Recursive
Least Squares (RLS) method with direct forgetting
(Kulhavy and Karny 1984) was used for this parameter
estimation. The discrete version of the algorithm could
be described by following equations:
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
( )
( ) ( )
( )
( )
( ) ( ) ( ) ( )
( )
( )
( )
( )
( )
( )
1 2
1
1
1
1 1
1
1 1
1
1 / 1
1 1
1 for 1 0
1 1
1 for 1 0
T
T
T
k y k k k
r k k k k
k k
k
r k
k
k k k k
k
k r k
r k k
r k
c
|
=
=
=
+
=
+
>
P
P
P
L
u
( ) ( )
( ) ( ) ( ) ( )
( ) ( )
1
1 1
1
1 1
T
k k k k
k k
k r k |
=
+
P P
P P
where
1
is the forgetting factor computed e.g. via
( ) ( ) ( )
2
1
1 k K k k c =
for a small value of the constant K.
Control system configuration
Two control system configurations were adopted. The
first 1DOF (one degree-of-freedom) configuration
displayed in Figure 11 has a regulator only in the
feedback part. On the other hand, configuration with
two degrees-of-freedom (2DOF) has both feedback and
feedforward parts see Figure 12.
u
e w
-
v
y
Figure 11: 1DOF control scheme
In both schemes G is an approximate transfer function
from (8), Q is feedback and R feedforward part of the
controller. The signal w is the reference signal, u is a
control variable, e is an error, y represents an output
variable and v is disturbance in the input to the system.
u
w
-
v
y
= +
for > 0 be an optional coefficient reflecting closed-
loop poles and stable polynomial n(s) is obtained from
the spectral factorization of the polynomial a(s)
( ) ( ) ( ) ( )
* *
n s n s a s a s =
Simulation experiment
Changes of the heat removal were used as manipulated
variable and the controlled output was the temperature
of the reactant:
( ) ( ) ( ) | | ( )
( ) ( )
( )
| | ; 100 %
s
c c s
r r s
c
Q t Q t
y t T t T t K u t
Q t
= =
Dynamic analysis of the output temperature shows that
ELM could be expressed by a second order system with
the relative order one described in the continuous-time
form by the differential equation
( ) ( ) ( ) 2 1 1
1 0 1 0
( ) ( ) ( ) ( ) ( ) y t a y t a y t b u t b u t + + = +
And in the complex s-plane as the transfer function
1 0
2
1 0
( )
b s b
G s
s a s a
+
=
+ +
(17)
Filtered variables u
f
and y
f
were computed from
differential equations similar as in (10)
( ) ( )
( ) ( )
2 1
1 0
2 1
1 0
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
f f f
f f f
y t c y t c y t y t
u t c u t c u t u t
+ + =
+ + =
where parameters c
1
and c
0
were chosen equal to c
1
=
1.4 and c
0
= 0.49. The recursive least squares method
with directional forgetting was used for parameter
estimation. The regression vector and vector of
parameters for ELM (17) have the form
( ) ( )
( )
( ) ( )
( )
( )
( ) | |
1 1
0 1 0 1
, , ,
, , ,
T
k f k f k f k f k
T
k
t y t y t u t u t
t a a b b
(
=
=
u
Starting values for the RLS method with direct
forgetting were following: the vector of parameters
T
(k) = [0.1,0.1,0.1,0.1]; the covariance matrix P(0)
with the dimension 4 x 4 has 10
-6
on the diagonal; a
starting value of the forgetting factor was
1
(0) = 0.95
and further, (0) = 0, (0) = 0. Degrees of polynomials
of the feedforward R(s) and feedback Q(s) parts of the
controller were computed from the transfer function
(17) via (16): deg q = 2, deg p = 1, deg r = 0 and then,
transfer functions were
( )
( )
( )
( )
2
2 1 0 0
1 0 1 0
,
q s q s q r
Q s R s
s p s p s p s p
+ +
= =
+ +
Coefficients of polynomials p, q and r were computed
from diophantic equations (13) and (14) where
polynomial d(s) was of the fourth degree
( ) ( ) ( )
2
d s n s s o = +
With parameter > 0. Coefficients of the polynomial
n(s) are computed via
2 2
0 0 1 1 0 0
, 2 2 n a n a n a = = +
The simulation took 300 min and three changes of the
reference value were made during this time. The
reference value was w(t) = 2 K in the time domain
0<t<100 min, w(t) = -1 K on the interval 100<t<200
min and w(t) = 1 K in the last interval 200<t<300 min.
A proportional regulator, with gain k
p
= -1, was used for
first 15 steps because of identification, which does not
work well with oscillating values in the beginning.
Figure 13: Course of output y(t) for 1DOF set-up and
different values of the parameter = 0.2; 0.3 and 0.4
The sampling period for the identification and the
control action value was T
v
= 0.5 min. The manipulated
variable was limited to the interval -75% u(t) 75%.
Figure 14: Course of output y(t) for 2DOF set-up and
different values of the parameter = 0.2; 0.3 and 0.4
Figure 15: Comparison of outputs y(t) and action values
u(t) for 1DOF and 2DOF set-ups with root = 0.4
Figure 13 and Figure 14 show results for 1DOF and
2DOF configuration and different parameters . As it
can be seen in both figures, 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 in this case.
Figure 15 compares results for 1DOF and 2DOF
configuration for the same placement of the parameter
= 0.4. The main advantages of 2DOF configuration are
lower overshoots and smoother changes of action value.
Parameter estimation during the simulation for 1DOF
configuration displayed in Figure 16 shows that the
chosen RLS method with direct forgetting has a
problem only in the beginning of the simulation because
of small amount of information.
Figure 16: Course of estimated parameters a
0
, a
1
, b
0
and
b
1
for 1DOF configuration and root = 0.4
CONCLUSION
The paper shows methodology from simulation of a
nonlinear process represented by the CSTR reactor to
adaptive control of this system. Simulation of the
steady-state reveals the ideal working point and
dynamic analysis shows step responses for more input
values. Proposed adaptive control based on polynomial
synthesis and the pole-placement method provides good
control results although the system has negative control
properties such as non-minimum phase behaviour and
changes the sign of gain. The control process has
quicker slope and overshoots lower with increasing
value of the parameter , but increasing cannot be
infinite because of limitation of the action variable. The
main advantage of the 2DOF control configuration is
represented by smaller overshoots and smoother
changes of the action variables which is important from
the practical point of view, where action value could be
e.g. valve twist. Shock changes of the twist could
destroy or damage the valve. The results demonstrate
the usability of this control method, which is
represented by a good quality and stability of the output
response.
REFERENCES
strm, K.J. a B. Wittenmark (1989). Adaptive Control.
Addison Wesley, Reading, MA.
Dostl, P., Bobl, V., Sysel, M. (2002): Design of controllers
for integrating and unstable time delay systems using
polynomial method, In: Proc.. 2002 American Control
Conference, Anchorage, Alaska, USA, 2773-2778.
Grimble, M. J. (1994). Robust industrial control. Optimal
design approach for polynomial systems. Prentice Hall,
London.
Chen, H., Kremling, A., Allgwer, F. (1995): Nonlinear
Predictive Control of a Benchmark CSTR. In: Proceedings
of 3rd European Control Conference. Rome, Italy
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.
Kuera, V. (1993). Diophantine equations in control A
survey. Automatica, 29, 1361-1375.
Kulhav, R., Krn, M. (1984): Tracking of slowly varying
parameters by directional forgetting, In: Proc. 9th IFAC
World Congress, vol. X, Budapest, 78-83.
Luyben, W. L. (1989): Process Modelling, Simulation and
Control for Chemical Engineers. McGraw-Hill, New
York.
Wahlberg, B. (1990).: The effects of rapid sampling in system
identification, Automatica, vol. 26, 167-170.
ACKNOWLEDGMENT
This work was supported by the Grant Agency of the
Czech Republic under grants No. 102/03/H116 and by
the Ministry of Education of the Czech Republic under
grant MSM 7088352101.
AUTHOR BIOGRAPHIES
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. He went to 3 month
study stays at University of Applied
Science Cologne, Germany in 2003 and Politecnico di
Milano, Italy in 2004. 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].
PETR DOSTAL went to Technical
University of Pardubice, where he obtained
master degree in 1968 and PhD. degree in
Technical Cybernetics in 1979. In the year
2000 he became professor in Process
Control. His research interest are modeling
and simulation of continuous-time chemical processes,
polynomial methods, optimal, adaptive and robust
control. You can contact him on email address
[email protected].