NIRMA UNIVERSITTY JOURNAL OF ENGINEERING AND TECHNOLOGY, VOL.1, NO.
2, JUL-DEC 2010 55
Optimal Control of CSTR
Kalpesh Pathak, Anil Markana and Nishant Parikh
Abstract—Nonlinear Model PredictiveControl (MPC) of Con-
tinuous Stirred Tank Reactor (CSTR) has been demostrated in
this work. Optimal state estimation has been done using Extended
Kalman Filter (EKF). Second order mathematical model for
CSTR has been developed and further used for dynamic simula-
tions. It is found that optimal control of temperature inside the
CSTR is achieved better with the help of MPC strategy compared
to conventional control strategies. It is seen that setpoint tracking
performance using this optimal control strategy is satisfactory
achieved.
Index Terms—Model Predictive Control, Extended Kalman
Filter, controller effort
I. I NTRODUCTION
Chemical reactors together with mass transfer processes
constitute an important part of chemical processes. From a
control point of view, reactors belong to the most difficult
nonlinear processes. We describe here CSTR as second order
process where the aim is to control the temperature of product
inside CSTR by manipulating the inlet steam temperature.
Exothermic reactors are very interesting systems because of
their potential safety problems and the possibility of exotic
behavior such as multiple steady states. Furthermore, oper-
ation of chemical reactors is corrupted by many different Fig. 1. Continuous Stirred Tank Reactor
uncertainties. Some of them arise from varying or not ex-
actly known parameters like chemical kinetics or reaction
activity. Operating points also change in this process. Various
been performed for normal operating conditions and with dis-
types of perturbations also affect chemical reactors. All these
turbances also. Past work includes classical control, Artificial
uncertainties can cause poor performance or even instability
Intelligence(AI), Neural Network(NN) and Fuzzy logic based
of closed-loop control systems. In this paper we concentrate
control algorithm for CSTR.
on a CSTR as a highly nonlinear system. In the jacketed
Optimal control strategies like MPC and Linear Quadratic
chemical reactor (CSTR) shown in Figure 1, a second-order
Gaussian (LQG) Control are effective here. MPC refers to
exothermic reaction takes place, in which component A react
a class of algorithms that compute a sequence of manipulated
irreversibly and at specific reaction rate to form a product.
variable adjustments in order to optimize the future behavior
The reaction rate constant follows the Arrhenius equation.
of a plant. Adaptation of linear models with occurrence of new
According to this equation, the effect of temperature, on the
conditions according to variety of operating points in nonlinear
specific reaction rate is usually exponential. This exponential
systems is a solution for extending linear methods in design
temperature dependence represents one of the most severe
of controllers for nonlinear systems.Nonlinear MPC to control
nonlinearities in chemical engineering systems.[7] .
temperature inside CSTR has been presented here. Optimal
Patwardhan S.C. et. al.[5] used a discrete quadratic pertur-
state estimation has been done using Extended Kalman Filter
bation model for approximating nonlinear plant dynamics
(EKF). Second order mathematical model for CSTR has
in the neighborhood of the operating point by simulating a
been developed and further used for dynamic simulations.
benchmark CSTR system. Simulation with MPC with State
Satisfactory set point tracking performance shows that optimal
Estimation and Adaptation Mechanism[7] for a CSTR has
control of temperature inside the CSTR is achieved better with
Kalpesh Pathak is an M.Tech Student at School of Petroleum Technology, the help of MPC strategy compared to conventional control
Pandit Deendayal Petroleum University, Gandhinagar, Gujarat-382007, India. strategies.
Email:[email protected]
Anil Markana is a Lecturer at School of Petroleum Technology, Pan-
dit Deendayal Petroleum University, Gandhinagar, Gujarat-382007, India. II. MATHEMATICAL MODEL
Email:[email protected]. Telephone(+91)79 23275052 In this section the mathematical model for the CSTR is
Nishant Parikh is a Lecturer at School of Petroleum Technology, Pan-
dit Deendayal Petroleum University, Gandhinagar, Gujarat-382007, India. derived. The process input and output are temperature of the
Email:[email protected]. Telephone(+91)79 23275025 steam and temperature of the product respectively.
56 NIRMA UNIVERSITTY JOURNAL OF ENGINEERING AND TECHNOLOGY, VOL.1, NO.2, JUL-DEC 2010
Overall reactor material balance State variable form of the equations
The overall reactor material balance equation is.
d F −Ea
d CA = f1 (CA , T ) = (CAf −CA )−k0 exp( )CA (5)
vρ = Fin ρin − Fout ρ (1) dt v RT
dt d F (−∆H) −Ea UA
T = f2 (CA , T ) (Tf −T )+ ∗k0 exp( )CA − (T −Tj )
dt v ρCp RT vρCp
Where, (6)
v : constant liquid rector volume Taking state variable x1 = CA and x2 = T above model can
ρ : density of reactor fluid be written as nonlinear state variable form
d
x(t) = f (x, u) (7)
ρ in : density of inlet stream dt
Fin : Flow rate of inlet stream
Fout : Flow rate of outlet stream where,
Assuming Constant density (ρ in = ρ ) and volume, it is easy x(t) : state vector
to show that Fin = Fout = F. u(t) : Input vector
The nonlinear dynamical Eqns for CSTR given by Eqn 5 &
Eqn. 6, considering parameters and constants listed in TableI
Balance on component A can be written as,
d x2
here we consider the simple reaction A → B. The balance x1 = Da (1 − x1 ) − exp( ) − x1 (8)
on component A is dt 1 + xγ2
d x2
d x2 = −x2 +B(Da (1−x1 )−exp( ))+β(u−x2 ) (9)
v CA = F CAf − F CA − V rA (2) dt 1 + xγ2
dt
The parameter values of the laboratory process are given in
Table I
Where,
CA :Concentration of component A in the reactor Parameters Values
rA :Rate of reaction per unit volume β 3
γ 40
The Arrhenius expression is normally used for the rate of B 22 DMA
reaction. A first-order reaction results in the following Da 0.082 DMA
u -2.5 DMA
−Ea
rA = k0 exp( )CA (3) TABLE I
RT PARAMETER VALUES
Where,
k0 :Frequency factor
III. OPTIMAL CONTROL STRATEGY
Ea :Activation energy
R : Ideal gas constant Linear model predictive control[6],[8] refers to a class
T :Reactor temperature on an absolute scale(Rankine or of control algorithms that compute a manipulated variable
Kelvin) profile by utilizing a linear process model to optimize a
linear or quadratic open loop performance objective subject
to linear constraints over a future time horizon. The first
Reactor energy balance move of this open loop optimal manipulated variable profile is
then implemented. This procedure is repeated at each control
The reactor energy balance assuming constant volume, heat interval with the process measurements used to update the
capacity (Cp ) and density, and neglecting changes in the optimization problem. MPC is a control algorithm based on
kinetic and potential energy is, solving an online optimal control problem. A receding horizon
approach is used, which can be summarized in the following
d
vρCp T = F ρCp (Tf − T ) + (−∆H) ∗ V rA − UA (T − Tj ) steps:
dt
(4) 1) At time k and for the current state x(k); solve, on-line,
an open-loop optimal control problem over some future
where, interval, taking in to account of constraints.
(-4H) : heat of reaction 2) Apply the first step in the optimal control sequence.
U : Heat transfer coefficient 3) Repeat the procedure at time (k + 1); using the current
A : Heat transfer area state x(k + 1).
Tf :Feed temperature When x(k) is not directly measured, one can obtain a closed
Tj :Jacket temperature loop solution by replacing x(k) by an estimate x̂(k), provided
NIRMA UNIVERSITTY JOURNAL OF ENGINEERING AND TECHNOLOGY, VOL.1,NO.2, JUL-DEC 2010 57
by some form of observer. The various MPC algorithms only series expansion of the state equation around xk−1 = x̂k−1 and
differ amongst themselves in the model used to represent the ωk−1 = 0 to obtain the following:
process, noise and the cost function to be minimized. They ∂fk−1 ∂fk−1
share the common features as xk = fk−1 (x̂+
k−1 , uk−1 , 0)+ | x̂+ +
k−1 (xk−1 −x̂k−1 )+ | x̂+
k−1 ω
∂x ∂x
1) Process model that is explicitly used to predict the (15)
process output for a fixed number of steps in to future. xk = fk−1 (x̂k−1 , uk−1 , 0) + Fk−1 (xk−1 − x̂+ k−1 ) + Lk−1 ωk−1
2) A known future reference trajectory. (16)
3) Calculation of a future control sequence minimizing a xk = Fk−1 xk−1 +[fk−1 (x̂+ +
k−1 , uk−1 , 0)−Fk−1 x̂k−1 ]+Lk−1 ωk−1
certain objective function (usually quadratic, that in- (17)
volves future process output errors and control incre- xk = Fk−1 xk−1 + ũk−1 + W̃k−1 (18)
ments), Fk−1 and Lk−1 are defined by the above equation. The known
4) Receding strategy: at each sampling period only the first signal uk and the noise signal W̃k are defined as follows:
control signal of the sequence calculated is applied to a
process controlled. ũk = fk (x̂+ +
k , uk , 0) − fk x̂k (19)
ω˜k ∼ (0, Lk Qk LTk ) (20)
Objective Function
We linearize the measurement equation around xk = x̂−
k and
The various MPC algorithms propose different objective vk = 0 to obtain
functions[9] for obtaining the control law. The general aim is
∂hk ∂hk
that the future output y(n + j) on the considered horizon should yk = hk (x̂−
k−1 , 0) + | x̂− −
k−1 (xk − x̂k−1 ) + | x̂−
k−1 vk
follow a desired reference signal w and at the same time, the ∂x ∂x
(21)
control effort, u necessary for doing so should be penalized. yk = hk (x̂− , 0) + H (x − x̂ −
) + M v (22)
k−1 k k k−1 k k
The general expression for such an objective function will be
min yk = Hk xk + [hk (x̂− −
k−1 , 0) − Hk x̂k−1 ] + Mk vk (23)
j=N
X1 j=1
j X yk = Hk vk + zk + ṽk (24)
J= δ(j)[ŷ(n+ )−ω(n+j)]2 + ρ(j)[∆u(n+j−1)]2
n Hk and Mk are defined by the above equation. The known
N2 Nu
(10) signal zk and the noise signal ṽk are defined as
In some cases, the above equation also includes weighing on
control effort.N1 and N2 are the minimum and maximum cost zk = hk (x̂− −
k−1 , 0) − Hk x̂k−1 (25)
horizons and Nu is the control horizon. ω(n + j) is the future ṽk ∼ (0, Mk Rk MkT ) (26)
reference trajectory.
We have a linear state space system in Eqn 18 and a linear
IV. NONLINEAR STATE ESTIMATION measurement in Eqn 24 That means we can use the standard
Kalman filter equations to estimate the state. This results in
This section presents discrete-time EKF[3],[4] for nonlinear the following equations for the discrete time extended Kalman
state estimation. It considers discrete time dynamics and dis- filter.
crete time measurements. This situation is often encountered
in practice. Even if the underlying system dynamics are Pk− = Fk−1 Pk−1
+ T
Fk−1 + Lk−1 Qk−1 LTk−1 (27)
continuous time, the EKF usually needs to be implemented
Kk = Pk− HkT (Hk Pk− HkT + Mk Rk MkT )−1 (28)
in a digital computer. This means that there might not be
enough computational power to integrate the system dynamics x̂−
k = fk−1 (x̂−
k−1 , uk−1 , 0) (29)
as required in a continuous-time EKF or a hybrid EKF. So the
dynamics are often discretized. and then a discrete-time EKF zk = hk (x̂− −
k , 0) − Hk x̂k (30)
can be used. x̂+ − −
k = x̂k + Kk (yk − Hk x̂k − zk ) (31)
Suppose the CSTR system model represented as
x̂+
k = x̂−
k + Kk [yk − hk (x̂−
k , 0)] (32)
xk = f(k−1) (x(k−1) , u(k−1) , ω(k−1) ) (11)
Pk+ = (I − Kk Hk )Pk− (33)
yk = hk (xk , vk ) (12)
state noise V. RESULTS & DISCUSSION
ωk ∼ (0, Qk ) (13) This section presents results of simulation using MAT-
LAB. Fig. 2 shows the simulation results for controlling
and measurement noise temperature inside the reactor when an MPC with EKF is
vk ∼ (0, Rk ) (14) implemented. Simulation parameters like prediction horizon
and control horizon are 50 and 2 respectively. After a setpoint
where xk , uk and yk are system state, input and ouput change response reaches final steady value within less than
respectively. ωk and vk are zero mean white noise sequence 8 seconds.Results shows good tracking performance when a
with variance of Qk and Rk respectively. We perform a Taylor reference trajectory changes.
58 NIRMA UNIVERSITTY JOURNAL OF ENGINEERING AND TECHNOLOGY, VOL.1, NO.2, JUL-DEC 2010
AnilMarkana received his B.E. degree in Instru-
mentation and Control engineering from GEC Gand-
hinagar, Gujarat University, India, in 2000, M.Tech
degree in Systems and Control engineering from
Indian Institute of Technology, Bombay, India, in
2008, and currently pursuing Ph.D. degree in Sys-
tems and Control engineering from the Indian In-
stitute of Technology, Bombay, Mumbai. He is
currently a lecturer in the School of Petroleum
Technology, Pandit Deendayal Petroleum University,
Gandhinagar, Gujarat, India. His current research
interests include Advance Process Control, Optimal control, Multi objective
optimization based MPC and Control theory.
KalpeshPathak received his BE degree in Instru-
mentation & Control Engineering from S.S. En-
gineering College, Bhavnagar, India, in 2000 and
M.Tech. degree in Petroleum Engineering from
Fig. 2. Simulation results for MPC with Extended Kalman Filter for CSTR
School of Petroleum Technology, Pandit Deendayal
Petroleum University, Gandhinagar, India, in 2010.
He is currently an Assistant Professor in the Depart-
ment of Instrumentation & Control Engineering at
Government Engineering College, Gandhinagar. His
VI. CONCLUSION current research interests include Optimal control
theory for enhanced oil recovery, Model predictive
control and Digital signal processing.
Second order mathematical model for CSTR has been
developed and dynamic simulation has been performed using
it. It can be observed that the optimal control of temperature NishantParikh received his BE degree in Instru-
mentation and Control engineering from Shantilal
inside the CSTR is achieved better with the help of MPC Shah College of Engineering and Technology, Bhav-
strategy compared to conventional control strategies.Nonlinear nagar, India, in 2002, M.Tech degree in Systems
MPC of CSTR has been demostrated and response shows that and Control engineering from Indian Institute of
Technology, Bombay, India, in 2008, and currently
satisfactory setpoint tracking performance with this optimal pursuing Ph.D. degree in Chemical engineering from
control strategy has been achieved. the Indian Institute of Technology, Bombay, Mum-
bai. He is currently a lecturer in the School of
Petroleum Technology, Pandit Deendayal Petroleum
University, Gandhinagar, Gujarat, India. His current
research interests include areas of system identification, advance process
control and digital control.
R EFERENCES
[1] P. S. Maybeck, ”Modern Signals and Systems”, Academic Press, NY,
1979.
[2] K. R. Muske and J. B. Rawlings, .Model predictive control with linear
models.,AIChE, vol.39, pp. 262-287, 1993.
[3] J. H. Lee and N. L. Ricker, ”Extended Kalman Filter based Nonlinear
Model Predictive Control”, Industrial and Engineering Chemistry Re-
search, vol. 33, pp 1530-1541,1994.
[4] J. H. Lee and A. K. Dutta, ”Nonlinear Inferential Control of Pulp
Digesters”, AIChE Journal, vol. 40, pp 50-64,1994.
[5] S.C.Patwardhan and K.P. Madhavan, ”Nonlinear predictive control of an
exothermic CSTR using recursive quadratic state space models”, IEEE
onference, NY , USA , pp.967 - 972 ,1995
[6] Qin, S.J., Badegwell, T.A. .An Overview of Industrial Model Predictive
Control Technology..5th International Conference on Chemical Process
Control AIChE & CACHE, pp.232-256, 1997.
[7] M.Khodabandeh and H.Bolandi,”Model Predictive Control with State
Estimation and Adaptation Mechanism for a Continuous Stirred Tank
Reactor”, International Conference on Control, Automation and Systems,
Seoul, Korea, 2007
[8] S.Patwardhan,”Lecture notes on Advance Process Control., IIT Bombay,
2008.
[9] Anil Markana, .Performance Analysis of Controllers. Master of Technol-
ogy( Thesis), IIT Bombay,2008.