Chin. J . Chern. Eng., 15(5) 691-697
(2007)
Nonlinear Model Predictive Control Based on Support Vector Machine with Multi-kernel* BAO Zhejing(6 @%)**, PI Daoying(&@N) and SUN Youxian(%ik
w)
State Key Laboratory of Industrial Control Technology, Institute of Industrial Process Control, Zhejiang University, Hangzhou 310027, China
Abstract Multi-kernel-based support vector machine (SVM) model structure of nonlinear systems and its specific identification method is proposed, which is composed of a SVM with linear kernel function followed in series by a SVM with spline kernel function. With the help of this model, nonlinear model predictive control can be transformed to linear model predictive control, and consequently a unified analytical solution of optimal input of multi-step-ahead predictive control is possible to derive. This algorithm does not require online iterative optimization in order to be suitable for real-time control with less calculation. The simulation results of pH neutralization process and CSTR reactor show the effectiveness and advantages of the presented algorithm. Keywords nonlinear model predictive control, support vector machine with multi-kernel, nonlinear system identification, kernel function
1 INTRODUCTION In recent years, model predictive control (MPC) has become one of the most successful control algorithms, especially in the chemical and petrochemical process control industry. Predictive model is a basic element of MPC. For a weak nonlinear system, good performance can be realized using linear predictive model; and for a severe nonlinear system, nonlinear predictive model is necessary to approximate system dynamics. Since most industrial processes exhibit severe nonlinearity, the studies on nonlinear model-based predictive control (NMPC) have drawn increasing attention. Many nonlinear models for predictive control are presented, such as support vector machine (SVM)[ 1,2], neural network (NN)[3], and fuzzy model[4]. Among the above-mentioned models, SVM has significant advantages over the latter two models because SVM is based on statistical learning theory and structural risk minimization principle. However, in all existing SVM-based NMPC strategies, heavy computational burden arise, as a result of online nonlinear iterative optimization[4-61. Therefore these methods cannot be applied to the cases where short sampling periods are required, and furthermore an analytical solution of control input is impossible to derive. Ref.[ 11 only provided the analytical equation related to the unknown control law of one-step-ahead NMPC and known pa-
Au(k+j-I)
rameters, and for multi-step-ahead NMPC the control law can be obtained only by a numerical optimization approach[4]. Inspired by Weiner model, multi-kernel-based SVM approach to modeling nonlinear systems is presented. This model, consisting of a SVM with linear kernel function followed in series by a SVM with spline kernel function, can approximate most nonlinear systems. In the model structure, linear kernel function-based SVM represents system dynamics and spline kernel function-based SVM represents system static behavior. On the basis of the model, NMPC can be transformed to linear model predictive control (LMPC) after handling the output future reference trajectory by the inverse of the SVM with spline kernel, and then the analytical solution of control law can be derived without online iterative optimization. The simulation results of pH neutralization process and CSTR can demonstrate the effectiveness and advantages. Ref.[7] gives more details about SVM regression problem.
2 MULTI-KERNEL-BASED SVM IDENTIFICATION FOR NONLINEAR SYSTEMS 2.1 Model structure of SVM with multi-kernel The structure of SVM with multi-kernel is shown in Fig.1, consisting of the dynamic part based on SVM
The dynamic part based on SVM with linear
r: /-Dl
SVM with spline kernel
Figure 1 Model structure of SVM with multi-kernel Received 2006-09-14, accepted 2007-03-10.
* Supported by the State Key Development Program for Basic Research of China (No.2002CB312200) and the National Natural Science Foundation of China (No.60574019). ** To whom correspondence should be addressed. E-mail:
[email protected]
Chin. J. Ch. E.(Vol. 15, No.5)
692
with linear kernel followed in series by the static part based on SVM with spline kernel.
x(k+ j Ik) = f[x(k);-,x(k-n, Au(k+j-l);..,Au(k),u(k-l)
+1),
;..,U(k-rt,
+1)] (1)
where, fl.) is a linear function and A u ( k ) = u ( k ) u(k - 1) . At time k, j-step-ahead predictive output x(k + j I k ) is a function with respect to the delayed
n, outputs, the delayed nu -1 inputs, and j unknown future increments of input. The models of x(k+jlk) (j = l;..,H,) do not rely on each other, and consequently no accumulative error occurs, which is very important when the prediction horizon is large. Modeling Eq.( 1) by SVM with linear kernel,
S / j ) is the input vector of support vector corresponding sample when constructing xm (k + j I k ) and S +; =
[ ~ ( +k j)l.
2.2 Training procedure of SVM with multi-kernel On the basis of the Ref.[8], the following two steps of SVM with multi-kernel identification are proposed: (1) Training the static nonlinearity. After obtaining the static input-output data pairs { u ( k ) ,y(t)] , Eqs.(4) and (5) are trained with spline kernel-based SVM and parameters m i , c ~ , d~j ,and t j , c ; , ~ d; , are derived,
where, w, is the number of support vectors of model
respectively; (2) Training the dynamical linearity. First, the dynamic input-output data { u ( k ) ] and { y ( k ) ] is obtained, and { x ( k ) } is generated by substituting { y(k)] into Eq.(5), and then Eq.(2) is trained with linear kernel-based SVM to obtain wj , aj,i and bj .
xm(k + j I k ) , Z:,) is the input vector of support vector corresponding sample when constructing xm(k + jlk) and vector Z Ik+] = [x(k),-, x(k--n,+l), Au(k+j- l), .-,
3 NMPC BASED ON SVM WITH MULTIKERNEL
WI
xm (k + j I k ) =
p,,, (zy.z;+,)+b,
(2)
r=l
Au(k), ~ ( k -l), ..., u(k-n,+l)]. Y(k + A = g[x(k + A1
(3)
where, g ( . ) is a nonlinear function. When modeling nonlinearity with SVM, the usually employed kernel functions have polynomial kernel, RBF kernel, Fourier kernel, spline kernel, and so on. From experiments, it was found that better regression can be achieved using spline kernel function mainly because the static behavior of most chemical processes is piece wise nonlinear. Modeling Eq.(3) by SVM with spline kernel,
k)=zc,,,K(J,“’(4) m,
Ym
(k+ j I
‘Jfk+,)+dj
1=1
where, m, is the number of support vector of model y,(k
+ j I k ) , K ( . ) denotes
3.1 Reference trajectory and feedback correction Reference signal of predictive control is an exponential trajectory from current output value as follows:
spline kernel function,
J,(’) is the input vector of support vector corresponding = sample when constructing ym(k + j I k ) and JIk+,
[x(k + j>l. SVM-based j-step-ahead predictive model with multi-kernel can be described by Eqs.(2) and (4). Assume g(.) is invertible and x ( k + j ) = g-’[y(k + j ) ] . Modeling g-’(.) by SVM with spline kernel, and the following holds: ‘1
x m ( k + j I k ) = C C ’ , , k K ( S I ( ’ ) ’ S ’ k + I ) + d f , (5) 1=1
where, t j is the number of support vector of model
xm (k + j I k ) , K ( . ) denotes spline kernel function, October, 2007
The structure of NMPC based on SVM with multi-kernel is shown in Fig.2. The basic idea of this algorithm is illustrated as follows: First, the reference signal of intermediate variable x is produced by substituting the reference signal of output y into Eq.(5), second, the analytical solution of control input is derived by implementing LMPC to the linear Eq.(2) and then the obtained input is applied directly to the process. In order to obtain the control law, the dynamic value of intermediate variable x should be generated by substituting the actual system output y into Eq.(5).
where, yr (k + j ) is reference trajectory, ys (k + j ) is the desired set-point value, and a is a tuning factor related with the system’s robustness and convergence. At each sampling instant, the reference trajectory xr(k + j ) of the intermediate value x is derived by substituting yr (k + j ) into Eq.(5). In servo control, a is usually set to zero, and then reference trajectory y,(k + j ) is equal to y,(k + j ) and independent of the system actual output. As a result, reference trajectory x,(k + j) can be offline produced by Eq.(5). Predictive control can correct model error and reject disturbance by introducing feedback. In fact, in this algorithm control law is developed according to
Nonlinear Model Predictive Control Based on Support Vector Machine with Multi-kernel
693
trajectoly
SVM with linear
-’
__.
.
x,(klk-l)
+
4
4
-
SVM with linear kernel based Hp-step-ahead 4 predictive model
Xp(k+HpIk )
;
V
Correction- H,
q
-
+ b*
Figure 2 Structure of NMPC based on SVM with multi-kernel
Eq.(2). The traditional feedback correction strategy is illustrated as follows: xp( k + j I k ) = x, ( k + j I k ) + H ( j ) [ x ( k ) - x , ( k Ik-1)]
(6) that is, at current time k, j-step-ahead predictive model error is obtained by weighted 1-step-ahead predictive model error. Since the cause of prediction errors is unknown, weighting matrix is determined only by experience and test. In experiments, it is found that offset-free set-point tracking at steady state can hardly be realized by the traditional feedback correction method. The multi-step-ahead predictive models are independent and the latest plantlmodel mismatch of all predictive models is already known. Therefore, j-step-ahead predictive model proposed at time k can be corrected by the discrepancy between the latest output x(k), which can be obtained by substituting the system actual output y ( k ) into Eq.(5), and the latest j-step-ahead-predictor output x,(k I k - j ) . So, xp ( k
+ j I k ) = x m ( k + jl k ) + [ x ( k ) - x ,
( k Ik -j ) ]
weighting matrix. Q = diag (41,.. .,4 ~) ,, R = diag ( ‘ 0
9 . .
., Y H , J
.
By considering A u ( k + j ) = O ( j = H , ; . . , H , )
in
H , < H p case, Eq.(2) can be modified as
xm ( k + j I k ) = v
, x ( k - n , +1)
Au [ k + min ( j , H , ) - 13
u(k-1)
fj[
i
(9)
u(k-nu +1) W
where,
Wl
v j = r ~ a j , i I ~ , : ’ , . . . , C a i , i I ~1, : ’ ,
11. =
i=l
(7)
3.2 Optimization of MPC objective function The objective function of MPC is defined as Ref.[9] 2
min J = llxp( k )- xr (k)ll, + where,
I AU
(k$
(8) T
x , ( k ) = [xp ( k + 1I k ) ; . . , x , ( k + H , I k ) ] ,
xr(k) = [xr( k + 11,. ..,xr ( k + H , ) ] ’
and
From Eq.(8):
b( k ) =
[ A u ( k ) ; . . , A u ( k + H , -1)IT. Q and R are known
x ( k - j - n , +1) Chin. J. Ch. E. 15(5) 691 (2007)
Chin. J. Ch. E. (Vol. 15, h . 5 )
694
the use of the inverse of matrix and can lead to a quick and precise solving[9].
Au(k- j )
+ Au[k
-j
+ min( j , H , ) -I]
4 SIMULATION RESULTS 4.1 Example 1 pH neutralization, in which a weak acid (HAc) is neutralized by a strong base (NaOH), is a typical Weiner process[ 10,111. The physical model of this process consists of two parts: the linear dynamic model and the nonlinear static model. The dynamic model is given by:
u ( k - j - 1)
u ( k - j - n , +1)
Consider Eqs.(6), (8), and (lo), then
xp( k ) - x, ( k ) = D . Az4 ( k ) + g
i"'*;-~o],
g = [ g1
where, D =
7
g HP
x ( k ) - x ( k -j ) g.=v. J
J
x ( k - n , +1)-x(k-j-n, Au(k - j )
1.i
f j
[ [
Au [k - j
+ min ( j , H , ) - I]
u ( k - 1) - u ( k - j - 1)
u(k-n, +1)-up-j-nu x(k)-x,(k+j)
+1)
I+
where, inputs Fa and Fb are flow rate of the acid and
1-
+1)
the base (molmin-'), wa and wb are concentrations, respectively (mo1.L-'). The static model is given by: Wb
I+
Since Q and R are positive definite, matrices Qs and R, are obtained which are their square roots. Thus MPC objective function can be rewritten as: T
finJ=[D.h(k)+g] T
T Q,Q,
T
[ D . h ( k ) + g ] + h ( k ) R,R , h ( k )
(13)
From Eq.(12), the optimal h o p t ( k ) can be considered as the 'least-squares' solution of the equation
is derived. For only the first component of hopt ( k ) is applied to the plant, the optimal control at time k is Auopt( k ) = [1,0,. . .,ol.b o p t ( k )
(15)
In existing articles, the solution of LMPC is obtained usually by computing the inverse of a matrix[lO] and thereby a loss of precision will arise when control horizon is large because the matrix is usually ill-conditioned. The above-mentioned method avoids October, 2007
+ 10-y - 1 0 y - ~-~
Wa
1+ l o p K a - y
=O
where, y is pH. Consider the single-inputhingle-output (SISO) system: the input is NaOH flow rate Fb and the output is pH. The other parameters used in the model are relative to the specified system. The nonlinearity exhibited in pH process is severe, especially near pH = 9 . The sampling period is OSmin. Random input, generated with uniform distribution in the interval [515-51.5, 515+51.5], is applied to the process as the same as in Ref.[ 111, and 300 pairs of training data are produced. SVM tuning parameters of models with spline kernel are chosen as C = lo6, &=lo" and those of model with linear kernel are C = 1 06 , € = l o-6 , n, = 3 , nu = 3 . In order to examine modeling precision, the following test input, identical to Ref.[11], is generated:
Fb =515+51.5sin(2nt/25), t 6 1 5 0 Fb = 5 15 + 25.75 sin (2nt / 25) + 25.75sin (2nt /lo) , 0150 As shown in Fig.3, SVM with multi-kernel can precisely model the nonlinear pH neutralization process and the larger modeling error mainly occurs near pH = 9 , which accords with the process physical characteristics. The mean squared error (MSE) corresponding to Fig.3 is,O.O111.In Ref.[ll], several identification methods are discussed, of which performance of algorithm supervised self-organizing counter-propagation network (SSOCPN) is the best, with MSE of Fig.4 being 0.012. SVM with multi-kernel can approximate the nonlinear pH process to a desired degree of accuracy. Furthermore, the modeling procedure of algorithm SSOCPN is too complicated because 34 fuzzy rules are required. With the same MPC parameter H , = 3 , H, = 2 ,
Nonlinear Model Predictive Control Based on Support Vector Machine with Multi-kernel
the output curves of the proposed method and method nonlinear model predictive control branch and bound
0
50 100 150 200 250 300 350 400 450 500 period
12 10 8
e
a 6
I
41 I
l
l
l
l
l
l
l
l
l
Figure 3 Comparison between the output of SVM model with multi-kerneland actual pH process model output; ...... actual output ~
4.2
Example2 CSTR, studied by Refs.[l], [2], and [12], is chosen to indicate that the proposed approach can identify most nonlinear systems. After adopting normalization, the material and energy balance equations of CSTR are:
-
-2
rT
10 -
9 -
E
(NMPCB&B) and locally dynamical linearization generalized predictive control (LDL-GPC) in Ref.[ 101 are shown in Fig.5, where set-point tracking ability of the proposed method is much better than LDL-GPC with a shorter transient period as well as a slighter overshoot, and similar to nonlinear model-based predictive control method NMPCB&B. At each sampling instant, the average online calculation time of the proposed method is only 0.0193s, whereas that of LDL-GPC and NMPC-B&B is 0.0253s and 1.7389s, respectively. In LDL-GPC, the fuzzy model is online dynamically linearized to transform NMPC to LMPC at each sampling period, which can certainly account for a certain proportion of online time consumption and worsen control performance resulting from approximation.
l
50 100 150 200 250 300 350 400 450 500 period
0
695
L
The state xl ( t ) corresponds to the conversion rate of the reaction and 0 d xl(t) d 1; x 2 ( t ) is the dimensionless temperature. The sampling period is 1s. Assume that only the temperature can be measured online, that is,
8 -
I 6
I
I
50
1
I
I
100 t, min
I
I
150
200
"""yr;- - - - y (NMPC-B&B); y (LDL-GPC) Figure 5 Control performance: the proposed method (upper), method NMPC-B&B and LDL-GPC in Ref.[lO] (lower)
For other parameters, see Ref.[l2]. Random input, generated with uniform distribution in the interval [-2, 31, is applied to the process, and 400 pairs of training data are produced. SVM tuning parameters of models with spline kernel are chosen as C = lo6 , E = lo4 and those of model with n, = 3 , nu = 3 . linear kernel are C = l o 4 ,E = As shown in Fig.6, the predictive model based on SVM with multi-kernel can approximate the severe nonlinear CSTR with MSE of Fig.6 being 5.8965 X lop4. To examine control performance, MPC parameters, disturbance and noise are as the same as in Refs.[l] and [2]. As shown in Fig.7, with H , = H , = 1 ,
~
the proposed method can track the set-point steadily and quickly, and according to Fig.8, the output is Chin. J. Ch. E. 15(5) 691 (2007)
Chin. J. Ch. E. (Vol. 15, No.5)
696 0.10 I
0.9
-
0.05 h, -0.05 -0.10
0
1.0
I
0.8
0.7 0.6
'
I
20
0.5
I
40
60 1,
80
100
s
c
A
0.4 0.3
I
0.2 0.5
0. I
0
0 0
100
200
10 20 30 40 50 60 70 80 90 100
300 /,
1, s
400
500
600
s
0.9 I
Figure 6 Comparison between the output of SVM model with multi-kernel and actual CSTR - . - . - actual output; model output ~
I
I
I
I
I
I
I
0
100
200
300
400
500
600
1, s
I
0
I
200
100
300
400
500
Figure 8 Output response of CSTR with disturbance (upper) and noise (lower) (Hp=Hu= 1)
600
1, s
Figure 7 Output response of CSTR (H,= Hu= 1) ~~~~
Yr;
~
0.8
Y
0.6
influenced very little despite the disturbance and the set-point can be tracked well only after several sampling periods, and Fig.8 also shows that although noise exists persistently the tracking ability is still
-A
0.4
0.2
600
e2 ( k ) correspond-
maintained. Performance index k =1
ing to Fig.7 and Fig.8 is listed in Table 1. This proposed method has better performance compared with the method in Ref.[l]. Moreover, in Fig.9;the output curve of multi-step-ahead predictive control with H , =4, H , = 2 is drawn, which suggests that the disturbance rejection ability of the proposed method is better than that in Ref.[2], although the response speed of the urouosed method is a little bit slower. The significant advantages of the proposed method over Refs.[l] and [2] are that a unified analytical solution of control law is given regardless of whether it is one-step-ahead or multi-step-ahead predictive control and online calculation consumption remains unchanged with different prediction horizon and control horizon. However, in Ref.[2], the optimal control input of multi-step-ahead predictive control is obtained by online Nelder-Mead simplex direct search with a given starting point for searching and an exponential October, 2007
0
50
100
150 200 time. s
250
300
0.6 a.
0.21 0.4
0'
I
I
50
100
I
I
150 200 time. s
I
250
300
Figure 9 Comparison of disturbance rejection: the proposed method (upper) and method in Ref.[2] (lower)(H,=4, H , = 2 ) _ _ _ _ Yr; -Y
Nonlinear Model Predictive Control Based on Support Vector Machine with Multi-kernel
697
600
Table 1 Performance index c e z ( k ) k =1
Method
Without disturbance or noise
With disturbance
With noise
this method
0.1016
0.1090
0.1105
method in Ref.[ I]
0.1148
0.1219
0.1268
growth of online computational time will occur with the increase of control horizon, which is unacceptable by most actual systems. Furthermore, in the worst case, the search can easily stick to local minima if a bad starting point is selected.
5 CONCLUSIONS NMPC based on SVM with multi-kernel is presented in this study. The model structure, composed of the dynamical subsystem based on SVM with linear kernel function followed in series by the static subsystem based on SVM with spline kernel function, is suitable to most nonlinear systems. Based on the model, NMPC can be transformed to LMPC. The significant advantage is that this method possesses less calculation and higher real-time because an analytical solution of control law of multi-step-ahead predictive control is given without online iterative optimization needed, which is very important in cases where short sampling period is required. The simulation results of pH neutralization process and CSTR can demonstrate the effectiveness of the proposed method.
REFERENCES 1
2
3
4
5
6
7
NOMENCLATURE SVM parameter tracking error of output y at time k prediction horizon control horizon weighting matrix in objective function of predictive control optimal control solution at time k intermediate value of the controlled system j-step-ahead predictive value of the intermediate value n after correction SVM-basedj-step-ahead predictive value of output y reference value of output y at time k+j the desired set-point value of output y at time k+j delay operator tuning factor of predictive control
8
9 10 11 12
Zhong, W.M., He, GL., Pi, D.Y., Sun, Y.X., “SVM with polynomial kernel function based nonlinear model one-step-ahead predictive control”, Chin. J . Chem. Eng., 13(3), 373-379(2005). Zhong, W.M., Pi, D.Y., Sun, Y.X., “Support vector machine based nonlinear model multi-step-ahead optimizing predictive control”, Journal of Central South University of Technology, 12(5), 591-595 (2005). Kambhampati, C., Mason, J.D., Warwick, K., “A stable one-step-ahead predictive control of non-linear systems”, Autornutica, 36,485-495(2000). Liu, B., Shen, Q., Su, H.Y., Chu, J., “A nonlinear predictive control algorithm based on fuzzy online modeling and discrete optimization Systems”, In: Proceedings IEEE of Systems, Man and Cybernetics’03, IEEE Press, Washington D.C., 816-821(2003). Miao, Q., Wang, S.F., “Nonlinear model predictive control based on support vector regression”, In: Proceedings of the First International Conference on Machine Learning and Cybernetics, IEEE Press, Beijing, 1657- 166l(2002). Zhang, H.R., Zhang, Z.Z., Li, C.G., “Support vector machine based nonlinear model predictive control”, Systems Engineering and Electronics, 25 (3), 330334(2003). (in Chinese) Vapnik, V.N., The Nature of Statistical Learning Theory, Springer-Verlag, New York (1995). Huang, D.P., Zhu, X.F., Zhou, Q.J., “Multivariable nonlinear predictive control based on an integrating model”, Control Theory and Applications, 16(1), 3842( 1999). (in Chinese) Maciejowski, J.M., Predictive Control with Constraints, Prentice Hall Press, London (2002). Liu, B., “A study on nonlinear system modeling and predictive control”, Ph. D. Thesis, Zhejiang University, China (2004). (in Chinese). Nie, J.H., Loh, A.P., Hang, C.C., “Modeling pH neutralization processes using fuzzy-neutral approaches”, Fuzzy Sets and Systems, 78( l), 5-22( 1996). Cao, Y.Y., Frank, P.M., “Analysis and synthesis of nonlinear time-delay systems via fuzzy control approach”, IEEE Transactions on Fuzzy Systems, 8(2), 20-21 l(2000).
Chin. J. Ch. E. 15(5) 691 (2007)