3.4.1 Nonlinearity Quantification and Measure
Due to the nature of systems being nonlinear, work has been done in the testing and quantification of the nonlinearity of a system. A common approach to addressing the quantification of nonlin- earities is to measure the nonlinear system against a linear version of itself and hence quantify the “degree of nonlinearity” of the system. [74] defines the nonlinearity measures of a dynamic system as “the normalized largest difference between the nonlinear process and a linear time-invariant sys- tem”.
Alternatively, as noted in [75], the nonlinearity is measured against a straight line or the devi- ation of the system from a straight line. The work in [75] was aimed primarily at quantifying the nonlinearity in isolation, whereas [76] and [77] take the concept of quantifying nonlinearities
a step further by also taking the control action into account. [76] and [78] introduce the idea of an “Optimal Control Structure (OCS)” which, as the name suggests, is set in an optimal control context which is closely linked to MPC. The Optimal Control Structure takes the dynamics as well as performance objectives into account by making use of Lagrange multipliers and Lagrangian optimization while an open-loop nonlinearity test is done by using coherence estimation. This OCS method was applied to a practical chemical reactor problem in [77].
Building upon the work in [76], [78] and [77], [79] introduced the “closed-loop Optimal Control Law (OCL) nonlinearity measure” that uses closed-loop trajectories and the nonlinearity measure defined in [74], outlined in the first paragraph. This work improved upon previous research in terms of accuracy, computational performance and broader applicability. Many other approaches to ob- taining a nonlinearity measure such as ([80],[81],[82],[83]) have been researched and documented.
The above mentioned methods are able to provide a quantitative measure of the nonlinearity of a system, however they do not provide a graphical view into the effects of the system nonlinearities on the optimization problem which affects the performance of the optimization algorithm and hence the control of the system (in Optimal Control and MPC).
3.4.2 Optimization Visualisation
Visualising or graphical views provide people with a platform from which to glean insight or infor- mation in a logical and clear layout. [84] presented a software package that provides the capability of visually analysing and comparing optimization methods in terms of, amongst others, rate of convergence and radius of convergence. A different outlook is presented in [85] where the visual- ization of the performance optimization algorithm is presented in real-time. A similar, more recent and specific application of this is found in [86] where the optimization or search process in Particle Swarm Optimization (PSO) is visually presented by displaying the movement of the particles within the search space. These tools are useful in obtaining a better understanding of the operation of optimization algorithms but are not suited to visually displaying the effects of nonlinearities on the performance of the optimization.
From the above discussion it can be deduced that not many tools are available for control engineers to gain insight into the optimization within NMPC. Such a tool, if made available, may provide engineers with confidence in their decisions and additionally enable them to base their decisions on a clear graphical representation of the behaviour of the system and the optimization (in terms of convexity etc.).
Chapter 4
NMPC Implementation
In this chapter the implementation of the NMPC algorithm is discussed. This includes some of the algorithm choices that were employed in [1] as this algorithm was used in this study. Firstly, a formulation of NMPC is presented which is followed by a discussion of the algorithm. The algorithm discussion presents the steps in the NMPC algorithm and some approaches to executing them, such as the discretization methods. The algorithm discussion also includes a section on the implementation of the optimization algorithms used in this study, which was done in MATLAB. A short test example showing the global vs. local optimization properties of the algorithms is shown. This is followed by a high level discussion of the MATLAB implementation of NMPC as carried out in [1] which was adopted in this study. Flow charts of the MATLAB implementation are available in Appendix A.
4.1
Formulation of NMPC
To outline the NMPC procedure, the first step is the use of a nonlinear model of the system dynam- ics to obtain a prediction of the system trajectory over a time horizon. This prediction is then used to calculate the required control input by optimizing an objective (cost) function over a control horizon. Once the control input sequence has been obtained, the first control input in the sequence is applied at the next time instance and the process is repeated.
This section presents the formulation of discrete time NMPC, primarily based on the algorithm presented in [1], beginning with the first step in the NMPC algorithm which is prediction using a system model. The discrete time nonlinear system (model):
x(k + 1) = f (x(k), u(k)), (4.1) where x ∈ X,
u ∈ U, k ∈ N,
is used to calculate the trajectory of the system states (x), given initial states x(0) = x0 and a con-
trol sequence (u). U ⊂ R, the set of all control inputs, and X ⊂ Rn, the set of all the states, will be
considered as metric spaces which cater for the calculation of metrics or distances between elements.
In order to proceed to the next step of the NMPC algorithm, which is optimization, an objective or cost function is required. The objective function is the function that will be optimized subject to constraints which include the system model, the state constraints and input constraints. In general, the objective function provides a performance measure of how near or far the current states are from the desired reference state or trajectory. The objective function is, at times, used to penalise the control input (u) since it may be undesirable to have too large an input and is also often related to economic objectives ([7]). These are merely some of the more common examples of objective or cost functions but in general the cost function may be defined as warranted by the application.
Equation 4.2 presents a cost function based on the Euclidean distance or 2-norm which determines
the distance between the state (x) and the reference trajectory, ˜x(k), as well as the input (u) and
(if known) the reference control sequence, ˜u(k), with the parameter β ≥ 0.
`(x, u) = kx(k) − ˜x(k)k2+ βku(k) − ˜u(k)k2 (4.2)
To continue with the second step of the NMPC algorithm, given a prediction horizon length (Tp>
2), an open-loop optimal control problem is formulated which is then solved to obtain the control input sequence.
min
u J (x(k), u(k)) (4.3)
subject to : x(k + 1) = f (x(k), u(k)),
with Initial Condition x(0) = x0,
u ∈ U, x ∈ X, where J (x(k), u(k)) = Tp−1 X k=0 `(x(k), u(k))
The closed-loop system is defined as xc = f (x, uc(, x)) where uc(x)1 is the control input feedback
law which is the solution of the optimal control problem in 4.3.
Once the control input solution has been obtained the final step is to apply the first control input in the control input sequence at the next period.