Optim Control Appl Methods - 2014 - Quirynen - Autogenerating Microsecond Solvers For Nonlinear MPC A Tutorial Using ACADO
Optim Control Appl Methods - 2014 - Quirynen - Autogenerating Microsecond Solvers For Nonlinear MPC A Tutorial Using ACADO
SUMMARY
Nonlinear model predictive control (NMPC) allows one to explicitly treat nonlinear dynamics and con-
straints. To apply NMPC in real time on embedded hardware, online algorithms as well as efficient code
implementations are crucial. A tutorial-style approach is adopted in this article to present such algorith-
mic ideas and to show how they can efficiently be implemented based on the ACADO Toolkit from
MATLAB (MathWorks, Natick, MA, USA). Using its code generation tool, one can export tailored Runge–
Kutta methods—explicit and implicit ones—with efficient propagation of their sensitivities. The article
summarizes recent research results on autogenerated integrators for NMPC and shows how they allow to for-
mulate and solve practically relevant problems in only a few tens of microseconds. Several common NMPC
formulations can be treated by these methods, including those with stiff ordinary differential equations, fully
implicit differential algebraic equations, linear input and output models, and continuous output independent
of the integration grid. One of the new algorithmic contributions is an efficient implementation of infinite
horizon closed-loop costing. As a guiding example, a full swing-up of an inverted pendulum is considered.
Copyright © 2014 John Wiley & Sons, Ltd.
KEY WORDS: NMPC; embedded optimization; Runge–Kutta methods; code generation; sensitivity
analysis
1. INTRODUCTION
In model predictive control (MPC), at each sampling instant, one solves an optimal control prob-
lem (OCP) using the current system state as initial value. The increasing popularity of nonlinear
MPC (NMPC) for real-time control is due to its ability to directly handle nonlinear dynamics and
constraints. Let us consider the following continuous time OCP formulation:
Z t0 CT
minimize kF .t; x.t /; u.t //k22 dt C kFN .x.t0 C T //k22 (1a)
x./; u./ t0
subject to x.t0 / D xN 0 ; (1b)
x.t
P / D f .t; x.t /; u.t //; 8t 2 Œt0 ; t0 C T ; (1c)
0 > h.x.t /; u.t //; 8t 2 Œt0 ; t0 C T ; (1d)
0 > r.x.t0 C T //; (1e)
where t0 is the current time instant, x.t / 2 Rnx denotes the differential states, and u.t / 2 Rnu are
the control inputs at time t . The NMPC objective is defined by (1a), while (1d) and (1e) denote
respectively the path and terminal constraints. The nonlinear dynamics in (1c) are described by an
*Correspondence to: R. Quirynen, KU Leuven, ESAT-STADIUS, Kasteelpark Arenberg 10, B-3001 Leuven, Belgium.
† E-mail: [email protected]
explicit system of ordinary differential equations (ODEs), but this will be further generalized to
implicit systems of differential algebraic equations (DAEs). The optimization problem depends on
the parameter xN 0 2 Rnx through the initial value constraint of (1b) and can also be time depen-
dent. Hence, the control trajectory obtained by solving problem (1) provides a feedback strategy
u .t0 ; xN 0 /, which depends on the current state and time.
The OCP is in practice often solved by a direct approach where one first discretizes the prob-
lem to obtain a structured nonlinear program (NLP), which is generally nonconvex. A Newton-type
algorithm is able to find a locally optimal solution by solving the Karush–Kuhn–Tucker conditions.
Two popular Newton-type techniques are interior point (IP) methods and sequential quadratic pro-
gramming (SQP) [1]. IP methods for nonconvex problems treat the inequality constraints therein
by the use of a smoothening technique [2]. SQP instead consists in sequentially approximating the
NLP by convex quadratic program (QP) subproblems.
Recent algorithmic progress [3, 4] allowed to reduce computational delays between receiving the
new state estimate and applying the next control input to the process [3]. This made it possible to
apply NMPC also to fast dynamic systems with sampling times in the millisecond or even microsec-
ond range. The real-time iteration (RTI) scheme [5] is an SQP-type online algorithm. The resulting
sequence of sparse QPs can either be solved directly using a structure exploiting convex solver such
as FORCES [6] or qpDUNES [7] or by reducing the size of the QP subproblems with a condens-
ing technique [8, 9] and using a dense linear algebra solver such as qpOASES [10]. A discussion
on these algorithmic aspects can be found in [11]. It is important to note that the presented tech-
niques are also applicable to moving horizon estimation, which delivers estimates of process states
or parameters in real time [12].
Embedded integrators with efficient sensitivity propagation are a crucial part of the algorithmic
tools needed to implement NMPC in real time. The online linearization of constraints imposing the
model equations is typically a computationally expensive step in the RTI scheme [13]. Targeting
real-time applications, a deterministic run time for the used integration methods is also important.
The approach throughout this article will be that parameters such as the step size and order of the
method are therefore determined offline and kept fixed. The use of tailored explicit Runge–Kutta
(ERK) methods for real-time optimal control has been presented in [13, 14]. This idea was extended
in the more recent work on online implicit Runge–Kutta (IRK) methods [15]. Tailored techniques for
the efficient computation of the sensitivity information have been discussed in [16]. The application
of these embedded, implicit solvers to systems of DAEs and the motivation for continuous output
were presented in [17]. A three-stage model formulation is proposed in [18], as a way to exploit
common linear subsystems in a dynamic model.
In addition to using tailored algorithms, highly efficient code implementations are necessary to
meet the tight timing constraints on embedded control hardware. In this context, the technique of
automatic code generation has experienced an increasing popularity [19]. One can perform offline
optimizations of the code to be generated, for example, by removing unnecessary computations,
by optimizing memory access and cache usage, and by exploiting the problem’s specific structure.
Convex optimization solvers such as CVXGEN [20] and FORCES [6] are both generating cus-
tomized IP solvers. In order to solve nonlinear OCP problems, the ACADO code generation tool [13]
exports highly efficient C code, implementing a tailored RTI scheme. It is part of the open-source
ACADO Toolkit and interfaced to various convex solvers [7, 11]. ACADO code generation has
already been used for real-time optimal control, showcasing millisecond or even microsecond exe-
cution times both in simulation [21, 22] and in real-world experiments [14, 23–25]. This article will
show how to efficiently implement NMPC in a rather intuitive way, by using ACADO from MAT-
LAB (MathWorks, Natick, MA, USA). The focus will mostly be on the code-generated integrators
and their importance in an efficient treatment of various NMPC formulations. Novel SQP-type algo-
rithms can also be prototyped easily, by using the stand-alone integrator code in combination with a
convex solver.
This paper is organized as follows. Section 2 briefly presents direct multiple shooting and the
Gauss–Newton method in the RTI scheme. Section 3 introduces the guiding example, targeting
the swing-up of an inverted pendulum. Code generation of explicit and implicit integration meth-
ods is respectively discussed and illustrated in Sections 4 and 5. The exploitation and use of a
Copyright © 2014 John Wiley & Sons, Ltd. Optim. Control Appl. Meth. 2015; 36:685–704
DOI: 10.1002/oca
10991514, 2015, 5, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/oca.2152 by <shibboleth>[email protected], Wiley Online Library on [07/08/2024]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
CODE-GENERATED ACADO INTEGRATORS FOR FAST CONTROL 687
three-stage model structure for NMPC are the topic of discussion in Section 6. Continuous out-
put is then presented by Section 7 and used to efficiently approximate infinite horizon closed-loop
costing. Section 8 finally concludes the paper and outlines further developments. All numerical sim-
ulations are performed using the ACADO code generation tool on a computer equipped with Intel
i7-3720QM processor (Intel, Santa Clara, CA, USA), running a 64-bit version of Ubuntu 12.04
(Canonical Ltd, London, UK).
N 1
1 X
minimize kFi .xi ; ui /k22 C kFN .xN /k22 (2a)
X; U 2
i D0
subject to 0 D x0 xN 0 ; (2b)
0 D xi C1 ˆi .xi ; ui /; i D 0; : : : ; N 1; (2c)
0 > hi .xi ; ui /; i D 0; : : : ; N 1; (2d)
0 > r.xN /; (2e)
where i D 0 corresponds to the current time instant and with state trajectory X D Œx0> ; : : : ; xN > >
> > >
and control trajectory U D Œu0 ; : : : ; uN 1 . The function ˆi .xi ; ui / defines the simulation of
the nonlinear dynamics over one interval, starting from the state xi and using the control values
ui . The stage cost Fi ./ represents the evaluation of the function F in (1a), and this is either at the
corresponding shooting node or on a finer grid, for example, based on continuous output as discussed
in Section 7. Direct multiple shooting addresses the problem in (2) in the full variable space .X; U /.
On the other hand, a sequential approach performs the simulation separately from solving the
optimization problem. One can namely obtain a reduced OCP formulation by eliminating the vari-
ables xi using the results Xsim .xN 0 ; U / of a forward simulation over the full horizon. This technique
is better known as single shooting as presented in [27]. One can interpret multiple shooting as a
lifted variant of the latter method, and the cost per Newton iteration can be made close to equal as
Copyright © 2014 John Wiley & Sons, Ltd. Optim. Control Appl. Meth. 2015; 36:685–704
DOI: 10.1002/oca
10991514, 2015, 5, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/oca.2152 by <shibboleth>[email protected], Wiley Online Library on [07/08/2024]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
688 R. QUIRYNEN ET AL.
discussed in [28]. In addition, the use of multiple shooting has many advantages over single shoot-
ing. Direct multiple shooting often has better convergence properties, and it can be initialized in a
more flexible way. It is also better suited for unstable systems, and the resulting algorithm can be
parallelized much more easily [28].
subject to 0 D x0 xN 0 ; (3b)
" #
h i Œk
Œk Œk Œk Œk xi xi
0 D xi C1 i xi ; ui Ai ; Bi ; i D 0; : : : ; N 1; (3c)
ui uŒk
i
" #
h i Œk
x x
0 > hi xiŒk; uŒk
i C CiŒk; DiŒk i iŒk ; i D 0; : : : ; N 1; (3d)
ui ui
Œk
0 > r xN C CNŒk xN xN Œk
; (3e)
Copyright © 2014 John Wiley & Sons, Ltd. Optim. Control Appl. Meth. 2015; 36:685–704
DOI: 10.1002/oca
10991514, 2015, 5, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/oca.2152 by <shibboleth>[email protected], Wiley Online Library on [07/08/2024]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
CODE-GENERATED ACADO INTEGRATORS FOR FAST CONTROL 689
been proposed as a highly competitive approach [5]. A survey of online optimization algorithms for
NMPC can be found in [3]. The RTI scheme, as presented in Algorithm 1, pursues to minimize the
feedback time to the process. It performs only one SQP-type iteration of the generalized Gauss–
Newton method per sampling time, to avoid iterating until convergence for an outdated problem.
Initial value embedding, that is, the use of a constraint such as in (2b) to impose the initial state
values, also plays a crucial role. The state estimate xN 0 enters linearly, and the optimal control solu-
tion depends differentiably on this parameter, except during active set changes. Combined with the
Gauss–Newton Hessian approximation, this yields a multiplier-free, generalized tangential predic-
tor, that is, one that can work across active set changes [3]. A final, important ingredient of the RTI
scheme is its division of the computations at each sampling instant into a preparation and a feed-
back phase. The typically more computationally demanding preparation phase includes the problem
linearization and potential condensing of the large structured QP. This preparation task can be per-
formed before the next state estimate is available and includes most of the necessary computations.
Once the new value becomes available, the feedback phase can quickly solve the prepared convex
subproblem. This can drastically reduce the computational delay between receiving the new state
estimate and applying the next control input to the process.
Copyright © 2014 John Wiley & Sons, Ltd. Optim. Control Appl. Meth. 2015; 36:685–704
DOI: 10.1002/oca
10991514, 2015, 5, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/oca.2152 by <shibboleth>[email protected], Wiley Online Library on [07/08/2024]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
690 R. QUIRYNEN ET AL.
The guiding example that will be used throughout this article is the classical system of a pendulum
mounted on top of a cart as illustrated in Figure 2. It forms an ideal tutorial example for NMPC
because it is simple and intuitive but it can also exhibit rather fast dynamics and nonlinear behavior.
Subsection 3.1 first describes the modeling task for this system with an alternative DAE model in
Subsection 3.2. The OCP formulation can then be introduced in Subsection 3.3.
The kinetic energy of the system is given by T D 12 mpP > pP C 12 M wP02 ; where M denotes the cart
mass. The potential energy subsequently corresponds to U D mgy1 ; where g denotes the gravita-
tional acceleration. Using the Lagrangian formalism from [33], one can define L D T U so that
the equations of motion read
d @L @L
D Fq ; (5)
dt @qP @q
with the generalized coordinates q D Œw0 ; > , the generalized forces Fq D Œu; 0> , and u defined
as a control input. This formulation directly yields the following implicit ODE system:
Copyright © 2014 John Wiley & Sons, Ltd. Optim. Control Appl. Meth. 2015; 36:685–704
DOI: 10.1002/oca
10991514, 2015, 5, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/oca.2152 by <shibboleth>[email protected], Wiley Online Library on [07/08/2024]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
CODE-GENERATED ACADO INTEGRATORS FOR FAST CONTROL 691
1
C.q/ D .w1 w0 /2 C y12 l 2 D 0:
2
The Lagrangian is now given by L D T U C , where is the Lagrange multiplier with respect
to this constraint. The obtained DAE is of index 3, but it can be reduced to one of index 1, and the
resulting equations of motion read
2 32 3 2 0
3
M 0 0 w0 w1 wR 0
6 0 m 0 w1 w0 7 6 wR 1 7 6 mg 7 C.0/ D 0
4 0 0 m y1 5 4 yR 5 D 6
4 u
7;
5 CP .0/ D 0 ; (8)
1
2 2
w0 w1 w1 w0 y1 0 yP .wP 0 wP 1 /
where w0 , w1 , and y1 as well as their time derivatives are differential states and is an algebraic
state. Note that if a consistent initial state is provided, the conditions C.0/ D 0 and CP .0/ D 0
automatically hold and the NMPC scheme will not need to impose them.
where the states are defined as x D Œw0 ; ; wP 0 ; P > , the horizon length T D 1 s, and the weighting
matrices Q and R are defined as
Q D diag 10 10 0:1 0:1 and R D Œ0:01:
Note that the units are chosen consistently with the unit of measure of the states, so as to yield a
dimensionless cost. To obtain a tractable problem, a multiple shooting discretization is performed
using 20 intervals over the control horizon. The used NMPC sampling time is equal to Ts D 0:05 s
to be able to deal with the fast nonlinear dynamics in the system.
Copyright © 2014 John Wiley & Sons, Ltd. Optim. Control Appl. Meth. 2015; 36:685–704
DOI: 10.1002/oca
10991514, 2015, 5, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/oca.2152 by <shibboleth>[email protected], Wiley Online Library on [07/08/2024]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
Figure 3. MATLAB code example to implement nonlinear model predictive control (NMPC) using ACADO
code generation.
the stage cost is defined as Fi .xi ; ui / D Wi1=2 .FQ .xi ; ui / yiref /, such that users can easily spec-
ify weighting matrices Wi and a reference trajectory yiref . The following four crucial steps can be
identified:
1. Define the model equations: This part of the code will be changed the most throughout the
following sections, since our focus will be on the way this nonlinear system is dealt with in
fast NMPC applications.
2. Simulation routine: An integrator is generated to accurately simulate the behavior of the pro-
cess after applying the next control inputs. Although only ACADO is being used here, this
component can be replaced by any available simulation environment.
3. NMPC export: The OCP needs to be formulated in ACADO syntax, including the dynam-
ics, the objective functions, and constraints, so that a corresponding solver can be exported.
Various options can be used to customize the code-generated algorithm.
4. Simulation: The exported solver can be used to run various closed-loop NMPC simulations
while keeping the efficiency of the optimized C code for the relevant computations.
ACADO keywords can be used to define the various differential states and controls. They are
used to build all symbolic expressions that appear in the differential equations. After defining the
model in Figure 3, the code exports the four-stage ERK method of order 4 (ERK4) as a stand-
alone integrator to simulate the system. It is specified to perform five integration steps to simulate
the model over 0.05 s, resulting in a relatively high accuracy. The SIMexport module generates
the optimized C code into the folder called ‘SIM_export’. Notice that there are options to customize
the integrator and to include an efficient propagation of sensitivities. This turns it into a powerful
tool to prototype new algorithms as illustrated in [17] and also further in Section 7.2. The third step
involves the use of the OCP and OCPexport module, which generates the RTI-based solver for
NMPC. It allows the user to specify the embedded components such as the integrator and the convex
solver. In the code from Figure 3, the same ERK method is used and combined with a condensing
technique and qpOASES as the underlying solver. As mentioned earlier, it is possible to alternatively
employ a structure-exploiting solver such as FORCES or qpDUNES. The self-contained C code
is exported into the specified ‘MPC_export’ folder. Finally, the presented code also automatically
generates MEX functions, which can be used to perform
an evaluation of the model’s right-hand side and its derivatives,
a call to the integrator and its optional sensitivity propagation, and
the RTI scheme to solve the user-provided OCP instance.
Using this functionality, one can rather intuitively perform various NMPC simulations by consecu-
tively calling the OCP solver and the integrator in a loop.
Let us first present the case of having an OCP formulation where the dynamics are described by an
explicit ODE system. In that case, an explicit integration method can be used to solve the following
initial value problem:
x.t
P / D f .t; x.t /; u.t //;
(10)
x.0/ D x0 :
This section briefly covers ERK methods, which are first introduced in Subsection 4.1. An overview
on techniques for first-order sensitivity analysis is subsequently provided in Subsection 4.2. Finally,
an illustration of the resulting NMPC implementation and its performance will be presented in
Subsection 4.3.
Copyright © 2014 John Wiley & Sons, Ltd. Optim. Control Appl. Meth. 2015; 36:685–704
DOI: 10.1002/oca
10991514, 2015, 5, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/oca.2152 by <shibboleth>[email protected], Wiley Online Library on [07/08/2024]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
694 R. QUIRYNEN ET AL.
derivation and properties of these methods can be found in [34]. One can use the following s-stage
RK method to integrate the ODE system in (10) from time tn to tn C h:
s
X
ki D f .tn C ci h; xn C h aij kj ; un /; for i D 1; : : : ; s;
j D1
s
(11)
X
xnC1 D xn C h bi ki ;
i D1
where the values bi denote the weights, ci are the coefficients defining the s stages, and aij are
called the internal coefficients. For an ERK method, the coefficient matrix A D Œaij must be strictly
lower triangular so that the variables ki are defined explicitly in (11). The simplest method is the
well-known forward Euler method. It is usually more efficient to use a higher-order method such as
the methods of Runge and Heun or the popular four-stage ERK method of order 4 (ERK4) [34]. It
is important to note that explicit methods should typically not be used in case of a stiff problem, as
detailed in [35].
Copyright © 2014 John Wiley & Sons, Ltd. Optim. Control Appl. Meth. 2015; 36:685–704
DOI: 10.1002/oca
10991514, 2015, 5, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/oca.2152 by <shibboleth>[email protected], Wiley Online Library on [07/08/2024]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
CODE-GENERATED ACADO INTEGRATORS FOR FAST CONTROL 695
2 5
dw0
w0
0 0
−2 −5
0 1 2 3 4 0 1 2 3 4
5 10
dtheta
theta
0 0
−5 −10
0 1 2 3 4 0 1 2 3 4
20
0
u
−20
0 0.5 1 1.5 2 2.5 3 3.5 4
time (s)
Figure 4. Illustration of the closed-loop nonlinear model predictive control behavior for the original optimal
control problem formulation.
Table I. Average computation time per RTI step, interfacing an ACADO integrator and QP solver.
N = 60
ACADO total RTI 745 312 407
ERK4, explicit Runge–Kutta method of order 4; QP, quadratic program; RTI, real-time iteration.
in this case, but condensing combined with qpOASES provides the most efficient implementation
with only 80 s per time step. On longer horizons, a sparsity-exploiting solver such as FORCES
or qpDUNES can be shown to eventually become faster than the condensing-based approach as
discussed in [11]. The timing results from a simulation using N D 60 control intervals over a
horizon, which is also three times longer, are included in Table I for illustrative purposes. In this
specific case, the qpDUNES-based implementation becomes the most efficient one. The table also
presents the average computation time when using quadprog and ode45, respectively, to solve
the QP and to perform integration and sensitivity computations. The difference between an ACADO-
exported integrator and ode45 is quite noticeable, mostly because of using code generation and
fixing the step size. The propagation of sensitivities with ode45 is performed using the system
extended with the VDEs from (12).
A quite pragmatical definition of stiffness is when the dynamic equations are ‘such that certain
implicit methods perform better, usually tremendously better, than explicit ones’ [35]. Many real-
world problems are observed to be stiff [38]; that is, it is rather important to include implicit schemes
in this discussion. Moreover, the initial value problem formulation from (10) can be generalized to
0 D f .t; x.t
P /; x.t /; ´.t /; u.t //;
(13)
x.0/ D x0 ;
Copyright © 2014 John Wiley & Sons, Ltd. Optim. Control Appl. Meth. 2015; 36:685–704
DOI: 10.1002/oca
10991514, 2015, 5, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/oca.2152 by <shibboleth>[email protected], Wiley Online Library on [07/08/2024]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
696 R. QUIRYNEN ET AL.
where the coefficients bi , ci , and ai;j define the method as before, Zi denotes the stage values
of the algebraic states, and ki denotes the stage values of the differential state derivatives. The
result is a nonlinear system of s.nx C n´ / equations that must be solved using a Newton-type
method. Targeting real-time applications, not only the step size and order of the method but also
the number of Newton iterations L is assumed to be kept fixed. Given the results from a previous
integration step, one can construct a reasonable initialization for the next stage values. The number
of iterations L should be chosen in a conservative way, considering the applications for which the
resulting scheme will be employed [15]. Let us write the nonlinear system as G.rn ; K/ D 0 where
rn D .xn ; un /; that is, the Newton iterations are
K Œi D K Œi 1 M 1 G rn ; K Œi 1 ; i D 1; : : : ; L; (15)
dK @G 1 @G
D ; (16)
drn @K @rn
Copyright © 2014 John Wiley & Sons, Ltd. Optim. Control Appl. Meth. 2015; 36:685–704
DOI: 10.1002/oca
10991514, 2015, 5, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/oca.2152 by <shibboleth>[email protected], Wiley Online Library on [07/08/2024]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
CODE-GENERATED ACADO INTEGRATORS FOR FAST CONTROL 697
1: for i D 1 ! L do
2: K Œi K Œi 1 M 1 G rn ; K Œi 1
3: end for P
4: xnC1 Pxn C h siD1 bi ki Q
s t cj
5: ´n i D1 li .0/Zi with li .t / D j ¤i ci cj
@G
6: M @K
rn ; K ŒL
dK
7: compute dr using M in Eq. (16)
@xnC1
n
P
8: @rn
@xn
@rn
C h siD1 bi dr
d ki
@´n P s dZi
n
9: @rn i D1 li .0/ drn
5.3. Application: nonlinear model predictive control using a differential algebraic equation model
Regarding our guiding example, one can also use the implicit ODE in (6) or the DAE model in (8)
for NMPC. The ACADO formulation of the implicit DAE system looks as follows:
This code can be used as before to generate an IRK method with tailored sensitivity propaga-
tion or to export a full RTI scheme. The average computation time for one RTI step is presented in
Table II, using each of the three possible model formulations. The ACADO-generated scheme uses
condensing combined with qpOASES, and the results also show the time spent in integration and
sensitivity propagation. The same IRK method is used for all three model formulations, namely a
Gauss method of order 2 (IRK method of order 2) with a step size of 0.05 s. The different NMPC
implementations seem to result in a rather similar execution time; that is, there is little to no over-
head corresponding to treating an implicit ODE or even DAE system instead of the simple explicit
model. An implicit ODE or a DAE formulation can sometimes even lead to faster computation times
because of simpler expressions in the model, which is observed for the implicit ODE in this case.
Note that the DAE system consists of seven instead of four states (six differential and one algebraic
state), while its corresponding execution time is comparable to the others.
Many dynamic systems are described by a set of nonlinear differential equations with possibly a
few algebraic states. One would often identify coupled subsystems that can be simulated in separate
stages. In the special case that such a subsystem is linear, this can be additionally exploited. Subsec-
tion 6.1 presents a three-stage model formulation, which has been observed to appear rather often
Copyright © 2014 John Wiley & Sons, Ltd. Optim. Control Appl. Meth. 2015; 36:685–704
DOI: 10.1002/oca
10991514, 2015, 5, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/oca.2152 by <shibboleth>[email protected], Wiley Online Library on [07/08/2024]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
698 R. QUIRYNEN ET AL.
Table II. Average computation time for NMPC using different model formulations in ACADO.
Explicit ODE (7) (s) Implicit ODE (6) (s) Implicit DAE (8) (s)
Integration (IRK2) 24 22 32
Total RTI (qpOASES) 60 58 85
DAE, differential algebraic equation; IRK2, implicit Runge–Kutta method of order 2; NMPC,
nonlinear model predictive control; ODE, ordinary differential equation; RTI, real-time iteration.
with matrices A1 , B1 , and A3 , invertible matrices C1 and C3 , and nonlinear functions f2 and f3 .
The main assumption is that the Jacobian matrix @ ´;@fxP2Œ2 is invertible; that is, the second subsystem
. /
represents an implicit DAE of index 1. Linear input (17a) and output (17c) systems can, for example,
originate from partially linear dynamics or from filtering actions, respectively, before and after the
nonlinear dynamics. In case that A3 D 0 and C3 is an identity matrix, (17c) reduces to
xP Œ3 D f3 x Œ1 ; x Œ2 ; xP Œ1 ; xP Œ2 ; ´; u (18)
which are better known as quadrature states [39]. They are typically used to formulate objective and
constraint functions, similar to how the more general linear input and output states can be used.
dK B C
DB
@
dK2 dK2
dx Œ1 dx Œ2
0 dK du
2 C;
A (19)
drn
dK3 dK3 dK3 dK3
dx Œ1 dx Œ2 dx Œ3 du
Copyright © 2014 John Wiley & Sons, Ltd. Optim. Control Appl. Meth. 2015; 36:685–704
DOI: 10.1002/oca
10991514, 2015, 5, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/oca.2152 by <shibboleth>[email protected], Wiley Online Library on [07/08/2024]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
CODE-GENERATED ACADO INTEGRATORS FOR FAST CONTROL 699
where K1 , K2 , and K3 denote the stage values corresponding to the three subsystems. Because of
dK1 dK1 dK3
linearity, the values dx Œ1 , du , and dx Œ3 are constant and can be precomputed in a code genera-
tion framework. In case of IRK methods, the speedup to be made is typically much larger. Linear
subsystems namely allow the inverse of the constant Jacobian to be precomputed offline, which
reduces the cost of computing stage values to merely one matrix-vector multiplication [18].
P HP D P !C HP ; (20)
where !C D 2fC and fC is the cutoff frequency. The implicit ODE model for the inverted
pendulum on a cart can now easily be extended with both the linear input and output systems:
The updated OCP formulation includes a constraint 100 6 uR 6 100 and additional weights
on both uR and HP in the objective. The average computation time per RTI step using ACADO is
presented in Table III. Unlike the results in Table II, a Gauss method of order 4 (IRK method of order
4) instead of order 2 has been used for illustrative purposes. The table includes the computation time
for the original and extended NMPC scheme, comparing its implementation both with and without
structure exploitation. Note that the use of linear subsystems allowed us to implement this more
practical scheme at the cost of merely 132 s instead of the original 116 s per step. A comparison
between the NMPC behavior using either the original or the frequency-weighted formulation is
shown in Figure 6. It can be observed that the controller is less aggressive and the trajectories appear
slightly smoother.
7. CONTINUOUS OUTPUT
Copyright © 2014 John Wiley & Sons, Ltd. Optim. Control Appl. Meth. 2015; 36:685–704
DOI: 10.1002/oca
10991514, 2015, 5, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/oca.2152 by <shibboleth>[email protected], Wiley Online Library on [07/08/2024]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
700 R. QUIRYNEN ET AL.
1 5 original NMPC
frequency−weighted
0
dw0
w0
0
−1
−2 −5
0 0.5 1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 3
4 10
dtheta
2 5
theta
0 0
−2 −5
0 0.5 1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 3
20 100
10 50
uR
0 0
u
−10 −50
−20 −100
0 0.5 1 1.5 2 2.5 3 0 0.5 1 1.5 2 2.5 3
time (s) time (s)
Figure 6. Simulation results for nonlinear model predictive control using either the original or the frequency-
weighted formulation.
presented in [17], where multirate measurements for moving horizon estimation were efficiently
incorporated in a real-time feasible scheme. Other control-related ideas could be to approximate a
least-squares integral or to define certain constraints on a rather fine grid. Subsection 7.1 briefly
presents the support of continuous output for a specific family of IRK methods. An interesting
NMPC application is introduced in Subsection 7.2, where an infinite horizon closed-loop costing
scheme will be implemented in an efficient way.
Copyright © 2014 John Wiley & Sons, Ltd. Optim. Control Appl. Meth. 2015; 36:685–704
DOI: 10.1002/oca
10991514, 2015, 5, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/oca.2152 by <shibboleth>[email protected], Wiley Online Library on [07/08/2024]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
CODE-GENERATED ACADO INTEGRATORS FOR FAST CONTROL 701
7.2. Application: nonlinear model predictive control using infinite horizon closed-loop costing
Until now, the issue of nominal closed-loop stability of the implemented NMPC scheme has not
been addressed although it forms a crucial property. Instead of determining a suitable terminal
region or sufficiently prolonging the control horizon [41], let us briefly look into the technique of
infinite horizon closed-loop costing [42, 43]. The scheme is based on a local control law and uses
an infinite prediction horizon in which the state and input constraints are still imposed. A tractable
approximation of the infinite horizon cost associated with the local controller is used as a penalty
on the terminal state. Stability of the closed-loop system can then be proven in a rigorous way [43].
To formulate a practical scheme, the prediction horizon can be truncated without losing this stabil-
ity guarantee as is the topic of discussion in [42]. Furthermore, the path constraints will only be
imposed at specific time points. The main advantage of introducing the prediction horizon Tp is
that it allows us to enlarge the region of attraction around the reference point without increasing the
control horizon Tc , that is, with the same number of decision variables [44].
Let us adapt the OCP formulation from (9) accordingly:
Z t0 CT
minimize kx.t / x ref k2Q C ku.t / uref k2R dt (22a)
x./;u./ t0
subject to x.t0 / D xN 0 ; (22b)
x.t
P / D f .x.t /; u.t //; 8t 2 Œt0 ; t0 C T ; (22c)
u.t / D uLQR .x.t //; 8t 2 Œt0 C Tc ; t0 C T ; (22d)
hN 6 h.t / 6 h; N 8t 2 Œt0 ; t0 C T ; (22e)
where T D Tc C Tp , the function h is defined as h.t / D Œw0 .t /; u.t /> , and the bounding values
are hN D Œ2; 20> . The unstable steady state is denoted by .xss ; uss /, such that the Linear Quadratic
Regulator (LQR) which locally stabilizes this reference point can be defined as uLQR D uss Kp .x
xss / where Kp 2 Rnu nx . The corresponding discrete time OCP formulation reads
Nc 1
1 X
minimize kxi x ref k2Q C kui uref k2R C kg.xNc / g ref k2W (23a)
X; U 2
i D0
subject to 0 D x0 xN 0 ; (23b)
0 D xi C1 ˆi .xi ; ui /; i D 0; : : : ; Nc 1; (23c)
hN 6 h.xi / 6 h;N i D 0; : : : ; Nc 1; (23d)
hN 6 hj .xN / 6 h;
c
N j D 0; : : : ; Np ; (23e)
where the functions hj .xNc / and g.xNc / are defined by a forward simulation over the prediction
horizon using the linear control law, g ref D Œx ref I uref I : : : 2 RNp .nx Cnu / denotes the corresponding
reference values, and W D diag.Q; R; : : :/ 2 RNp .nx Cnu /Np .nx Cnu / is a block-diagonal weight-
ing matrix. Let us consider a control horizon of Nc D 10 and a prediction horizon of Np D 20,
that is, respectively, Tc D 0:5s and Tp D 1:0 s, using a discretization with the same sampling
time Ts D 0:05 s in both. One can generate an ACADO integrator, dedicated to perform the sim-
ulation over the prediction horizon. The goal is to take rather large integration steps but to use the
continuous output feature to efficiently define the extra constraints and the terminal cost.
This will be compared with the original NMPC scheme with Nc D 20 control intervals and no
prediction horizon (case 1). Note that it becomes difficult to reduce the size of the horizon further and
Copyright © 2014 John Wiley & Sons, Ltd. Optim. Control Appl. Meth. 2015; 36:685–704
DOI: 10.1002/oca
10991514, 2015, 5, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/oca.2152 by <shibboleth>[email protected], Wiley Online Library on [07/08/2024]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
702 R. QUIRYNEN ET AL.
Table IV. Average computation time for approximate infinite horizon NMPC.
3.5
theta
2.5
2
−2 −1.5 −1 −0.5 0 0.5 1 1.5 2
w0
Figure 7. This figure shows the implicitly defined terminal region by nonlinear model predictive control with
closed-loop costing where feasible points in .w0 ; / space are dotted and infeasible points left blank (other
two states are kept zero).
to still obtain a stable controller in this case. The resulting average computation time per RTI step is
presented in Table IV using a Gauss method of order 4 and step size 0.05 s, which is interfaced to a
FORCES solver. The implementation using continuous output (case 3) is much faster than the one
without (case 2), where a separate integration step needs to be performed for each interval. Note that
the latter scheme delivers a higher integration accuracy over the prediction horizon, although it is not
necessary for our example. Integrators with continuous output provide the user with the flexibility
needed to compute all results in an efficient way and with the desired precision. It is interesting that
this approach can be interpreted as one that implicitly generates a terminal region as illustrated in
Figure 7. It shows how much the inverted pendulum is allowed to be tilted and in which direction
depending on the position of the cart, such that the LQR controller can still stabilize it under the
restrictions of our system.
This article has summarized recent algorithmic progress on autogenerated integration methods and
illustrated ways to employ them for NMPC. Code-generated integrators with tailored sensitiv-
ity propagation can form a powerful tool. Selecting a suitable method and exploiting its features
can allow a range of new NMPC formulations and applications to become real-time and feasi-
ble. Based on the ACADO code generation tool from MATLAB, a tutorial-style approach has
been adopted using a simple guiding example that consists of an inverted pendulum on a cart.
In addition, the potential to easily prototype new algorithms was briefly illustrated. The stand-
alone implicit integrators with continuous output allowed us to efficiently implement NMPC with
closed-loop costing.
Copyright © 2014 John Wiley & Sons, Ltd. Optim. Control Appl. Meth. 2015; 36:685–704
DOI: 10.1002/oca
10991514, 2015, 5, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/oca.2152 by <shibboleth>[email protected], Wiley Online Library on [07/08/2024]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
CODE-GENERATED ACADO INTEGRATORS FOR FAST CONTROL 703
These ideas can be extended to support tailored, embedded algorithms for distributed as well as
robust formulations of optimal control. Such possible extensions as well as novel techniques for
efficient sensitivity propagation are among the topics of ongoing research.
ACKNOWLEDGEMENTS
The authors would like to thank all reviewers for their valuable comments, which helped to improve this
article. This research was supported by the following institutions: KUL: Optimization in Engineering Cen-
ter OPTEC (PFV/10/002), GOA/10/09 and GOA/10/11; Flemish Government: IOF/KP/SCORES4CHEM;
FWO: PhD/postdoc grants and projects: G.0320.08 and G.0377.09; IWT: PhD grants and projects: SBO
LeCoPro; Belgian Federal Science Policy Office: IUAP P7 (DYSCO, Dynamical systems, control and opti-
mization, 2012–2017); and the European Union’s Seventh Framework Programme: EMBOCON (248940),
SADCO (264735), TEMPO (607957), Eurostars SMART, and ERC HIGHWIND (259166). The first author
holds a PhD fellowship of the Research Foundation – Flanders (FWO).
REFERENCES
1. Nocedal J, Wright SJ. Numerical Optimization (2nd edn), Springer Series in Operations Research and Financial
Engineering. Springer: New York, 2006.
2. Wächter A, Biegler LT. On the implementation of a primal-dual interior point filter line search algorithm for large-
scale nonlinear programming. Mathematical Programming 2006; 106(1):25–57.
3. Diehl M, Ferreau HJ, Haverbeke N. In Nonlinear Model Predictive Control, volume 384 of Lecture Notes in Con-
trol and Information Sciences, Chapter Efficient Numerical Methods for Nonlinear MPC and Moving Horizon
Estimation. Springer: Berlin Heidelberg, 2009; 391–417.
4. Kirches C, Wirsching L, Sager S, Bock HG. Efficient numerics for nonlinear model predictive control. In Recent
Advances in Optimization and Its Applications in Engineering, Diehl M, Glineur FF, Michiels JW (eds). Springer:
Berlin Heidelberg, 2010; 339–357.
5. Diehl M, Bock HG, Schlöder JP. A real-time iteration scheme for nonlinear optimization in optimal feedback control.
SIAM Journal on Control and Optimization 2005; 43(5):1714–1736.
6. Domahidi A, Zgraggen A, Zeilinger MN, Morari M, Jones CN. Efficient interior point methods for multistage prob-
lems arising in receding horizon control. IEEE Conference on Decision and Control (CDC), Maui, HI, USA, 2012;
668–674.
7. Frasch JV, Sager S, Diehl M. A parallel quadratic programming method for dynamic optimization
problems. Mathematical Programming Computations 2013. Optimization online: http://www.optimization-
online.org/DB_HTML/2013/11/4114.html.
8. Andersson J. A general-purpose software framework for dynamic optimization. PhD Thesis, Arenberg Doctoral
School, KU Leuven, Department of Electrical Engineering (ESAT/SCD) and Optimization in Engineering Center,
Kasteelpark Arenberg 10, 3001-Heverlee, Belgium, 2013.
9. Frison G, Jorgensen J. A fast condensing method for solution of linear-quadratic control problems. Proceedings of
the 52nd IEEE Conference on Decision and Control, Florence, Italy, 2013; 7715–7720.
10. Ferreau HJ. An online active set strategy for fast solution of parametric quadratic programs with applications to
predictive engine control. Master’s Thesis, University of Heidelberg, Baden-Württemberg, Germany, 2006.
11. Vukov M, Domahidi A, Ferreau HJ, Morari M, Diehl M. Auto-generated algorithms for nonlinear model predic-
tive control on long and on short horizons. Proceedings of the 52nd Conference on Decision and Control (CDC),
Florence, Italy, 2013; 5113–5118.
12. Ferreau HJ, Kraus T, Vukov M, Saeys W, Diehl M. High-speed moving horizon estimation based on automatic code
generation. Proceedings of the 51th IEEE Conference on Decision and Control (CDC 2012), Maui, Hawaii, 2012;
687–692.
13. Houska B, Ferreau HJ, Diehl M. An auto-generated real-time iteration algorithm for nonlinear MPC in the
microsecond range. Automatica 2011; 47(10):2279–2285.
14. Vukov M, Van Loock W, Houska B, Ferreau HJ, Swevers J, Diehl M. Experimental validation of nonlinear MPC
on an overhead crane using automatic code generation. The 2012 American Control Conference, Montreal, Canada,
2012; 6264–6269.
15. Quirynen R, Vukov M, Diehl M. Auto generation of implicit integrators for embedded NMPC with microsecond
sampling times. In Proceedings of the 4th IFAC Nonlinear Model Predictive Control Conference, Noordwijkerhout,
Netherlands, 2012; 175–180.
16. Quirynen R. Automatic code generation of implicit Runge-Kutta integrators with continuous output for fast
embedded optimization. Master’s Thesis, University of Leuven, Belgium, KU Leuven, 2012.
17. Quirynen R, Gros S, Diehl M. Fast auto generated ACADO integrators and application to MHE with multi-rate
measurements. Proceedings of the European Control Conference, Zurich, Switzerland, 2013; 3077–3082.
18. Quirynen R, Gros S, Diehl M. Efficient NMPC for nonlinear models with linear subsystems. Proceedings of the 52nd
IEEE Conference on Decision and Control, Florence, Italy, 2013; 5101–5106.
Copyright © 2014 John Wiley & Sons, Ltd. Optim. Control Appl. Meth. 2015; 36:685–704
DOI: 10.1002/oca
10991514, 2015, 5, Downloaded from https://onlinelibrary.wiley.com/doi/10.1002/oca.2152 by <shibboleth>[email protected], Wiley Online Library on [07/08/2024]. See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions) on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License
704 R. QUIRYNEN ET AL.
19. Ohtsuka T, Kodama A. Automatic code generation system for nonlinear receding horizon control. Transactions of
the Society of Instrument and Control Engineers 2002; 38(7):617–623.
20. Mattingley J, Boyd S. Convex Optimization in Signal Processing and Communications, Chapter Automatic Code
Generation for Real-time Convex Optimization. Cambridge University Press, 2009.
21. Frasch JV, Gray AJ, Zanon M, Ferreau HJ, Sager S, Borrelli F, Diehl M. An auto-generated nonlinear MPC algo-
rithm for real-time obstacle avoidance of ground vehicles. Proceedings of the European Control Conference, Zurich,
Switzerland, 2013; 4136–4141.
22. Gros S, Zanon M, Vukov M, Diehl M. Nonlinear MPC and MHE for mechanical multi-body systems with appli-
cation to fast tethered airplanes. Proceedings of the 4th IFAC Nonlinear Model Predictive Control Conference,
Noordwijkerhout, The Netherlands, 2012; 86–93.
23. Debrouwere F, Vukov M, Quirynen R, Diehl M, Swevers J. Experimental validation of combined nonlinear optimal
control and estimation of an overhead crane. Proceedings of the 19th World Congress of the International Federation
of Automatic Control, Cape Town, South Africa, 2014; 9617–9622.
24. Geebelen K, Vukov M, Wagner A, Ahmad H, Zanon M, Gros S, Vandepitte D, Swevers J, Diehl M. An experimental
test setup for advanced estimation and control of an airborne wind energy systems. In Airborne Wind Energy, Ahrens
U, Diehl M, Schmehl R (eds). Springer: Berlin Heidelberg, 2013.
25. Kraus T, Ferreau HJ, Kayacan E, Ramon H, De Baerdemaeker J, Diehl M, Saeys W. Moving horizon estimation and
nonlinear model predictive control for autonomous agricultural vehicles. Computers and Electronics in Agriculture
2013; 98:25–33.
26. Bock HG, Plitt KJ. A multiple shooting algorithm for direct solution of optimal control problems. Proceedings 9th
IFAC World Congress Budapest, Budapest, Hungary, 1984; 242–247. Pergamon Press.
27. Sargent RWH, Sullivan GR. The development of an efficient optimal control package. In Proceedings of the 8th IFIP
Conference on Optimization Techniques (1977), Part 2, Stoer J (ed.). Springer: Heidelberg, 1978; 158–168.
28. Albersmeyer J, Diehl M. The lifted Newton method and its application in optimization. SIAM Journal on
Optimization 2010; 20(3):1655–1684.
29. Bock HG. Recent advances in parameter identification techniques for ODE. In Numerical Treatment of Inverse
Problems in Differential and Integral Equations, Deuflhard P, Hairer E (eds). Birkhäuser: Boston, 1983; 95–121.
30. Tran-Dinh Q, Savorgnan C, Diehl M. Adjoint-based predictor-corrector sequential convex programming for
parametric nonlinear optimization. SIAM Journal on Optimization 2012; 22(4):1258–1284.
31. Houska B, Ferreau HJ, Diehl M. ACADO toolkit – an open source framework for automatic control and dynamic
optimization. Optimal Control Applications and Methods 2011; 32(3):298–312.
32. Zanon M, Horn G, Gros S, Diehl M. Control of dual-airfoil airborne wind energy systems based on nonlinear MPC
and MHE. European Control Conference, Strasbourg, France, 2014; 1801–1806.
33. Papastavridis JG. Analytical Mechanics. Oxford University Press, Inc., 2002.
34. Hairer E, Nørsett SP, Wanner G. Solving Ordinary Differential Equations I (2nd edn), Springer Series in
Computational Mathematics. Springer: Berlin, 1993.
35. Hairer E, Wanner G. Solving Ordinary Differential Equations II – Stiff and Differential-algebraic Problems (2nd
edn). Springer: Berlin Heidelberg, 1991.
36. Griewank A, Walther A. Evaluating Derivatives (2nd edn). SIAM: Philadelphia, PA, 2008.
37. Albersmeyer J. Adjoint-based algorithms and numerical methods for sensitivity generation and optimization
of large scale dynamic systems. Ph.D. Thesis, Ruprecht-Karls-Universitität Heidelberg, Baden-Württemberg,
Germany, 2010.
38. Zanon M, Frasch J, Diehl M. Nonlinear moving horizon estimation for combined state and friction coefficient
estimation in autonomous driving. Proceedings of the European Control Conference, Zurich, Switzerland, 2013;
4130–4135.
39. Serban R, Hindmarsh AC. CVODES: the sensitivity-enabled ODE solver in SUNDIALS. Proceedings of IDETC/CIE
2005, Long Beach, California, USA, 2005; 257–269.
40. Enright WH, Jackson KR, Nørsett SP, Thomsen PG. Interpolants for Runge-Kutta formulas. ACM Transactions on
Mathematical Software 1986; 12:193–218.
41. Allgöwer F, Badgwell TA, Qin JS, Rawlings JB, Wright SJ. Nonlinear predictive control and moving horizon estima-
tion – an introductory overview. In Advances in Control, Highlights of ECC’99, Frank PM (ed.). Springer: London,
1999; 391–449.
42. Magni L, De Nicolao G, Magnani L, Scattolini R. A stabilizing model-based predictive control for nonlinear systems.
Automatica 2001; 37(9):1351–1362.
43. Nicolao GD, Magni L, Scattolini R. Stabilizing receding-horizon control of nonlinear time varying systems. IEEE
Transactions on Automatic Control 1998; AC-43(7):1030–1036.
44. Diehl M, Magni L, Nicolao GD. Efficient NMPC of unstable periodic systems using approximate infinite horizon
closed loop costing. Annual Reviews in Control 2004; 28(1):37 –45.
Copyright © 2014 John Wiley & Sons, Ltd. Optim. Control Appl. Meth. 2015; 36:685–704
DOI: 10.1002/oca