Efficient Nonlinear Model Predictive Control for Affine System
Tao ZHENG and Wei CHEN
1. Introduction
Model predictive control (MPC) refers to the class of computer control algorithms in which a dynamic process model is used to predict and optimize process performance. Since its lower request of modeling accuracy and robustness to complicated process plants, MPC for linear systems has been widely accepted in the process industry and many other fields. But for highly nonlinear processes, or for some moderately nonlinear processes with large operating regions, linear MPC is often inefficient. To solve these difficulties, nonlinear model predictive control (NMPC) attracted increasing attention over the past decade (Qin et al., 2003, Cannon, 2004). Nowadays, the research on NMPC mainly focuses on its theoretical characters, such as stability, robustness and so on, while the computational method of NMPC is ignored in some extent. The fact mentioned above is one of the most serious reasons that obstruct the practical implementations of NMPC.
Analyzing the computational problem of NMPC, the direct incorporation of a nonlinear process into the linear MPC formulation structure may result in a nonconvex nonlinear programming problem, which needs to be solved under strict sampling time constraints and has been proved as an NPhard problem (Zheng, 1997). In general, since there is no accurate analytical solution to most kinds of nonlinear programming problem, we usually have to use numerical methods such as Sequential Quadric Programming (SQP) (Ferreau et al., 2006) or Genetic Algorithm (GA) (Yuzgec et al., 2006). Moreover, the computational load of NMPC using numerical methods is also much heavier than that of linear MPC, and it would even increase exponentially when the predictive horizon length increases. All of these facts lead us to develop a novel NMPC with analytical solution and little computational load in this chapter.
Since affine nonlinear system can represents a lot of practical plants in industry control, including the watertank system that we used to carry out the simulations and experiments, it has been chosen for propose our novel NMPC algorithm. Follow the steps of research work, the chapter is arranged as follows:
In Section 2, analytical onestep NMPC for affine nonlinear system will be introduced at first, then, after description of the control problem of a watertank system, simulations will be carried out to verify the result of theoretical research. Error analysis and feedback compensation will be discussed with theoretical analysis, simulations and experiment at last.
Then, in Section 3, by substituting reference trajectory for predicted state with stairlike control strategy, and using sequential onestep predictions instead of the multistep prediction, the analytical multistep NMPC for affine nonlinear system will be proposed. Simulative and experimental control results will also indicate the efficiency of it. The feedback compensation mentioned in Section 2 is also used to guarantee the robustness to model mismatch.
Conclusion and further research direction will be given at last in Section 4.
2. Onestep NMPC for affine system
2.1. Description of NMPC for affine system
Consider a timeinvariant, discrete, affine nonlinear system with integer k representing the current discrete time event:
In the above,
uk,xk,ξk
are input, state and disturbance of the system respectively,
f:Rn→Rn
,
g:Rn→Rn×m
are corresponding nonlinear mapping functions with proper dimension.
Assume
x^
k+jk
are predictive values of
xk+j
at time k,
Δuk=ukuk1
and
Δu^
k+jk
are the solutions of future increment of
uk+j
at time k, then the objective function
Jk
can be written as follow:
The function F (.) and G (.,.) represent the terminal state penalty and the stage cost respectively, where p is the predictive horizon.
In general,
Jk
usually has a quadratic form. Assume
wk+jk
is the reference value of
xk+j
at time k which is called reference trajectory (the form of
wk+jk
will be introduced with detail in Section 2.2 and 3.1 for onestep NMPC and multistep NMPC respectively), semipositive definite matrix Q and positive definite matrix R are weighting matrices, (2) now can be written as :
Corresponding to (1) and (3), the NMPC for affine system at each sampling time now is formulated as the minimization of
Jk
, by choosing the increments sequence of future control input
[ΔukkΔuk+1k⋯Δuk+p−1k]
, under constraints (1b) and (1c).
By the way, for simplicity, In (3), part of
Jk
is about the system state
xk
, if the output of the system
yk=Cxk
, which is a linear combination of the state (C is a linear matrix), we can rewrite (3) as follow to make an objective function
Jk
about system output:
And sometimes,
Δuk+jk
in
Jk
could also be changed as
uk+jk
to meet the need of practical control problems.
2.2. Onestep NMPC for affine system
Except for some special model, such as Hammerstein model, analytic solution of multistep NMPC could not be obtained for most nonlinear systems, including the NMPC for affine system mentioned above in Section 2.1. But if the analytic inverse of system function exists (could be either statespace model or inputstate model), the onestep NMPC always has the analytic solution. So all the research in this chapter is not only suitable for affine nonlinear system, but also suitable for other nonlinear systems, that have analytic inverse system function.
Consider system described by (1a1d) again, the onestep prediction can be deduced directly as follow with only one unknown data
Δukk=ukk−uk−1
at time k:
In (5),
x^k+1k1
means the part which contains only known data (
xk
and
uk1
) at time k, and
g(xk)⋅Δukk
is the unknown part of predictive state
x^k+1k
.
If there is no model mismatch, the predictive error of (5) will be
x˜k+1k=xk+1−x^k+1k=ξk+1
. Especially, if
ξk
is a stationary stochastic noise with zero mean and variance
E[ξk]=δ2
, it is easy known that
E[x˜k+1k]=0
, and
E[(x˜k+1k−E[x˜k+1k])T⋅(x˜k+1k−E[x˜k+1k])]=nδ2
, in another word, both the mean and the variance of the predictive error have a minimum value, so the prediction is an optimal prediction here in (5).
Then if the setpoint is
xsp
, and to soften the future state curve, the expected state value at time k+1 is chosen as
wk+1k=αxk+(1−α)xsp
, where
α∈[0,1)
is called soften factor, thus the objective function of onestep NMPC can be written as follow:
To minimize
Jk
without constraints (1b) and (1c), we just need to have
∂Jk∂Δukk=0
and
∂2Jk∂Δukk20
, then:
Mark
H=g(xk)T⋅Q⋅g(xk)+R
and
F=g(xk)⋅Q⋅(wk+1k−
x^
k+1k1)
, so the increment of instant future input is:
But in practical control problem, limitations on input and output always exist, so the result of (8) is usually not efficient. To satisfy the constraints, we can just put logical limitation on amplitudes of
uk
and
xk
, or some classical methods such as Lagrange method could be used. For simplicity, we only discuss about the Lagrange method here in this chapter.
First, suppose every constraint in (1b) and (1c) could be rewritten in the form as
aiTΔukk≤bi
,
i=1,2,⋯q
, then the matrix form of all constraints is:
In which,
A=[a1Ta2T...aqT]T
B=[b1b2...bq]T
.
Choose Lagrange function as
Lk(λi)=Jk+λiT(aiTΔukk−bi)
,
i=1,2,⋯q
, let
∂L∂Δukk=HΔukk+F+aiλi=0
and
∂L∂λi=aiTΔukk−bi=0
, then:
If
λi≤0
in (
10b), means that the corresponding constraint has no effect on
Δukk
, we can choose
λ¯i=0
, but if
λi0
in (
10b), the corresponding constraint has effect on
Δuk
indeed, so we must choose
λ¯i=λi
, finally, the solution of onestep NMPC with constraints could be:
In which,
Λ¯=[λ¯1λ¯2⋯λ¯q]T
2.3. Control problem of the watertank system
Our plant of simulations and experiments in this chapter is a watertank control system as that in Fig. 1. and Fig. 2. (We just used one watertank of this threetank system). Its affine nonlinear model is achieved by mechanism modeling (Chen et al., 2006), in which the variables are normalized, and the sample time is 1 second here:
s. t.
In (12),
xk
is the height of water in the tank, and
uk
is the velocity of water flow into the tank, from pump P_{1} and valve V_{1}, while valve V_{2} is always open. In the control problem of the watertank, for convenience, we choose the system state as the output, that means
yk=xk
, and the system functions are
f(xk)=xk−0.2021xk
and
g(xk)=0.01923
.
Figure 1.
Photo of the watertank system
Figure 2.
Structure of the watertank system
To change the height of the water level, we can change the velocity of input flow, by adjusting control current of valve V_{1,} and the normalized relation between the control current and the velocity
uk
is shown in Fig. 3.
Figure 3.
The relation between control current and input
uk
2.4 Onestep NMPC of the watertank system and its feedback compensation
Choose objective function
Jk=(
x^
k+1k−wk+1k)2+0.001Δukk2
,
xsp=30%
and soften factor
α=0.95
, to carry out all the simulations and the experiment in this section. (except for part of Table 1., where we choose
α=0.975
)
Suppose there is no model mismatch, the simulative control result of onestep NMPC for watertank system is obtained as Fig. 4. and it is surely meet the control objective.
Figure 4.
Simulation of onestep NMPC without model mismatch and feedback compensation
To imitate the model mismatch, we change the simulative model of the plant from
xk+1=xk−0.2021xk+0.01923uk
to
xk+1=xk−110%×0.2021xk+90%×0.01923uk
, but still use
xk+1=xk−0.2021xk+0.01923uk
to be the predictive model in onestep NMPC, the result in Fig. 5. now indicates that there is obvious steadystate error.
Figure 5.
Simulation of onestep NMPC with model mismatch but without feedback compensation
Proposition 1: For affine nonlinear system
xk+1=f′(xk)+g′(xk)⋅uk
, if the setpoint is
xsp
, steadystate is
us
and
xs
, and the predictive model is
xk+1=f(xk)+g(xk)⋅uk
, without consideration of constraints, the steadystate error of onestep NMPC is
e=xs−xsp=(f′(xs)−f(xs))+(g′(xs)−g(xs))⋅us1−α
, in which
α
is the soften factor.Proof: If the system is at the steadystate, then we have
xk−1=xk=xs
and
uk−1=uk=us
.
Since
uk−1=uk=us
, so
Δuk=0
, from (8), we know matrix F=0, or equally
(wk+1k−
x^
k+1k1)=0
.
Update the process of onestep NMPC at time k, we have:
(13)(14), and notice that
xs=f′(xs)+g′(xs)⋅us
for steadystate, we get:
0
So:
Proof end.
Because the soften factor
α∈[0,1)
, thus
1−α≠0
always holds, the necessary condition for
e=0
is
(f′(xs)−f(xs))+(g′(xs)−g(xs))⋅us=0
. When there is model mismatch, there will be steadystate error, while this error is independent of weight matrix Q and dependent of the soften factor
α
. For corresponding discussion on steadystate error of onestep NMPC with constraints, the only difference is (11) will take the place of (8) in the proof.
Table 1. is the comparison on
e=xs−xsp
between simulation and theoretical analysis, and they have the same result. (simulative model
xk+1=xk−110%×0.2021xk+90%×0.01923uk
, predictive model
xk+1=xk−0.2021xk+0.01923uk
)

Q
 e=x_{s}x_{sp}
Simulation(%)  e=x_{s}x_{sp}
Value of (15)(%) 
0.975  0  8.3489  8.3489 
0.001  8.3489  8.3489 
0.01  8.3489  8.3489 
0.95
 0  4.5279  4.5279 
0.001  4.5279  4.5279 
0.01  4.5279  4.5279 
Table 1.
Comparison on
e=xs−xsp
between simulation and theoretical analysis
From (15) we know, we cannot eliminate this steadystate error by adjusting
α
, so feedback compensation could be used here, mark the predictive error
ek
at time k as follow:
In which,
xk
is obtained by system feedback at time k, and
x^kk−1
is the predictive value of
xk
at time k1.
Then add
ek
to the predictive value of
xk+1
at time k directly, so (5) is rewritten as follow:
Use this new predictive value to carry out onestep NMPC, the simulation result in Fig. 6. verify its robustness under model mismatch, since there is no steadystate error with this feedback compensation method.
The direct feedback compensation method above is easy to understand and carry out, but it is very sensitive to noise. Fig. 7. is the simulative result of it when there is noise add to the system state, we can see that the input vibrates so violently, that is not only harmful to the actuator in practical control system, but also harmful to system performance, because the actuator usually cannot always follow the input signal of this kind.
To develop the character of feedback compensation, simply, we can use the weighted average error
e¯
k
instead of single
ek
in (17):
Choose
i=20
,
hi=0.05
, the simulative result is shown in Fig. 8. Compared with Fig. 7. it has almost the same control performance, but the input is much more smooth now. Using the same method and parameters, experiment has been done on the watertank system, the result in Fig. 9. also verifies the efficiency of the proposed onestep NMPC for affine systems with feedback compensation.
Figure 6.
Simulation of onestep NMPC with model mismatch and direct feedback compensation
Figure 7.
Simulation of onestep NMPC with model mismatch, noise and direct feedback compensation
Figure 8.
Simulation of onestep NMPC with model mismatch, noise and smoothed feedback compensation
Figure 9.
Experiment of onestep NMPC with setpoint
xsp=30%
3. Efficient multistep NMPC for affine system
Since reference trajectory and stairlike control strategy will be used to establish efficient multistep NMPC for affine system in this chapter, we will introduce them in Section 3.1 and 3.2 at first, and then, the multistep NMPC algorithm will be discussed with theoretical research, simulations and experiments.
3.1. Reference trajectory for future state
In process control, the state usually meets the objective in the form of setpoint along a softer trajectory, rather than reach the setpoint immediately in only one sample time. This may because of the limit on control input, but a softer change of state is often more beneficial to actuators, even the whole process in practice. This trajectory, usually called reference trajectory, often can be defined as a first order exponential curve:
In which,
xsp
still denotes the setpoint,
α∈[0,1)
is the soften factor, and the initial value of the trajectory is
wkk=xk
.The value of
α
determines the speed of dynamic response and the curvature of the trajectory, the larger it is, the softer the curve is. Fig. 10. shows different trajectory with different
α
. Generally speaking, suitable
α
could be chosen based on the expected setting time in different practical cases.
Figure 10.
Reference trajectory with different soften factor
α
3.2. Stairlike control strategy
To lighten the computational load of nonlinear optimization, which is one of the biggest obstacles in NMPC’s application, stairlike control strategy is introduced here. Suppose the first unknown control input’s increment
Δuk=uk−uk−1=Δ
, and the stair coefficient
β
is a positive real number, then the future control input’s increment can be decided by the following expression:
Instead of the full future sequence of control input’s increment:
[ΔukΔuk+1⋯Δuk+p−1]
, which has p independent variables. Using this strategy, in multistep NMPC, it now need only compute
Δuk
. The computational load now is independent of the length of predictive horizon, which is very convenient for us to choose long predictive horizon in NMPC to obtain a better control performance (Zheng et al., 2007).
Since the dynamic optimization process will be repeated at every sample time, and only instant input
uk=uk1+Δuk
will be carried out actually in NMPC, this strategy is efficient here. In the strategy, it supposes the future increase of control input will be in a same direction, which is the same as the experience in control practice of the human beings, and prevents the frequent oscillation of the input, which is very harmful to the actuators in real control plants. Fig. 11. shows the input sequences with different
β
.
3.3. Multistep NMPC for affine system
The onestep NMPC in Section 2 is simple and fast, but it also has one fatal disadvantage. Its predictive horizon is only one step, while long predictive horizon is usually needed for better performance in MPC algorithms. Onestep prediction may lead overshooting or other bad influence on system’s behaviour. So we will try to establish a novel efficient multistep NMPC based on proposed onestep NMPC in this section.
In this multistep NMPC algorithm, the first step prediction is the same as (5), then follows the prediction of
x^k+1k
in (5), the onestep prediction of
x^k+jk,j=2,3,⋯,p
could be obtained directly:
Figure 11.
Stairlike control strategy
Since
x^k+j−1k
already contains nonlinear function of former data, one may not obtain the analytic solution of (21) for prediction more than one step. Take the situation of j=2 for example:
For most nonlinear f(.) and g(.), the embedding form above makes it impossible to get an analytic solution of
uk+1
and further future input. So, using reference trajectory, we modified the onestep predictions when
j≥2
as follow:
Using the stairlike control strategy, mark
Δukk=Δ
, (23) can be transformed as:
Here,
x^k+jk1
contains only the known data at time k, while the other part is made up by the increment of future input, thus the unknown data are separated linearly by (24), so the analytic solution of
Δ
can be achieved.
For
j=1,2,⋯,p
, write the predictions in the form of matrix:
Thus
X^k=Xk1+Sk⋅ΔUk=Xk1+S¯k⋅Δ
, for minimization of traditional quadric objective function
minΔJk=minΔ[(X^k−Wk)TQ(X^k−Wk)+ΔUkTRΔUk]
, where semipositive definite matrix Q and positive definite matrix R are weighting matrices, by
∂Jk∂Δ=0
and
∂2Jk∂Δ20
, the control solution of multistep prediction is then obtained. Especially for single input problem, with objective function
minΔJk=minΔ[(X^k−Wk)T(X^k−Wk)+rΔUkTΔUk]
, it is easily denoted as follow:
At last, the instant input
ukk=uk−1+Δ
can be carried out actually. As mentioned in Section 2, and if the model mismatch can be seen as timeinvariant in p sample time (usually satisfied in the case of steady state in practice), to maintain the robustness,
ek
or
e¯
k
can be also added to every prediction as mentioned in (17) and (18):
Though there are approximate predictions in the novel NMPC which may take in some inaccuracy, the feedback compensation mentioned above and the new optimization process at every sample time will eliminate the error before its accumulation, to keep the efficiency of the algorithm. The constraints also could be handled by methods mentioned Section 2 or by other numerical optimizing algorithm, thus we would not discuss about it here again.
3.4. Multistep NMPC of the watertank system
Choose
α=0.975
,
β=0.5
,
r=0.005
,
xsp=60%or30%
and predictive horizon
p=10
to carry out simulations. Still use the different plant model and predictive model as that of Fig. 5. and Fig. 6. to imitate the model mismatch, the result in Fig. 12. and Fig. 13. shows the efficiency and robustness of this efficient multiobjective NMPC.
Choose
α=0.975
,
β=0.5
,
r=0.005
,
xsp=60%
to carry out experiments. Comparing control result between onestep NMPC and multistep NMPC in Fig. 14. and Fig. 15., we can see the obvious developments on both input and output of the watertank system when longer predictive horizon is used. It also verifies the efficiency of proposed novel multistep NMPC algorithm. At last, Fig. 16. is the satisfactory performance of the efficient multistep NMPC under disturbance (we open an additional outlet valve of the tank for 20 seconds).
Figure 12.
Simulation of multistep NMPC with model mismatch but without feedback compensation
Figure 13.
Simulation of multistep NMPC with model mismatch and feedback compensation
Figure 14.
Experiment of onestep NMPC with setpoint
xsp=60%
(Overshooting exists when setpoint is higher than Fig. 9.)
Figure 15.
Experiment of onestep NMPC with setpoint
xsp=60%
(p=10 and and No overshooting)
Figure 16.
Experiment of onestep NMPC under disturbance
4. Conclusion
Using a series of approximate onestep predictions instead of the traditional multistep prediction, the proposed multistep NMPC leaded to an analytic result for nonlinear control of affine system. The use of stairlike control strategy caused a very little computational load and the feedback compensation brought robustness of model mismatch to it.
The simulations and experiments verify the practicability and efficiency of this multistep NMPC for affine system, while the theoretical stability and other analysis will be the future work with considerable value.
Acknowledgements
This work is supported by National Natural Science Foundation of China (Youth Foundation, No. 61004082) and Special Foundation for Ph. D. of Hefei University of Technology (No. 2010HGBZ0616, from the Fundamental Research Funds for the Central Universities).
References
1 
M. Cannon,
2004 Efficient nonlinear model predictive control algorithms. Annual Reviews in Control, 28 2 January, 2004, 229
237 , 13675788
2 
W. Chen, G. Wu,
2006 Modeling of nonlinear twotank system and model predictive control. Journal of System Simulation, 18 8 August, 2006, 2078
2081 , 01004731X 3 
H. J. Ferreau, G. Lorini, M. Dieh,l,
2006 Fast nonlinear model predictive control of gasoline engines. Proceedings of the 2006 IEEE International Conference on Control Applications, 0780397959
2754
2759 , Munich, Germany, October, 2006, IEEE Publishing, Piscataway, USA. 4 
S. J. Qin, T. A. Badgwell,
2003 A survey of industrial model predictive control technology. Control Engineering Practice, 11 7 July, 2003, 733
764 , 09670661
5 
U. . Yuzgec, Y. . Becerikl, M. Turker,
2006 Nonlinear predictive control of a drying process using genetic algorithms. ISA Transactions, 45 4 October, 2006, 589
602 , 00190578
6 
A. Zheng,
1997 A Computationally Efficient Nonlinear MPC Algorithm. Proceedings of the American Control Conference, 0780338324
1623
1627 , Albuquerque, USA, June, 1997, IEEE Publishing, Piscataway, USA. 7 
T. Zheng, G. Wu, D. F. He,
2007 Nonlinear Model Predictive Control Based on Lexicographic Multiobjective Genetic Algorithm. Proceedings of International Conference on Intelligent & Advanced Systems 2007, 1424413559
61
65 , Kuala Lumpur, Malaysia, November, 2007, IEEE Publishing, Piscataway, USA.