Nonlinear Model Predictive Control of Chemical Processes with a

Nonlinear Model Predictive Control of Chemical
Processes with a Wiener Identification Approach
MohammadMehdi Arefi1, Allahyar Montazeri1, Javad Poshtan1, and MohammadReza Jahed-Motlagh2
1
Electrical Engineering Department, 2Computer Engineering Department
Iran University of Science and Technology, Tehran, Iran
Email: [email protected]
Abstract- Some chemical plants such as pH neutralization
process have highly nonlinear behavior. Such processes demand a
powerful wiener identification approach based on neural
networks for identification of the nonlinear part. In this paper,
the pH neutralization process is identified with NN-based wiener
identification method and two linear and nonlinear model
predictive controllers with the ability of rejecting slowly varying
unmeasured disturbances are applied. Simulation results show
that the obtained wiener model has good capability to predict the
step response of the process. Parameters of both linear and
nonlinear model predictive controllers are tuned and the best
obtained results are compared. For this purpose, different
operating points are selected to have a wide range of operation for
the nonlinear process. Simulation results show that the nonlinear
controller has better performance without any overshoot in
comparison with linear MPC and also less steady-state error in
tracking the set -points.
I.
INTRODUCTION
There are very few design techniques that can be proved to
stabilize processes in the presence of nonlinearities and
constraints. Model Predictive Control (MPC) -an optimal
control, model based method- has been one of the successful
controllers in manufacturing industries for the past two
decades. MPC refers to a class of computer control algorithms
that control the future behavior of a plant through the use of an
explicit process model. At each control interval the MPC
algorithm computes an open-loop sequence of manipulated
variable adjustments in order to optimize future plant behavior.
The first input in the optimal sequence is injected into the
plant, and the entire optimization is repeated at subsequent
control intervals [1]. By now, the application of MPC
controllers based on linear dynamic models cover a wide range
of applications and linear MPC theory can be considered quiet
mature. Nevertheless, many manufacturing processes are
inherently nonlinear and there are cases where nonlinear
effects are significant and can not be ignored. These include at
least two broad categories of applications [1]:
1- Regulator control problems where the process is highly
nonlinear and subject to large frequent disturbances (pH
control, etc.)
1-4244-0726-5/06/$20.00 '2006 IEEE
2- Servo control problems where the operating points change
frequently and span a wide range of nonlinear process
dynamics (polymer manufacturing, ammonia synthesis, etc.)
In fact higher product quality specifications and increasing
productivity demands, tighter environmental regulations and
demanding economical considerations require to operate
systems over a wide range of operating conditions and often
near the boundary of admissible region [2]. Besides the
operating point in some batch processes is not in steady-state
and all of the operations are performed in transient conditions
[3]. Under these conditions linear models are often not
sufficient to describe the process dynamics adequately and
nonlinear models must be used.
In recent years several nonlinear model predictive control
(NMPC) techniques from identification as well as control
points of view are addressed for different processes in
literatures. Among these techniques, neural networks play
important role especially in identification phase. For example
in [4], neural networks are used to develop a model for highly
nonlinear CSTR and pH neutralization processes. A nonlinear
internal model controller is designed based on these models
and results are compared with PID controller. In [5], an RBF
neural network is used to model and control of an unstable
CSTR process. The use of neural network for modeling of a
CSTR process has also reported in [6]. The controller is
designed using classical optimization methods. The main
problem with neural network as a model is that it performs
well in the range of data used for training neural network but
has poor extrapolation property in other regions. To cope with
this problem, dynamic nonlinear models are proposed [2], [7].
The use of wiener models where a linear dynamic model is
followed by a static nonlinearity is one of the solutions. A
nonlinear model predictive controller for pH neutralization and
CSTR processes using wiener model method is addressed in
[8], [9]. In these methods a static nonlinear term is used to
model the inverse of the nonlinearity of the plant and selected
as polynomial with proper degree or piece-wise linear terms.
In this paper a nonlinear model predictive control based on
classic optimization methods with nonlinear identification
using wiener model for a highly nonlinear chemical process is
proposed. The main difference between this method and those
in [8], [9] is that here, the static nonlinear term is neural
1735
network. The use of polynomials for direct identification of
these highly nonlinear plants will result in poor validation. For
this purpose after this introduction, the theory of wiener
identification using neural network as the static nonlinear term
is presented. Also selection of the test signal to achieve the best
result for identification is studied. In section 3 the design of
nonlinear model predictive controller based on the identified
wiener model is presented. The simulation results for
identification and control of pH neutralization process are
given in section 4 and finally conclusions come.
II. NN-BASED WIENER IDENTIFICATION
A. Wiener Identification
A Wiener model consists of a dynamic linear block (H1) in
cascade with a static nonlinearity at the output (H2), as shown
in Fig. 1. Here z(k ) Î Rl is an intermediate signal which has not
necessarily a physical meaning.
u(k)
z(k)
H1
y(k)
H2
θ Î Rl (( l +2 )u +1) and must be estimated using nonlinear least square
methods. u is the number of neurons in the hidden layer and
the last term e (k ) shows the estimation error. The cost function
which minimized for estimation of the vector parameters θ is:
min
θ
N
å
k =1
u æ
æ l
öö
y1 ( k) - å çç a (1, i )f çç å b (1, i, j ) zˆ j (k ) + b(1, i ) ÷÷ ÷÷ + b(1,u + 1)
=
1
i =1 è
j
è
øø
u æ
æ l
öö
yl ( k) - å çç a (l , i )f çç å b (l , i, j ) zˆ j (k ) + b(l , i ) ÷÷ ÷÷ + b(l ,u + 1)
i =1 è
è j =1
øø
2
(3)
Finally the best parameters for the linear and nonlinear parts
are identified with an optimization algorithm. For this purpose,
the system matrices identified for the linear part and the vector
parameter estimated for the nonlinear part are used as initial
conditions for the calculation of the final parameters. In spite
of the vector parameter defined for the nonlinear part a full
parameterization of the wiener model in (1) requires that the
system matrices ( A, B, C, D) and also the vector of initial
condition x(1) be included in the vector parameter. To have
minimum parameter for the matrices the pair ( A, C) must be
transformed with similar transformations to what is called
output normal form.
Definition:
The
pair
of
the
system
( A, C)
Fig. 1. The Wiener model.
matrices ( A, B, C, D) is output normal form if A T A + CT C = I n ,
State-space representation of a wiener model can be stated as
follows:
x(k + 1) = Ax(k) + Bu (k)
z(k ) = Cx(k) + Du (k )
(1)
y(k) = f ( z(k)) + v(k )
where x(k ) is an n ´ 1 state vector at time k , u (k ) an m ´ 1
vector of control input, y(k ) an l ´ 1 vector of measured output
and v(k ) is a measurement noise with zero mean which is
independent of u (k ) for all k’s. The system matrices
A, B, C, D are real with proper dimension and f (.) is a
nonlinear vector function defined on Rl ® Rl . The sequences
of input and output data used for identification of (1) are
available. Besides, it is assumed the input sequences {u (k )} are
persistent exciting [10] and statistically independent of noise
sequences {v(k)} . The systematic approach for identification of
the above problem is stated completely in [11]. The first step is
identification of linear part using state-space methods. So
assuming the nonlinear mapping as an identity, the linear
dynamic characterized by quadruple ( A, B, C, D) will be
identified. Then using the identified matrices ( A, B, C, D) , the
sequences of the output of this LTI system {zˆ (k )}kN=1 will be
computed. With this sequence a primary identification of the
nonlinear part of the wiener model can be estimated. Here, this
static nonlinear term is identified with a single layer neural
network with the following structure:
where I n Î R n´n is an identity matrix. The above definition
explicitly shows that the matrix A must be asymptotically
stable. In order the state space description of the system be
unique, the matrices A and C are transformed such that
éC ù
ê A ú be lower triangular with positive elements in the diagonal.
ë û
After these transformations, the parameterization can be
performed using nl parameters. More details about this
method of parameterization can be found in [12, 13]. All
parameters of the system matrices after this parameterization
are stacked in the vector θ on . The estimation of the all
parameters of the parameterized wiener system can be obtained
by minimizing this performance index:
u æ
æ l
öö
f s ( z( k )) = å çç a ( s, i )f çç å b ( s, i, j ) z j (k ) + b( s, i) ÷÷ ÷÷ + b( s, u + 1) + e s ( k )
i =1 è
j
1
=
è
øø
(2)
In the above equation f s (.) and zs (k) are used to
characterize the sth input and output of this nonlinear term.
Besides, a ( s, i) ، b ( s, i, j ) ، b( s, i ) and b( s,u + 1) are unknown
real coefficients stacked in the vector parameter
N
min = å y(k ) - yˆ (k, x(1), θon , θ)
x (1),θon ,θ
2
(4)
k =1
where N is the number of samples used for identification. To
obtain all parameters of the system, the above least square
minimization must be solved. The method used here is
Levenberg-Marquardt which tries to find local minima of the
performance index iteratively. If Θ is the vector of the all
parameters by defining e(Θ) = y - yˆ (Θ) , where e(Θ) is the
error between the target and output vector. The parameters of
Θ can be updated in each iteration. Suppose the value of these
parameters at t iteration of Levenberg-Marquardt algorithm is
shown by Θ(t ) , then this algorithm can be stated as follows:
(5)
Θ(t + 1) = Θ(t ) + ΔΘ(t )
where ΔΘ is obtained by solving this set of nonlinear
equations:
(6)
(J T (t ) J (t ) + m I )DΘ = -J T e(Θ(t ))
1736
In the above equation, J (t ) is the Jacobian matrix with these
derivatives:
¶yˆ (Θ(t ))
J ij := i
, i = 1 : N , j = 1 : length (Θ).
(7)
¶Θ j
The tuning parameter m Î (0, ¥) is called the Levenberg factor
and is necessary for convergence of the algorithm. The
derivatives in (7) are calculated analytically for the nonlinear
part and approximated using forward difference method for the
linear part [13]. All identification procedures are performed
using SLICOT toolbox [13].
B. Test Design
Some important factors which must be considered in
designing the identification test for nonlinear systems are: the
duration of the test signal, its amplitude and shape, its spectrum
(the average switching time), the correlation of the test signal
in each channel, and the number of manipulated variables in
each test.
Since in nonlinear systems the test time depends mainly on
the number of parameters in the model and the level of noise
and unmeasured disturbances, it is recommended longer test
time in comparison with linear systems. This is typically
considered about 16-25 times of the settling time of the
process. The other factors may be included by choosing one of
the following excitation signals [14]:
1- Staircase test: In this type of test the width of the pulses and
their numbers must be selected properly.
2- Generalized multiple-level noise (GMN): This type of test
which is also used here is a multi-level extension of
generalized binary noise. In this test the amplitude and the
number of pulses must be selected suitably. The number of
levels on this test is equal or greater than the degree of
nonlinear polynomial which must be identified. Moreover, the
average switching time of the test can be obtained from
Tsw= T/3, where T is the %98 of the settling time of the
process.
3- Filtered white uniform noise: The flexibility in shaping the
spectrum of this type of signal is its main advantage. Each
spectrum may be realized with a proper filter. A first order
low-pass filter is often suitable for this purpose.
where z (k ) is the vector of outputs of linear model, u(k)
the vector of manipulating variables, y (k ) the vector of the
outputs of the wiener model shown in Fig. 2, and r (k) the
vector consisting set points.
u(k)
If at time k, the future state and behavior of the plant is
assumed to be known, they can be written in vector form in
MIMO case as follows:
[
z(k) = zT (k + 1) zT (k + 2) L zT (k + P )
[
y ( k ) = [y
]
]
( k + P )]
u(k) = u (k + 1) u (k + 2) L u (k + M )
T
T
[
T
(k + 1)
T
y (k + 2) L y
T
T
T
(8)
T
(9)
T
(10)
]
r(k) = r T (k + 1) r T (k + 2) L r T (k + P )
T
(11)
y(k)
NN(.)
Fig. 2. The Wiener model for NMPC.
Also M , P are the control and prediction horizon
respectively. The predicted output of the linear model can be
written as:
(12)
zˆ (k) = b u (k) + xx(k )
where b , x and u (k ) are:
D
0
0
0
é CB
ù
ê
ú
CB
D
0
0
ê CAB
ú
2
ê
ú
CA
B
CAB
CB
D
0
b=
ê
ú
M
M
M
M
M
ê
ú
P
1
2
3
P
P
P
P
M
P
i
êCA B CA B CA B L (D - CA B + å CA B)ú
i=M
ëê
ûú
é CT A ù
ê T 2ú
êC A ú
x = ê CT A 3 ú
ê
ú
ê M ú
êC T A P ú
ë
û
(13)
(14)
[
u (k) = u T (k) u T (k)
]
T
(15)
Besides, the predicted output of the wiener model is as
follows:
é f ( zˆ (k + 1)) ù
ú
ê ˆ
ê f ( z(k + 2)) ú
(16)
yˆ (k ) = ê f ( zˆ (k + 3)) ú = f (zˆ (k ))
ú
ê
M
ú
ê
ê f ( zˆ (k + P ))ú
û
ë
Finally by solving and minimizing this optimization problem
the control signal applied to the process can be obtained:
P
min J
u ( k +1), u ( k + 2), ..., u (k + M )
=
M
M
å yˆ (k + j | k) - r (k) + å Du(k + j | k) + å u(k + j | k)
j =1
2
Q
j =1
2
S
j =1
2
R
(17)
where
Du (k + j k ) = u (k + j k ) - u (k + j - 1 k )
III. NONLINEAR MODEL PREDICTIVE CONTROLLER
z(k)
x(k+1)=Ax(k)+Bu(k)
z(k)=Cx(k)+Du(k)
(18)
In the above equations, Q , S and R are the weighting
matrices for the output and rate of change of the control input
respectively. In addition, it is assumed that:
u (k + j ) = u ( M ) for j = M + 1 to P
(19)
In this optimization problem the eligible limits for the
control input and its rate of change and also for output signal
may be considered with these inequalities:
u min £ u(k) £ u max
"k
(20)
du min £ u(k ) - u(k - 1) £ du max
"k
y min £ y (k ) £ y max
"k
1737
The optimization problem stated above can be solved with
Successive Quadratic Programming (SQP) method. It is
important to notice that the optimization time must be less than
the sampling time of the process since the obtained control
signal can be applied to the process.
To compensate the eventual mismatch between the process
and its model and in order to consider unmeasured
disturbances in the process, a term like this must be added to
the predicted output of the plant [6]:
(21)
d( k ) = y (k ) - y m ( k )
where y (k ) is the output of the real process and y m (k ) is the
model output. The modified predicted output will be:
y pred (k + i ) = y m (k + i ) + d(k), for i = 1K P
(22)
9.5
9
8.5
+10%
pH
8
7.5
-10%
7
6.5
6
0
2
4
6
8
10
Time (Min)
12
14
16
18
20
Fig. 4. Open-loop step response of the pH neutralization process for changing
the flow rate of the input signal.
IV. SIMULATION RESULTS
A. IDENTIFICATION RESULTS
The considered pH neutralization process consists of an acid
(HNO3) stream, a base (NaOH) stream, and a buffer
(NaHCO3) stream that are mixed in a constant volume (V)
stirring tank. The process is schematically depicted in Fig. 3.
To identify this process a GMN signal with six levels 13,
15.55, 17, 18, 20, and 25 is selected to cover the spanned range
of the input signal. Switching time between these levels is
assumed to be 6 samples. 1280 sample of the input-output data
with sampling time of 0.25min is used for identification. Fig. 5
shows the input and output signals of the process (base flow
rate and the pH of the solution respectively). A measurement
noise with the SNR of 20dB is added to the output signal.
base flow rate (mls-1)
25
20
15
10
0
200
400
600
800
1000
1200
1400
200
400
600
800
No of sample
1000
1200
1400
11
10
pH
9
8
7
6
0
Fig. 3. Schematic representation of pH neutralization process.
The inputs of the system are the base flow rate (u1), buffer
flow rate (u2), and the acid flow rate (u3), while the pH level of
the effluent solution is considered as the output (y). Usually the
acid flow rate and the volume of the tank are assumed to be
constant and the pH level of the effluent solution is controlled
by changing the base flow rate. The buffer flow rate is assumed
as an unmeasured disturbance. The governed nonlinear
equations which are highly nonlinear and their corresponding
parameters are described in [8]. The nominal condition of y
and u1 are 7 and 15.55 mls-1 respectively. Fig. 4 shows the
nonlinear behavior of the open-loop response of the process for
+ /- 10% change in the base flow rate. As it can be seen the
gain for +10% change is about 250% greater than the -10%
change.
Fig. 5. GMN input (Up) and output (Down) signals for identification of pH
process.
For identification, a wiener model with 5 neurons in the
hidden layer is chosen. The linear part of this model is a
second order state-space. The output data for better training of
the neural network are normalized between -1 and +1. 800
samples are used for identification and the rest of the signal is
used for validation purpose. Fig. 6 shows the validation results.
Also the step response of the model and plant for +10%
change in the input signal are compared in Fig. 7. These plots
validate the nonlinear identified model.
1738
11
10
Wiener Model
Validation Data (Clean)
Validation data (noisy)
10.5
10
9
9.5
8.5
8
pH
pH
9
8.5
7.5
8
7
7.5
6.5
7
6
6.5
5.5
6
0
Setpoint
NMPC
9.5
50
100
150
200
250
samples
300
350
400
450
5
500
0
5
10
15
20
25
Time (Min)
Fig. 6. Validation of the wiener model of pH process.
Fig. 8. The performance of set-point tracking of pH process using NMPC.
9.5
10
Real Process
Wiener Model
Setpoint
NMPC
LMPC
9.5
9
9
8.5
8.5
pH
pH
8
8
7.5
7
7.5
6.5
6
7
5.5
6.5
0
2
4
6
8
10
Time (Min)
12
Fig. 7. Step response of the wiener model for
signal of pH process.
14
16
18
5
0
20
5
10
15
20
25
Time (Min)
+10% change in the input
Fig. 9. Comparison of NMPC (solid line) with MPC (dashed line) in command
following for pH process.
control Signal
30
NMPC
LMPC
B. CONTROL RESULTS
25
20
u1 (mls-1)
The behavior of the mentioned regulating points with NMPC
is shown in Fig. 8. As it can be seen, the performance of
NMPC is good without any overshoot for all operating points.
The prediction and control horizons for NMPC are tuned as 5
and 3 respectively. The weighting matrices of NMPC are
selected as Q = 500 and S = 70 . Notice that, in this case, the
criterion function is as in (17), unless it does not include the
term penalizes the control effort (i.e. R in (17)). Also,
saturation constraints in the manipulated variable are imposed
to take into account the minimum and the maximum aperture
of the valve regulating the base flow rate. For both cases
(NMPC and linear MPC) a lower limit of 13 ml/s and an upper
limit of 25 ml/s were chosen for this variable.
The results are also compared with linear MPC in Fig. 9. As
it is clear from this figure, the NMPC has better performance
without any overshoot, while in linear MPC especially when
the operating point goes far from the point where linear model
is identified the performance is poor.
The control efforts for both NMPC and MPC (i.e. the base
flow rate) are shown in Fig. 10. As it can be seen this signal for
NMPC is relatively smoother than for Linear MPC and has not
large step changes.
15
10
5
0
0
5
10
15
20
25
Time (Min)
Fig. 10. Comparison of NMPC (solid line) with MPC (dashed line) in he base
flow rate for pH process.
To see the computation time required for generating the
control signal, in all of the simulation it is shown in Fig. 11. As
it can be seen in this figure the maximum computation time for
optimization is 1.05sec which is below enough the chosen
sampling time of 15sec for the process and hence the control
signal is feasible. The SQP optimization is performed using
fmincon function of the MATLAB software.
1739
respect to linear MPC. This is especially true when the
operating condition of the process is far from the point where
the model for linear MPC is identified. Results show that in
such conditions the linear MPC for pH neutralization process
follows the set point with overshoot, while the nonlinear MPC
exhibits a desirable fast response with smoother changes in the
control effort. Simulations also confirm that the designed
controllers have the capability to reject a slowly varying
unmeasured disturbance which are often happens in chemical
processes.
CPU Time
1.4
1.2
Time (sec)
1
0.8
0.6
0.4
0.2
0
0
5
10
15
20
ACKNOWLEDGMENT
25
Time (Min)
Fig. 11. Computation time of the CPU for SQP optimization for pH process.
The performance of the NMPC controller for rejecting the
unmeasured disturbance with the strategy described in section
III is shown in Fig. 12. Here the unmeasured disturbance is the
buffer flow rate which is reduced from 0.55 to 0.2 ml/s.
The authors would like to acknowledge Dr. Vasile Sima
from National Institute for Research & Development in
Informatics for his useful helps and comments on working with
SLICOT software.
REFERENCES
[1]
10
Setpoint
NMPC
9.5
[2]
9
8.5
[3]
pH
8
[4]
7.5
7
[5]
6.5
6
[6]
5.5
5
0
5
10
15
20
25
[7]
Time (Min)
Fig. 12. The performance of the NMPC in rejecting unmeasured disturbance
for pH process.
V. CONCLUSIONS
[8]
[9]
In this paper a nonlinear model predictive controller for
control of a highly nonlinear chemical process is applied and
simulated. The selected process is pH neutralization which has
strong nonlinearity and wide range of operating points. These
properties cause the linear MPC techniques does not show
good results and demands a more complex identification and
controller design procedure.
The model which is an important factor for prediction in
MPC, is selected a wiener model with neural network as the
static nonlinear term. Simulation results from the identification
phase approve the validation of the identified model. Besides,
the step responses of the plant and this identified model are in
good agreement and very close to each other. This shows the
ability of this type of model structure for modeling highly
nonlinear processes (for example pH neutralization).
Simulation of the NMPC controller for a wide range of
operating point shows superior performance of the NMPC with
[10]
[11]
[12]
[13]
[14]
1740
S.J. Qin, and T.A. Badgwell, “An overview of nonlinear model predictive
applications,” In IFAC Workshop on Nonlinear Model Predictive
Control, Assessment and Future Direction, Ascona, Switzerland, 1998.
S. Piche, B.S. Rodsari, D. Johnson, and M. Gerules, “Nonlinear model
predictive control using neural network,” IEEE Control Systems
Magazine, vol. 20, no. 3, pp. 53–62, 2000.
E.F. Camacho, and C. Bordons, Model Predictive Control. SpringerVerlag, London, 2nd ed, 2004.
E.P. Nahas, M.A. Henson, and D.E. Seborg, “Nonlinear internal model
control strategy for neural networks models,” Computers chem. Engng,
vol. 16, no. 12, pp. 1039-1057, 1992.
Ch. Venkateswarlu, and K. Venkat Rao, “Dynamic recurrent radial basis
function network model predictive control of unstable nonlinear
processes,” Chemical Engineering Science, vol. 60, pp. 6717-6733, 2005.
J.J. Song, and S. Park, “Neural model predictive control for nonlinear
chemical processes, ” Journal of Chemical Engineering of Japan, vol. 26,
no. 4, pp. 347-354, 1993.
H. Zhao, J. Guiver, R. Neelakantan, L.T. Biegler, “A nonlinear industrial
model predictive controller using integrated PLS and neural net statespace model,” Control Engineering Practice, vol. 9, pp. 125-133, 2001.
J.C. Gomez, A. Jutan, and E. Baeyens, “Wiener model identification and
predictive control of a pH neutralization process,” IEE Proceeding of
Control Theory Appl., vol. 151, no. 3, May 2004.
A.L. Cervantes, O.E. Agamennoni, and J.L. Figueroa, “A nonlinear
model predictive control system based on Wiener piecewise linear
models,” Journal of Process Control, vol. 13, pp. 655-666, 2003.
M. Verhaegen, “Identification of the deterministic term of MIMO state
space models given in innovation form from input-output data,”
Automatica , vol. 30, no. 1, pp. 61-74, 1994.
M. Verhaegen, “Identification of the temperature-product quality
relationship in a multi-component distillation column,” Chemical
Engineering Communications, vol. 163, pp. 111-132, 1998.
B. Haverkamp, State Space Identification: Theory and Practice. Ph.D
thesis, Faculty of Information Technology and Systems, Delft University
of Technology, Delft, The Netherlands, 2001.
V. Sima, “Fast numerical algorithm for wiener systems identification,”
International Working Conference on Analysis and Optimization of
Differential systems, pp. 375-386, September. 10-14, Romania, 2003.
Y. Zhu, Multivariable System Identification for Process Control.
Pergamon, An imprint of Elsevier Science, 2001.