Abstract
This paper proposes a hybrid algorithm by combining particle swarm optimization (PSO) with sequential quadratic programming (SQP) to handle the optimization part of the nonlinear model predictive control (NMPC). In the proposed method, a nonlinear model of the plant is directly applied to predict the future behaviour of the system for a certain horizon. In each sampling time a constrained nonlinear optimization (CNO) problem has to be solved in order to find the optimizing input sequence with predefined length. These solutions minimize the errors between the predicted states and the desired ones of the system. Only the first optimizing input is applied to the system and the rest of the sequence is discarded. The whole prediction and optimization must be repeated for the next upcoming steps. The evolutionary and heuristic PSO algorithm in cooperation with the powerful local minimizing SQP algorithm can quickly find these optimizing solutions and also can satisfy the constrains. The evaporation process due to its nonlinear dynamics and the existence of disturbances affecting the evaporator is considered to evaluate the performance of the proposed method. The simulation results show that the controller designed via the proposed approach can make the system track the reference commands and satisfy the restrictions properly. Moreover, based on the simulation results it can be seen that this approach is more efficient in comparison with the NMPC method, in which only the SQP algorithm has been utilized for optimization, and also the linear model predictive control method.
Keywords
Introduction
Model predictive control (MPC) is one of the few control techniques that is able to consider constraints, on both states and inputs of the system, in the design of the control law for linear, nonlinear or uncertain systems (Piche et al., 2000). MPC employs an explicit model to predict and optimize the future behaviour of a plant. At each sampling time, an open-loop optimal control sequence is obtained through solving an optimization problem, and then the first element of this sequence is applied to the plant, while the remaining elements are discarded. This optimization procedure is repeated in every step.
Although most industrial processes are nonlinear, applications of MPC are commonly based on linear dynamic models. In the standard MPC, usually a nonlinear model of the system is linearized around the operating point. Using linear model predictive control (LMPC) is usually recommended when the process operates at a single operating point and the primary use of the controller is to reject small disturbances. However, in practice it is often required to track a changing set point, and to minimize offset as much as possible in the presence of significant plant–model mismatches and disturbances. To address reference tracking problems, Alvardo et al. (2011) and Limon et al. (2008, 2010) have proposed to augment the linear model with a static model for the disturbance and to use estimators to estimate the states and disturbances. While these methods in the case of model mismatch are able to yield the offset free tracking for nonlinear plant, the transient behaviour and the control performance are not satisfactory, especially in cases in which there are changing disturbances of high magnitudes.
In cases that the exact model of the systems is unknown, a combination of MPC with intelligent methods such as neural network methods or fuzzy logic algorithms is a noteworthy option. For example, in Dalamagkidis et al. (2011) a combination of neural networks and nonlinear model predictive control (NMPC) has been proposed to control an unmanned helicopter. In Ding (2011) and Ding and Ping (2013), infinite MPC has been proposed to control systems modelled by the fuzzy logic method. In this method for each sampling interval, a linear Takagi–Sugeno model has been obtained based on the system behaviour and then it has been used in prediction control design. In Aswani et al. (2013), using two models, MPC has been applied to systems with uncertainties. The first model was an approximation of the model together with limited uncertainties and the second one updated each time based on the statistical method. Despite the advantages of such hybrid methods, they generally depend on input–output sample data and numerical solving of the optimization problem may be affected due to approximation in the predictive model. When a nonlinear plant model is available, it makes sense to use it for prediction in MPC. It decreases the prediction errors, resulting in better control decisions.
Morari and Maeder (2012) and Yang et al. (2012) proposed to augment the nonlinear model of the plant with a static model for the disturbance and, like the LMPC method, estimate the plant state and disturbance values. These methods are more efficient compared with the LMPC approaches in addressing nonlinear plants. However, these methods are not efficient when the disturbances affecting the process are changing frequently during the process. Furthermore, the calculation burden is very cumbersome because the use of the nonlinear model to predict and estimate is time consuming. This defect in on-line constrained nonlinear optimization (CNO), as the key part of MPC, is irreparable. This difficulty is cumbersome, especially in the case of large dimension and highly nonlinear processes.
Therefore, improvement in NMPC is of great importance, especially for general models of nonlinear systems and in the presence of disturbance. There are several methods to finding the solution to a CNO problem, for example gradient descents, iterative dynamic programming, sequential quadratic programming (SQP), the interior point algorithm and so on (Boggs and Tolle, 2000; Schweitzer, 1971; Sorensen, 2006). In order to decrease the calculation burden, in Almaro et al. (2014) and Yang and Biegler (2013), based on gradient and sensitivity of cost function, effective methods have been proposed. Although these methods are successful in NMPC, they are severely dependent on a suitable initial guess for a solution, especially in cases when the cost functions to be minimized contain different local minima. In NMPC, due to the use of the nonlinear model for prediction, the cost function to be minimized is usually non-convex and therefore it may have several local minima. To cope with this disadvantage, the paper proposes that an evolutionary algorithm, which is able to explore the admissible region of potential solutions, is used to find the best initial guess and then introduce it to the nonlinear optimization algorithms.
The proposed method is a combination of particle swarm optimization (PSO) as the evolutionary algorithm and SQP as the CNO approach to deal with the nonlinear programming (NLP) due to their accuracy and fast converging. SQP is a NLP method that starts from a single searching point and finds a solution using the gradient information (Stoer and Bulirsch, 2002). The SQP algorithm is described in Appendix A. In addition, the PSO is a heuristic optimization algorithm based on simulating the movement and flocking of birds (Kennedy and Eberhart, 1995). In a solution space, a randomly chosen flock of solutions, which are commonly called particles, are applied to initialize the search process. The position of each particle iteratively changes by its velocity. Each particle’s velocity is adjusted based on its performance and that of the whole swarm in finding the best position. Such iterative changes in the positions of the particles make the swarm move towards better solution regions. Summarized details of the PSO algorithm are included in Appendix B.
The PSO part of the hybrid algorithm searches the solution area, which is determined by the constraints of the plant. It starts searching by randomly initializing the position of a group of particles in that area. Each particle position is a potential solution, and the PSO algorithm tries to find the best one. After PSO finds a position close to the global best position in the solution space, the SQP algorithm then takes over and searches around that position in order to converge to the global optimum. That is because PSO usually can barely converge to the optimum after getting close to the best position. In this way, the hybrid algorithm may find an optimum more quickly and more accurately. Therefore, the paper goes beyond the previous study on SQP-based NMPC by improving the optimization using an evolutionary algorithm, and obtains much better optimization as an important part of NMPC.
An evaporator system as a test-bed is considered to evaluate the proposed approach. It is a nonlinear multi-input multi-output system. Compared with NMPC, in which a simple SQP is utilized for optimization, our method can considerably enhance the results for nonlinear systems. Simulation results obtained by applying the proposed scheme to the evaporator system show that the controller designed with the proposed approach can make the plant track the piecewise constant references despite the influence of the frequently changing disturbances affecting the plant.
The rest of the paper is organized as follows: an overview of NMPC is presented in the following section. The third section is dedicated to the proposed approach for NMPC problems. A case study to evaluate the proposed method is given in the fourth section. Simulation results are presented in the fifth section and, finally, in the sixth section concluding remarks are presented.
Nonlinear model predictive control
Problem statement
Consider the nonlinear system to be controlled is given by the following dynamic equation:
where
Consider a nominal model of the process as follows:
where
We take
Controller design
To achieve the control objective, LMPC as a popular predictive control method has been widely used in industry. In this method, it is convenient to extract a linear model around the operating point of the nonlinear plant. When disturbances affecting the process are constant, according to Limon et al. (2008, 2010) and Alvardo et al. (2011) the linear model is augmented with a static model for disturbances as shown in (3), and then it is applied to prediction phase of MPC:
where
In the case that the disturbances are varying frequently around their nominal value and moreover the varying is of a meaningful amount, LMPC is not able to reach the control objective. In this case, NMPC can effectively improve the system response since it uses the nonlinear model of the plant for prediction.
For the nonlinear model (2), in the current sample k, assuming the states variables of the process are accessible, consider the general optimal control problem as follows:
where
Considering the optimizer of (4) as
To facilitate the calculation of (4), it is common to assume that the control decisions are the same after a horizon, the so-called the control horizon, that is,
The optimization problem (4) must be solved during every sampling time. Then the solution is applied to the process in a receding horizon manner.
Since the nonlinear model of the system is used for prediction, the optimization problem (4) becomes a CNO problem that is not convex and often has different local solutions. So, unlike in LMPC, the optimization cannot be solved by quadratic programming (QP) algorithms, as QP is the conventional approach in LMPC.
To find the solutions of (4) a nonlinear program is required. In order to reach this goal, there are several CNO methods that are able to handle non-convex optimization problems.
The proposed method
As mentioned in the last paragraphs of the second section, the CNO problem (4) requires that the NLP algorithm be solved numerically. In order to find the solution of (4), the SQP approach as a constrained nonlinear minimizing algorithm can be used because of its fast convergence and high accuracy around local minima. In this paper we consider a class of nonlinear autonomous discrete-time systems of the following equation form:
where xp , yp , u, d and gp are the same as defined for (1). Also Fp , Gp are continuously differentiable nonlinear functions.
Therefore, the model used for predicting the future behaviours of the plant is as below:
where x, y and g are the same as defined for (2). F and G are continuously differentiable nonlinear functions.
Based on Equations (4) and (7), the optimization problem becomes
Calculating Equation (8), we obtain a continuously differentiable nonlinear function of the input vector as follows:
where
where the vectors
where
To find the optimum solution of problem (9) using SQP, it is required to initialize
In order to show how PSO can find a proper initial point for SQP, we consider the optimum problem for two typical cost functions with different local optima densities as follows.
In the case that the density of local optima in the admissible range is not high, PSO can easily converge to a proper initial point in the valley where the global optimum is located. Then SQP starts from this point and converges to the global optimum. Figure 1 shows a typical cost function
In the case that the density of local optima is high, PSO might converge to a point that is not in the global optimum’s valley. Therefore, starting from this point SQP will converge to an optimum that is not global. However, depending on the number of particles and the number of iterations in PSO, we can reach a local optimum that has acceptable performance in minimizing the cost function. For an optimization closer to that of the global optimum, we need to increase the number of particles and iterations. However, it must be noted that the increase in these numbers will take more time for calculation. This might even exceed the sample time, resulting in impractical control. For instance in Figure 2, the cost function

A typical cost function that has few local optima.

A typical cost function that has too many local optima.
Therefore PSO can help to find the global optimum by delivering a much better point as an initial guess to SQP.
However, it must be noted that the time taken by the optimization process between two consecutive samples is required to be less than the sample time as much as possible. This is necessary in on-line optimization. Therefore, NMPC can be used with any learning method that is fast enough to converge to a proper point during the sample time. The selection of PSO as an evolutionally algorithm is motivated by the fact that it can converge to a proper initial point, quickly. Furthermore, unlike the other heuristic algorithms, such as the genetic algorithm (GA) and Differential Evolution (DE), it does not require many operators (Vesterstrom and Thomsen, 2004).
This combination of PSO and SQP constructs a hybrid optimizing algorithm with quick and accurate performance. This advantage of the proposed method can be remarkably useful in on-line optimization, which is a key part of NMPC. A block diagram of the proposal approach is shown in Figure 3.

Block diagram of the proposed method. PSO: particle swarm optimization; SQP: sequential quadratic programming; NMPC: nonlinear model predictive control.
The procedure for designing the NMPC controller using the proposed hybrid method can be summarized as follows.
Step1: Using the nonlinear model (2) and xp (k) measured from plant, predict the future state variables over the prediction horizon Np .
Step2: Place the predicted state variables into (4) to form a nonlinear cost function that is going to be minimized.
Step 3: Based on the constraints on the state and input variables of the plant, determine the admissible set of the solutions.
Step 4: Run the PSO algorithm to find the best solution of the resulting CNO problem. In PSO, the positions and the velocities of a group of particles must be initialized randomly within the range determined in the previous step. (Each particle represents a potential solution.)
Step 5: After PSO has terminated, apply the best solution obtained as the initial guess for the SQP algorithm.
Step 6: Run the SQP algorithm to search around the initial guess to find the optimum solution.
Step 7: When SQP has terminated, apply the first element of the optimal solution (optimal control horizon sequence) to the plant and discard the others and go back to step 1 for the next sample (k+1).
Case study: evaporator
In this section an industrial process, namely the evaporator, is introduced as a case study to implement the proposed approach. It possesses a highly nonlinear dynamic and can be affected by frequently varying disturbances during the process time. We assume that (i) the dynamics of the plant are nonlinear, (ii) the state variables can be measured and (iii) the states and inputs of the plant are subject to hard constraints. Figure 4 shows the diagram of the evaporator system, where F 2, P 100 and F 200 are the manipulated variables. F 1, X 1, T 1 and T 200 are the input disturbances. L 2, X 2 and P 2 are the state variables of the plant and are measurable. X 2 and P 2 are also the controlled variables. A description of the system variables and their values are given in Table 1.

Evaporator system (Cao, 2005).
Variables of the plant (Cao, 2005; Newell and Lee, 1989).
The dynamic equations of the plant are as follows (Newell and Lee, 1989):
where the equations to calculate F 4 and F 5 are given in Appendix C. We can see from Appendix C that F 4 and F 5 are nonlinear functions of state, input and disturbance variables. Therefore, F 4, F 5, F 1 X 1 and F 2 X 2 in Equation (12) are implying that the evaporator is a nonlinear system.
The control goal is to design a controller based on NMPC that can make controlled variables X 2 and P 2 track the stepwise, changing references s2 and s3, while disturbances as shown in Figure 5 are varying within ±20% of their nominal values. These nominal values are available in Table 1. This objective must be achieved under the conditions that the hard constraints (i) 0 ≤ F 2 ≤ 4, (ii) 0 ≤ P 100 ≤ 400, (iii) 0 ≤ F 200 ≤ 400 must be satisfied and L 2 must be kept as close as possible to its nominal value (s1 = 1 m).

Frequently changing disturbances.
Simulation results
To validate the NMPC controller designed based on the proposed hybrid method, the case study problem is simulated using MATLAB software. The sampling time Ts is assigned to 1 min, the predictive horizon Np = 5 and the control horizon Nc = 3. In the cost function, the weighting matrices Q = 100 × I and R = I were considered. In the PSO algorithm the number of iterations and particles were both assigned 50, and the parameters w max = 0.9, w min = 0.4, c 1 = c 2 = 2. For the evaporator, the state variables L 2, X 2 and P 2 initialized according to Table 1 at 1 (m), 25% and 50.5 (kPa), respectively.
Figure 6 shows a comparison between NMPC based on a simple SQP without utilizing PSO, proposed NMPC and LMPC. The simulation results show that despite the fact that reference inputs are changing stepwise, and the disturbances are changing frequently, the proposed NMPC controller is able to make the plant track the reference commands. LMPC, on the contrary, despite leading L 2 towards impractical values, cannot perform as well as proposed method in tracking. For SQP-based NMPC, in each sampling interval, the optimization process is initialized with guesses of optimal inputs. These guesses are the average points chosen from a 10-time randomization in the admissible ranges. Figure 6 shows that SQP is not sufficient at all to handle the optimization without starting from proper points. It is shown in Figure 7 that the constraints on manipulated variables are satisfied by the hybrid approach. The achievement for the proposed controller is due to the use of a nonlinear model to predict the future behaviours of the plant and, of course, the aid of the hybrid PSO-SQP algorithm to solve the CNO problem quickly and accurately during each sampling time. Figure 8 shows the time taken by the proposed hybrid algorithm to converge to the optimal solution per step. It signifies the advantage of employing the proposed approach in NMPC in the case of industrial processes, which are usually not fast.

Evaluation of the proposed nonlinear model predictive control (NMPC) by comparing it with sequential quadratic programming (SQP)-based NMPC without particle swarm optimization (PSO) and also linear model predictive control (LMPC).

Behaviour of the manipulated variables in the proposed method.

The time taken by the proposed algorithm during each step for finding the optimum solution.
In order to show that utilizing the PSO algorithm can efficiently improve the performance compared with other intelligent optimization algorithms, Figure 9 shows a comparison between NMPC based on SQP-DE, SQP-GA and the proposed method. In simulations the population and iteration numbers in DE and GA were the same as in PSO. For DE we assigned the crossover constant 0.5 and the deferential variation factor 1. In GA we assigned the crossover rate 0.8 and the mutation rate 0.01. Further information on DE and GA and their parameters can be found in Cruz et al. (2003) and Schmitt (2004). As shown in Figure 9, the proposed method makes the outputs of the evaporator follow the reference inputs more precisely. Furthermore, Figure 10 shows that NMPC with PSO is faster than NMPC with DE or GA. Therefore, we can conclude from Figures 9 and 10 that NMPC is more effective with PSO.

Nonlinear model predictive control (NMPC) performance comparison when it is used with particle swarm optimization (PSO), Differential Evolution (DE) and the genetic algorithm (GA).

Comparing the optimization time of nonlinear model predictive control (NMPC) when used with particle swarm optimization (PSO), Differential Evolution (DE) and the genetic algorithm (GA).
Conclusion
In MPC it is very profitable to use the nonlinear model instead of the linearized model in nonlinear systems. However, it is not easy to solve the constrained optimization problem resulting in NMPC, because it usually contains different local optima. Moreover, the accuracy and fast converging to an optimum solution are very important in on-line optimization. Consequently, this drawback may result in non-optimized performance of the controller. This paper proposed a hybrid method combining PSO with SQP to cope with that shortage. The cooperation between PSO and SQP in NMPC yields a quick and accurate algorithm to find the solution to the optimization problem. Simulation results on a nonlinear evaporator system showed that the proposed method can be significantly useful to design controllers based on NMPC.
Footnotes
Appendix A: sequential quadratic programming
Consider a nonlinear optimization problem of the form
where
This method is based on iterative formulation and on the solution of QP sub-problems (Nocedal and Wright, 2006). To construct the sub-problems, we first present the following definition.
The functional
is called the Lagrangian functional of the NLP (A.1). The vectors
With this definition we can say now that the sub-problems are obtained by linearizing the constraints and approximating the Lagrangian function quadratically as follows:
where dz
= z–zk
and zk
is called iterate k, and λ
k
, µ
k
are its associated Lagrangian multipliers. The vector
This sub-problem is a QP sub-problem; its solution is used to form the next iterate:
The step length parameter α k is determined by an appropriate line search procedure so that a sufficient decrease in a merit function is obtained (Nocedal and Wright, 2006). Although this optimizing method is less time consuming than the population-based search algorithms, it is highly dependent on the initial estimate of the solution.
Appendix B: particle swarm optimization
At each iteration, the velocity vector, which changes each particle’s position, is calculated as follows:
where Pi t is the position of the particle i in the tth iteration, Pbesti t is the best position of this particle up to iterate t (i.e. personal best), Gbestt is the best position up to iterate t among all particles (i.e. global best), w is the inertia weight and c 1 and c 2 are acceleration coefficients. r 1 and r 2 are two random numbers in the range [0, 1]. The position of each particle can be updated for next iteration as follows:
The performance of PSO is highly reliant on the mechanism whereby the inertia weight factor varies during the search. A proper mechanism can improve PSO in exploration and convergence. In this paper we apply the following mechanism, which is proposed by Shi and Eberhart (1998):
where t max is the maximum number of iterations and t is the current number of iterations.
Appendix C
Funding
This research received no specific grant from any funding agency in the public, commercial or not-for-profit sectors.
