(IJCSIS) International Journal of Computer Science and Information Security, Vol. 10, No. 7, July 2012
Modeling and Control of CSTR using Model based Neural Network Predictive Control
Piyush Shrivastava
Assistant Professor,
Electrical& Electronics EngineeringDepartment, Takshshila Institute of Engineering & Technology, Jabalpur, Madhya Pradesh, India
.
Abstract—this paper presents a predictive control strategy based on neural network model of the plant is applied to Continuous Stirred Tank Reactor (CSTR). This system is a highly nonlinear process; therefore, a nonlinear predictive method, e.g., neural network predictive control, can be a better match to govern the system dynamics. In the paper, the NN model and the way in which it can be used to predict the behavior of the CSTR process over a certain prediction horizon are described, and some comments about the optimization procedure are made. Predictive control algorithm is applied to control the concentration in a continuous stirred tank reactor (CSTR), whose parameters are optimally determined by solving quadratic performance index using the optimization algorithm. An efficient control of the product concentration in cstr can be achieved only through accurate model. Here an attempt is made to alleviate the modeling difficulties using Artificial Intelligent technique such as Neural Network. Simulation results demonstrate the feasibility and effectiveness of the NNMPC technique.
KeywordsContinuous Stirred Tank Reactor; Neural Network based Predictive Control; Nonlinear Auto Regressive with eXogenous signal.
I.
INTRODUCTION
One of the main aims in industry is to reduce operating costs. This implies improvements in the final product quality, as well as making better use of the energy resources. Advanced control systems are in fact designed to cope with these requirements. Model based predictive control (MBPC) [1,2] is now widely used in industry and a large number of implementation algorithms due to its ability to handle difficult control problems which involve multivariable process interactions, constraints in the system variables, time delays, etc. The most important advantage of the MPC technology comes from the process model itself, which allows the controller to deal with an exact replica of the real process dynamics, implying a much better control quality. The inclusion of the constraints is the feature that most clearly distinguishes MPC from other process control techniques, leading to a tighter control and a more reliable controller.
Another important characteristic, which contributes to the success of the MPC technique, is that the MPC algorithms
38
consider plant behavior over a future horizon in time. Thus, the effects of both feedforward and feedback disturbances can be anticipated and eliminated, fact which permits the controller to drive the process output more closely to the reference trajectory. The classical MBPC algorithms use linear models of the process to predict the output of the process over a certain horizon, and to evaluate a future sequence of control signals in order to minimize a certain cost function that takes account of the future output prediction errors over a reference trajectory, as well as control efforts. Although industrial processes especially continuous and batch processes in chemical and petrochemical plants usually contain complex nonlinearities, most of the MPC algorithms are based on a linear model of the process and such predictive control algorithms may not give rise to satisfactory control performance [3, 4]. Linear models such as step response and impulse response models are preferred, because they can be identified in a straightforward manner from process test data. In addition, the goal for most of the applications is to maintain the system at a desired steady state, rather than moving rapidly between different operating points, so a precisely identified linear model is sufficiently accurate in the neighborhood of a single operating point. As linear models are reliable from this point of view, they will provide most of the benefits with MPC technology. Even so, if the process is highly nonlinear and subject to large frequent disturbances; a nonlinear model will be necessary to describe the behavior of the process. Also in servo control problems where the operating point is frequently changing, a nonlinear model of the plant is indispensable. In situations like the ones mentioned above, the task of obtaining a highfidelity model is more difficult to build for nonlinear processes.
In recent years, the use of neural networks for nonlinear system identification has proved to be extremely successful [5 9]. The aim of this paper is to develop a nonlinear control technique to provide highquality control in the presence of nonlinearities, as well as a better understanding of the design process when using these emerging technologies, i.e., neural network control algorithm. The combination of neural networks and modelbased predictive control seems to be a good choice to achieve good performance in the control. In this paper, we will use an optimization algorithm to minimize the
http://sites.google.com/site/ijcsis/ ISSN 19475500
(IJCSIS) International Journal of Computer Science and Information Security, Vol. 10, No. 7, July 2012
cost function and obtain the control input. The paper analyses a neural network based nonlinear predictive controller for a Continuous Stirred Tank Reactor (CSTR), which is a highly nonlinear process. The procedure is based on construction of a neural model for the process and the proper use of that in the optimization process.
This paper begins with an introduction about the predictive control and then the description of the nonlinear predictive control and the way in which it is implemented. The neural model and the way in which it can be used to predict the behavior of the CSTR process over a certain prediction horizon are described, and some comments about the optimization procedure are made. Afterwards, the control aims, the steps in the design of the control system, and some simulation results are discussed.
II. PREDICTIVE CONTROL
The predictive controller, in summary, is characterized by computing future control actions based on output values predicted by a model, with vast literature and academic and industrial interest (Clarke, 1987; Garcia et all, 1989; Arnaldo, 1998) [4]. This section presents the concepts of predictive control based on NPC, using the usual optimization functions and control laws, applied to the conventional predictive controllers.
A. Optimization functions The optimization function, usually represented by the index J, represents the function that the control action tries to minimize. In an intuitive way, the error between the plant output and the desired value is the simplest example of an optimization function, and it is expressed by:
(1)
Where:
y(k) represent the plant output
y k ref ( )represent the desired response e(k) represent the estimation error
k is the sample time
One of the most usual optimization functions is based on the square error and it is represented as:
(2)
But the optimization index can take forms of more complex functions. For predictive controllers, whose models are capable to predict N steps ahead, the simple application of the square error approach can present satisfactory results. This case admits that the optimization function is not limited to an only point, but an entire vector of N predicted errors. It seeks to optimize the whole trajectory of the future control actions in a horizon of N steps ahead.
(3)
More complex optimization functions can consider the control effort. It is the specific case of GPC (Generalized Predictive Control), where the optimization index J can be expressed as:
(4)
where:
y(k )  is the output plant estimation at instant = k Δu  is the control action increment. N1  is the minimum horizon of prediction. NU  is the control horizon. NY  is the maximum horizon of prediction.
The objective of the control problem is to minimize the index J, with respect to the control actions, looking for the points where the first order differential is null.
_{I}_{I}_{I}_{.} _{N}_{E}_{U}_{R}_{A}_{L} NETWORK PREDICTIVE CONTROL
By the knowledge of the identified neural model of the nonlinear plant which is capable of doing multi step ahead predictions, Predictive control algorithm is applied to control nonlinear process. The idea of predictive control is to minimize cost function, J at each sampling point:
JtUk( ,
( )) =
N
2
∑
[
t=N
1
rk( +i) − yˆ (k+i)
2
N
u
][
+
∑
ρ Δuk( +−i 1)
i=1
]
2
(5)
With respect to the N _{u} future controls,
(
Uk
)
(
= uk
[
)
and subject to constraints:
(
NiNn≤
u
≤
2
−
k
)
(
uk +−N
u
1)] ^{T}
(6)
(7)
Using the predictive control strategy with identified NARX model (NNMPC) it is possible to calculate the optimal control sequence for nonlinear plant. Here, term r(k+i) is the required reference plant output, _{y}_{ˆ} _{(}_{k}_{+}_{i}_{)} is predicted NN model output, _{Δ}_{u}_{k}_{(} _{+} _{i} _{−} _{1}_{)} is the control increment, N _{1} and N _{2} are the minimum and maximum prediction (or cost) horizons, Nu is the control horizon, and _{ρ} is the control penalty factor[4]. The predictive control approach is also termed as a receding horizon strategy, as it solves the abovedefined optimization problem [5] for a finite future, at a current time and implements the first optimal control input as the current control input. The vector u = [Δu(k),Δu(k+1),…Δu(k + Nu1)] is calculated by minimizing cost function, J at each sample k for selected values of the control parameters {N _{1} , N _{2} , Nu, ρ}.
39
http://sites.google.com/site/ijcsis/ ISSN 19475500
Th ese control
(IJCSIS) International Journal of Computer Science and Information Security, Vol. 10, No. 7, July 2012
parameters de fines the pr edictive cont rol
The purpos e of our neur al network m odel is to do
J in NNMPCi s an optimizati on
pro blem minimi zed iterative ly. Similar t o NN traini ng stra tegies, iterati ve search met hods are appl ied to determ ine
Th e minimization
of criterion,
the minimum.
specif ies
(i) is the sea rch direction a nd
size. Variou s types of a lgorithms ex ist,
cha racterized by the way in w hich search d irection and s tep
Newton bas ed
Le venberg–Marq uardt (LM) a lgorithm is im plemented. T he
sea rch direction a pplied in LM algorithm is:
the current iterate
(i
θ
+1)
=
(
μ
^{i}^{)}
is
i
( )
θ
the
(i)
+
μ
step
.d
(i)
(number ‘i’),
(8)
wher e,
θ
(i)
d
siz e are selecte d. In the p resent work
ˆ
(H [U (t)] +λ I)d
i
i
i
i
= G[U (t)]
(9)
with Gradien t vector and H essian matrix as:
i
G[U (t)] =
= −
2
ϕ
T
[U
i
∂ J(t,U(t))
∂ U(t)
%

(t)]E(t)+2 ρ
()
Ut
=
U
i
t
()
%
∂ U(t)
%
U
∂ U(t)
(
∂
2
%
J(t, U(t)) _{}
∂
i
H[ U (t)] =
=
U(t )
∂
2
∂
∂
U(t)
⎛
⎜
⎝
∂
ˆ
Ut ()
=
U
⎞
⎟
⎠
i
^{Y}^{(}^{t}^{)} E(t)
U(t)
() t
+2
ρ
∂
U %
T
(t)
∂
U(t)
∂
U %
( t ) ( )
t
∂
U
t )

()
Ut =U
i
t
()

()
Ut =U
( 
10) 

i 
t () 

( 
11) 
inverse Hess ian
the
con trol inputs. T he most popul ar formula kn own as Broyd en
Fle tcherGoldfarb Shanno (BF GS) algorithm
the inverse Hessi an is used he re[8]. The pro posed scheme im plementing the NNMPC is sh own in Figure 2.
of
wh ere B ^{(}^{i}^{)} specifi es the approx imation of the
and
G[U ^{(}^{i}^{)} (t)] is
the gradient
of the J wit h respect to
to approxim ate
Tim e Series Pred iction with Ne ural Networks
40
a 
rapid ly increasing divergence due 
to accumulat ion of errors. 
It 
there fore puts high demands on 
accuracy of th e model. The 
better t he model mat ches the actu al plant the le ss significant
the acc umulated erro r. A sampling time as large
to reduce th e error accum ulation as it
for a given
time h orizon. The ne ural network t rained to do o ne step ahead
effectiv ely reduces t he number of
an effe ctive method
as possible is
steps needed
predict ion will mode l the plant. Th e acquisition
is also referred to as
System Identif ication.
of this model
I
V. MODELIN G OF NEURAL NETWORK PRE DICTIVE
CONTROL (N
NPC)
The thr ee steps invol ved in the AN N model devel opment are
A. Ge neration of Inp utOutput dat a
The da ta generated t o train the net work should c ontain all the
CSTR. The
input w as given to t he convention al model of th e CSTR and
relevan t information
about the dy namics of the
from t he conventio nal model, th e input and
output were
sample d for 0.02 sa mpling instant s and the requ ired sampled
data ar e obtained to t rain the netwo rk.
Figure 2: InputOutp ut Sequence
B. Ne ural Network A rchitecture
The fe ed forward ne twork with sig moidal activa tion function
was ch osen based o n the trials w ith different multila yer perceptron .
structures of
http://sites.google.com/site/ijcsis/ ISSN 19475500
(IJCSIS) International Journal of Computer Science and Information Security, Vol. 10, No. 7, July 2012
Fig ure 3: ANN m odel of the CS TR
7 neurons in the hidden lay er. architecture of ANN. The A NN
7
neu rons in the hi dden layer and one neuron in the output lay er.
sel ected here co nsists of 4 n eurons in th e input layer,
Th e lowest error corresponds to He nce it is select ed as optimal
Th e ANN archit ecture used in the present w ork is shown 
in 

Fig ure 3. The trai ning algorithm 
used in the C STR modeling 
is 
bac k propagatio n algorithm. 
Before train ing the proc ess 
we ights are initia lized to small random numb ers. The weig hts
all training se ts.
Wh en the error fo r the entire se t is acceptably low, the traini ng is s topped.
error gets m inimized for
are
adjusted till
Ta ble 2 shows t he parameters mo del for the CS TR
used in deve loping the A NN
Parame ters 
Va lues 

Input ne urons 
4 

Output N eurons 
1 

Hidden layer 
7 

Neuro ns 

No. of hidd en layer 
7 

Activation function 
Sig moidal 

Training al gorithm 
Levenber gMarquardt 

Iterati on 
10 
000 
Archite cture 
Feed forward 

Initial w eights 
1 
Table 2: ANN Parameters f or CSTR mode ling
C. Model Valida tion
Th e final step in
mo del [11]. Vali dation is perfo rmed by eval uating the mo del
per formance usin g trained dat a and test dat a. The input a nd
network and t he network w as
tar get were pres ented to the
developing t he model is
the
validation of
trai ned using Lev enbergMarqu ardt algorithm .
Va lidation tests on training s et:
Fi gure 4: (a) On e step ahead p rediction of m odel, (b) Predi ction error bet ween model o utput and pred icted output
Val idation tests o n test set:
Figur e 5 :(a) one st ep ahead predi ction of model (validation
set), ( b) Prediction e rror between
model output a nd predicted
o utput (validati on set)
V.
CONT
Continuous
Figure 6.This CSTR
The
INUOUS STIRR ED TANK REA CTOR
Stirred Tank
Reactor [6]
is shown in
model in used as the nonlinea r system.
The i mage part with relationship ID rId50 was not found in the file.
Figure 6: C ontinuous Stir red Tank Reac tor
The
equations w hich shows t he dynamic
system is
model of the
41
http://sites.google.com/site/ijcsis/ ISSN 19475500
(IJCSIS) International Journal of Computer Science and Information Security, Vol. 10, No. 7, July 2012
(14)
(15)
prod uct
con centration at t he output of th e process, w _{1} ( t) is the flow r ate
of the concentrat ed feed C _{b}_{1} an d w _{2} (t) is the
dil uted feed C _{b}_{2}
and
flow rate of the
.The input co ncentration ar e set to C _{b}_{1} =2 4.9
where
C _{b}_{2} =
h
(t)
is
the
liquid
level,
C _{b} (t)
is
the
the
0.1.T he
constants
associated
w ith
rate
of
con sumption are 
k 
_{1} =k _{2} =1. 
The objective 
of the contro ller is to mai ntain the prod uct 
con centration by adjusting the f ow w _{1} (t), w _{2} (t) =0.1.The le vel
The designed controller use s a
neu ral network
of the tank h is n ot controlled.
to
pot ential control signals. The tr aining data we re obtained fr om
the nonlinear mod el of CSTR.
model to pred ict future CS TR responses
VI.
SI
MULATION RES ULTS AND CO NCLUSION
govern theCS TR
dy namics to forc e the system c oncentration t o track a cert ain
set points. In this system, the in put is the cool ant flow rate a nd
the
ide ntifier is train ed and initial ized before th e control acti on
sta rts. The input vector of the i dentifier inclu des coolant fl ow
rat es at different t ime steps (the sampling time
Th e performance of the propose d controller is shown in Fig ure
7. Evidently, the concentration values of the plant could tra ck
the setpoint valu es excellent. I t is to be note d that to impro ve
larger predicti on
tim e. It is rem arkable to n ote that bec ause of hig hly
no nlinearity natu re of CSTR p rocess, using the conventio nal
con trol technique
see n in figure 7 t hat controller output is track ing the referen ce sig nal.
the
output is th e concentrati on of the pr ocess [12]. T he
Th e objective of
the control s trategy is to
is 20sec).
transient resp onse, one ma y consider a
could not re ach the contro l task. It can be
Figure 8:
control signal by the controll er
In 
this p aper modelin g 
of 
CSTR 
has been 

implem ented using artificial 
neu ral 
networks. 
The neural 
model has been train ed using data set obtained f rom dynamic equatio ns. Feed for ward neural n etwork has b een used to
model 
the CSTR. T he neural mod el has been d esigned as a 

black 
box model. T he simulation 
results from 
conventional 
model and the neural model were c ompared for th e given input
variatio ns and the re sults have be en found sati sfactory. The simula tion shows tha t implementat ion of the Ne ural Network based a dvanced contr ollers for the s etpoint tracki ng case were
able to
target values
smooth ly and within reasonable rise
force proces s output varia bles to their
and settling t imes.
VII.
REFER
ENCES
[1]
some new res ults,Industrial
Engine ering Chemica l Process ”. D ev. 21, 3083 23.
L.G. Lightb ody and G. W . Irwin, “Neu ral networks
“in Proc. I FAC Symp.
Algorit hms Architec tures RealTi me Control, B angor, U.K. pp. 1–1 3, 1992.
[3]
Algorithm”,
Autom atica, Vol.23, no.2, pp: 137  148, 1987.
[4]
control : past, presen t and future, Engine ering, 23, 667 682.
[5]
control based on Ham merstein mod els”, in. Proc. International
Sympo sium on Proce ss System Eng ineering, Seo ul, Korea, pp. 995–10 00, 1994.
[6]
reactor” Proc eedings 23rd
Europe an Conferenc e on Modellin g and Simulat ion ©ECMS
Javier Otamendi, An drzej Bargiela, 2006.
[7]
A. Mel lichamp, “An adaptive nonli near predictiv e controller,” in Pro c. Amer. C ontrol Confer ence., vol. 2 ,,pp. 1614– 1619,1 990.
[8]
deviate d power of a n identified N NARX mode l of a hydro
“Nonlinear p redictive con trol to track
Vasičkanino va and M. B akošova, “Ne ural network
predict ive control o f a chemical
X. Zhu, D. E. Seborg, “N onlinear mod el predictive
D. W. Cl arke, C. Mo htadi and P . S. Tuffs,
“Gener alized Predic tive Control
for no nlinear adap tive control,
Garcia C. E . and Morari , M. 1982. In ternal model
control I. “A unifyin g review and
[2]
Basic
Morari, M.
and Lee, J.
H. 1999. Mod el predictive Computers a nd Chemical
J. D. Morni ngred, B. E. P aden, D. E. Se borg, and D.
N.
Kishor,
Fig ure 7: Respon se graph with and without co ntroller 
plant”. 
Expert Syst ems with Ap plications 35, 
1741–1751, 

2008. 

[9] 
Tan, Y. and Cauwenbergh e, A. “Nonli near one step 

ahead 
control using 
neural netw orks: control 
strategy and 
42
http://sites.google.com/site/ijcsis/ ISSN 19475500
(IJCSIS) International Journal of Computer Science and Information Security, Vol. 10, No. 7, July 2012
stability design”, Automatica, vol 32, no. 12, 17011706,
1996.
[10] Dan, W.P., 1996. Artificial Neural Networks Theory and Applications. Prentice Hall, Upper Saddle River, New Jersey, USA. [11] S.A.Billings, and W.S.F. Voon, “Correlation based model validity tests for nonlinear models. International Journal of Control, 44, 235–244.1986.
AUTHORS PROFILE
Author is presently working as Assistant Professor in Electrical and Electronics Department of Takshshila Institute of Engineering and Technology. He received the Masters degree in Electrical Engineering with specialization in Control Systems Engineering from Jabalpur Engineering College. His area of specialization is in Neural Networks, Control Systems, Fuzzy Logic.
43
http://sites.google.com/site/ijcsis/ ISSN 19475500
Viel mehr als nur Dokumente.
Entdecken, was Scribd alles zu bieten hat, inklusive Bücher und Hörbücher von großen Verlagen.
Jederzeit kündbar.