Fast Numerical Methods For Mixed-Integer Nonlinear Model-Predictive Control
Fast Numerical Methods For Mixed-Integer Nonlinear Model-Predictive Control
VIEWEG+TEUBNER RESEARCH
Bibliographic information published by the Deutsche Nationalbibliothek
The Deutsche Nationalbibliothek lists this publication in the Deutsche Nationalbibliografie;
detailed bibliographic data are available in the Internet at http://dnb.d-nb.de.
Registered and/or industrial names, trade names, trade descriptions etc. cited in this publica-
tion are part of the law for trade-mark protection and may not be used free in any form or by
any means even if this is not specifically marked.
ISBN 978-3-8348-1572-9
Acknowledgments
Sophie Mereau
This work was presented to the combined faculty for mathematics and
natural sciences of Heidelberg University as a doctoral thesis in mathemat-
ics on July 23rd , 2010, and was successfully defended on November 2nd .
My final lines go to my girlfriend Simone Evke. Thank you for your love,
for your patience and support whenever my mind was entangled in upper
and lower triangles, and for every plan for the future we made up together.
Christian Kirches
Abstract
This work aims at the investigation and development of fast numerical meth-
ods for nonlinear mixed–integer optimal control and model–predictive con-
trol problems. A new algorithm is developed based on the direct multiple
shooting method for optimal control and on the idea of real–time itera-
tions, and using a convex reformulation and relaxation of dynamics and
constraints of the original predictive control problem. This algorithm relies
on theoretical results and is based on a nonconvex Sequential Quadratic
Programming method and a new active set method for nonconvex paramet-
ric quadratic programming. It achieves real–time capable control feedback
though block structured linear algebra for which we develop new matrix
updates techniques. The applicability of the developed methods is demon-
strated on several applications.
This thesis presents novel results and advances over previously estab-
lished techniques in a number of areas as follows:
• We develop a new algorithm for mixed–integer nonlinear model–
predictive control. It consists of a combination of Bock’s direct multi-
ple shooting method, a reformulation based on partial outer convexifi-
cation and relaxation of the integer controls, a rounding scheme, and
a real–time iteration scheme.
• For this new algorithm we establish an interpretation in the frame-
work of inexact Newton–type methods and give a proof of local con-
tractivity assuming an upper bound on the sampling time, implying
nominal stability of this new algorithm.
• We propose a convexification of path constraints directly depending
on integer controls that guarantees feasibility after rounding, and in-
vestigate the properties of the obtained nonlinear programs. We show
that these programs can be treated favorably as Mathematical Pro-
gram with Vanishing Constraints, a young and challenging class of
nonconvex problems.
• We describe a Sequential Quadratic Programming method and de-
velop a new parametric active set method for the arising nonconvex
viii Abstract
0 Introduction 1
A Implementation 321
Contents xi
Bibliography 347
List of Figures
9.1 Objective function values and infeasibilities for problem (9.2). 240
9.2 Solutions for problem (9.3) limiting the number of switches. 245
9.3 Solutions for problem (9.3) penalizing the number of switches. 246
9.4 Objectives and infeasibilities for problem (9.6) after SUR-0.5. 252
9.5 Upper bounds on δt for example (9.6). . . . . . . . . . . . . . . 257
9.6 Variables of the robot path coordination NLP problem. . . . . 265
9.7 Solutions for the NLP formulation (9.10) obtained with IPOPT. 269
9.8 Solutions for problem (9.14) obtained with MuShROOM. . . . . . 272
9.9 Controls used in the single–track vehicle model. . . . . . . . . 275
9.10 Coordinates and states used in the single–track vehicle model. 276
9.11 Parameters used in the single–track vehicle model. . . . . . . 278
9.12 Optimal solutions of problem (9.33). . . . . . . . . . . . . . . . . 282
9.13 Properties of the uncondensed QPs for problem (9.33). . . . . 284
9.14 Properties of the condensed QPs for problem (9.33). . . . . . 285
9.15 Average per–iteration QP solver runtime for problem (9.33). 287
9.16 Controls of the truck model. . . . . . . . . . . . . . . . . . . . . . 291
9.17 Differential states of the truck model. . . . . . . . . . . . . . . . 292
9.18 Parameters of the truck model. . . . . . . . . . . . . . . . . . . . 294
Optimal Control
Model–Predictive Control
Linear MPC has over the past decades matured to widespread applicabil-
ity in a large number of industrial scenarios. See for example the reviews
[77], [171] and the overviews found in [7], [46], [177] and [217]. It is fre-
quently the case that nonlinear models, derived from first principles such
as fundamental physical, mechanical, or chemical laws, lead to more ac-
curate models of the actual process under consideration. Overviews over
Introduction 3
Mixed–Integer Programming
[16, 173, 174, 193] for problem formulations, numerical methods, and ap-
plications.
Switch Costs
The outer convexification and relaxation method [183] did not previously
consider path constraints directly depending on a binary or integer con-
trol function. We propose a new reformulation of point constraints and dis-
cretized path constraints directly depending on integer controls. This refor-
mulation guarantees feasibility after rounding of the relaxed optimal solu-
tion obtained for the discretized OCP. The properties of the obtained NLPs
are investigated for the first time, and explanations for frequently observed
ill–behavedness of SQP and Quadratic Program (QP) methods on these pro-
grams are given. We identify sources of lack of constraint qualification, ill–
conditioning, infeasible steps, and cycling of active set method. Addressing
these issues we show that the arising NLPs can instead be treated favorably
as Mathematical Programs with Vanishing Constraints (MPVCs), a young
and challenging class of nonconvex nonlinear problems that commonly arise
in truss optimization and only recently attracted increased research inter-
est on its own [3, 105, 109]. The connection to mixed–integer convexifica-
tion and relaxation approaches however is, to the best of our knowledge, a
Introduction 7
We develop and prove new block structured matrix update techniques for
the block structured factorization that reduce the run time complexity of all
but the first active set iteration by one order to O (mn2 ), making our method
attractive also for dynamic systems with more than a few differential states.
We stress the novelty of these update techniques for the case of block struc-
tured KKT matrices by quoting [158] who state that “In some areas of ap-
plication, the KKT matrix [...] contains special structure. For instance, the
QPs that arise in optimal control and MPC have banded matrices [...] When
active–set methods are applied to this problem, however, the advantages of
bandedness and sparsity are lost after just a few updates of the basis.” For
the case of KKT matrices with block diagonal Hessian and block bi–diagonal
constraints, we improve upon the described situation by providing basis up-
dates that fully maintain the block structure. Our techniques are based on a
combination of existing QR, Schur complement, and Cholesky updates and
generate no fill–in.
Software Package
Case Studies
of the resulting NLPs as MPVCs, the nonconvex SQP and active set QP al-
gorithms, and the block structured factorization with matrix updates, are
demonstrated at the example of several mixed–integer optimal control prob-
lems and – where possible – compared to existing algorithmic approaches.
haustive search algorithms of the dynamic programming type [42, 80, 103]
that do either require precomputation of the optimal solution or do not meet
the computational resource constraints.
In this thesis, this predictive cruise control problem is solved for the first
time under demanding real–time constraints. The resulting algorithms are
presently considered for application in an ongoing industrial cooperation.
Thesis Overview
This thesis is laid out in nine chapters and one appendix as follows.
In chapter 1 we introduce Optimal Control Problems (OCPs) for dynamic
processes described by systems of Ordinary Differential Equations (ODEs).
We survey numerical methods for the algorithmic solution of such prob-
lems, and settle on multiple shooting methods. We present in great detail
Bock’s direct multiple shooting method for optimal control, and give point-
ers to new developments in this thesis affecting various components of this
method.
Chapter 2 is concerned with Mixed–Integer Optimal Control Problems, a
class of optimal control problems with both continuous and discrete con-
trols. After a brief survey of possible algorithmic approaches towards solv-
ing problems of this class, we describe the outer convexification and relax-
ation approach. This approach allows to obtain a local solution of a Mixed–
Integer Optimal Control Problem (MIOCP) or an approximation thereof by
solving a single, continuous, but possibly larger OCP without observing ex-
ponential run time in practice. We present bounds on the quality of the
approximation of the optimal control and ODE state trajectories. An ex-
tension of the MIOCP problem class including the notion of switch costs
is presented. A Mixed–Integer Linear Program (MILP) formulation is devel-
oped that computes an integer feasible control trajectory satisfying a switch
cost constraint from a relaxed optimal but possibly fractional one. In order
to include the switch cost constraint in the OCP itself, a convexification of
this formulation is developed. It avoids attracting fractional solutions and
maintains separability, thus allowing for integration into the direct multiple
shooting method.
In chapter 3 we cover the theory of Nonlinear Programming (NLP) and
present Sequential Quadratic Programming (SQP) algorithms for the solu-
tion of the discretized, convexified, and relaxed MIOCP. Numerical methods
Introduction 11
for the solution of Initial Value Problems (IVPs) required to evaluate certain
direct multiple shooting NLP constraints and for derivative and sensitivity
generation are briefly presented.
Chapter 6 presents a new SQP method for MPVCs that carries the noncon-
vexity of the problem over to the local subproblems. A new parametric active
set strategy for the solution of a sequence of those local subproblems, which
are referred to as Quadratic Programs with Vanishing Constraints (QPVCs).
Strong MPVC stationarity conditions are used to derive active set exchange
rules that allow to find a strongly stationary point on the nonconvex feasi-
ble set of a QPVC. Even though QPVCs must be considered as nonconvex
problems, global optimality can be verified locally, and a heuristic is pre-
sented that exploits this knowledge to improve strongly stationary points
up to global optimality.
12 0 Introduction
In chapter 7 the focus is put on sparse and block structured linear al-
gebra for QPVCs with many control parameters due to outer convexifica-
tion of MIOCP constraints. We survey existing approaches for exploiting
the arising block structures and evaluate their applicability. We continue by
presenting a factorization of the QPVC’s KKT system that is tailored to the
case of many control parameters and is free of any fill–in, called the Hessian
Projection Schur Complement (HPSC) factorization in this thesis. It has a fa-
vorable runtime complexity for problems with long prediction horizons and
for MIOCPs reformulated by outer convexification. Properties, applicability,
and extensions of this factorization are investigated in detail, and the run
time and storage space requirements are examined.
Matrix update for factorizations are of vital importance for the efficiency
of any active set method. The rate at which QPVC solutions can be computed
effectively determines the control feedback delay of the mixed–integer
NMPC controller. Chapter 8 is concerned with detailed proofs of new matrix
updates for the HPSC factorization that reduce the runtime complexity in
terms of the number of unknowns by one order.
Chapter 9 presents numerical results for all new algorithms and makes
comparisons to existing methods at the example of several mixed–integer
optimal control and mixed–integer NMPC problems. In an extensive indus-
trial case study, a challenging mixed–integer nonlinear model predictive
control problem is solved under demanding real–time constraints. We show
that by using the developed numerical methods, this problem could even be
solved on an embedded system with limited computational resources.
This thesis is closed by appendix A, containing details on the implemen-
tation of the developed algorithms within the software packages MuShROOM
and qpHPSC.
Computing Environment
All computational results and run times presented in this thesis have
been obtained on a 64–bit Ubuntu© Linux™ 9.10 system powered by an
Intel© Core™ i7 920 CPU at 2.67 GHz, with 6 GB main memory available.
A single core of the available four physical cores of the CPU has been used.
All source code is written in ANSI C99 and compiled using version 4.4.1
of the GNU C/C++ compiler collection, with applicable machine–specific
optimization flags enabled.
1 The Direct Multiple Shooting Method for
Optimal Control
x
In definition 1.1 we have modeled a time dependent process x : T → n ,
def
t → x (t) on the time horizon T = [t 0 , t f ] ⊂ by a system of ODEs
This dynamic process can be affected by a control input u(t) at any time.
u def
We assume the function u : T → n to be measurable and define U = {u :
u
T → n | u measurable} to be the set of all such control functions. The
variable x (t) describes the system state of this process at any time t ∈ T ,
def x
and we define X = {x : T → n } to be the set of all state trajectories.
To ensure existence and uniqueness of the ODE system’s solution, we as-
x u x
sume f : T × n × n → n to be piecewise Lipschitz continuous. The
nx u c
constraint function c : T × × n → n restricts the set of admissi-
ble state and control trajectories x (·) and u(·). It may contain mixed path
and control constraints, restrict the set of initial values x (t 0 ), and contain
boundary conditions for the trajectories. Finally, the point constraint func-
x r
tion r : (n )m+1 → n imposes point–wise constraints on the states in a
finite number m + 1 of grid points {t i } ⊂ T , 0 i m that may be coupled
in time. Possible uses are the specification of boundary conditions such as
initial and terminal states or periodicity constraints. The presented Optimal
Control Problem (OCP) clearly is an infinite–dimensional optimization prob-
lem, the unknowns to be determined being the control trajectory u(·) and
the resulting state trajectory x (·) of the process.
The performance index ϕ(x (·), u(·)) evaluated on the time horizon T usually
is a general objective function that consists of an integral contribution, the
Lagrange type objective with integrand l (t, x (t), u(t)), and an end–point
contribution, the Mayer type objective m(t f , x (t f )),
tf
ϕ(x (·), u(·)) = l (t, x (t), u(t)) d t + m(t f , x (t f )). (1.3)
t0
Constraint Types
0 c(x (t i )), 0 i m.
0 c(x (t 0 ), . . . , x (t m ))
0 c(x (t 0 ), x (t f )),
0 = π0 (x (t 0 )) − πf (x (t f )),
wherein π0 and πf may e.g. contain permutations of the state vector’s com-
ponents. Both types of constraints can be reformulated as decoupled con-
straints e.g. by introducing an augmented state vector x̂ = [ x r ] holding
the constraint residuals,
f (t, x (t), u(t))
fˆ(t, x̂ (t), u(t)) = , (1.5)
0
rk (t k ) = ck (x (t k )).
16 1 The Direct Multiple Shooting Method
r (x (t f )) = x (t f ) − x steady = 0,
where x steady is the differential steady state of the process, help to guarantee
nominal stability [153]. Initial value constraints
x (t 0 ) = x 0
def def
t(τ) = t 0 + hτ, h = tf − t0. (1.7)
Global Parameters
p
A vector of model parameters p ∈ n describing global properties of the
dynamic process and its environment may enter the objective function, the
ODE system, and the constraints,
1.1 Problem Formulations 17
A(t, x (t), z(t), u(t), p) ẋ (t) = f (t, x (t), z(t), u(t), p), t ∈ T , (1.10)
0 = g (t, x (t), z(t), u(t), p), t ∈ T .
Here the left hand side matrix A(·) and the Jacobian g z (·) are assumed to be
regular. We may then regard the algebraic state trajectory z(·) as an implicit
function z(t) = g −1 (t, x (t), u(t), p) of the differential state and control tra-
jectories.
18 1 The Direct Multiple Shooting Method
We refer to [4, 5, 15, 61, 166] for the numerical solution of semi–implicit
index one DAE systems. In [133, 191] partial reduction techniques for the
algebraic states are presented in an SQP framework.
For the solution of optimal control problems of type (1.1) several different
methods have been developed. They differ in the choice of the optimization
space, the applied type of discretization, the precision of the obtained op-
timal solutions, the computational demand of the method that limits the
size of the problem instances that can be treated in a given amount of
time, and finally in the ease of implementation as a numerical code. We
mention indirect methods based on Pontryagin’s Maximum Principle, and
review dynamic programming, based on Bellman’s Principle of Optimality.
Direct methods are presented in greater detail, and we distinguish collo-
cation methods from shooting methods here. Finally, the direct multiple
shooting method is presented as a hybrid approach combining the advan-
tages of both direct methods. We go into more detail here, as all numerical
algorithms presented in this thesis are based on and focused on direct mul-
tiple shooting.
Put in brief words, Bellman’s principle states that any subarc of an opti-
mal solution is optimal. The converse is not true in general, i.e., the concate-
nation of optimal solutions on a partition of the interval T is not necessarily
an optimal solution on the whole interval T . We refer to [23] for an exten-
sive treatment of the applications of the Dynamic Programming approach to
20 1 The Direct Multiple Shooting Method
optimal control and only briefly describe the algorithm here. Based on the
principle of optimality, we define the cost–to–go function
Definition 1.2 (Continuous Cost–to–go Function)
On an interval [ t̂, t f ] ⊂ T ⊂ the cost–to–go function ϕ for problem (1.1) with a
Bolza type objective is defined as
tf
def
ϕ( t̂, x̂ ) = min
l(x (t), u(t)) d t + m(x (t f )) x ( t̂) = x̂ , x (·), u(·) feasible .
t̂
def
The recursion ends in k = m, t m = t f with ϕ(t m , x m ) = m(x m ).
Using this recursive definition, the optimal objective function values to-
gether with the values of the optimal state trajectory x (·) and control tra-
jectory u(·) can be computed in the grid points t k by backward recursion,
starting with k = m and proceeding to k = 0. The minimization problem
(1.12) has to be solved for each time interval [t k , t k+1 ] and for all feasi-
ble initial values x k . The resulting cost–to–go function value together with
the corresponding optimal control u k have to be tabulated in state space
for use in the next backward recursion step, which requires the choice of
discretizations for the sets of feasible values of x k and u k .
Dynamic Programming has been used in some Model Predictive Control
(MPC) applications, cf. [103, 42], and has the advantage of searching the
entire state space, thus finding a globally optimal solution. The technique
suffers from the “curse of dimensionality”, though, and delivers sufficiently
fast run times for tiny problem instances only. Control algorithms based
1.2 Solution Methods for Optimal Control Problems 21
def
v = s0 , q0 , q1 , . . . , q m−1
is obtained which can be solved using e.g. the SQP techniques presented
in chapter 3. Control and path constraints frequently are discretized and
enforced on the control discretization grid only, or may be included in the
objective using penalty terms.
The direct single shooting method suffers from a number of drawbacks.
As only the initial state and the control variables enter the NLP, initializa-
tion of the state trajectory using prior knowledge about the process is not
possible. Further, for a chosen initialization of x o and the controls u , the
22 1 The Direct Multiple Shooting Method
Figure 1.1: Illustration of the direct single shooting discretization applied to the op-
timal control problem.
IVP’s solution need not even exist, e.g. due to a singularity in time. Even if
it exists, it possibly cannot be computed numerically due to propagation of
errors over the course of the integration. Typically, to guarantee existence
of a numerical solution of highly nonlinear or unstable ODEs, an initial guess
of these variables is required that is already very close to the true optimal
solution. Such a guess may of course be hard to obtain. The convergence
speed of the NLP solver is effectively governed by the amount of nonlinear-
ity present in the ODE system, and single shooting methods cannot improve
upon this situation. Finally, even well–conditioned IVPs may induce unsta-
ble Boundary Value Problems (BVPs), and a small step in the initial value x 0
may result in a large step in the ODE’s solution x (·) or induce large viola-
tions of constraints. This behavior is a challenge for derivative–based NLP
methods.
Still, direct single shooting is often used in practice as the idea is easy to
grasp, the implementation is straightforward, and the resulting NLP has a
small number of unknowns only.
Collocation methods for BVPs go back to the works [182, 211] and one of
the first works on direct collocation for OCPs is [210]. Collocation methods
discretize both the states and the controls on a fine grid of m intervals with
k collocation points per interval. To this end, the ODE system
which can be solved with NLP methods such as sparse interior point meth-
ods or tailored Sequential Quadratic Programming methods. Refinements
and applications of direct collocation can be found in e.g. [10, 26, 101, 194,
206, 225].
In contrast to direct single shooting, collocation allows to initialize the
state trajectory variables, thereby allowing more a–priori knowledge about
the process and its optimal solution to enter the problem. Small violations of
the matching conditions over the course of the NLP solution help dampen
the spreading of perturbations. Although the resulting NLP is very large,
efficient solution methods exist, e.g. [215].
A drawback of collocation methods is the difficulty to include adaptivity
of the ODE or DAE solution process. This concept is of particular impor-
tance for the treatment of highly nonlinear or stiff systems, which require
small step sizes in a priori unknown regions of the time horizon, and thus
high values of m in the collocation approach. In addition, certain collocation
schemes may exhibit highly oscillatory behavior on singular arcs of the op-
timal control, cf. [112], which may degrade the NLP solver’s performance,
and which can be overcome by elaborate regularization approaches only.
Direct multiple shooting methods, to be presented in the next section, over-
come these limitations by making efficient use of state–of–the–art adaptive
ODE and DAE solvers, cf. [5, 4, 15, 61, 166], thereby decoupling state and
control discretization. Finally, the large–scale sparse NLP obtained from the
collocation discretization of the OCP is most efficiently solved by interior–
point methods that can easily apply sparse linear algebra, cf. [28, 215]. For
most model predictive control tasks, though, active set methods are pre-
ferred as detailed in chapter 4 due to their better warm starting abilities
[13, 138]. The sparsity patterns introduced by collocation however are not
easily exploited in active set methods.
24 1 The Direct Multiple Shooting Method
First descriptions of multiple shooting methods for the solution of BVPs can
be found in [29, 30, 31, 43, 162]. The direct multiple shooting method for
OCP goes back to the works of [36, 167]. Direct multiple shooting meth-
ods are hybrids of direct collocation and direct single shooting approaches,
as they discretize the state trajectory, but still rely on solving IVPs. They
typically have an advantage over direct collocation methods in that they
easily allow to use of highly efficient adaptive solvers for the IVPs, e.g.
[5, 4, 15, 61, 166]. Contrary to single shooting, the initialization of the state
trajectory variables is easily possible, also permitting infeasible initializa-
tions. Stability of both the IVP and the BVP solution process is improved. In
addition, computational experience shows that nonlinearity present in the
BVP is diminished, thus improving the speed of convergence [6].
The remainder of this chapter is exclusively concerned with the direct
multiple shooting method for optimal control, which serves as the founda-
tion for all algorithms to be presented in this thesis.
The direct multiple shooting method for optimal control has its origins in
the diploma thesis [167], supervised by Hans Georg Bock, and was first
published in [36]. Extensions can be found in e.g. [4, 34, 51, 133, 134, 191].
The direct multiple shooting code MUSCOD-II is described in detail in [132],
and the direct multiple shooting code MuShROOM developed as part of this
thesis is described in appendix A.
We consider the numerical solution of the following class of OCPs that
have been introduced in the previous sections together with various possi-
ble extensions:
tf
min m(t f , x (t f )) + l(t, x (t), u(t)) d t (1.15a)
x (·),u(·)
t0
q
bi j : [t i , t i+1 ] × ni j −→ , (t, qi j ) → qi j ,
q t i+1 − t t − ti
bi j : [t i , t i+1 ] × ni j −→ , (t, q i j ) → qi j 1 + qi j 2 ,
t i+1 − t i t i+1 − t i
4
k−1
q
ni j t − ti
bi j : [t i , t i+1 ] × −→ , (t, q i j ) → qi j k βk
k=1
t i+1 − t i
def
bm (t m , q m ) = bm−1 (t m , q m−1 ). (1.17)
For certain choices of the control discretization, e.g. for piecewise linear
controls, continuity of the discretized control trajectory may be desired. This
can be enforced by imposing additional control continuity conditions for the
trajectory u j (t) in all points of the control discretization grid {t i },
The choice of the control discretization obviously affects the quality of the
discretized OCP’s solution approximation that of the infinite–dimensional
one, see e.g. [122].
Here, the expression x i (t i+1 ; t i , si , q i ) denotes the final value x (t i+1 ) ob-
tained as the solution of the IVP (1.19) on the interval [t i , t i+1 ] when
starting in the initial value x (t i ) = si and applying the control trajectory
u(t) = bi (t, q i ) on [t i , t i+1 ]. The evaluation of the residual of constraint
(1.20) thus requires the solution of an IVP by an appropriate numerical
method, see [5, 4, 15, 61] and chapter 3.
Figure 1.2: Illustration of the direct multiple shooting discretization applied to the
optimal control problem. On the left, all shooting nodes were initialized
identically and the solution of the m IVPs violates the matching condi-
tions. On the right, the matching conditions are fulfilled after conver-
gence of the NLP solver.
More generally, the IVPs (1.19) together with the matching conditions
(1.20) may be replaced by a sufficiently smooth but otherwise arbitrarily
chosen mapping
q
The resulting vector of (m + 1)nx + mnq unknowns, assuming ni j to be
identical for all nodes and controls, is denoted by
def
v = s0 q0 . . . sm−1 q m−1 sm . (1.22)
28 1 The Direct Multiple Shooting Method
0 ci (t i , si , bi (t i , q i )), 0 i m. (1.23)
This discretization will in general enlarge the feasible set of the discretized
optimal control problem compared to that of the continuous one, and will
thus affect the obtained optimal solution. For most real–world problems, it
can be observed that an optimal trajectory (x (·), u (·)) obtained as solu-
tion of the discretized problem shows only negligible violations of the path
constraints c(·) in the interior of shooting intervals if those are enforced on
the shooting nodes. If significant violations are observed or strict feasibil-
ity on the whole of T is of importance, remaining violations can sometimes
be treated successfully by choosing an adapted, possibly finer shooting grid
{t i }. Alternatively, a semi–infinite programming algorithm for tracking of
constraint violations in the interior of shooting intervals is discussed in
[168, 169].
m
min l i (t i , si , q i ) (1.24)
s,q
i=0
s. t. 0 = x i (t i+1 ; t i , si , q i ) − si+1 , 0 i m − 1,
eq
0 = ri (t i , si , bi (t i , q i )), 0 i m,
0 ri (t i , si , bi (t i , q i )),
in
0 i m,
0 ci (t i , si , bi (t i , q i )), 0 i m.
nonconvex SQP method for a special class of NLPs obtained from the dis-
cretization of convexified MIOCPs. The quadratic subproblems arising in
this SQP method are studied and an active set algorithm for ttheir solution
is presented.
1.3.5 Separability
1.4 Summary
In this chapter we have defined a class of optimal control problems for dy-
namic processes modeled by systems of ODE or semi–implicit index one
DAE systems and have described various extensions of this problem class.
A survey of numerical approaches for the solution of problems of this class
considered direct and indirect as well as sequential and simultaneous ap-
proaches. We presented in more detail the direct multiple shooting method
for optimal control, a hybrid approach that can be located between sin-
gle shooting and collocation methods. It is known for its excellent conver-
gence properties, yields a highly structured NLP, but allows at the same
time the use of state–of–the–art adaptive solvers for the IVPs. The resulting
discretized OCPs are best treated by SQPs methods which will be investi-
gated from different points of view in several places in this thesis.
2 Mixed–Integer Optimal Control
tf
In addition to the conventions of definition 1.1, the dynamic process x (·) is affected
w
by an additional vector–valued control function w : T → Ω ⊂ n , t → w (t) which
def nΩ w
only attains values from a finite discrete set Ω = {ω , . . . , ω } ⊂ n with cardinality
1
|Ω| = nΩ < ∞.
This problem class differs from the class of OCPs treated in chapter 1 by
the integer feasibility requirement imposed on the additionally introduced
control function w : T → Ω. Here nw denotes the number of scalar integer
control functions, and nΩ denotes the finite number of discrete choices the
vector valued integer control trajectory w (·) can attain at each point in
time. For the discussion in this chapter, we restrict the problem class (2.1)
to binary control functions w (t) ∈ {0, 1}n , i.e., nΩ = 2n .
w w
w (·) then inherit the integrality property. This approach yields a Mixed–
Integer Nonlinear Program (MINLP) in place of the continuous NLP (1.24).
The multiple shooting discretization of this problem is given in the following
definition.
Definition 2.2 (Multiple Shooting Discretized MIOCP)
The multiple shooting discretized counterpart of the mixed–integer optimal control
problem (2.1) with binary control functions is
m
min l i (t i , si , q i , wi ) (2.3)
s,q,w
i=0
s. t. 0 = x i (t i+1 ; t i , si , bi (t i , q i ), wi ) − si+1 , 0 i m − 1,
eq
0 = ri (t i , si , bi (t i , q i ), wi ), 0 i m,
0 riin (t i , si , bi (t i , q i ), wi ), 0 i m,
0 ci (t i , si , bi (t i , q i ), wi ), 0 i m,
w
wi ∈ {0, 1}n , 0 i m.
min f (x , w ) (2.4)
x ,w
s. t. 0 = g (x , w ),
0 h(x , w ),
w
w ∈ {0, 1}n .
The class of MINLP problems is N P –hard [78]. Hence, there exist in-
stances of problem (2.4) than cannot be solved in polynomial runtime on a
deterministic machine. Moreover, this fact serves as a first indicator that
computing exact solutions to problems of practical interest in real–time is
likely to be a most challenging task. In this section we briefly mention var-
ious approaches targeted either at solving the MIOCP or the MINLPs to
optimality, or at approximating a local or global solution.
34 2 Mixed–Integer Optimal Control
Full Enumeration
Dynamic Programming
In practice, good heuristics for the choice of the next subproblem and the
selection of fractional variables to branch on are crucial to quickly obtain
feasible solutions and tight upper bounds. This avoids visits to all possible
subproblems, in which case Branch & Bound would degenerate to full enu-
meration again. Such heuristics frequently must be tailored to the specific
problem under investigation, and details can be found in e.g. [58, 140].
The first Branch & Bound algorithm for integer linear programming is
due to [49, 128]. Extensions to convex nonlinear mixed–integer problems
can e.g. be found in [19, 39, 135, 136].
In the linear case, the optimal solution is known to coincide with a vertex
of the convex hull of the feasible set. The algorithm then aims at adding
36 2 Mixed–Integer Optimal Control
Outer Approximation
The Outer Approximation method due to [59] was developed for convex
MINLPs explicitly. It aimed at avoiding the potentially large number of NLPs
to be solved in a branching method by replacing them with more accessi-
ble Mixed–Integer Linear Programs (MILPs), for which advanced techniques
and solvers have been readily available. To this end, an alternating sequence
of MILPs, called master problems, and NLPs is solved. Therein, the MILP
yields an integer solution and a lower bound to the original problem’s solu-
tion while the NLP with fixed integer variables yields — if feasible — yields
an upper bound and a new linearization point, improving the outer approx-
imation of the convex feasible set by linearizations of the constraints.
For applications of Outer Approximation to MIOCPs with time–indepen-
dent binary variables we refer to [93, 160].
2.2.5 Reformulations
The difficulty of the problem class (2.1) comes from the integer restrictions
on some of the control variables. The idea of replacing the integrality re-
quirement by adding one or more constraints to the continuous formulation
therefore is of obvious appeal. To this end, several propositions can be found
in the literature.
w i (1 − w i ) = 0, w i ∈ [0, 1] ⊂ .
The feasible sets coincide, and the reformulation thus is exact. As the first
constraint is nonconvex, the feasible set is disjoint, and Linear Indepen-
dence Constraint Qualification (LICQ) is violated, descent based methods
such as Sequential Quadratic Programming (SQP) show bad performance
on this reformulation. This situation can be ameliorated to a certain extent
by introducing the formulation
w i (1 − w i ) β, w i ∈ [0, 1] ⊂ ,
{(0, 1), (1, 0)} ⊂ 2 and homotopies for relaxation are applied here as well.
In [137] the Fischer–Burmeister function
F FB (w1 , w2 ) = w1 + w2 − w12 + w22
As we have seen, all presented methods require for the case of MIOCP the
solution of a potentially large number of discretized optimal control sub-
problems. In view of the fast solution times required for the computation
of the control feedback, such techniques are unlikely to be successful ap-
proaches for fast mixed–integer NMPC. We therefore continue our presenta-
tion with the introduction of a convexification and relaxation approach that
serves to obtain a good approximation of a local solution of the discretized
MIOCP by solving only a single but possibly larger discretized OCP.
Inner Convexification
A naïve idea for transforming problem (2.1) into a purely continuous NLP is
to simply drop the integrality requirement on the unknown w . This requires
that all model functions, comprising the objective function, the Ordinary
Differential Equation (ODE) system’s right hand side function, and all con-
straint functions can be evaluated in fractional points of the space of un-
knowns, and yield meaningful results that do not prevent optimal solutions
from being found. The locally optimal solution found for the NLP obtained
by the inner convexification approach will in general not be an integer one.
Guarantees for integer feasibility of a rounded solution in the neighborhood
of the locally optimal one can in general not be derived, nor can bounds
on the loss of optimality be given. This approach has been used for mixed–
integer optimal control in e.g. [80] in combination with a branching algo-
rithm to overcome the mentioned problems.
Outer Convexification
10 10
5 5
0 0
-2 0 2 -2 0 2
(a) Inner convexification of f (x, w). (b) Outer convexification of f (x, w).
The results of this section were first presented in [183] and apply to
the infinite–dimensional MIOCP prior to any discretization taking place. We
present bounds on the objective function and the constraint residuals of
the optimal solutions obtained when applying the outer convexification ap-
proach to the MIOCP. We also state the bang–bang principle which allows
to deduce binary feasibility and optimality of relaxed solutions for certain
linear optimal control problems.
w (t).
42 2 Mixed–Integer Optimal Control
Clearly due to the relaxation that equals the inner convexification approach
described above, the right hand side function f (·) will be evaluated in non–
integer choices for the relaxed binary control w (t).
x (t 0 ) = x 0 ,
nw
ω(t) ∈ {0, 1}2 , t ∈T,
w
2n
1= ωi (t), t ∈T. (2.5)
i=1
Here the constant parameters ωi indicate evaluation of the right hand side
f (·) in the admissible choice w (t) = ωi . The Special Ordered Set (SOS)
type 1 property holds for the trajectory of convex multipliers ω(·) and is
enforced by the additionally imposed constraint (2.5).
n
ωi = 1, ωi ∈ {0, 1}, 1 i n. (SOS1)
i=1
x (t 0 ) = x 0 ,
nw
α(t) ∈ [0, 1]2 , t ∈T,
w
2n
1= αi (t), t ∈T.
i=1
(BN) (BC)
convexification
relaxation relaxation
(RN) (RC)
The same is obviously true for the relaxed counterpart function α(·). In mixed–
integer linear programming, this elimination is usually avoided as it destroys to a
certain extent the sparsity structure present in the constraints matrices. For the di-
rect multiple shooting discretization, this elimination has shown itself to be of advan-
tage for some MIOCPs. Sparsity of the node constraint Jacobians is usually not ex-
ploited and the number of active set iterations spent in the Quadratic Program (QP)
subproblem solution tends to become smaller.
u
is referred to as a linear control problem. The function u : T → n , t → u(t) shall
be measurable and satisfy lower and upper bounds u lo and u up . The matrix functions
x x x u
A : T → n ×n , B : T → n ×n shall be continuous.
We require the definition of the controllable set, and define further two
classes U meas and U bb of control functions as follows.
Definition 2.10 (Controllable Set)
x
The controllable set at time t ∈ T is the set of all points x 0 ∈ n that can be steered
back to the origin x (t) = 0 in time t by control functions from a given set U ,
C (U , t) = x 0 ∈ n ∃u(·) ∈ U : x (t; x 0 , u(·)) = 0
def x
(2.8)
The controllable set is defined to be the union of all controllable sets at time t ,
def
C (U ) = C (U , t) (2.9)
t>0
reformulation, cf. [122, 183, 184, 185, 187] for applications. On a given dis-
cretization grid, this holds for the discretized OCP’s solution except in the
neighborhood of switching points of the convex multiplier trajectories α(·).
If those do not fall onto grid points of the control discreization grid, frac-
tional solutions may be obtained on the corresponding shooting interval, cf.
[122, 183].
Remark 2.5 (Bang–Bang Optimal Problems and Active Set Methods)
Exploiting the bang–bang property also in the numerical methods used to solve the
convexified and relaxed NLP is crucial to achieve maximum computational efficiency.
Controls that enter linearly should be removed from a major part of the involved
linear algebra by suitable active set methods as soon as they attain one of the two
extremal values. We revisit this question in chapter 7.
For nonlinear or nonconvex problems, the bang–bang principle 2.1 does not
hold, and the relaxed solution will in general not be binary feasible. In this
setion, bounds on the objective function gap and the constraint residual gap
are presented that correlate the auxiliary problems to each other.
Theorem 2.2 (Objective functions of (BN) and (BC))
The binary nonlinear problem (BN) has an optimal solution (x , u , w ) if and only
if the binary convexified problem (BC) has an optimal solution (x , u , ω ). Their
objective function values ϕ BN and ϕ BC are identical.
Theorem 2.2 holds for the pair of binary problems only and is in general
not true for the pair of relaxed problems. This is evident as the feasible set
of (RN) will in general be larger than that of (RC) as could already be seen
in example 2.1. We can however relate the solutions of (BC) and (RC) to
each other, which shows the advantage of the convexified formulation (RC)
over the nonlinear formulation (RN).
Theorem 2.3 (Objective functions of (BC) and (RC))
Let (x , u , α ) be an optimal solution of the relaxed convexified problem (RC) with
objective function value ϕ RC . Then for every
> 0 there exists a binary feasible con-
trol function ω
and a state trajectory x
such that (x
, u , ω
) is a feasible solution
of (BC) with objective function value ϕ
BC and it holds that ϕ
BC ϕ RC +
.
ϕ RN ϕ RC ϕ
BC = ϕ
BN ϕ RC +
.
The four auxiliary problems formulation in section 2.3.1 depart from the
more general class of MIOCPs in a single but critical way: We have so far
assumed that no path constraints are present.
If the binary control function w (·) enters the path constraints c(·) explicitly,
the picture is different. The bang–bang control ω(·) may lead to violations
of the path constraints that could be satisfied by the relaxed trajectory α(·)
and moreover, the original problem may not even have a binary feasible
solution as the following example due to [183, 186] shows.
Example 2.2 (Path constraints depending on a binary control function)
Consider for problem (BN) the one–dimensional control constraint
1 − 10−n − w(t)
0 c(w (t)) = , n 1.
w(t) − 10−n
These constraints exclude all binary feasible solutions for w(·), while the relaxed
problem (RC) may still have a feasible solution in the interior of T × [0, 1].
In this variant a feasible solution does not exist even for the convexified and
relaxed problem (RC), which immediately allows to verify infeasibility of the
original problem (BN). This reformulation however has a number of implica-
tions for the NLPs obtained from transferring (2.3) into its convexified and
relaxed counterpart problem. Chapters 5 and 6 are dedicated to this issue.
w
{0, 1}n for t ∈ [t i , t i+1 ] on the grid {t i }, 0 i m is defined by
t i+1
def 1 if αj (t) dt 12 ,
pi, j = ti 1 j nw . (2.13)
0 otherwise.
w
{0, 1}n for t ∈ [t i , t i+1 ] on the grid {t i }, 0 i m obtained by applying strategy
SUR–0.5 is defined by
t i+1 i−1
def 1 if t αj (t) dt − k=0 pk, j 12 ,
pi, j = 0 1 j nw . (2.14)
0 otherwise.
Direct rounding is immediately obvious, but does not exploit the fact that
the p j belong to a control trajectory in time. Figure 2.3 illustrates the idea
of sum–up rounding which strives to minimize the deviation of the control
integrals at any point t on the time horizon T ,
t
ω(τ) − α(τ) dτ .
t
0
50 2 Mixed–Integer Optimal Control
For control affine systems, the deviation of the state trajectory after
rounding x (t; x 0 , ω(·)) from the relaxed optimal one x (t; x 0 , α(·)) can be
bounded using the following important result based on theorem 2.5 and
Gronwall’s lemma.
Theorem 2.6 (Sum–up Rounding of the State Trajectory)
def
Let two initial value problems be given on the time horizon T = [t 0 , t f ],
x
and assume that A(·, x (·)) is essentially bounded on T × n by a constant M ∈ + .
Assume further that there exists a constant
> 0 such that it holds for all t ∈ T that
t
ω(s) − α(s) ds
.
0
2.4 Rounding Strategies 51
w
pi ∈ {0, 1}n for t ∈ [t i , t i+1 ] ⊂ T on the grid {t i }, 0 i m is defined for 1 j nw
by
⎧ t i+1 t i+1
1 if (∀k : α̃i j (t) dt t α̃ik (t) dt)
def
⎨ tti+1
i t i+1
i
pi, j = ∧ (∀k, αi j (t) dt = t α̃ik (t) dt : j < k), (2.18)
⎩ ti i
0 otherwise.
This rounding strategy chooses for each shooting interval the largest re-
laxed optimal choice q̃i, j amongst all choices 1 j nw . If the index j of the
largest choice is not unique, smaller indices are arbitrarily preferred. The
equivalent for sum–up rounding is given in the following definition.
Definition 2.16 (SOS1–SUR Rounding)
Let α (·) be the solution of (RC). Let further control differences p̂i j for the j -th step
of sum–up rounding be defined as
ti
i−1
αj (t) dt −
def
p̂i, j = pk, j . (2.19)
t0 k=0
def
Then the sum–up rounding solution ω(t) = pi for t ∈ [t i , t i+1 ] ⊂ T on the grid {t i },
0 i m obtained by applying strategy SOS1–SUR–0.5 is defined for 1 j nw by
def 1 if (∀k : p̂i, j p̂i,k ) ∧ (∀k, p̂i, j = p̂i,k : j < k),
pi, j = (2.20)
0 otherwise.
52 2 Mixed–Integer Optimal Control
The following variant of theorem 2.5 holds for the control approximation
obtained from application of the SOS1–SUR–0.5 rounding scheme to the
relaxed optimal control trajectory.
Theorem 2.7 (SOS1–SUR–0.5 Approximation of the Control Integral)
w
Let α(t) : T × [0, 1]n be a measurable function. Define on a given approximation
def w
grid {t i }, 0 i m, a binary control trajectory ω(t) = pi ∈ {0, 1}n for t ∈ [t i , t i+1 ]
by
def 1 if (∀k : p̂i, j p̂i,k ) ∧ (∀k, p̂i, j = p̂i,k : j < k),
pi, j = (2.21)
0 otherwise.
1 1 0.5
Integral gap
q̃ (t i )
q(t i )
0.5 0.5 0
0 0 -0.5
20 40 20 40 20 40
Index i Index i Index i
Figure 2.3: Sum–up rounding minimizes the deviation of the control integrals. On
this equidistant grid, the integral gap never exceeds one half.
In this section we are concerned with the introduction of switch costs into
the problem class (2.1) in order to avoid solutions that show frequent switch-
ing of the binary control trajectory.
The first example of an optimal control problem with a solution that shows
Zeno’s phenomenon was given in [76]. Chattering of an integer control may
54 2 Mixed–Integer Optimal Control
be undesirable from a point of view of the process under control, and the
inclusion of switch costs in the MIOCPs then becomes a modeling issue. For
example, the change of a discrete decisions might take some process time to
complete, incur some operational cost that is to be kept as low as possible,
or may be discouraged due to mechanical wear–off in the physical device
realizing the switch, e.g. in a valve or a gearbox [42, 103]. Closely related is
the problem of seeking for sparse controls that switch only a limited number
of times and remain on the lower bound for most of the time, e.g. when
optimizing the application of drugs over time during medical treatment [63].
We summarize under the term switch costs three different but related
settings. First, the number of switches permitted on the time horizon may
be bounded from above by a number smaller than the number m of avail-
able control discretization intervals. Second, it may be desirable to penal-
ize the occurrence of a switch by a positive contribution to the problem’s
objective, striving for a pareto–optimal solution that constitutes a compro-
mise between maximum performance and minimum operation of the switch.
Third, operating a switch may trigger fast transients in the dynamic process
states. One possible way of representing these transients is by approxima-
tion using state discontinuities. For the case of implicitly defined, i.e., state
dependent switches this is discussed e.g. in [156, 40, 118]. For the case
of externally operated switches, i.e., here discretized time–varying control
functions with a finite number of admissible values, such state jumps occur
in the discretization points.
It is immediately evident that any inclusion of positive costs of switches of
a binary or integer control, either by penalization of the number of switches
in the objective function or by limiting the number of switches through an
additionally imposed constraint, prevents Zeno’s phenomenon from occur-
ring as the resulting solution would show infinite cost in the first case and
be infeasible in the second case.
solution. For fine discretizations, the inclusion of switch costs may have a
significant impact on the shape of optimal solutions.
that computes a binary feasible solution ω(·) from a relaxed optimal one
α (·) subject to givens limits σ j > 0, 1 j nw for the number σ j of
switches of the binary control trajectory ω j (·) after rounding. Here q i ∈
Ω
[0, 1]n , 0 i m − 1 denote the control parameters of a relaxed optimal
Ω
solution of a direct discretization of (BC), and let pi ∈ {0, 1}n denote the
rounded solution respecting switch costs.
The relaxed solution serves as an excellent initial guess that is very cheap
to obtain. A combinatorial Branch & Bound algorithm is developed for this
problem in [190] that exploits this information to gain significant computa-
tional speed–ups.
In view of the inherent complexity of this MILP and the fast computa-
tion times required for mixed–integer NMPC we focus in the following on
an approximate switch cost formulation that can be readily included in the
convexified and relaxed OCP.
In this section we develop a switch cost formulation that is suitable for inclu-
sion into the convexified relaxed problem (RC) and fits into a direct multiple
shooting discretization. The key issues here are maintaining differentiability
and separability of the problem formulation.
56 2 Mixed–Integer Optimal Control
def
ω(t) = q i ∈ Ω t ∈ [t i , t i+1 ), 0 i m − 1, (2.25)
is assumed for the binary convexified control trajectory ω(·), and we remind
def
the reader of the convenience definition ω(t m ) = q m = q m−1 . The addition-
ally introduced variable σ counts the number of changes in each component
of the discretized binary control trajectory ω(·) over time. The number of
switches may be constrained by an upper limit σmax or included in the ob-
jective function using a weighting penalization factor π. We further denote
by (RCS) the relaxed counterpart problem of (BCS) which only differs in
Ω
q i ∈ [0, 1]n , 0 i m − 1. (RCS)
nΩ
m nΩ
min l i (t i , si , ω ) qi j +
j
πjσj (BCS)
s,q
i=0 j=1 j=1
nΩ
s. t. 0= x i (t i+1 ; t i , si , ω j ) qi j − si+1 , 0 i m − 1,
j=1
s0 = x 0 ,
Ω
q i ∈ {0, 1}n , 0 i m − 1,
nΩ
1= qi j , 0 i m − 1,
j=1
m−1
σj = q − qi, j , 1 j nΩ ,
i+1, j
i=0
σ j σ j,max , 1 j nΩ .
2.5.4 Reformulations
and we present two reformulations that overcome this. Second, the behav-
ior of (RCS) after relaxation of the binary requirement is studied. Finally,
the above formulation obviously comprises a coupled constraint connect-
ing control parameters from adjacent shooting intervals. This impairs the
separability property of the NLP’s Lagrangian and we present a separable
reformulation in order to maintain computational efficiency.
Differentiable Reformulation
m−1
1
σk = 2
δi, j , (2.26)
i=0
Here, positivity of the slacks δi, j is ensured by the two additionally in-
troduced constraints. This moves the nondifferentiability to the active set
method solving the NLP. At least one of the two constraints on the positive
differences δi, j will be active at any time.
After relaxation of the convex multipliers qi, j emerging from the outer
convexification approach, the above differential reformulation has the draw-
back of attracting fractional solutions. As an example, the relaxed optimal
1
solution qi j = for all intervals 0 i m − 1 and j = 1, 2 should be rec-
2
ognized as a “switching” solution, as the sum–up rounding strategy would
yield a rounded control alternating between zero and one. The differences of
adjacent relaxed optimal control parameters are zero however, which yields
σ = 0.
58 2 Mixed–Integer Optimal Control
Convex Reformulation
def
σi, j = αi, j (qi, j + qi+1, j ) + βi, j (2 − qi, j − qi+1, j ), αi, j + βi, j = 1, (2.27)
in which αi, j and βi, j are binary convex multipliers introduced as additional
degrees of freedom into the optimization problem. Note that the SOS1 con-
straint can again be used to eliminate the multiplier βi, j ,
Under minimization of the switch cost, this expression yields the solutions
listed in table 2.1a. Figure 2.4a depicts the evaluation points and values.
For the relaxed problem (RCS), this convex reformulation ensures that
fractional solutions are assigned a nonzero cost, in particular any fractional
solution is more expensive than the nonswitching binary ones, and that the
switching binary solutions are assigned the highest cost. Table 2.1b shows
the switch costs under minimization for fractional values of the relaxed con-
trol parameters. The convexification envelope is depicted in figure 2.4b.
1 1
σi, j σi, j
0 0
1 1 1 1
w̃ i, j w̃ i+1, j w̃ i, j w̃ i+1, j
0 0
(a) Switch costs for binary controls. (b) Switch costs for relaxed controls.
Figure 2.4: Convex reformulation of the switch cost constraint for two binary con-
trols adjacent in the time discretization.
1 1
qi, j qi+1, j αi, j βi, j σ
2 i, j
qi, j + qi+1, j αi, j βi, j σ
2 i, j
0 0 1 0 0 <1 1 0 <1
0 1 free free 1 =1 free free 1
1 0 free free 1 >1 0 1 <1
1 1 0 1 0
(a) Switch costs for binary controls. (b) Switch costs for relaxed controls.
Table 2.1: Binary and relaxed optimal solutions for the convex switch cost reformu-
lation.
Separability of the objective function and all constraint functions with re-
spect to the discretization in time is a crucial property of the direct multiple
shooting discretization. It introduces a block structure into the discretized
OCP that can be exploited very efficiently as detailed in chapter 7. The only
coupling between adjacent shooting intervals allowed so far has been the
consistency condition imposed on the IVP solutions in the shooting nodes.
This matching condition deviates from the classical direct multiple shooting
method [36, 167] in that it depends on the control parameter vector of the
subsequent shooting interval. In chapter 7 we investigate structured linear
algebra techniques for SQP subproblems with many control parameters that
support this generalized type of matching condition. The separable linear
reformulation reads
m−1 nΩ
1
σ= 2
δi j , δi di −δi , 0 i m − 1. (2.30)
i=0 j=1
2.6 Summary
In this section we prepare our investigation of SQP methods for the solu-
tion of the discretized optimal control problem by repeating definitions of a
number of terms commonly arising in constrained nonlinear programming
for further reference. We give an overview over major results characterizing
optimal solutions of NLPs. These can be found in any standard textbook on
nonlinear programming, e.g. [24, 72, 158].
3.1.1 Definitions
min f (x ) (3.1)
x ∈n
s. t. g (x ) = 0,
h(x ) 0,
g
with objective function f : n → , equality constraints g : n → n , and inequality
h
constraints h : n → n is called a Nonlinear Program.
g (x ) = 0,
h(x ) 0.
min f (x ).
x ∈F
For any point of the feasible set, the active set denotes the subset of inequal-
ity constraints that are satisfied to equality.
The restriction of the inequality constraint function h onto the active in-
equality constraints is denoted by hA : n → |A| , x → hA (x ).
Constraint Qualifications (CQs) ensure a certain well–behavedness of the
feasible set in a neighborhood of a feasible point x ∈ F . We often require
the set of active constraints to be linear independent.
Definition 3.4 (Linear Independence Constraint Qualification, Regular Point)
We say that Linear Independence Constraint Qualification (LICQ) holds for problem
(3.1) in x ∈ n if it holds that
g x (x )
rank = ng + nhA . (3.4)
hA x (x )
∀x ∈ B
(x ) ∩ F : f (x ) f (x ).
∀x ∈ B
(x ) ∩ F , x = x : f (x ) > f (x )
def
L(x , λ, μ) = f (x ) − λ T g (x ) − μ T h(x ) (3.5)
64 3 Constrained Nonlinear Programming
g h
with Lagrange multipliers λ ∈ n and μ ∈ n is called the Lagrangian (function)
of problem (3.1).
0 = L x (x , λ , μ ),
0 = g (x ),
0 h(x ),
0 μ ,
0 = μ h(x ).
T
Proof Proofs under LICQ can be found in any standard textbook on nonlin-
ear programming, such as [72, 158].
For a given point KKT point x there may be many choices of λ and μ
that satisfy the KKT condition of theorem 3.1. Under LICQ and strict com-
plementarity, uniqueness of the Lagrange multipliers in a KKT point can be
shown. For the design of most derivative based algorithms for constrained
nonlinear optimization, LICQ thus is the CQ assumed most often.
Proof For the equality constraints and the subset of active inequality con-
straints, this is evident from linear independence of the gradients g x (x )
and (hA ) x (x ). For the inactive inequality constraints, μi = 0 for i ∈
/ A(x )
is enforced by strict complementarity.
A necessary and a sufficient condition for local optimality that both use
second order derivative information are given in this section. We require
the definition of the reduced or null–space Hessian.
def
H red (x , λ, μ) = Z T (x ) L x x (x , λ, μ) Z(x ), (3.6)
3.1.4 Stability
We are concerned with the stability of a KKT point under small perturba-
tions of the problem data in (3.1). Under strict complementarity, the active
set can be shown to remain invariant for small perturbations of the solution.
To this end we consider the perturbed problem
min f (x ,
) (3.7)
x ∈n
s. t. g (x ,
) = 0,
h(x ,
) 0
In this section we introduce two SQP methods, the full–step exact Hessian
SQP method and the constrained Gauß–Newton method, and mention their
3.2 Sequential Quadratic Programming 67
local convergence properties. They may be used to solve OCPs of the class
(1.1) after a direct multiple shooting discretization.
SQP methods are iterative descent–based methods for finding a KKT point
of problem (3.1) by computing a sequence of iterates {(x k , λk , μk )} starting
in an initial guess (x 0 , λ0 , μ0 ). The steps are found from the minimization of
local quadratic models of the Lagrangian function on a linearization of the
feasible set in the most recent iterate.
Definition 3.10 (Local Quadratic Subproblem)
x g h
The local quadratic subproblem in (x k , λk , μk ) ∈ n × n × n for problem (3.1) is
given by
1 T T
min 2
δx k B k δx k + δx k b k (3.8)
δx k ∈D k
s. t. g (x k ) + g x (x k )δx k = 0,
h(x k ) + h x (x k )δx k 0.
The solution δx k of (3.8) is used as a step direction to obtain the next iterate
x k+1 ,
def
x k+1 = x k + αk δx k . (3.9)
solution of (3.8) are the new SQP dual iterates after a full step αk = 1, thus
we have
def
λk+1 = (1 − αk )λk + αk λ̂k , (3.10)
def
μk+1 = (1 − αk )μk + αk μ̂k .
For a proof we refer to e.g. [132]. The sequence of SQP iterates can be
shown to converge to a KKT point of (3.1) under certain conditions as de-
tailed below. In practice, it is terminated once a prescribed convergence
criterion is satisfied.
The full step exact Hessian SQP method is named for its choice
B k = L x x (x k , λk , μk ), (3.11)
k
D = , n
αk = 1
For equality constrained problems, this can be seen from the KKT conditions
of the local quadratic subproblem (3.8),
T
B k δx k + b k − λ̂k g x (x k ) = 0, (3.12)
k k
g (x ) + g x (x )δx = 0. k
T
B k δx k + L x (x k , λk , μk ) − δλk g x (x k ) = 0, (3.13)
k k k
g (x ) + g x (x )δx = 0.
This is the Newton–Raphson iteration for (δx k , δλk ) on the KKT system of
(3.8),
L x (x k , λk , μk ) d L x (x k , λk , μk ) δx k
+ = 0. (3.14)
g (x k ) d(x , λ) g (x k ) δλk
The local convergence rate of the full step exact Hessian SQP method in the
neighborhood of a KKT point thus is quadratic. Good initial guesses for x 0
are required, though. The following theorem shows that such guesses are
not required for the Lagrange multipliers λ0 .
Theorem 3.7 (Convergence of the full step exact Hessian SQP Method)
Let (x , λ ) satisfy theorem 3.4. Let (x 0 , λ0 ) be chosen such that x 0 is sufficiently
close to x and that the KKT matrix of (3.8) is regular. Then the sequence of iter-
ates generated by the full step exact Hessian SQP method shows local q–quadratic
convergence to (x , λ ).
nr
f (x ) = 1
2
||r (x )||22 = 1
2
ri2 (x ), (3.15)
i=1
x r
where r : n → n , x → r (x ) is a vector valued residual function. The
gradient f x is
nr
f x (x ) = ri (x )ri x (x ) = r xT (x )r (x ), (3.16)
i=1
nr
f x x (x ) = ri Tx (x )ri x (x ) + ri (x )ri x x (x ) (3.17)
i=1
nr
= r xT (x )r x (x ) + ri (x )ri x x (x ).
i=1
The first part of the Hessian f x x can be calculated only from gradient infor-
mation and in addition often dominates the second order contribution in the
case of small residuals r (x ) or because the model is almost linear close to
the solution. This gives rise to the approximation
def
BGN (x ) = r xT (x )r x (x ) (3.18)
T T T
k+1 def B k δx k δx k B k δ f xk δ f xk
B =B − k
T
+ T
(3.19)
δx k B k δx k δ f xk δx k
For larger dimensions nx , and thus larger and possibly dense Hessian ap-
proximations B k , the limited memory variant L-BFGS of this approximation
is attractive. Instead of storing the matrix B k , a limited number l of his-
torical vector pairs (δx i , δ f xi ), k − l + 1 i k, is stored from which the
approximation B k is rebuilt. In each SQP iteration the oldest vector pair is
replaced by the current step and gradient step. While B k could in principle
be computed by repeated application of (3.19), this requires O (l 2 nx ) mul-
tiplications and we refer to e.g. [158] for compact representations of the
L-BFGS update that reduce the computational effort to only O (lnx ) multipli-
cations.
This approximation scheme has also proved itself successful for ill–
conditioned problems and for initial guesses far away from the optimal so-
lution, in which case outdated secant information unrelated to the locally
optimal solution would accumulate in a conventional BFGS approximation.
It is of vital importance to note that the rank two update (3.19) can be
applied independently to each Hessian block Bik , 0 i m of the direct
multiple shooting system. This leads to a rank 2m update for the NLP that
significantly improves the convergence speed of the SQP method as first
noted in [36].
72 3 Constrained Nonlinear Programming
def % &
N = (y1 , y2 ) ∈ D × D | y2 = y1 − M(y1 )r (y1 ) . (3.21)
def
With this, we define with δ y k = −M(y k )r (y k ) the constant
def
δk = κ + ω δ y k (3.24)
2
3.2 Sequential Quadratic Programming 73
We are now prepared to state a local contraction theorem for the se-
quence {y k } of SQP iterates.
Theorem 3.8 (Local Contraction Theorem)
Let M satisfy the ω– and κ–conditions and let y 0 ∈ D . If δ0 < 1 and D 0 (y 0 ) ⊂ D ,
then y k ∈ D 0 (y 0 ) and {y k } → y ∈ D 0 (y 0 ) with convergence rate
δ y k+1 δ k δ y k = κ δ y k + ω δ y k 2 . (3.26)
2
j
δk k+ j
δ0
y k+ j − y δ y k δ y 0 . (3.27)
1−δ k 1−δ0
In algorithm 3.1 we have left open the issue of finding a suitable termination
criterion. Certainly, due to approximation errors in the derivatives and due
to finite precision and conditioning issues we will in general be able to iden-
tify a primal–dual point (x k , λk , μk ) that is satisfies the optimality conditions
only to a certain prescribed tolerance. In [133] it has been proposed to use
the KKT tolerance
g g
n n
kkttol(x , λ, μ) = f x (x , λ, μ T δx ) +
def
|λi g i (x )| + |μi hi (x )|.
i=1 i=1
(3.28)
3.2.7 Scaling
The step direction, step length, and the termination criterion are susceptible
to scaling of the unknowns and of the objective function and the constraints
functions. Most NLP algorithm therefore either determine appropriate scale
factors automatically, or provide a means for the user to specify suitable
x g h
positive scale factors σx ∈ n , σf ∈ , σg ∈ n , σh ∈ n . The equivalent
NLP
s. t. σg,i g̃ i (Σx x ) = 0, 1 i ng ,
σh,i h̃i (Σx x ) 0, 1 i nh ,
is then solved in place of the original one (3.1). Here Σx = diag σx and f˜(·),
g̃(·), and h̃(·) are appropriately rescaled counterparts of the original prob-
lem functions. In order to avoid rounding and cutoff errors to be introduced
due to limited machine precision, the scale factors should be chosen as pos-
itive powers of two which can be represented exactly and allow for fast and
lossless multiplication and division.
a symbolic expression for the desired derivative. While this process can eas-
ily be carried out manually, it is cumbersome for larger model functions and
has been automated in computer algebra systems like Maple V [150] and
Mathematica [222]. These tools also readily provide facilities to translate
the symbolic derivative expression into e.g. Fortran or C source code.
'
n
f (x 1 , . . . , x n ) = xi
i=1
due to [200]. Here, the gradient’s entries ( f x )i consist of all partial products
that omit one factor x i , while the Hessian’s entries ( f x x )i j are the partial
products that omit any two factors x i , x j . The efficient reuse of common
subexpressions is up to the compiler that translates the possibly inefficient
symbolic expression into machine code.
f (x 0 + hd) − f (x 0 )
fx d = + O(h), (3.32)
h
Combination with a second Taylor series expansion with negative increment
h yields the improved central difference scheme
f (x 0 + hd) − f (x 0 − hd)
fx d = + O(h2 ). (3.33)
2h
76 3 Constrained Nonlinear Programming
As the perturbation is applied to the imaginary part this approach does not
suffer from cancellation errors. The perturbation magnitude h||d|| should be
chosen small but representable, e.g. h||d|| = 10−100 .
Principle
1. For 1 i n the function ϕi−n = πni is the projection on the i -th component
of the evaluation point x ∈ n ,
Comparing this algorithm to the zero order forward sweep, we see that
the directional derivative information is initialized with the direction ẋ ∈ n .
Along with the nominal evaluation of the function sequence ϕ , derivative
information is accumulated in v̇ by application of the chain rule to the ele-
mental functions ϕi . Algorithm 3.3 can easily be extended to compute multi-
ple directional derivatives in one sweep. The overall computational effort is
3
bounded by 1+ nd function evaluations [92], where nd is the number of for-
2
ward directions. The computed derivative is exact within machine precision,
while slightly more expensive than finite difference approximations.
3.3 Derivative Generation 79
The evaluation of the dynamic process x (t) on the time horizon T requires
the solution of IVPs on the shooting intervals. In this section, we present
Runge–Kutta methods as popular representatives of one–step methods for
non–stiff ODEs.
s #
s $
def def
Φ(t, h, x ) = ci k i , k i = f t + αi h, x + h Bi j k j , (3.39)
i=1 j=1
def x (t + h) − x (t)
lim sup ||τ (t, h, x )|| = 0, τ(t, h, x ) = − Φ (t, h, x ) . (3.40)
h→0 t∈T h
A one–step method Φ is called stable if there exists κ < ∞ such that ||(h)||
κ ||τ(h)||.
82 3 Constrained Nonlinear Programming
0
1 1
2 2
1 1
2
0 2
1 0 0 1
1 1 1 1
6 3 3 6
Figure 3.1: Butcher tableau of the classical 4th order explicit RK method.
3.4 Initial Value Problems and Sensitivity Generation 83
Perturbed Trajectories
η(t f ; t 0 , x 0 + hd x , p + hd p ) − η(t f ; t 0 , x 0 , p)
x d (t f ; t 0 , x 0 , p) = (3.42)
h
+ O(tol/h) + O(h)
together with the IVP (3.37). The expected local approximation error for x d
1 1
is reduced to O (tol) + O (eps 2 ) if h is chosen such that h||x d || ∈ O (eps 2 ).
x p
Adjoint sensitivities x̄ d ∈ n , p̄d ∈ n of the discretization scheme for IVP
x
(3.37) into a direction d̄ ∈ n can be computed by applying the reverse
mode of automatic differentiation, cf. section 3.3.4. For an explicit Runge–
Kutta method (3.39), this yields for N k 1 the adjoint iteration schemes
def def
x̄ dN = d̄, x̄ dk−1 = x̄ dk − hk−1 Φ̄x (t k−1 , hk−1 , x k−1 ), (3.45a)
def def
p̄dN = 0, p̄dk−1 = p̄dk +h k−1 p
Φ̄ (t k−1 k−1
,h ,x k−1
), (3.45b)
with the adjoint one–step method’s generating functions Φ̄x and Φ̄p being
def
s
def
Φ̄x (t, h, x ) = k̄ ix , k̄ ix = −d̄iT f x (t i , x i , p), (3.46a)
i=1
s
def p p def
Φ̄p (t, h, x ) = k̄ i , k̄ i = d̄iT f p (t i , x i , p). (3.46b)
i=1
86 3 Constrained Nonlinear Programming
Therein, we have used the shortcut notation d̄i to denote the adjoint direc-
tion of the i -th stage,
def
s
d̄i = ci x̄ d (t) − h B ji k̄ xj . (3.47)
j=i+1
dx
d̄ T (t f ; t 0 , x 0 , p) d (3.49)
dx 0 , p
3.5 Summary
In an online optimal control application, we aim at solving not only one sin-
gle instance of the optimal control problem, but rather a sequence of such
problems. At every time instant t , an optimal control problem as described
in chapter 1 with an initial value x 0 (t) representing the differential state of
the process has to be solved instantaneously. The resulting optimal control
u (t) is fed back to the process at time t . Hence, the trajectory u (·, x 0 (·))
constitutes an optimal feedback control.
past future
x 0 (t)
x (t)
x (·)
u (·)
t t +h
Figure 4.1: Idealized real–time optimal control. For the observed process state x 0 (t)
the infinite–dimensional predictive control problem is solved instanta-
neously and the optimal control u (t) is fed back to the process at time
t , steering it to an optimal state trajectory x (·).
past future
x (t 1 )
x (t 0 )
u (t 1 )
u (t 0 )
δt 0
t0 t1 t2 t3 t4 ... t +h
Figure 4.2: The conventional NMPC approach. The optimal feedback control u (t 0 )
for the process state x (t 0 ) is available only after a computational delay
of δt 0 and is fed back to the process for the time interval [t 1 , t 2 ]. In
the meantime, a rather arbitrary and suboptimal control is applied. The
feedback control u (t 0 ) therefore is unrelated to the process state x (t 1 )
that has since deviated from the optimal trajectory.
It is the fundamental idea of the real–time iteration scheme, cf. [51, 53], to
use a predictor x pred (t + δt) of the process state x (·) at the time instant t +
δt when the computed control u (t) is anticipated to be ready for feedback
to the process. First, a careful initialization of the SQP method used to solve
the discretized optimal control problem allows to reduce the computational
effort to only one SQP iteration for each problem. Second, a separation of
the computations necessary to obtain the feedback control into three phases
is made, two of which can be completed in advance without knowledge of
the actual process state. This approach reduces the feedback delay δt by
orders of magnitude.
past future
x pred (t 1 )
x 0 (t 1 ) x 0 (t 1 + δt 1 )
x (t 0 )
u (t 1 + δt 1 )
u (t 1 )
t0 t1 t2 t3 t4 ... t +h
Figure 4.3: The real–time iteration scheme for a piecewise constant control dis-
cretization of the predictive control problem. A first order predictor of
the process state in t 1 is used as an initialization for the computation
of the feedback control u (t 1 ). The feedback delay δt 1 and thus the
feedback duration for the unrelated and suboptimal control is drastically
reduced by the three–phase computation. Consequentially, the actually
optimal feedback control u (t 1 + δt 1 ) does not deviate much from the
computed one.
min f (x , τ) (4.1)
x ,τ
s. t. 0 = g (x , τ),
0 h(x , τ),
4.2 The Real–Time Iteration Scheme 93
s. t. 0 = (g x δx ) t + (g x ) Tx δx ,
T
0 = (hstrong
x
) t + (hstrong
x
) x δx ,
T
0 (hweak
x
) t + (hweak
x
) x δx ,
def def
satisfies strict complementarity. Herein B = L x x and b = (L x ) t are both evaluated in
the KKT point (x (0), λ (0), μ (0)) and hstrong and hweak denote the restrictions of h
onto the strongly resp. weakly active constraints.
Tangential Predictor
We now consider the family (4.1) of NLPs including the additional constraint
τ − τ̂ = 0 (4.3)
Due to its linearity, the additional embedding constraint (4.3) will already
be satisfied after the first SQP iteration. The additional Lagrange multiplier
introduced in the QP for this constraint does not play a role as the Hessian
of the Lagrangian is unaffected.
1
min 2
δx T B(τ)δx + δx T b(τ) (4.4)
δx
s. t. 0 = g x (τ)δx + g (τ),
0 h x (τ)δx + h(τ),
convexification and relaxation approach for the structure of these PQPs has
been investigated in chapter 5.
We have seen from theorem 4.2 that the first iterate of the exact Hessian
SQP method consistutes a first order tangential predictor of the solution of
an NLP given an initializer in the neighborhood. The augmented problem
formulation (4.3) was used for this purpose. In our setting of real–time op-
timal control, the parametric variable is the initial process state sk that is
fixed to the measured or estimated actual process state x 0 (t k ) by a triv-
ial linear equality constraint. For the direct multiple shooting discretization
(1.24) this initial value embedding for problem P(t 0 ) reads
m
min l i (t i , si , q i ) (4.5)
s,q
i=0
s. t. 0 = x i (t i+1 ; t i , si , q i ) − si+1 , 0 i m − 1,
eq
0 = ri (t i , si , bi (t i , q i )), 0 i m,
0 ri (t i , si , bi (t i , q i )),
in
0 i m,
0 ci (t i , si , bi (t i , q i )), 0 i m,
0 = s0 − x 0 (t ). 0
Shift Strategy
the outcome of the first SQP iteration for the NLP with embedded initial
value x 0 (t k ) or equivalently the outcome of the k-th iteration of the real–
time iteration scheme, to initialize the next iteration with v k+1 as follows,
def
v k+1 = (s1 , q1 , . . . , sm−1 , q m−1 , sm , q m−1
new
, smnew ).
new new
The new state and control values q m−1 and sm can be chosen according to
different strategies.
new
1. An obvious choice is q m−1 = q m−1 and smnew = sm . The only infeasibility
introduced for iteration k + 1 into a feasible trajectory from iteration
k is the potentially violated matching condition
new
2. A new state value sm that satisfies the matching condition can be
determined at the expense of solving an IVP on the new last shooting
interval
new
ẋ m−1 (t) = f (t, x (t), b(t, q m−1 ), p), t ∈ [t m−1 , t m ] ⊂ ,
x m−1 (t m−1 ) = sm−1 .
new
employing the control parameter value q m−1 . Path and terminal con-
straints may still be violated by this initialization.
4.2 The Real–Time Iteration Scheme 97
The shift in the primal variables carries over to that of the dual variables,
of the computed node function values and linearizations, and depending on
the approximation scheme also to the Hessian.
For short horizons and problem instances whose solution characteristics are
dominated by terminal constraints or the Mayer–term objective that possi-
bly are introduced to cover the neglegted cost of an infinite prediction hori-
zon, the solutions of the subsequent problems may show similar features.
In this case a better initialization of the NLP variables may be provided by
v k+1 = v k . The initial value embedding then introduces an infeasibility and
the obtained first SQP iterate is exactly the first order predictor of theo-
rem 4.2 if an exact Hessian method is used. In this warm start strategy, the
sampling times also decouple from the shooting grid discretization, i.e., the
discretization can be chosen coarser than the control feedback.
The real–time iteration scheme with warm start strategy can be seen as a
generator of linear local feedback laws. In this sense, it’s sampling rate can
be fully decoupled from that of the control feedback. The linear feedback
controller evaluates the most recently generated feedback law, a compu-
tationally very cheap operation, until the real–time iteration scheme has
computed a more recent feedback law based on new function evaluations
and linearizations [51]. This idea can be extended to adaptive reevaluation
and relinearization of different parts of the discretized OCP, and has been
realized in a so–called multi–level iteration scheme, see e.g. [37, 123].
The quadratic subproblem solved for the step δv = (δs , δq ) in each real–
time iteration on a moving horizon reads
1
min 2
δv T B(v )δv + δv T b(v ) (4.6)
δv
s. t. 0 = g v (v )δv + g (v ),
0 h v (v )δv + h(v ),
0 = s0 + δs0 − x 0 (t k ).
2. Feedback : Solve problem (4.6) for the control feedback δq0 on the
first multiple shooting interval and feed it back to the process.
Nominal stability of the closed–loop NMPC system when using the real–
time iteration scheme to compute control feedback is of vital importance
in order to ensure that the NMPC controller does not accidentally drive
the controlled process away from a desired point of operation. This section
sketches a proof of contractivity of the real–time iteration scheme due to
[51]. In the next section we rely on this proof to derive conditions for local
contractivity of our new mixed–integer extension to the real–time iteration
scheme.
In the previous section we have derived the real–time iteration scheme from
a special SQP method for a family of parametric NLPs, performing one SQP
iteration for each problem. We now consider the real–time iteration scheme
first on a shrinking horizon of initial length m and assume sampling times
δt k that sum up to the horizon length h such that the predictive control
problem has been solved after the k-th feedback and the horizon has shrunk
to zero length.
s. t. 0 = g (s, q ),
0 = s0 − x 0 (t 0 ),
Due to linearity, the correct values for s0 and q0 will be found already after
the first SQP iteration on problem P(t 1 ). This shows that fixing q0 is com-
pletely equivalent to solving P(t 1 ) on a shrinked horizon of length m−1. For
the case of Differential Algebraic Equation (DAE) dynamics see [51].
Based on this conclusion we define the sequence {P(t k )}k of problems for
0 k m as
s. t. 0 = g (s, q ),
0 = sk − x 0 (t k ),
0 = qi − ui , 0 i k − 1.
def
y k+1 = y k + δ y k = y k − M(y k )r (y k ) (4.10)
∀y ∈ D : ||M(y)|| β. (4.11)
Assume further that the deviation of the Hessian approximation B(y) from the exact
Hessian L x x (y) is bounded by κ/β < 1/β on D ,
Finally, let the assumptions of the local contraction theorem 3.8 hold; let in particular
the first step δ y 0 starting in an initial guess y 0 be sufficiently small such that
def
δ0 = κ + ω δ y 0 < 1. (4.14)
2
The following theorem shows that this property carries over to all prob-
lems of the sequence.
Theorem 4.4 (Contraction Constants of the On–Line Problems)
Let the sufficient local convergence conditions (4.3) hold for problem P(t 0 ) (4.7).
Then the inverse Jacobian approximations M for the problems P(t k ) satisfy the κ–
and ω–conditions of definition 3.12 and 3.13 with the same values of κ and ω.
4.3.3 Contractivity
⎢Pk Lq (s , q, λ)⎥
r (y) = ⎢ ⎥
def
2
⎢ L (s , q, λ) ⎥ . (4.15)
⎣ s ⎦
g (s , q)
102 4 Mixed–Integer Real–Time Iterations
def
P1k q k = q0k . . . q k−1
k
0 ... 0 , (4.17)
def
P2k q k = 0 . . . 0 q kk . . . q m−1
k
.
Proof Key to the proof of this theorem is the observation that the step
def
δ y k = −M k (y k )r k (y k ) (4.18)
def
δ y k = −M k+1 (y k )r k+1 (y k ), (4.19)
i.e., if the residual function and inverse Jacobian approximation of the next
problem P(t k+1 ) are used in which the feedback control parameter q k to be
determined in problem P(t k ) under investigation is already known. To see
this, we only need to show
Observe now that we have in particular for the already determined control
parameters
past future
x 0 (t 1 )
x 0 (t 1 + δt 1 )
1 w (t 1 + δt 1 )
w (t 1 )
0
t0 t1 t2 t3 t4 ... t +h
Figure 4.4: The mixed–integer real–time iteration scheme for a piecewise constant
control discretization of a binary control function. The relaxed optimal
feedback control w (t 1 ) is rounded to a binary feasible one according
to a rounding scheme. The resulting deviation of the process state x (t)
from the computed optimal state trajectory can be bounded by a suitable
choice of the discretization grid.
Figure 4.4 depicts the new mixed–integer variant of the real–time itera-
tion scheme for the case of a single binary control. The computed integer
feedback control w (t 1 ) is available for feedback to the process after a very
small feedback delay only, and thus does not deviate much from the theo-
retically optimal feedback w (t 1 ). It is rounded to a binary feasible control
feedback that is applied to the process for the duration of the preparation
phase of the next real–time iteration.
Several questions obviously arise. An appropriate rounding scheme
should ensure binary or integer feasibility of the control while trying to
approximate as closely as possible the relaxed optimal solution. Rounding
the control results in a deviation of the state trajectory from the optimal one
that is attainable only by a fractional control, and this deviation is coupled
to the discretization grid granularity. Investigation of the contractivity prop-
erties of the resulting mixed–integer real–time iteration scheme is crucial
in order to guarantee nominal stability. Ideally, the contractivity argument
should yield an estimated upper bound on the allowable sampling times of
the scheme.
4.4 Mixed–Integer Model Predictive Control 105
Herein, the vector e k (y k ) denotes the modification applied to the new iter-
ate after the step δ y k , required in order to obtain an integer feasible control
part q kk+1 of the new iterate y k+1 . Assuming binary controls q k and noting
that after the Newton–type iteration for problem P(t k ) only the k–th control
is rounded, we have for the modification e k (y k ) the identity
q
e k (y k ) = 0 . . . 0 ekk (ykk ) 0 . . . 0 ∈ m·n , (4.23)
q
wherein ekk (ykk ) ∈ n with bounds on ||ekk (ykk )|| possibly depending on the
actual rounding scheme applied. The introduced modification obviously af-
fects the classical real–time iteration scheme argument in several ways as
follows:
• Note that in problem P(t k+1 ) the correct values of skk and q kk are still
identified after the first Newton–type iteration for that problem as the
two embedding constraints (4.8) remain linear.
We are interested in obtaining after the k–th iteration from q kk and the New-
ton–type step δq kk a binary feasible new mixed–integer real–time iterate
q kk+1 . Analogous to the rounding schemes of chapter 2 for off–line MIOCPs,
two different on–line rounding schemes may be conceived that define a mod-
ified step δ q̃ kk to a new binary feasible feedback control q kk+1 .
Direct Rounding
Direct rounding does not take into account the accumulated past deviation
from the relaxed optimal control trajectory incurred by rounding. This situ-
ation is improved by sum–up rounding as has been shown in chapter 2.
Sum–Up Rounding
Note that this rounding strategy can be implemented without the need
for a memory of all past mixed–integer real–time iterates. For the case of
SOS1–constraints due to convexification of nonlinearly entering integer con-
trols, these rounding strategies need to be adapted to maintain feasibility
as shown in chapter 2.
4.4 Mixed–Integer Model Predictive Control 107
The fixation of q kk+1 in problem P(t k+1 ) to a possibly different value than
that of the true next Newton–type iterate q k + δq k introduces a deviation of
the process state x (t k+1 ) from the predicted one sk+1 . Two possibilities to
address this can be thought of.
4.4.4 Contractivity
δ ỹ k = δ y k + e k (y k ) = − M̃ k (y k )r k (y k ), (4.28)
y k+1 = y k − M̃ k (y k )r k (y k ) (4.29)
δ y k + e k (y k ) = − M̃ k (y k )r k (y k ) (4.30)
exist, and let M̃ k (y k ) satisfy the κ–condition with κ < 1. Then the mixed–integer
real–time iteration scheme contracts to a feasible and integer feasible point y .
Let e k (y k ) denote an arbitrary but fixed modification of the step δ y k . Then the mod-
ified matrix M̃ k (y k ) satisfying
def
δ ỹ k = δ y k + e k (y k ) = − M̃ k (y k )r k (y k )
4.4 Mixed–Integer Model Predictive Control 109
def e k (y k )e k (y k ) T
M̃ k (y k ) = M k (y k ) − , (4.31)
e k (y k ) T r k (y k )
and it is otherwise given by the symmetric rank two (DFP) update
# $
def T T
M̃ k (y k ) = I − γk δ ỹ k r k (y k ) T M k (y k ) I − γk r k (y k )δ ỹ k − γk δ ỹ k δ ỹ k ,
(4.32)
def kT
γ = 1/(δ ỹ
k
r (y )).
k k
Proof The proof is given by verifying the modified Newton–type step prop-
erty. If e k (y k ) T r k (y k ) = 0 we have
− M̃ k (y k )r k (y k )
( )
e k (y k )e k (y k ) T
k k
= − M (y ) − k k T k k r k (y k )
e (y ) r (y )
e k (y k ) T r k (y k )
= − M k (y k )r k (y k ) + e k (y k )
e k (y k ) T r k (y k )
k
= δ y + e (y ) k k
= δ ỹ k .
T
Otherwise, if δ ỹ k r k (y k ) = 0 we have
− M̃ k (y k )r k (y k )
# # T
$
= I − γk δ ỹ k r k (y k ) T M k (y k ) I − γk r k (y k )δ ỹ k
T
$
−γk δ ỹ k δ ỹ k r k (y k )
= I − γk δ ỹ k r k (y k ) T M k (y k ) r k (y k ) − r k (y k ) + δ ỹ k
= δ ỹ k .
T T
If finally δ ỹ k r k (y k ) = −δ ỹ k J k (y k )δ y = 0 then δ y = 0 by regularity of
the exact KKT matrix J k (y k ) and y k was a stationary point.
For the next problem P(t k+1 ), which is set up in the new iterate y k+1 with
integer feasible control q kk+1 , we assume that control to be fixed by intro-
110 4 Mixed–Integer Real–Time Iterations
β||J k (y k )e k (y k )||
||δ y k + e k (y k )||. (4.33)
Proof We evaluate the κ–condition (definition 3.13) for the modified matrix
M̃ k assuming that M k satisfies it with constant κM ,
|| M̃ k (y k+1 ) I − J k (y k ) M̃ k (y k ) r k (y k )||
= || M̃ k (y k+1 ) r k (y k ) − J k (y k ) M̃ k (y k )r k (y k ) ||
= || M̃ k (y k+1 ) r k (y k ) + J k (y k )δ ỹ k ||
= || M̃ k (y k+1 ) r k (y k ) + J k (y k )δ y k + J k (y k )e k (y k ) ||
= || M̃ k (y k+1 ) I − J k (y k )M k (y k ) r k (y k ) + J k (y k )e k (y k ) ||
= || M̃ k (y k+1 ) I − J k (y k )M k (y k ) r k (y k ) + M̃ k (y k+1 )J k (y k )e k (y k )||
|| M̃ k (y k+1 ) I − J k (y k )M k (y k ) r k (y k )|| + || M̃ k (y k+1 )J k (y k )e k (y k )||
κM ||δ ỹ k || + || M̃ k (y k+1 )|| ||J k (y k )e k (y k )||
κM ||δ ỹ k || + β||J k (y k )e k (y k )||.
def
establishes a coupling of this quantity to the length δt k = t k+1 − t k of the
k–th multiple shooting interval [t k , t k+1 ] ⊂ and shows that this quantity
vanishes along with δt .
nq
ẋ (t) = qk,i f (t, x (t), ωi ), t ∈ [t k , t k+1 ],
i=1
x (t k ) = sk .
and introduce integral forms for the linear time–variant IVPs for the sensi-
tivities of the IVP solution with respect to sk
t k+1
nq
dx (t k+1 ) dx (t)
=I+ qk,i f x (t, x (t), ωi ) dt,
dsk tk i=1
dsk
112 4 Mixed–Integer Real–Time Iterations
dx (t k+1 ) dx (t k+1 )
→I and → 0.
dsk dq k
We evaluate the two remaining nonzero terms in the Jacobian vector prod-
q
uct. First, we have for Gk
q d dx k (t k+1 )
Gk = x k (t k+1 ; t k , sk , q k ) − sk+1 = (4.35)
dq dq k
q q q def sq
that Gk ek → 0ek = 0 for δk = t k+1 − t k → 0. Second, we have for Bk that
* t k+1
+
sq d2
Bk = l(t, x (t), q k ) dt − λ T
x k (t k+1 ; t k , sk , q k ) − sk+1
dsk dq k tk
t k+1
dx (t) d2 x k (t k+1 )
= l x q (t, x (t), q k ) dt − λ T . (4.36)
tk
dsk dsk dq k
sq
We further investigate the second term contributing to Bk which is again
defined by a linear time–variant IVP,
nq
t k+1
d2 x k (t k+1 ) d dx (t)
= qk,i f x (t, x (t), ωi ) + f (t, x (t), ωi )eiT dt
dsk dq k dsk t i=1
dq k
k
t k+1 nq (
dx (t) T dx (t)
= qk,i f x x (t) (4.37)
t i=1
ds k dq k
k
)
d2 x (t) dx (t)
+qk,i f x (t) + f x (t) eiT dt,
dsk dq k dsk
wherein we have omitted all but the leading argument of f . The limit be-
havior for t k+1 → t k is
4.4 Mixed–Integer Model Predictive Control 113
d2 x k (t k+1 )
→ 0.
dsk dq
def
Again by continuity of the integrand, we observe for δk = t k+1 − t k → 0 that
sq q q
Bk ek → 0ek = 0.
This shows ||J k (y k )e k || → 0 for δt → 0. By continuity in t k+1 there ex-
ists
a shooting interval length δ t̂ such that for all δt < δ t̂ it holds that
β J k (y k )e k <
for any
> 0. This completes the proof.
We can extend the proof of the last theorem in order to derive a simple
and accessible upper bound on the sampling time δt to be chosen for the
mixed–integer real–time iteration scheme. We only consider problems with
sq
vanishing cross–term Bk of the Hessian of the Lagrangian here.
|| M̃ k (y)|| β ∀y ∈ D,
and let the ODE system’s right hand sides after outer convexification f (t, x (t), ωi )
be bounded by bf̃ > 0,
x
|| f (t, x , ωi )|| bf̃ ∀t ∈ T , x ∈ X ⊂ n ,
Assume further that Bk = 0. Then the term M̃ k (y k+1 )J k (y k )e k (y k ) satisfies with
sq
def
δt = t k+1 − t k
M̃ k (y k+1 )J k (y k )e k (y k ) β b δt exp(A δt). (4.38)
f̃ f̃
q q
Proof In order to consider estimates of the nonzero vector component Gk ek
we first require the explicit solution to the sensitivity IVPs w.r.t. q k . Observe
that the explicit solution to the linear time varying IVP in integral form
t1
u(t 1 ) = 0 + A(t)u(t) + b(t) dt, t1 > t0
t0
is
t1
* t
+ * t1
+
u(t 1 ) = b(t) exp − A(s) ds dt exp A(t) dt , t1 > t0.
t0 t0 t0
q
By comparison of terms this gives for Gk in (4.35) the explicit solution
t k+1
* t
+ * t k+1
+
q
Gk = f (t)eiT exp − qk,i f x (s) ds dt exp f x (t) dt .
tk tk tk
t1
Using the estimate u(t 1 ) ||A(t)|| ||u(t)|| + ||b(t)|| dt for the general
q
t0
explicit solution, we have for the first component’s norm G that k
q q
G e b δt exp(A δt),
k k f̃ f̃
from e k (y k ) 1 guaranteed by rounding, and by using the assumed
bound and Lipschitz constant on f (·).
4.5 Summary
In this chapter we have presented the real–time iteration scheme for fast
NMPC using active–set based NLP methods such as Sequential Quadratic
Programming to repeatedly compute feedback controls based on a multiple
shooting discretization of the predictive control problem. The underlying
algorithmic ideas have been described and NLP theory has been studied
as necessary to sketch a proof of local contractivity of the real–time itera-
tion scheme. We have developed a new extension to the real–time iteration
scheme that is applicable to mixed–integer NMPC problems. We have fur-
ther derived a new sufficient condition for local contractivity of the mixed–
integer real–time iterations. The proof relies on the existing contractivity
statement for the continuous case. There, such a statement could be shown
116 4 Mixed–Integer Real–Time Iterations
under the assumption that the repeatedly fixed controls are indeed fixed
onto the exact outcome of the last Newton–type step. To make this frame-
work accessible, we showed existence of a theoretical modification to the
approximate inverse KKT matrix that provides the Newton–type step includ-
ing the contribution due to a rounding scheme being applied afterwards.
The proof of existence relies on a symmetric rank one or Broyden type rank
two update. We derived a sufficient condition for the modified KKT matrix
to satisfy the κ–condition for local contractivity, and showed that this con-
dition can actually be satisfied by a sampling time chosen small enough. A
dependency on the granularity of the binary or integer control discretization
along the lines of chapter 2 has thus been established also for mixed–integer
Model Predictive Control. Vice versa, we showed that, if appropriate bounds
and Lipschitz constants on certain model functions are available, an upper
bound on the sampling time can be derived.
5 Outer Convexification of Constraints
nw
w̃ i (t) · g (t, x (t), ωi , p) 0, t ∈T, (5.1)
i=1
nw
w̃ i (t) = 1, t ∈T.
i=1
This ensures that the constraint function g (·) is evaluated in integer feasible
controls ωi only. While in addition it is obvious that any rounded solution de-
rived from the relaxed optimal one will be feasible, this formulation leads to
relaxed optimal solutions that show compensation effects. Choices w̃ i (t) > 0
for some 1 i nw that are infeasible with respect to g (ωi ) can be com-
pensated for by nonzero choices w̃ j (t) > 0 that are not part of the MIOCP’s
solution.
by
w
nw
w̃ (t) ∈ [0, 1]n , w̃ i (t) = 1, t ∈T.
i=1
In the spirit of a Big–M method for feasibility determination [158], the con-
straints g can be relaxed using a relaxation parameter M > 0,
nw
nw
w̃ (t) ∈ [0, 1] , w̃ i (t) = 1, t ∈T.
i=1
0 λg(x/λ), (5.5)
0 x λx , up
λ ∈ [0, 1] ⊂ .
x̃ i (t)
w̃ i (t) · g ,ω i
0, t ∈T, 1 i nw , (5.6)
w̃ i (t)
w̃ i (t) · x up x̃ i (t), t ∈ T , 1 i nw ,
nw
up
x̃ i (t) ∈ [0, x ], x̃ i (t) = x(t), t ∈T, 1 i nw ,
i=1
w
nw
w̃ (t) ∈ [0, 1]n , w̃ i (t) = 1, t ∈T.
i=1
The local optimality conditions of theorem 3.1 were given under the assump-
tion that LICQ holds in the candidate point x in order to ensure a certain
wellbehavedness of the feasible set in its neighborhood. The Karush–Kuhn–
Tucker (KKT) theorem (3.1) can however be proven under less restrictive
conditions, and various Constraint Qualifications (CQs) differing in strength
and applicability have been devised by numerous authors. We present in the
following four popular CQs in order of decreasing strength which will be of
interest during the investigation of MPVCs in section 5.3.
We first require the definitions of the tangent and the linearized cone.
is called the Bouligand tangent cone of the set F in the point x . The set
L(x ) = d ∈ n g x (x ) d = 0, hA x (x ) d 0
def T T
(5.8)
The dual T (x , F ) of the tangent cone is also referred to as the normal cone
of F in x . In the next section, these cones will play a role in characterizing
the shape of the feasible set in a neighborhood of the point x .
T
g x (x ) d = 0, (MFCQ)
T
hA x (x ) d > 0.
122 5 Outer Convexification of Constraints
T (x , F ) = L(x ). (ACQ)
T (x , F ) = L(x ) . (GCQ)
whereas the converse never holds. Proofs of theorem 3.1 assuming each of
the above CQs as well as counterexamples for the converse cases can e.g.
be found in [1, 165].
2. In x 1 = 0, g(x 2 ) = 0 we have
0 0
C= .
1 0
L(x ) = +
0
× .
T (x , F ) = (+
0
× +
0
) ∪ ({0} × −
0
),
which shows that ACQ is violated in this point. All other points satisfy ACQ by
implication.
4. Observe that for the duals of the above cones it holds that
L(x ) = T (x , F ) = +
0
× {0},
which finally shows that of the four introduced CQs, GCQ is the only one to
hold on the entire feasible set.
These finding lead us to the following remark about CQs for NLPs with
constraints treated by Outer Convexification.
Remark 5.1 (Violation of CQs)
For constraints treated by Outer Convexification, LICQ is violated if the binary con-
trol variable associated with a vanishing constraint is zero. If in addition the vanish-
ing constraint is active at its lower or upper bound, MFCQ and ACQ are violated as
well. As GCQ holds, locally optimal points are still KKT points.
5.2.3 Ill–Conditioning
0
2 4
2 2
6
4
4 4
8
-5 6
6 6
8 10
log10 x 1
8 8
10 12
-10 10 10
14
12
12 12
16
14
14 14
-15 16
16 16
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
log10 g(x 2 )
Figure 5.1: Logarithm of the Jacobian’s condition number (log10 cond C ) for a van-
ishing constraint x 1 · g(x 2 ) 0 and a simple bound x 1 0, depending on
the residuals g(x 2 ) and x 1 .
(a) x 1 > 0, g(x 2 ) > 0 (b) x 1 > 0, g(x 2 ) = 0 (c) x 1 = 0, g(x 2 ) < 0
Figure 5.2: Linearized feasible sets ( ) entering the QP subproblems lead to infea-
|||
sible and suboptimal steps of the SQP method. Actually globally feasible
steps (
) for the NLP. In cases (a), (c), (d), and (f), the QP subproblem
may determine an NLP–infeasible step. In cases (a), (b), (e), and (f), the
determined step may be suboptimal.
c(x ) = x 1 · g(x 2 ) 0,
x 1 0,
For a linearization point x that is not degenerate, i.e., x 1 > 0, this may be written as
−x 1 if x is feasible, i.e., g(x 2 ) > 0, def g x (x 2 )
δx 1 + βδx 2 β = x1 ∈ .
−x 1 if x is infeasible, i.e., g(x 2 ) < 0, g(x 2 )
Figure 5.3 shows the linearized feasible set of the quadratic subprob-
lem for an SQP iterate that is feasible. With β → 0, which means x 1 → 0
or g(x 2 ) → ∞, the angle between the two constraints approaches π
and the corner of the feasible set becomes degenerate. The resulting ill–
conditioning of the linearization was also observed numerically in figure
5.1.
Figure 5.4 shows the linearized feasible set for an infeasible SQP iter-
ate. In contrast to the previous case, with β → 0 the angle between the
constraints approaches 0 and the feasible set is spike-shaped. Besides ill–
conditioning, this may potentially result in many tiny steps being made by
an active set method if the stationary point is located near the spike’s pin-
point. This phenomenon is known as “zig–zagging”.
δx2 δx2
δx1 δx1
feasible feasible
δx2 δx2
δx1 δx1
infeasible infeasible
Theoretical and numerical challenges introduced into the NLP by outer con-
vexification of constraints depending on binary or integer controls have
been exemplarily studied in this section. Our findings clearly justify the
need for deeper investigation of the combinatorial structure of such NLPs
128 5 Outer Convexification of Constraints
in order to take the structure into account in the design of a tailored SQP
algorithm.
The findings of the first section lead us to investigate NLPs with con-
straints treated by outer convexification from a different point of view.
In this section we introduce the problem class of Mathematical Programs
with Vanishing Constraints (MPVCs), highly challenging nonconvex prob-
lems that have only recently attracted increased research interest. This
problem class provides a framework for analysis of the shortcomings of the
standard Lagrangian approach at solving MPVCs, and yields new station-
arity conditions for a separated, i.e., non–multiplicative formulation of the
vanishing constraints that will in general be much more well conditioned.
Pioneering work on the topic of MPVCs was brought forward only re-
cently by [3, 106, 107]. In these works, MPVCs were shown to constitute
a challenging class of problems, as standard constraint qualifications such
as LICQ and MFCQ turn out to be violated for most problem instances. In
the thesis [105] an exhaustive treatment of the theoretical properties of
MPVCs can be found. The theoretical results presented in this section are
a summary of those parts of [109] and the aforementioned works that are
required for the numerical treatment of NLPs with constraints treated by
outer convexification.
min f (x ) (5.9)
x ∈n
s. t. g i (x ) · hi (x ) 0, 1 i l,
h(x ) 0
min f (x ) (5.10)
x ∈n
s. t. hi (x ) > 0 =⇒ g i (x ) 0, 1 i m,
h(x ) 0.
min f (x ) (5.11)
x ∈n
s. t. ξi · hi (x ) = 0, 1 i l,
h(x ) 0,
ξ 0,
g (x ) − ξ 0.
In fact, MPECs are known to constitute an even more difficult class than
MPVCs, as both LICQ and MFCQ are violated in every feasible point [47].
Consequentially, standard NLP sufficient conditions for optimality of x as
presented in section 3.1.3 do not hold. If on the other hand hi (x ) = 0 for
all indices 1 i l , we could as well have found the same solution x by
including all vanishing constraints g i as standard constraints, which allows
to treat problem (5.9) as a plain NLP.
Relaxation Method
min f (x ) (5.12)
x ∈n
s. t. g i (x ) · hi (x ) −τ, 1 i l,
h(x ) 0,
ϕ(a, b) = 0 ⇐⇒ b 0, a · b 0,
Finally, two remarks are in order about the applicability of the surveyed
reformulations.
5.4 An MPVC Lagrangian Framework 131
g −ξ g
F F F
h h h
τ → 0+
(a) Feasible set of original (b) Feasible set of MPEC (c) Feasible set of relaxed
problem (5.9). reformulation. problem (5.12), τ =
0.1.
We first require some notation to be defined. The notion of an active set for
problem MPVC requires some extension as shown in the following definition
of index sets.
Definition 5.4 (Index Sets)
Let x ∈ n be a feasible point. In a neighborhood B
(x ) of x , the set {1, . . . , l} ⊂
of indices of the l vanishing constraints is partitioned into the following index sets:
def def
I+ = {i | hi (x ) > 0}, I+0 = {i | hi (x ) > 0, g i (x ) = 0}, (5.13)
def
I++ = {i | hi (x ) > 0, g i (x ) > 0},
def def
I0 = {i | hi (x ) = 0}, I0+ = {i | hi (x ) = 0, g i (x ) > 0},
def
I00 = {i | hi (x ) = 0, g i (x ) = 0},
def
I0− = {i | hi (x ) = 0, g i (x ) < 0}.
I0+ I++
I00 h
I+0
I0−
min f (x ) (TNLP)
x ∈n
min f (x ) (RNLP)
x ∈n
Both problems depart from the original problem (5.9) in those vanishing
constraints imposed on x that are contained in the critical index set I00 in
x . Given a partition {I1 ; I2 } of the critical set I00 into two subsets I1 and I2 ,
I1 ∪ I2 = I00 , I1 ∩ I2 = ,
the branch problem for {I1 ; I2 }, first used in [107, 109], requires the van-
ishing constraints in I1 to be feasible, g i (x ) 0, and the constraints in I2
to have vanished, hi (x ) = 0.
min f (x ) (BNLP{I1 , I2 })
x ∈n
1.
, 2. 3. 4.
5.
FTNLP = FBNLP{J1 ;J2 } ⊂ FBNLP{I1 ;I2 } ⊂ F = FBNLP{J1 ;J2 } ⊂ FRNLP . (5.15)
J1 ∪J2 =I00 J1 ∪J2 =I00
J1 ∩J2 = J1 ∩J2 =
Proof For 1., consider that for every constraint i ∈ {1, . . . , l} there ex-
ists a partition with i ∈ J1 and one with i ∈ J2 . Hence g i (x ) 0 and
hi (x ) = 0 hold for the intersection set, satisfying (TNLP). The reverse di-
rection is obvious. Inclusion 2. is obvious as the intersection includes the
case {I1 ; I2 } = {J1 ; J2 }. Inclusion 3. is obvious as any choice of I2 = is
a proper restriction of F . Forming the union of feasible sets of the branch
problem lifts any restrictions imposed by choosing a specific J2 = , and we
get equivalence 4. Finally, problem (RNLP) allows for a violation of vanish-
ing constraints contained in I00 in a neighborhood of x , which justifies 5.
The initial observation that the constraints found in I00 induce the combi-
natorial nature of MPVCs gives rise to the following constraint qualification
for MPVC.
Definition 5.8 (Lower Level Strict Complementarity Condition)
Let x ∈ n be a feasible point of problem (5.9). If I00 = in x , we say that Lower
Level Strict Complementarity (LLSCC) holds for problem (5.9) in x .
T
Proof For any i ∈ I00 we have (g i · hi ) x (x ) = 0, so (g i · hi ) x (x ) d = 0 for all
vectors d ∈ n , hence MFCQ is violated. For any i ∈ I0− and for any d ∈ n
T T
which satisfies (hi ) x (x ) d 0 we find (g i · hi ) x (x ) d 0, hence MFCQ is
violated in this case, too.
As can be seen, the tangent cone of (5.9) is the union of finitely many NLP
tangent cones. Consequentially it is in general a non–polyhedral and non–
convex set that does not coincide with the convex and polyhedral linearized
cone, in which case ACQ is violated. Necessary conditions for ACQ to hold
for problem (5.9) can be found in [105]. Under reasonable assumptions, only
GCQ can be shown to hold for (5.9).
Using this definition we can restate theorem 5.1 by saying that for a fea-
sible point of problem (5.9), MPVC–LICQ is a sufficient condition for GCQ to
hold. Consequentially, under MPVC–LICQ a locally optimal point of problem
(5.9) satisfies the KKT conditions of theorem 3.1.
def
l
L(x , λ) = f (x ) − λhT h(x ) − λgh,i g i (x )hi (x ), (5.17)
i=1
wherein λh ∈ l and λgh ∈ l denote the Lagrange multipliers for the con-
straints h(x ) 0 and g i (x ) · hi (x ) 0 respectively. The multiplicative rep-
resentation of the vanishing constraints has been shown to be the source of
severe ill–conditioning in section 5.2. We introduce a modification of (5.17)
that separates the vanishing constraints’ parts g and h.
5.4 An MPVC Lagrangian Framework 137
g g g
h h h
def
Λ(x , μg , μh ) = f (x ) − μhT h(x ) − μgT g (x ) (5.18)
Based on the KKT conditions for the auxiliary problem (RNLP) we define
the notion of strong MPVC stationarity.
Hence, if the assumptions for theorem (3.1) are satisfied, strong station-
arity is a necessary condition for local optimality.
Theorem 5.3 (First Order Necessary Optimality Condition under GCQ)
Let x ∈ n be a locally optimal point of (5.9) and let GCQ hold in x . Then x is a
strongly stationary point of (5.9).
Proof Every locally optimal point satisfying GCQ is a KKT point by theorem
3.1. Every KKT point is strongly stationary by theorem 5.2
Theorem 5.3 can be recast using the newly introduced notion of MPVC–
LICQ as follows. In addition, we have uniqueness of the MPVC multipliers
analogous to the case of LICQ for NLPs.
Theorem 5.4 (First Order Necessary Optimality Cond. under MPVC–LICQ)
Let x ∈ n be a locally optimal point of (5.9) and let MPVC–LICQ hold in x . Then x
is a strongly stationary point of (5.9). The MPVC–multipliers μg and μh are unique.
∀d ∈ LMPVC (x ) : d T Λ x x (x , μg , μh ) d 0,
5.5 Summary
min f (x ) (6.1)
x ∈n
s. t. g (x ) ∈ F ,
s. t. g (x ) + g x (x )δx ∈ F .
∀x ∈ F ∩ B
(x ), α ∈ [0, 1] ⊂ : αx + (1 − α)x ∈ F ∩ B
(x ). (6.3)
It is easily verified that convex sets as well as finite intersections and finite
unions of closed convex sets are locally star–shaped. Under the restriction of
local starshapedness, convergence is established by the following theorem.
6.1 SQP for Nonconvex Programs 143
These are indeed just the strong second order sufficient conditions of theo-
rem 3.4 and the local convergence theorem 3.7. Strict complementarity per-
mits the extension to inequality constraints as already mentioned. Finally,
local star shape of the feasible set according to definition 6.1 guarantees
that the stationary point (x , λ ) indeed is unique in a local neighborhood.
The local subproblems generated by the SQP method described in the pre-
vious section are Quadratic Programs (QPs) with combinatorial structure of
the feasible set. For the combinatorial NLP (6.1) we assume that there exist
finitely many subsets Fi , 1 i nF that are of simpler, convex shape such
that a descent–based method is able to find a locally optimal solution of the
subproblems
1 T
min 2
x Hx + xTg (6.4)
x
s. t. Ax + b ∈ Fi ,
F
n
F= Fi . (6.5)
i=1
144 6 A Nonconvex Parametric SQP Method
Note that in general the subsets Fi cover F will not form a partition of F ,
i.e., they need not be pairwise disjoint but may overlap each other. In partic-
ular, if F is closed the subsets Fi will be closed and share boundary points
with adjacent ones. This gives rise to the notion of adjacent subproblems as
follows.
Definition 6.2 (Adjacent Subproblems)
x
A local subproblem on a subset Fi ⊂ F is called adjacent to a point x ∈ n if x ∈ Fi
holds. Two subproblems on subsets Fi , F j , i = j are called adjacent if a locally
optimal point x of subproblem i satisfies x ∈ F j .
Local Convergence
By theorem 5.2 the notion of stationarity in theorem 6.1 can under MPVC–
LICQ be substituted by the equivalent MPVC strong stationarity condition
of definition 5.11. The notion of strict complementarity then refers to the
MPVC multipliers. The Hessian approximation methods of chapter 3 can
be readily used also to approximate the Hessian of the MPVC Lagrangian.
In the BFGS case, the well–defined MPVC multiplier step is used in place
of the potentially unbounded Lagrange multiplier step. Finally, note that
the feasible sets obtained for the MPVCs are indeed locally star–shaped by
lemma 5.4.
1 T
min 2
x Hx + xTg (6.6)
x ∈D ⊆n
s. t. 0 Ax − b,
0 (Ci x − ci )(Di x − di ) 1 i l,
0 D x − d,
take the role of the controlling constraint h(x ) 0 and the vanishing con-
straint g (x ) 0 of the previous chapter.
146 6 A Nonconvex Parametric SQP Method
A remarkable result from [105] holds for MPVCs with convex objective and
affine linear parts of the vanishing constraints, which in particular includes
QPVCs with positive semidefinite Hessian H . Although the problem class of
QPVCs must truly be considered nonconvex due to the shape of its feasi-
ble set, the strong stationarity conditions of definition 5.11 are indeed also
sufficient conditions for local optimality.
Theorem 6.3 (QPVC First Order Sufficient Optimality Condition)
Let the objective function f be convex and let g , h be affine linear in problem (5.9).
Further, let x be a strongly stationary point of problem (5.9). Then x is a locally
optimal point of problem (5.9).
Figure 6.1 depicts two QPVCs that immediately reveal the difference be-
tween local and global optimality on the nonconvex feasible set. In par-
ticular, an active vanishing constraint that is not permitted to vanish may
cause local minima different from the global one as can be seen from figure
6.1b. This observation is a motivation of the following sufficient condition
for global optimality due to [105].
Theorem 6.4 (Sufficient Global Optimality Condition)
Let the objective function f be convex and let g , h be affine linear in problem (5.9).
Further, let x be a strongly stationary point of problem (5.9). Then if μh,I0− 0 and
μg,I+0 = 0, it holds that x is a globally optimal point of problem (5.9).
g g
h h
(a) A QPVC with a single optimal point. (b) A QPVC with a locally and a globally opti-
mal point.
Then the two convex subsets are called QPVC–adjacent if there exists a vanishing
constraint 1 i l such that constraint i is active in A1 but has vanished in A2 , and
the active sets are otherwise identical,
I0−
2
= I0−
1
∪ {i}, I+0
2
= I+0
1
\ {i},
I00
2
= I00
1
, I0+
2
= I0+
1
, I++
2
= I++
1
.
1 T
min 2
x Hx + xTg (6.8)
x ∈n
s. t. Ax b,
1 T
min 2
x Hx + x T g (p) (6.9)
x ∈n
s. t. Ax b(p),
with gradient g and constraints right hand side b vector being affine functions of
the parameter p ,
def def
g (p) = g0 + Gp, b(p) = b0 + Bp,
p p
where G ∈ n×n , B ∈ m×n , is called a Parametric Quadratic Program.
For any fixed value of p problem (6.9) becomes a QP in standard form, and
the results presented in the previous section remain valid. The purpose of
formulating and solving a PQP instead of an ordinary QP is to exploit prior
p
knowledge of the QP’s solution in p0 ∈ n to infer the solution for another
p
parameter p1 ∈ n .
Definition 6.8 (Set of Feasible Parameters)
p
The set P of parameters p ∈ n feasible for problem (6.9) is defined as
p
P = p ∈ n F (p) = ⊆ n
def p
(6.10)
where F (p) denotes the feasible set of the QP obtained from (6.9) for the parame-
ter p .
There is more structure to the set P , which can be partitioned using the
optimal solution’s active set as membership criterion.
Definition 6.9 (Critical Region)
Let P be the set of feasible homotopy parameters of a strictly convex PQP. Let
x (p) denote the optimal solution of the QP in p ∈ P , and denote by A(x (p)) the
associated active set. The set
∀i = j : C (Ai )◦ ∩ C (A j )◦ = . (6.12)
P= cl C (Ai ). (6.13)
i=1
1 T
min 2
x H(p)x + x T g (p) (6.14)
x ∈n
s. t. A(p)x b(p),
where
def def
H(p) = H0 + ΔH p, A(p) = A0 + ΔAp,
p p
with ΔH ∈ n×n×n , ΔA ∈ m×n×n . Given an arbitrary but fixed homotopy destina-
tion point p1 ∈ P , problem (6.14) can be reformulated to a PQP in standard form
6.3 A Primal–Dual Parametric Active Set Strategy 151
def def
with Hessian H̃ = H(p1 ) and constraints matrix à = A(p1 ) by letting
def
b̃(p) = b0 + Bp + ΔA(p1 − p)x , (6.15a)
def T
g̃ (p) = g0 + Gp − ΔH(p1 − p)x + (ΔA(p1 − p)) λ, (6.15b)
such that the optimal solutions (x (p), λ (p)) in p0 and p1 do not change.
np
Proof The KKT conditions (3.1) of problem (6.14) in p ∈ read
which are the KKT conditions of a PQP in standard form with gradient and
constraint right hand side homotopy, but with matrices fixed in the homo-
topy point p1 .
Active set methods exploit the notion of an active or working set selecting a
subset of linear independent inequality constraints that are assumed to be
satisfied to equality. A sequence of iterates {x k } towards the solution of the
QP is computed by solving for each step the Equality Constrained Quadratic
Program (EQP) obtained from restricting the QP to the current working
set W (x k ). This task involves the solution of a system of linear equations
and appropriate techniques to accomplish this are considered in chapter 7.
Based on its solution, the working set is updated by adding or removing
a blocking constraint, until a linear independent subset of the active set
belonging to the QP’s optimal solution has been found.
152 6 A Nonconvex Parametric SQP Method
Active set approaches usually are evaluated under the following aspects
concerning their efficiency, and in this section we present a parametric
primal–dual active set method due to [25, 67] for the solution of parametric
QPs that is notably distinguished from more classical active set methods in
several points.
This usually is the first requirement to start an active set method. Between
one third and one half of the total effort of solving a QP is typically spent for
finding an initial feasible guess [88]. The task of identifying such an initial
guess is usually referred to as phase one. Several different approaches exist,
such as the solution of an auxiliary Linear Program (LP) or the relaxation of
constraints in a homotopy, cf. [158].
This action is necessary whenever more than one component of the dual vec-
tor λ indicates non–optimality. Different pivoting strategies such as choos-
ing the constraint with the lowest index (lexical pivoting) or with the most
negative value λi are in use. Our algorithm adds and removes constraints
in the order they appear on the homotopy path, thereby avoiding the need
for pivoting strategies.
set is linearly dependent and thus will not be fully identified. Repeated ad-
dition and removal of constraints may happen with steps of zero length in
between if such a point is reached, a situation that has already been investi-
gated from the NLP point of view in section 5.2. Ultimately, the method may
revisit an active set without having made significant progress in the primal–
dual iterate (x , λ). The method is said to be cycling, possibly infinitely.
Solving the EQP to find the primal–dual step involves a factorization and
backsolve with the KKT matrix associated with the current active set. Com-
puting this factorization is necessary after each change of the active set,
and usually comes at the cost of O (n3 ) floating–point operations where n
denotes the number of unknowns in the QP. Exploiting structure and spar-
sity is crucial for the efficiency of the active set method. For certain factor-
izations, it is possible to compute the factorization only once and recover it
in O (n2 ) operations by using matrix updates after each active set change.
These issues are considered in chapters 7 and 8.
We now present a parametric active set method due to [25, 67] that com-
putes optimal solutions (x (τ), λ (τ)) = (x (p(τ)), λ (p(τ))) of a PQP along
def
def def
p(τ) = p0 + τδp, δp = p1 − p0 , τ ∈ [0, 1] ⊂ , (6.16)
given the optimal solution (x (0), λ (0)) of the PQP in τ = 0, i.e., for the
p
initial parameter p0 ∈ n . Gradient and residual can be reparameterized
154 6 A Nonconvex Parametric SQP Method
def def
b(τ) = b0 + B(p0 + τδp), g (τ) = g0 + G(p0 + τδp). (6.17)
def
δb(τ) = b(1) − b(τ) = (1 − τ)Bδp, (6.18)
def
δg (τ) = g (1) − g (τ) = (1 − τ)Gδp.
Rationale
that satisfy the KKT theorem 3.1 in every point τ ∈ [0, 1] ⊂ and start
in the known point (x (0), λ (0)) with the working set W (0) = W (x (0)).
Regularity of the KKT matrix implies that x (·) and λ (·) are piecewise affine
and that x (·) in addition is continuous by theorem 6.6. Hence there exist
k 2 primal–dual points (x i , λi ) ∈ n+m which for 2 i k − 1 are located
on the common boundaries of pairs (Ci−1 , Ci ) of critical regions, such that
for τ ∈ [τi , τi+1 ], 1 i k − 1 it holds that
Figure 6.2 depicts this situation in the space P of feasible homotopy param-
eters.
6.3 A Primal–Dual Parametric Active Set Strategy 155
C4 p1
τ5 = 1
τ4
C3
τ3
C2
p0
τ2 τ1 = 0
C1
A Primal–Dual Iteration
In the first iteration k = 1, the algorithm starts for τ1 = 0 in the given opti-
mal solution (x 1 , λ1 ) = (x (0), λ (0)). The initial working set W 1 is chosen
as a linear independent subset of the active set A(x 1 ).
λj
k
αdual
def
= min − k
j ∈ W ∧ δλ j < 0 , (6.23)
δλ j
and constraints j satisfying this minimum are called dual blocking con-
straints. By choosing
def
αk = min 1 − τk , αprim
k k
, αdual (6.24)
To find the new working set, we distinguish the following three cases:
def
where a T = Ai is the constraint row i of A entering the working set.
def
If v = 0 the new working set W k+1 = W k ∪ {i} is linear independent.
Linear dependence of the active set is indicated by v = 0. If then
w 0, the PQP is infeasible for all τ τk+1 . Otherwise, by removing
the constraint
λk+1
j = argmin
j
k
j ∈ W ∧ wj > 0 (6.27)
w j
def
from the active set we can restore linear independence of W k+1 =
W k ∪ {i} \ { j}. In addition, we set
def def def
λk+1
i = λk+1
j /w j , λk+1
j = 0, k+1
λW k+1 k+1
k = λW k − λ i wW k . (6.28)
T
H AW v 0
=
k
. (6.29)
AW k w −e j
we can restore boundedness of the EQP for the new working set
def
W k+1 = W k ∪ {i} \ { j}.
3. The optimal solution (x (1), λ (1)) = (x k+1 , λk+1 ) at the end of the
homotopy path is found if τk+1 = 1.
def
If τk+1 < 1 the algorithm continues with k = k + 1 in the new iterate.
In this section we give proofs for the individual steps of the described para-
metric active set strategy. Variants can be found in [25] and [67].
has a solution v = 0.
a T x w T bW (τ) (6.32)
Proof The stationarity condition of theorem 3.1 holds for (x (τk ), λ(τk )),
H x (τk ) + g (τk ) = AW
T
λ(τk ), (6.35)
H x (τk ) + g (τk ) = μa + AW
T
(λ(τk ) − μw ). (6.36)
- ./ 0
def
= λ̂
6.3 A Primal–Dual Parametric Active Set Strategy 159
We find that the coefficients (μ, λ̂) are also dual feasible solutions if λ̂ 0.
The largest μ satisfying this requirement is found as
λ j (τk )
def
μ = min ∀j ∈ W : w > 0 . (6.37)
w j
j
Proof The step δx for the segment [τk , τprim ] of the homotopy path [0, 1]
satisfies
T
wW bW (τ) < bi (τ) τ ∈ [τprim , 1]. (6.38)
def
The next segment [τprim , τ2 ] for the working set W̃ = W ∪ {i} \ { j} is chosen
such that
def
Again by linear dependence we have for the working set Ŵ = W \ { j}
T
b j (τ) = wŴ bŴ (τ) + w j A j x (τ)τ ∈ [τprim , τ2 ], (6.39)
By combining (6.38) and (6.39) and noting w j > 0 by theorem 6.10 we find
which shows that the removed constraint j remains feasible and strictly
inactive.
For typical MPC problems computational evidence suggests that ties fre-
quently can be circumvented by choice of suitable starting points and by
sorting heuristics for the constraints in question. We refer to [216] for an-
alytical methods to resolve ties in PQPs and do not further consider this
situation. In our code qpHPSC we currently detect ties but do no take spe-
cial action to resolve them, and have so far not experienced any numerical
problems.
Theorem 6.12 (Finite Termination)
If the PQP has no ties, the parametric quadratic active set algorithm terminates after
finitely many steps.
Proof There exist at most 2m critical regions associated with the active
sets Ai , 1 i 2m , and by theorem 6.6 every point τ ∈ [0, 1] belongs to
at most two critical regions as no primal ties exist. By theorem 6.11 a step
of positive length in τ on the homotopy path is made after every active set
change involving the addition of a primal blocking constraint to the current
active set. Thus after at most 2m active set changes, the end point τ = 1 of
the homotopy path is reached.
The described algorithm assumes that the optimal solution (x (0), λ (0)) in
the start τ = 0 of the homotopy path be known. This allows for highly effi-
cient hot–starting of the QP solution if the solution of a closely related QP
6.3 A Primal–Dual Parametric Active Set Strategy 161
has already been computed for some purpose. If not, the following auxil-
iary QP
1 T
min 2
x Hx (6.40)
x ∈n
s. t. Ax 0,
with optimal solution (x , λ ) = (0, 0) can be used together with the homo-
topy
def
g (τ) = τg (p1 ),
def
b(τ) = τb(p1 ),
from the auxiliary QP (6.40) to the one whose solution is sought. This pro-
cedure effectively describes a phase one type approach for our PQP al-
gorithm that achieves feasibility simultaneously with optimality in the end
point τ = 1 of the homotopy.
Theorem 6.7 actually hints at a more general initialization and hot starting
approach that can be realized in the framework of our PQP method. Given
an primal–dual point (x̂ , λ̂) ∈ n+m that satisfies only dual feasibility and
complementary slackness, e.g.
λ̂ 0, λ T (Ax̂ − b) = 0, (6.41)
makes (x̂ , λ̂) the optimal solution of the modified QP in τ. This is easily
verified by checking theorem 3.1. The working set W (x̂ ) needs to be chosen
appropriately. The modification (6.42) can be applied before starting the
PQP algorithm to the purpose of using (x̂ , λ̂) as an initial guess of the PQP’s
solution in τ = 1. Moreover, it can in principle be applied to the QP’s right
hand side in any point τ ∈ [0, 1) of the homotopy path during the execution
162 6 A Nonconvex Parametric SQP Method
of the described PQP algorithm. We will make extensive use of this property
in section 6.4.
Linearizations
Bounds
In this case, the right hand side homotopy step for the simple bounds
need not be computed, as δb(τ) = b(τ1 ) − b(τ0 ) = 0.
6.4 Parametric Quadratic Programming for Nonconvex Problems 163
1 T
min 2
x Hx + xTg (6.43)
x ∈n
s. t. 0 x ξi (bi − Ai x ), 1 i l,
x ξ 0,
where ξ ∈ {1, . . . , n}l ⊂ is a fixed index vector selecting the controlling component
x ξi of the unknown x ∈ n for each of the vanishing constraints 1 i l .
1 T
min 2
x Hx + xTg (6.44)
x ,s
s. t. C x − s d,
−C x + s −d,
0 si (bi − Ai x ), 1 i l,
s 0,
Note that (6.44) still has a strictly convex objective if H is positive definite,
as the slack is never a free unknown. In the case of QPVCs arising from
outer convexification and relaxation of constraints direct depending on an
164 6 A Nonconvex Parametric SQP Method
integer control, s in (6.44) and x ξ in (6.43) take the role of the relaxed
convex multipliers α of chapter 2.
We are concerned with devising a primal active set exchange strategy for
the vanishing constraints of QPVC (6.43).
Primal Blockings
The feasible set F of (6.43) is nonconvex as detailed in section 5.4, and can
be partitioned in at most 2l convex subsets Ci , each one associated with
unique subset Vi ∈ P ({1, . . . , l}) of vanishing constraints that are feasible
and ViC of vanishing constraints that have vanished,
def
Ci = {x ∈ n | (i ∈ Vi ∧ Ai x bi ) ∨ (i ∈ ViC ∧ x ξi = 0)}. (6.45)
Using the primal test (6.46), a vanishing constraint i becomes active only
if it is primally blocking and the associated control variable x ξi is nonzero,
i.e., the constraint i ∈ I+ is not permitted to vanish beyond its bound. If the
controlling variable is zero, i.e., i ∈ I0 , the vanishing constraint is free to
vanish and reappear as indicated by the unknowns x . In addition, as soon
as its associated controlling variable hits its simple lower bound any active
vanishing constraint also vanishes and is removed from the active set W k .
This ensures I00 = after all primal blockings, i.e., no bound or constraint
6.4 Parametric Quadratic Programming for Nonconvex Problems 165
ever enters the critical subset I00 of the active set. Hence these two kinds
of move between adjacent convex subsets is naturally accomplished by the
primal exchange strategy.
The described strategy allows to move between the convex subsets of the
feasible set as long as the piecewise affine homotopy path does not cross
the boundary of the nonconvex feasible set F into infeasibility before the
end τ = 1 of the homotopy has been reached. In the latter case, infeasibility
of the PQP by theorem 6.9 is detected by the parametric active set method
of section 6.3. For the case of a QPVC this means that for τ = 1 no strongly
stationary point is located in the current convex critical region. Two cases
can be distinguished here.
In both cases, let A and X denote the active sets for the constraints and
simple bounds associated with this critical region, and let j ∈ I+0 ⊆ A
denote an active vanishing constraint. The solution may be continued in
the adjacent critical region associated with the active set A \ { j} for the
constraints and X ∪ {i}, i = ξ j for the simple bounds on the unknowns.
The controlling variable x j is set to zero. In this critical region, the active
vanishing constraint blocking the progress of the homotopy has vanished.
Maintenance of linear independence may require removal of an additional
constraint from A or X .
We are concerned with devising a dual active set exchange strategy for
the vanishing constraints of QPVC (6.43). In accordance with the notation
of chapter 5 we denote the MPVC multipliers of the vanishing constraints
Ai x b by μg and those of the controlling variables’ simple bounds x ξ 0
by μh .
Dual Blockings
Λ x (x , μ) = 0, (6.47)
μh,I0+ 0, μh,I00 0, μh,I+ = 0,
μg,I+0 0, μg,I++ = 0, μg,I0 = 0.
As I00 = is guaranteed by the primal strategy, the only index set rel-
evant for the dual exchange of vanishing constraints is the set I0− of van-
ishing constraints that are infeasible and were permitted to vanish as the
associated controlling variable is zero. The following QPVC dual active set
exchange rule for simple bounds prevents the affected controlling variables
from leaving their lower bounds.
λj
τ dual def
= min − j ∈ W \ I ∧ δλ < 0 .
k
(6.48)
δλ
0− j
j
Dual Continuation
we will see in the next section, this modification has a close connection
to the question of global optimality of the MPVC strongly stationary point
identified by this QPVC active set strategy.
1. MPVC strong stationarity requires μg,i = 0 for an active vanishing
constraint i ∈ I+0 entering I0− via I00 , i.e., if the controlling variable
was free and is about to enter its lower bound, causing the vanishing
constraint i to actually vanish beyond its bound. Then, if we had μg,i >
0 in I+0 , the homotopy path shows a dual discontinuity which can be
treated as shown in the sequel of this section.
2. Likewise μh,i 0 is required for a controlling variable active at its
lower bound in I0− entering I0+ via I00 , i.e., if the associated van-
ishing constraint reappears. We find that a dual discontinuity of the
homotopy path occurs if we had μh,i < 0 in I0− .
The resulting active set strategy is depicted in figure 6.3 as a state machine.
Nodes show the index sets, subsets of the active set, and arcs show the
primal and dual conditions for transition of a simple bound or a vanishing
constraint from one index set to the other.
Theorem 6.13 indicates that the active set strategy for MPVC strong sta-
tionarity presented in the previous section can potentially be improved fur-
ther. Note that the global optimality conditions of the above theorem corre-
spond to the two conditions for a dual discontinuity of the homotopy path.
168 6 A Nonconvex Parametric SQP Method
xi 0
I0+ I++
μh, j < 0
x ξi 0 ∧ μg,i = 0
I00 I+0
μh, j < 0
I0−
Figure 6.3: Active set exchange rules for MPVC strong stationarity. Constraints
never remain in the state I00 which is shown for clarity only. Dotted
lines indicate convex feasible subsets.
In detail, a dual discontinuity arises if and only if the affected active vanish-
ing constraint or simple bound has an MPVC multiplier in violation of the
sufficient conditions for global optimality.
xi 0
I0+ I++
μh, j < 0
I00 I+0
g i (x ) 0
μg, j > 0 continue in x ξi = 0
∧ μh,ξi 0
I0−
Figure 6.4: Active set exchange rules for MPVC strong stationarity with heuristic
for global optimality. Constraints never remain in the states I00 and I+0
which are shown for clarity only. Due to our global optimality heuristic,
the arc from I+0 to I0− has no counterpart arc in the reverse direction.
Resolution of Degeneracy
Forcing x ξi = 0 and adding this simple lower bound to the active set may
cause linear dependence of the active constraints. A first attempt at resolv-
ing this is to use the linear dependence check and resolution procedure of
section 6.3.
In the case of SOS1 constraints, however, it is possible that the only ac-
tive constraints potentially resolving the degeneracy are the simple lower
bounds on variables x ξ j , j = i , controlling vanishing constraints, and it is
further possible that all vanishing constraints j = i actually have vanished.
In this situation, one of these simple bounds has to be removed from the
active set, and the associated vanishing constraint has to reappear, i.e., to
be made feasible by continuing in an adjacent critical region after a primal
170 6 A Nonconvex Parametric SQP Method
def
j = argmin{b j − A j x | j ∈ I0− }. (6.49)
The primal and dual strategies of the previous section require the paramet-
ric active set method to cope with both primal and dual discontinuities of
the homotopy path. As mentioned before, these can be regarded as restarts
of the method in a different convex critical section of the nonconvex feasible
set that is adjacent to the previous one in the sense of definition 6.4.
We now present two numerical techniques that make these continuations
possible in a highly efficient way. The underlying idea is that any arbitrary
primal–dual point can serve as an initializer for the parametric active set
method in τ = 0 as long as it satisfies all KKT conditions. The techniques
to be presented guarantee this by modifying the right hand side homotopy
from the initial gradient and right hand side g (0), b(0) to the final one g (1),
b(1) to make sure that all KKT conditions in the new starting point are
satisfied.
Primal Continuation
def
b(0) = b(τprimal ) − b̂. (6.51)
Setting the MPVC multiplier μh,ξi of the simple bound entering the active
set as x ξi = 0 to some positive value bounded away from zero has proven
useful in order to avoid primal ties in the ensuing active set iterations. The
introduced stationarity defect is easily covered by modifying the gradient
g (0) analogously to the following dual continuation.
Dual Continuation
The dual continuation requires either of the MPVC multipliers μg,i or μh,ξi to
jump to zero. The stationarity gap after letting e.g. μg,i = 0 can be computed
as
def
ĝ = H x + g (τdual ) − A T μg − μh (6.52)
def
g (0) = g (τdual ) − ĝ (6.53)
satisfying
def
0 = H x + g (0) − A T μg − μh . (6.54)
In this section, we collect the exchange rules for the parametric active set
strategy solving a QPVC.
Table 6.1: Possible active set exchanges in the parametric active set strategy for
QPVCs.
6.5 Summary
In this section we have a closer look at the block structure of the QPs stem-
ming from the direct multiple shooting discretization of the Optimal Control
Problem (OCP), given in the following definition.
Definition 7.1 (Direct Multiple Shooting Quadratic Program)
The quadratic program obtained from a local quadratic model of the Lagrangian of
the direct multiple shooting Nonlinear Program (NLP) (1.24) is
m
1 T
min v Hi v i
2 i
+ v iT gi (7.1)
v
i=0
s. t. ri Ri v i , 0 i m,
hi = Gi v i + Pi+1 v i+1 , 0 i m − 1.
v
Herein v i ∈ ni denote the m vectors of unknowns. The Hessian blocks are denotes
v v v
by Hi ∈ ni ×ni and gradients by gi ∈ ni . Linearized point constraints are denoted
nri ×nvi r
by matrices Ri ∈ and right hand side vectors ri ∈ ni . Linearized matching
h ×nv
conditions are written using sensitivity matrices Gi ∈ n i and coupling matrices
nh ×nvi+1 nhi
Pi ∈ with right hand side vectors hi ∈ .
m
1 T
min v Hi v i
2 i
+ v iT gi (7.2)
v
i=0
s. t. riA = RiA v i , 0 i m,
hi = Gi v i + Pi+1 v i+1 , 0 i m − 1.
The notation RiA and riA denotes the restriction of Ri and ri on the rows resp. ele-
ments of the constraints in the active set A(v ).
The KKT system associated with this EQP according to theorem 3.1 is
given in definition 7.3 on page 177. The performance of active set meth-
ods crucially depends on the ability to efficiently exploit simple bounds on
the unknown v . In particular when treating Mixed–Integer Optimal Control
Problems (MIOCPs) by outer convexification, many relaxed binary control
parameters in resulting NLPs and QP will be active at their lower or upper
7.1 Block Structure 177
rA
with Lagrange multipliers μA
i
∈ ni of the linearized decoupled point constraints
nx
and λi ∈ of the linearized matching conditions.
m
1 T
min v Hi v i
2 i
+ v iT gi (7.4)
v
i=0
s. t. li vi ui , 0 i m,
ri Ri v i , 0 i m,
hi = Gi v i + Pi+1 v i+1 , 0 i m − 1.
In the following, the active set A(v ) refers to the active linear inequality
constraints only. We introduce the active set X (v) of active simple bounds
on the unknown v by straightforward extension of definition 3.3, and denote
by F (v ) its complement set in the index set of all simple bounds.
Definition 7.5 (Active Simple Bound, Active Set of Simple Bounds)
Let x ∈ n be a feasible point of problem (7.4). A simple bound on v i j , 0 i m,
1 j nvi is called active if v i j = l i j or v i j = ui j holds. It is called inactive otherwise.
178 7 Linear Algebra for Block Structured QPs
is called the active set of the simple bounds associated with v . We denote by F (v)
the complement of X (v ) in the set {(i, j) | 0 i m, 1 j nvi }.
s. t. bi = IiX v i , 0 i m,
ri = RiA v i , 0 i m,
hi = Gi v i + Pi+1 v i+1 , 0 i m − 1.
The matrices IiX contain the subsets of rows of the identity matrix I belonging to
active simple bounds. The vectors bi contain an element–wise combination of the
entries of the vectors l i and u i as indicated by the current set X of fixed unknowns,
i.e., active simple bounds.
Definition 7.7 (KKT System of Direct Multiple Shooting EQP with Bounds)
For a given active set A(v ) the KKT system of problem (7.6) reads
⎡ T T ⎤
H FF H FX RAF G F ⎡ ⎤ ⎡ F⎤
⎢ 0X F 0X X X X T 0AX T 0X T ⎥ −v0F g
⎢H0 H0 I0 R0 G0 ⎥ ⎢ X ⎥ ⎢ 0X ⎥
⎢ X X
⎥ ⎢−v0 ⎥ ⎢ g0 ⎥
⎢ I0 ⎥⎢ X⎥ ⎢ X ⎥
⎢ AF AX ⎥ ⎢ ν0 ⎥ ⎢−b0 ⎥
⎢R ⎥ ⎢ A⎥ ⎢ A⎥
⎢ 0F R0X ⎥ ⎢ μ ⎥ ⎢ −r ⎥
⎢G F X ⎥⎢ 0 ⎥ ⎢ 0 ⎥
⎢ 0 G0 P1 P1 ⎥ ⎢ λ0 ⎥ ⎢ −h0 ⎥
⎢ F T FF FX AF T F T ⎥⎢
⎢ P H H R G ⎥ ⎢ −v F ⎥ ⎢ F⎥
⎥⎢ 1 ⎥ ⎢ g1 ⎥
1 1 1 1 1
⎢ T T T T
⎥ ⎢−v X ⎥ ⎢ X⎥
X XF XX XX AX X
⎢ P H H I R G
⎢ 1 1 1 1 1 1
⎥⎢ 1 ⎥ ⎢ ⎥ g1 ⎥
⎥⎢ νX ⎥ = ⎢ ⎥
XX
⎢ I1
−b1X ⎥
⎢ ⎥⎢ 1 ⎥ ⎢
⎢ ⎥ ⎢ μA ⎥ ⎢ ⎥
⎥⎢ 1 ⎥ ⎢ −r ⎥
. A
⎢ R1AF R1AX
.
. ⎢ 1 ⎥
⎢ ⎥⎢
⎢ ⎥ ⎢ .. ⎥ ⎢ . ⎥
⎢ . ⎥⎢ . ⎥ ⎢ . ⎥
⎥ ⎢ . ⎥
⎢ G1F G1X
. F X ⎥⎢
⎢ . Pm Pm ⎥ ⎢ −v F ⎥
⎥
⎢ F⎥
⎢ g ⎥
⎢ F T FF FX AF T ⎥ ⎢ ⎥ ⎢ mX ⎥
⎢ Pm Hm Hm Rm ⎥⎢ m
⎢ X T X F X X X X T AX T ⎥ ⎢
−v m ⎥ ⎢
X⎥
gm ⎥
⎢ Pm Hm Hm Im Rm ⎥⎣ X⎦ ⎢ ⎣−bX ⎦
⎥
⎢ XX ⎥ ν m m
⎣ Im ⎦
AF AX
μAm −rmA
Rm Rm
X
Here, νiX ∈ n are the Lagrange multipliers of the active simple bounds. The set
superscripts A, F , and X denote the subsets of rows (first) and columns (second) of
the matrices, while an asterisk () indicates that all rows are chosen.
7.2 Survey of Existing Methods 179
From system (7.7) we can already see that v iX can be easily determined.
Possible factorizations of the remainder of system (7.7) should exploit its
symmetry and block banded structure, and generate as little fill–in as pos-
sible outside the band of block matrices.
7.2.1 Condensing
Condensing algorithms for direct multiple shooting have been first de-
scribed by [34, 36, 162, 167] and later extended in e.g. [134, 191]. A detailed
description can be found in [132]. We start by reordering the unknown
def def
v1 = (s0 , q0 , . . . , q m−1 ), v2 = (s1 , . . . , sm ). (7.7)
180 7 Linear Algebra for Block Structured QPs
Here, superscripts s and q denote the subset of columns of the matrices be-
longing to the states and controls respectively. We may now use the negative
identity matrix blocks of the matching condition equalities as pivots to for-
mally eliminate the additionally introduced multiple shooting state values v2
from system (7.8), analogous to Gaussian elimination. From this elimination
procedure the dense constraint matrix
⎡ q
⎤
G0s G0 −I
⎢ s s q q ⎥
⎢ G 1 G0 G1s G0 G1 −I ⎥
⎢ ⎥
⎢ .. .. .. .. .. ⎥
⎢ . . . . . ⎥
⎢ m−1 ⎥
⎢
G −I def ⎢ Γ0 Γ 1 G0
m−1 q q
Γ2 G1 · · · Gm−1
m−1 q
−I ⎥
=⎢ ⎥ (7.9)
R q ⎥
⎢ R0s R0 ⎥
⎢ s s s q q ⎥
⎢ R 1 G0 R 1 G0 R1 ⎥
⎢ ⎥
⎢ .. .. .. .. ⎥
⎣ . . . . ⎦
q q q
s
Rm Γ0m−1 Rm
s
Γ1m−1 G0 Rm s
Γ2m−1 G1 · · · Rms
Gm−1
j
is obtained, with sensitivity matrix products Γi defined as
⎧
⎨ 1 Gs =
j
def
j def G sj · . . . · Gis if 0 i j m − 1,
Γi = l=i l (7.10)
⎩
I if i > j.
7.2 Survey of Existing Methods 181
From (7.9) we deduce that, after this elimination step, the transformed QP
in terms of the two parts v1 and v2 of the unknown reads
T T
1 v1 H 11 H 12 v1 v g1
min T + 1 (7.11)
v1 ,v2 2 v2 H 12 H 22 v2 v2 g2
s. t. 0 = G v1 − I v2 − h,
0 Rv1 − r ,
wherein the Hessian blocks and the gradient are obtained by reordering
H and g . The right hand side vectors h and r are computed by applying
the Gaussian elimination steps to h and r . System (7.11) lends itself to the
elimination of the unknown v2 . By this step we arrive at the condensed QP
1
min v T H v1
2 1
+ v1T g (7.12)
v1
s. t. 0 Rv1 − r
with the following dense Hessian matrix and gradient obtained from substi-
tution of v2 in the objective of (7.11)
T T T
H = H 11 + H 12 G + G H 12 + G H 22 G, (7.13a)
T T T
g = g1 + G g 2 − 2(H 12 h + G H 22 h). (7.13b)
The matrix multiplications required for the computation of these values are
easily laid out to exploit the block structure of G and H , cf. [132]. The dense
QP (7.12) can be solved using one of the widely available numerical codes
for dense Quadratic Programming, such as QPOPT [86] or qpOASES [68]. In
addition, from the above elimination steps one easily recovers v2 from the
solution v1 of the condensed QP (7.12),
v2 = Gv1 − h. (7.14)
knowns, which makes condensing techniques attractive for QPs with considerably
more states than control parameters, i.e., nq nx .
Remark 7.2 (Variant for the Case of Many Controls)
If condensing methods are used at all for MIOCPs with nq > nx after outer con-
vexification, the computation of the chains of sensitivity matrices should at least be
rearranged to postpone the prolongations onto the control space as long as possible,
e.g.
# $ # # q $$
Γkj+1 G j = Gks · . . . · G sj+1 G j instead of Γkj+1 G j = Gks Gk+1
q q q s
. . . G sj+1 G j . . .
This usually is not the case for existing implementations of condensing methods,
which use the second formulation preferable in the case nq nx .
be found in [51] and we refer to [202, 176] for algorithmic variants and
further details.
def
Φm (sm ) = 12 smT Hmss sm + smT gm (7.15)
for the last shooting node, the cost–to–go function for any node 0 i m−1
is constructed from that of the successor node i + 1 as the solution of the
small QP in the following unknown v i = (si , q i )
1 T
min v Hi v i
2 i
+ v iT gi + Φi+1 (si+1 ) (7.16)
q i ,si+1
s. t. Gi v i + Pi+1 v i+1 = hi .
which yields for any given state si the optimal control choice q i minimizing
the cost–to–go to si+1 and recursively to the final node m. As the objective
function of the m − 1 QPs remains quadratic, this procedure is efficient.
Direct methods for the solution of system (7.3) have gained increased inter-
est because arbitrary sparsity patterns of the KKT matrix to be factorized
can be exploited more easily. An appropriate choice for system (7.3) are
symmetric indefinite factorizations K = LBL T , where L is a lower triangu-
lar factor and B is a block diagonal matrix with 2 × 2 pivot blocks on the
diagonal that capture the indefiniteness of the KKT system [44, 158].
7.2.4 LU Factorization
scratch. This approach is explored in the code QPBLU for large–scale Quadra-
tic Programming by [108] and coworkers. Here, updates of the LU factor-
ization are computed using LUMOD, cf. [62] and also [220] for the underlying
elementary transformations.
We start by solving in system (7.7) for the step of the subset v iX of the primal
unknowns v i fixed to their simple upper or lower bounds. This yields
T X T T
νiX = giX − RiAX μA
i − Gi λi − PiX λi−1 + HiX F v iF + HiX X v iX . (7.18)
186 7 Linear Algebra for Block Structured QPs
Assuming regularity of the current active set A(v), the number of active
decoupled point constraints does not exceed the number of free unknowns.
This allows us to perform a QR decomposition of the transpose of the de-
coupled point constraints matrix RiAF . We write this decomposition as a TQ
decomposition that is obtained from a QR decomposition by transposition
reversal of the order of columns of the QR factors,
RiAF Q i = 0 Ti , Q i = Zi Yi (7.19)
Y Z
bases Yi ∈ ni ×n and Zi ∈ ni ×n of the range space Y and the null space
v v
Y Y
Z of RiAF respectively. The matrix Ti ∈ n ×n is a southeast triangular fac-
tor. Accordingly, we partition the step of the free subset v iF of the primal
Y
unknowns v i into components v i and v iZ ,
v iF = Yi v iY + Zi v iZ . (7.20)
Using this relation to solve the primal feasibility condition for decoupled
point constraints in system (7.7) for the range space part of v iF yields
T T T
Yi T PiF λi−1 − Yi T HiF F Yi v iY − Yi T HiF F Zi v iZ + Yi T RiAF μA T F
i + Yi Gi λi
= Yi T giF + Yi T HiF X v iX (7.22)
F T T
TiT μA T
i = Yi gi + Hi v i + HiF X v iX − GiF λi − PiF λi−1 .
FF F
(7.23)
Y
Finally, substituting Yi v i +Zi v iZ for v iF in the matching conditions and Zi v iZ
for v iF in the stationarity conditions of system (7.7) we find
7.3 A Factorization for Structured KKT Systems with Many Controls 187
T T T
ZiT PiF λi−1 − ZiT HiF F Zi v iZ + ZiT RiAF μA T F
i + Zi Gi λi (7.24a)
= ZiT giF + ZiT HiF F Yi v iY + ZiT HiF X v iX ,
GiF Zi v iZ + Pi+1
F Z
Zi+1 v i+1 (7.24b)
= hi − GiF Yi v iY − GiX v iX − Pi+1
F Y
Yi+1 v i+1 − X X
Pi+1 v i+1 .
G̃i = GiF Zi ,
def
P̃i = PiF Zi ,
def
g̃i = ZiT giF + HiF F Yi v iY + HiF X v iX ,
def
(7.25b)
The remaining system to be solved for v Z and λ can be put in matrix form,
⎡ ⎤⎡ ⎤ ⎡ ⎤
H̃0 G̃0T Z
⎢ ⎥ ⎢−v0 ⎥ ⎢ g̃0 ⎥
⎢ G̃0 P̃1 ⎥ ⎢ λ0 ⎥ ⎢ −h̃0 ⎥
⎢ ⎥⎢
⎢ P̃1T H̃1 G̃1T ⎥ ⎢−v Z ⎥ ⎢ ⎥
⎢ ⎥⎢ 1 ⎥ ⎢ g̃1 ⎥
⎢ .. ⎥ ⎢ λ ⎥ = ⎢ −h̃ ⎥
⎥ ⎢
⎥. (7.27)
⎢ G̃1 . ⎥⎢
⎥⎢ . ⎥ ⎢ 1⎥
1
⎢
⎢ .. ⎥ . ⎥ ⎢ .. ⎥
⎣ . P̃m ⎦ ⎣ . ⎦ ⎣ . ⎦
Z
P̃mT H̃m −v m g̃m
Solving (7.26a) for the null space part v iZ of the free subset v iF of the primal
unknowns, we find
H̃i v iZ = P̃iT λi−1 + G̃iT λi − g̃i , (7.28)
188 7 Linear Algebra for Block Structured QPs
T
Bi λi−1 + Ai λi + Bi+1 λi+1 = a i (7.32)
of the Cholesky factor of matrix (7.33). Here we have separated the upper
triangular diagonal block V0 ∈ n0 ×n0 and its off–diagonal block row D1 ∈
h h
n0 ×n1 from the Cholesky factor V1,...,m−1 of the remainder of the system.
h h
T
V1,...,m−1 V1,...,m−1 = A1,...,m−1 − D1T D1 . (7.36)
Observe now that the block column D1 consists of zero blocks except for
the single side–diagonal block entry V0−T B1T , and observe further that the
block product D1T D1 affects the block A1 of the remainder A1,...,m−1 of system
(7.33) only. Hence the block structure is carried over to the Cholesky factor,
which allows us to apply the presented identities to the subsequent blocks
1 to m − 1 as well. This is summarized in the following block tridiagonal
Cholesky decomposition procedure to be carried out in ascending order for
all nodes 0 i m − 1:
ViT Vi = Ai , (7.37a)
ViT Di+1 = Bi+1 T
0 ... 0 if i m − 2, (7.37b)
Ai+1 = Ai+1 − T
Di+1 Di+1 if i m − 2. (7.37c)
Using this decomposition the solution of system (7.33) to find the vector λ of
matching condition duals is now straightforward according to the following
recurrence relation:
Zi Ui−1 ,
def
Ji = (7.39c)
def F
ĝi = JiT ji,1 , (7.40)
def
a i = Ĝi ĝi + P̂i+1 ĝi+1 + Gi v i + Pi+1 v i+1 − hi (7.41)
Zi v iZ = Ji JiT ji,2
F
, (7.42a)
HiF F
Zi v iZ ,
def
ji,3 = ji,2 + (7.42b)
HiX F
TiT μA T F
i = Yi ji,3 , (7.42c)
X T
νi = ji,3 − RiAX μi . (7.42d)
tinuous, allowing at least the use of Level 1 BLAS. Indexed linear algebra
operations on the subsets of the intermediates j1 , j2 , and j3 can be avoided
by copying the affected vector elements to continuous storage in only O (n)
additional memory access operations.
The HPSC factorization is given in algorithm 7.2. The described improved
backsolve with the factorization is summarized in algorithm 7.1. Both algo-
rithms are implemented in our structure exploiting QP code qpHPSC, see
appendix A.
The tests for linear independence of the new active set and for positive
definiteness of the new Hessian, given in theorem 6.8, require a backsolve
with a special right hand side that has only a single nonzero block. In this
section we describe a tailored backsolve procedure for the degeneracy test.
Testing for linear independence of the new active set requires a backsolve
with the following special right hand side:
1. If the constraint entering the active set is point constraint row k of
node j , we have for 0 i m
RAj,k if i = j,
g = 0, h = 0, b = 0, ri = (7.43)
0 otherwise.
As constraints only affect a single node in the block structured QP (7.4), the
block vector has a single nonzero block only. This property may be exploited
to speed up the linear independence test as follows.
Let a point constraint in node j become active, and let r j = RA
def
j,k denote
Y
the new constraint row k of RA X
j . We find v = 0 for all blocks, v i = 0 for all
192 7 Linear Algebra for Block Structured QPs
i = j , and v Y −1
j = T j r j . The intermediate terms introduced in section 7.3.5
simplify to
def H j Yj v Y
j + g j if i = j,
ji,1 = (7.45a)
0 otherwise,
def
ji,2 = ji,1 − PiT λi−1 + GiT λi . (7.45b)
The forward sweep then yields λ̃i = 0 for all i < j − 1, while we cannot
infer λi = 0 from any of the backward sweep steps. At this point no further
significant savings can be made.
The HPSC factorization does not allow for significant savings to be made
when testing for boundedness of the Parametric Quadratic Program (PQP)
after a constraint has left the active set.
i.e., for boundedness of the PQP are thus omitted. This is additionally jus-
tified by noting that in an MPC problem formulation, all system states and
control parameters typically reside in bounded domains.
Algorithm 7.2: The HPSC factorization for the multiple shooting EQP’s
KKT system.
input : KKT system blocks H F F , G F , P F , RAF .
output : HPSC factorization T , Y , Z, U, V, D .
for i = 0 : m do
T
[Ti , Yi , Zi ] = tq(RiAF );
Ui = chol(ZiT HiF F Zi );
Ji = Zi /Ui ;
if i < m then Ĝi = GiF Ji ;
if i > 0 then P̂i = PiF Ji ;
end
A0 = 0 ;
for i = 0 : m − 1 do
Ai += Ĝi ĜiT + P̂i+1 P̂i+1
T
;
Vi = chol(Ai );
if i < m − 1 then
Di+1 = ViT \P̂i+1 ĜiT ;
Ai+1 = −Di+1T
Di+1 ;
end
end
If the Hessian blocks HiF F are positive definite for all occuring active sets,
and the QP thus is strictly convex, a simplification of the presented fac-
torization and backsolve procedure can be derived based on conjugacy, cf.
[158].
F
= HiF X v iX + gi , F
def def
H̃i = I, ji,1 g̃i = ZiT ji,1 . (7.52)
As the projected Hessian is the identity, the Schur complement step in-
cluding the Cholesky decomposition of the projected Hessian vanishes com-
pletely,
Zi v iZ = Zi ZiT ji,2
F
, (7.54a)
TiT μi = v iY F
+ YiT ji,2 , (7.54b)
X T
νi = ti,2 − RiX μi + HiX F Zi v iZ . (7.54c)
7.4.1 Applicability
The following theorem shows that, given a KKT system with direct multiple
shooting block structure, the HPSC factorization is as widely applicable as
the popular null space method for solving the KKT system of a dense QP.
Proof Assumption (2.) implies regularity of the RiAF and thus existence of
the TQ decompositions. Assumption (3.) guarantees the existence of the
Cholesky decompositions of the projected Hessian blocks H̃i = ZiT HiF F Zi .
It remains to be shown that the block tridiagonal system (7.33) which we
denote by K is positive definite. To this end, observe that we have for (7.33)
the representation
⎡ ⎤
A0 B1T
⎢ ⎥
⎢ B1 A1 B2T ⎥
⎢ ⎥
K =⎢ .. ⎥ (7.55)
⎢ B2 A2 .⎥
⎣ ⎦
.. ..
. .
⎡ ⎤⎡ ⎤⎡ ⎤
G0 P1 GT
⎢ ⎥ ⎢H̃0 ⎥ ⎢ 0T ⎥
⎢ G1 P 2 ⎥⎢ H̃1 ⎥ ⎢ P1 G1T ⎥
⎢ ⎥
=⎢ .. ⎥ ⎢ ⎥⎢ ⎥
⎢ G2 . ⎥ ⎢ H̃2 ⎥⎢ P2T G2T ⎥
⎣ ⎦⎣ ..
⎦⎣
.. ..
⎦
. .. . . .
def
= M H̃ M T .
∀w = 0 : w T H̃ w > 0. (7.56)
T
∀v = 0 : (M T v ) H̃(M T v ) = v T (M H̃ M T )v = v T K v > 0 (7.57)
which is the condition for positive definiteness of the system K . This com-
pletes the proof.
7.4.2 Uniqueness
Proof The employed Cholesky factorizations are unique. Thus the unique-
ness properties of the initial block QR factorizations carry over to the HPSC
T
factorization. The thin TQ factorizations RiAF Yi = Ti are unique up to the
signs of the reverse diagonal elements of the Ti and the choice of Zi is free
subject to orthonormality of Q i = [ Zi Yi ]. For proofs of the uniqueness prop-
erties of Cholesky and QR factorizations we refer to e.g. [89].
7.4.3 Stability
Pivoting
We refer to [89] and the references found therein for details. The most
promising option probably is symmetric block pivoting of the block tridi-
agonal Cholesky decomposition of system (7.33). This last option requires
cheap condition estimates of the diagonal blocks Ai and can be shown to
produce at most one additional off-diagonal block in system (7.33).
Iterative Refinement
part remains free and are defined as the result of optimization problems on
the manifolds
def
u
Ni (x ) = u ∈ n | Rix x + Riu u = ei .
We further define the manifolds of feasible states under the mapping defined
by Gi , Pi+1 , hi ,
def
x
Si (x i+1 , u i+1 ) = x ∈ n | ∃u ∈ N (x ) : Gix x + Giu u + Pi+1
x
x i+1 + Pi+1
u
u i+1 = hi ,
and the manifold of feasible controls for a given feasible initial state x i
alike,
def
Ui (x i , x i+1 , u i+1 ) = u ∈ N (x i ) | Gix x i + Giu u + Pi+1
x
x i+1 + Pi+1
u
u i+1 = hi .
For a given state x m−1 , the optimal control u m−1 , steering the process to
the terminal state x m ∈ Sm is now chosen according to Bellman’s principle
as minimizer of the objective ϕ
% &
u m−1 (x m−1 ) = argmin ϕm−1 (u, x m−1 , x m ) | u ∈ Um−1 (x m−1 , x m ) .
u
As can be seen, this control can be determined locally, i.e., without consid-
eration of the unknowns 0 i m − 2, once we have found x m−1 . In the
same spirit, all further values can be found during a backward sweep start-
ing with i = m − 2 as solutions of local optimization problems depending on
200 7 Linear Algebra for Block Structured QPs
u0 u1
x1 x2 xm
x0 G0 , P1 , h0 G1 , P2 , h1 ...
R0 , e0 R1 , e1 Rm , e m
The initial state x 0 is finally found by minimizing over S0 , and determines all
other unknowns. In the case of Nonlinear Model Predictive Control (NMPC),
S0 only contains one element, the estimated or measured system state em-
bedded by the initial value embedding constraint.
n and n + n = n.
F F X
7.5 Computational Complexity 201
Cost of a Factorization
Step FLOPs
QR decomposition C 2 (n − C3 )
Projected Hessian nZ nF (nZ + nF )
1 Z3
Cholesky decomposition
3
n
2
Temporary J1 nF nZ
Schur complements 2nx nF nZ
Tridiagonal blocks 2 nx 3
7 x3
Cholesky decomposition
3
n
Table 7.1: FLOP counts per shooting node for the HPSC factorization, algorithm 7.2.
Cost of a Backsolve
The operation counts for all steps of the backsolve algorithm 7.1 with the
HPSC factorization can be found in table 7.2. Overall, the computational
202 7 Linear Algebra for Block Structured QPs
Step FLOPs
Table 7.2: FLOP counts per shooting node for a backsolve with the HPSC factoriza-
tion, algorithm 7.1.
Table 7.3: FLOP bounds for a backsolve with the HPSC factorization depending on
the active set. Lower order terms are dropped.
Table 7.4: Memory requirements per shooting node for the matrices and factors
computed by the HPSC factorization, algorithm 7.1.
7.6 Summary
In this section, we have examined in detail the block structure of the quadra-
tic subproblems induced by the multiple shooting discretization. We have
surveyed block structured algorithms for its solution, such as condensing
204 7 Linear Algebra for Block Structured QPs
that preprocesses the block structured QP into a smaller but dense one,
and Riccati iterations which can be derived by a dynamic programming ar-
gument. Factorizations of the QP’s KKT system that exploit arbitrary spar-
sity patterns, such as LDL T and LU decompositions, have been mentioned.
Examination of these menthods showed that they either are inappropriate
for OCPs with many control parameters, cannot easily be incorporated in
active set methods, or are likely to suffer from fill–in after a few iterations
of the active set method.
To address this issue, we have presented a new block structured factoriza-
tion of the QP’s KKT system that can for the case of MIOCPs be computed
efficiently in O (mn) + O (mn2 nx ) operations, and is thus ideally suited for
long horizons and problems with many control parameters. We have investi-
gated a computationally efficient implementation of this factorization in the
context of the parametric active set method for QPVCs of chapter 6 that has
been realized in our block structured QP code qpHPSC. We have derived a
simplification based on conjugacy applicable to problems with positive def-
inite Hessian. Memory requirements and floating point operations for all
parts of the factorization algorithm and the backsolve algorithm have been
presented in detail.
8 Matrix Updates for the Block Structured
Factorization
In this section we briefly present the principal ideas behind selected ex-
isting matrix updates for Cholesky and QR factorizations to familiarize the
reader with the issues and techniques of updating matrix factors. We refer
to [83] for proofs of correctness and details on numerical stability, alterna-
tive approaches, and a comparison of their computational effort.
From this relation we easily determine expressions for the new column en-
tries r and of the updated Cholesky factor,
r = R−T a, (8.2)
1
T
= (α − r r ) . 2
provides factors of the updated matrix which are rectangular and whose
pattern of nonzero entries does not show upper triangular shape. Orthog-
onal eliminations can be used to restore the shape and yield an updated
Cholesky factor. A downdate can be realized by observing
rT r R α aT
= (8.4)
RT 0 0 a RT R
wherein the entries r and of the first column of the extended factor are
chosen as in (8.2). The extended factor is specifically constructed to allow
the use of orthogonal eliminations for the transformation of the factors on
the left hand side to the new shape
1
0T α 2 0 R α αa T
1 1 1 = T (8.5)
R T α 2 a α 2 α 2 aT αa R R + αaa T
which yields the new Cholesky factor R satisfying the desired identity
R T R = R T R − αaa T . Positive definiteness is again maintained only if
α > rT r.
where Q1 has gained a row from Q2 . This allows to compute the new ele-
ments r and of the triangular factor by exploiting orthogonality of Q to
find
r
Q1 a
T
= . (8.8)
⎡ ⎤
Ii−1
⎢ ⎥
⎢ cos ϕ sin ϕ ⎥
⎢ ⎥
=⎢ ⎥.
j def
Oi (ϕ) ⎢ I j−i−1 ⎥ (8.9)
⎢ − sin ϕ cos ϕ ⎥
⎣ ⎦
In− j
j j
Multiplication of Oi with a vector from the right (Oi v ) represents a clock-
wise rotation of the (i, j) plane by the angle ϕ , while multiplication from
j
the left ( v T Oi ) represents a counterclockwise rotation in a standard right–
handed coordinate system. Givens matrices can be constructed to zero out
a single element of a vector by modifying another single element only.
j
Definition 8.2 (Orthogonal Eliminations Oi )
j
The orthogonal elimination matrix Oi (v ) ∈ n×n , 1 i, j n, i = j for a vector
v ∈ n is defined element–wise as
⎧
vi / if (k, l) = (i, i) ∨ (k, l) = ( j, j),
⎪
⎪
⎪
j def ⎨ j /
v if (k, l) = (i, j),
Oi (v ) kl = −v j / if (k, l) = ( j, i), (8.10)
⎪
⎪
⎪
⎩1 if k = l ∧ k = i ∧ k = j,
0 otherwise,
def
with = vi2 + v 2j .
From the above definition it can be seen that orthogonal elimination ma-
trices can actually be constructed without the need to evaluate trigonomet-
ric functions in order to compute the angle ϕ . The following lemma formally
states the properties of orthogonal elimination matrices.
j
In particular, the multiplication from the left Oi A applies the Givens rota-
jT
tion to all columns of A, while the multiplication from the right AOi applies
it to all rows of A. Algorithm 8.1 is an exemplary way of computing and
storing an orthogonal elimination that eliminates v j by modifying vi . It re-
quires four multiplications and a square root. In [89, 99] details on the fast
and numerically stable computation of orthogonal elimination matrices can
be found that improve algorithm 8.1 and are used in our implementation
qpHPSC.
8.1.3 Applications
For dense active set range space and null space methods it is known that a
sequence of a QR decomposition and a Cholesky decomposition can be up-
dated properly after active set changes. A description of the necessary steps
for a dense null space active set method can be found e.g. in [67, 158]. Up-
date techniques for the LU factorization can be found in [62] and are used
in an active set method in [108], but are not relevant for the HPSC factor-
ization. Schur complement updates are used in a dual active set method by
[12] that assumes a block diagonal Hessian.
In this section, we derive matrix updates for the block local reductions of the
HPSC factorization for all four cases of active set changes. The first steps
of the matrix updates concerning the TQ decomposition and the Cholesky
decomposition of the null space Hessian are known from the dense null
space method, cf. [158] and the description of an actual implementation
in [67]. The extensions to the Schur complement step and the block tridi-
agonal Cholesky decomposition are new contributions and have first been
published in [121]. Matrix updates for the block tridiagonal Cholesky de-
composition of the reduced symmetric positive definite system (7.33) are
treated in the next section.
8.2.1 Preliminaries
Notation
def
K(A) = (H, R, G, P)
the block structured KKT system 7.7 on page 178 for a given active set A.
We further denote by the list of matrices
def
H(A) = (T , Z, Y , U, Ĝ, P̂, V, D)
212 8 Updates for the Block Structured Factorization
Permutations
are the permuted vectors of free unknowns. Then a HPSC factorization H of the
permuted KKT system K (A) is given by
Yi = Πi Yi , Zi = Πi Zi ,
def def
(8.11)
Proof We first consider the block matrix entries of the permuted KKT sys-
tem K . For invariance of the KKT system under the permutations Πi of the
free unknowns x iF , it holds that
RiAF = RiAF ΠiT , =⇒ RiAF x iF = RiAF ΠiT Πi x iF = RiAF x iF ,
GiF = GiF ΠiT , =⇒ GiF x iF = GiF ΠiT Πi x iF = GiF x iF ,
PiF = PiF ΠiT , =⇒ PiF x iF = PiF ΠiT Πi x iF = PiF x iF ,
T T
HiF F = Πi HiF F ΠiT , =⇒ x iF HiF F x iF = x iF ΠiT ΠHiF F ΠiT Πi x iF
T
= x iF HiF F x iF .
For the first step of the HPSC factorization, the block local TQ factorizations
of the free unknowns part of the active point constraints’ Jacobians RiAF ,
observe
0 Ti = RiAF Zi Yi = RiAF ΠiT Πi Zi Yi (8.12)
- ./ 0
=I
= RiAF Πi Zi Πi Yi = RiAF Zi Yi = 0 Ti ,
8.2 Updating the Block Local Reductions 213
which proves the relations (8.11) for Yi , Zi and invariance of the southest
triangular factor Ti = Ti . For the Cholesky factors Ui of the projected Hes-
sians H̃i , we find
Ui Ui = Zi HiF F Zi = ZiT ΠiT (Πi HiF F ΠiT )Πi Zi = ZiT HiF F Zi = UiT Ui ,
T T
- ./ 0 - ./ 0
=I =I
(8.13)
hence the Cholesky factors Ui of the permuted KKT system’s HPSC factor-
ization are identical to the factors Ui of the original one. The Schur comple-
ments Ĝi and P̂i are unaffected as well,
Ĝi = GiF Zi Ui−1 = (GiF ΠiT )Πi Zi Ui−1 = GiF Zi Ui−1 = Ĝi ,
def
(8.14)
- ./ 0
=I
P̂i PiF Zi Ui−1 (PiF Zi Ui−1 = PiF Zi Ui−1 = P̂i .
def
= = ΠiT )Πi
- ./ 0
=I
This evidently carries over to the blocks Ai and Bi of the positive definite
block tridiagonal system (7.33) on page 188,
T T T T
Ai = Ĝi Ĝi + P̂i P̂i = Ĝi Ĝi + P̂i P̂i = Ai ,
def
(8.15)
T T
Bi = Ĝi P̂i = Ĝi P̂i = Bi ,
def
and hence also to the Cholesky factor blocks Vi , Di of this system. This
completes the proof.
Note finally that permutations of the fixed part v iX of the unknowns do not
affect the factorization. The Lagrange multipliers νiX of the active simple
bounds must be permuted accordingly.
Projectors
We will frequently need to remove the last row or column of a matrix, re-
flecting the fact that the number of free unknowns, or the size of the range
space or null space of a TQ decomposition has decreased by one. To this
end, we introduce the projector I that serves to cut a column or a row off a
matrix A, and give a proof of two useful properties of this projector.
214 8 Updates for the Block Structured Factorization
such that I T AI = Ã and I T A−1 I = B̃. For the inverse we have the defining
relation AB = I , implying ÃB̃ + a1 b2T = I and Ã−1 = B̃ holds iff a1 = 0
or b2 = 0. This includes, but is not limited to, the case of lower or upper
triangular matrices A, as claimed. Finally to prove 4. we let O = [ Õ o ] such
that O I = Õ and find
I = OO T = Õ Õ T + oo T = O II T O T + oo T .
Algorithms
In the following, all matrix updates are also summarized in the form of al-
gorithms, on which we have several remarks to be made concerning their
presentation and efficiency.
8.2 Updating the Block Local Reductions 215
If a simple bound viFj = bi j becomes active, we may assume w.l.o.g. that the
unknown to be fixed is the last component j = nF F
i of v i . This can be ensured
by applying a suitable permutation to the unknown v iF and the matrix Q i ,
cf. theorem 8.1. In the following theorem we show how to restore the block
local reductions of a HPSC factorization for the new KKT matrix with active
simple bound on viFj .
Ai−1 = Ai−1 − p̂ p̂ ,
T
Ai = Ai − ĝ ĝ ,
T
Bi = Bi − ĝ p̂ T
(8.17d)
216 8 Updates for the Block Structured Factorization
where OZT with subsequences OZ and OT , and OU are appropriately chosen se-
quences of Givens rotations.
that serve to transform t T = (tZT , tYT ) into the unit row vector e T ,
⎡ ⎤ ⎡ T T ⎤
t T
t T 0 0 1
⎢ Z Y ⎥ OZT ⎢ IiX
⎢ X ⎥ X ⎥ def
⎣ Ii ⎦ =⎣ Ii ⎦ = .
I 0 Ti RiAX
0 Ti RiAX Ti r RiAX
The last nF Z
i − n rotations of the sequence OT introduce a reverse subdiago-
nal into Ti . By shifting Ti to the left we obtain the new TQ factor Ti and the
null space dimension shrinks by one. The remaining column r belongs the
now fixed component vi j of the unknown and enters RiAX to form the new
fixed part of the active point constraints matrix RiAX . Having applied the
Givens rotations to the right hand side of (8.18) we do so in the same way
for the left hand side to recover equality and find the new null space and
range space bases Zi and Yi ,
8.2 Updating the Block Local Reductions 217
⎡ ⎤
Zi y Y 0
Zi Yi OZT ⎢ ⎥ def Zi Yi
=⎣ 0 0 1 ⎦= .
IiX I IiX
IiX
(8.20)
which proves the relations (8.17a) for the TQ factorization matrices Zi , Yi ,
and Ti .
We next consider the reduced Hessian’s Cholesky factor Ui (8.17b). We
have separated the first nZ − 1 rotations of the sequence OZT as they affect
the new null space basis matrix Zi only, such that (8.21) can be for the new
null space basis Zi as
Zi = I T Zi OZ I. (8.22)
Ui Ui = Zi HiF F Zi = I T OZT ZiT I(I T HiF F I)I T Zi OZ I
T T
(8.23)
I 0 I 0
= I T OZT ZiT HiF F Z O I.
0 0
T
0T 0 i Z
Apparently the terms II T obstruct the reuse of the existing Cholesky fac-
torization ZiT HiF F Zi = UiT Ui . Observe now that the last row of the matrix
Zi OZ I is zero as can be seen from (8.20) and is cut off in the definition of
Zi in (8.22). We may therefore replace the terms II T in (8.23) by I without
impacting equality and find
Ui Ui = Zi HiF F Zi = I T OZT ZiT HiF F Zi OZ I
T T
(8.24)
T
=I T
OZT UiT Ui OZ I = (Ui OZ I) Ui OZ I.
Z
OU = OnnZ −1 · . . . · O32 O21 ,
def
(8.25)
218 8 Updates for the Block Structured Factorization
Ui = I T OU Ui OZ I. (8.26)
This proves relation (8.17b) for the Cholesky factor Ui of the reduced Hes-
sian HiF F .
The updates (8.17c) to the projected sensitivity matrices Ĝi and P̂i can be
computed constructively from Zi and Ui as
−1
−1
Ĝi = GiF Zi Ui = GiF I I T Zi OZ I I T OU Ui OZ I (8.27)
−1
= GiF (II T )Zi OZ I I T OU Ui OZ I
−1
= GiF Zi OZ I I T OU Ui OZ I (8.28)
−1
= GiF Zi OZ II T OU Ui OZ I (8.29)
F −1 T
= Gi Zi OZ II OZ Ui OU I
T T
def
and with 4. in lemma 8.2, letting z = (OZ )[:,nZ ] , this becomes
= GiF Zi I − z z T Ui−1 OUT I (8.30)
= GiF Zi Ui−1 OUT I − GiF Zi z z T Ui−1 OUT I
= Ĝi OUT I − GiF Zi z z T Ui−1 OUT I .
This finally proves the claimed relations (8.17c). For the tridiagonal system
blocks Ai−1 , Ai and Bi in (8.17d) affected by the updates to Ĝi and P̂i we
find constructively that
T
T
Ai = Ĝi Ĝi + P̂i+1 P̂i+1
T
= Ĝi ORT I Ĝi OUT I + P̂i+1 P̂i+1
T
(8.32)
= Ĝi OUT II T OU ĜiT + P̂i+1 P̂i+1
T
def
which again by 4. in lemma 8.2 and u T = (OU )[nZ ,:] is
= Ĝi I − u u T ĜiT + P̂i+1 P̂i+1
T
(8.33)
T
= Ĝi ĜiT − (Ĝi u)(Ĝi u) + P̂i+1 P̂i+1
T
T
= Ai − (Ĝi u)(Ĝi u)
def
= Ai − ĝ ĝ T , ĝ = Ĝi u.
This proves the relations (8.17d) for the tridiagonal system blocks Ai−1 , Ai ,
and Bi .
⎡ ⎤ ⎡ ⎤
.. .. .. .. ⎡ ⎤ ⎡ ⎤T
⎢ . . ⎥ ⎢ . . ⎥ . .
⎢ ⎥ ⎢ ⎥ ⎢ .. ⎥ ⎢ .. ⎥
⎢. . ⎥ ⎢. . ⎥ ⎢ ⎥ ⎢ ⎥
⎢ . Ai−2 Bi−1
T ⎥ ⎢ . Ai−2 Bi−1 T ⎥ ⎢0⎥ ⎢0⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢ B A B T ⎥ ⎢ Bi−1 Ai−1 Bi T ⎥ ⎢ p̂ ⎥ ⎢ p̂ ⎥
⎢ i−1 i−1 i ⎥=⎢ ⎥+⎢ ⎥·⎢ ⎥ .
⎢ Bi Ai Bi+1 T ⎥ ⎢ Bi Ai Bi+1 T ⎥ ⎢ ĝ ⎥ ⎢ ĝ ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢ .. ⎥ ⎢ .. ⎥ ⎢0⎥ ⎢0⎥
⎢ .⎥ ⎢ .⎥ ⎢ ⎥ ⎢ ⎥
⎢ Bi+1 Ai+1 ⎥ ⎢ Bi+1 Ai+1 ⎥ ⎣.⎦ ⎣.⎦
⎣ .. ..
⎦ ⎣ .. .
⎦ . .
.. . .
. . .
Ai−1 = Ai−1 − p̂ p̂ ,T
Ai = Ai − ĝ ĝ ,
T
Bi = Bi − ĝ p̂ ,
T
(8.35d)
where
OZ and
OU are appropriately chosen sequences of Givens rotations, and τ =
F
Ri, j Zi OZ .
Proof We first consider the relations (8.35a) for the matrices Zi , Yi , and
Ti of the TQ factorization of the active point constraints. If an inactive point
constraint 1 j nri on node i becomes active, the row vector r T = (RiF ) j
def
is appended to the bottom of the matrix of active point constraints RiAF and
its TQ factorization
RiAF 0 Ti
Zi Yi = , (8.36)
rT tZT tYT
The factor Ti gains a row and column as the range space dimension in-
creases and the null space dimension decreases, To maintain equality in
(8.36) we apply the sequence OZ also to the left hand side,
OZ
RiAF Zi Yi (8.39)
I
def
= RiAF Zi y Yi = RiAF Zi Yi
This proves the relations (8.35a) for the TQ factorization matrices Zi , Yi ,
and Ti . The projected Hessian factor Ui would be
Ui Ui = Zi HiF F Zi = I T OZT ZiT HiF F Zi OZ I = I T OZT UiT Ui OZ I, (8.41)
T T
def Z
OU = OnnZ −1 · . . . · O23 O12 , (8.42)
again resulting in
Ui = I T OU Ui OZ I.
def
(8.43)
This shows relation (8.35b) for the reduced Hessian’s Cholesky factor Ui .
With this result the proof of the remaining relations (8.35c) for Ĝi and P̂i
and (8.35d) for Âi−1 , Âi , and B̂i proceeds exactly as in section 8.2.2.
Theorem 8.4 (Deleting a Simple Bound from the Block Local Reductions)
Let H(A) be a HPSC factorization of the KKT system K(A). Let the simple bound on
X
the first fixed component vi1 of the unknown v i of node 0 i m be active in A, and
denote by A the otherwise identical active set with inactivated simple bound. Then
there exists a HPSC factorization H (A ) of the KKT matrix K (A ) that satisfies
Zi z z Yi Yi
Zi = , = OT , (8.44a)
0T ζ ζ 0T 1
0 Ti = Ti (RiX )1 OT , (8.44b)
Ui u
Ui = , u = Ui−T Zi T (HiF F z + hζ), (8.44c)
0T
3
= z T (HiF F z + hζ) + ζ(h T z + ηζ) − u T u
Ĝi = Ĝi ĝ with ĝ = (GiF z − Ĝu)/, (8.44d)
P̂i = P̂i p̂ with p̂ = (PiF z − P̂ u)/,
Bi = Bi + ĝ p̂ T ,
Proof We again consider the TQ factorization of RiAF first. In the extended
constraints matrix
IiX Zi Yi IiX
= , (8.45)
RiF RiX IiX 0 Ti RiX
the row belonging to the simple bound is removed on the left hand side.
Consequentially, the first column of RiX belonging to the unknown vi1
X
to be
8.2 Updating the Block Local Reductions 223
freed from its bound becomes the last one of Ti on the right hand side,
⎡ ⎤
Zi Yi
IiX ⎢ ⎥ IiX
X ⎣ 1 ⎦= . (8.46)
RiF r1X Ri 0 Ti r1X RiX
IiX
The southeast triangular shape of the factor Ti r1X is restored by a se-
quence of nY Givens rotations
F T Z T
OT = OnnF +1 · . . . · OnnZ +1
+2
def
(8.47)
This proves relation (8.44b) for the new southeast triangular TQ factor Ti .
This proves relations (8.44a) and (8.44b) for the null space and range space
bases Zi and Yi .
In order to prove relation (8.44c) for Ui , we denote the elements of the
new last row and column of the Hessian HiF F by a known row/column vec-
tor h and a known scalar η for the new diagonal element. For the Hessian’s
Cholesky factor Ui yet to be determined, these are denoted by an unknown
column vector u and an unknown scalar for the new diagonal element,
HiF F h Ui u
HiF F Ui
def def
= , = . (8.50)
hT η 0T
For the new projected Hessian factor Ui we find from expanding the pro-
jected Hessian Zi HiF F Zi = Ui Ui to
T T
224 8 Updates for the Block Structured Factorization
Zi T 0 HiF F h Zi z Ui T Ui Ui T u
= (8.51)
zT ζ hT η 0T ζ u Ui u u + 2
T T
that we can compute the factor’s new column entries u and from the
entries h and η of HiF F as follows,
This proves relation (8.44c) for the projected Hessian Cholesky factor Ui .
We next consider the Schur complement relations (8.44d). Since the ini-
tial nZ columns of Zi and Ui are identical to those of Zi and Ui , we find for
the Schur complements Ĝi and P̂i that Ĝi = Ĝi ĝ where ĝ is an additional
column that can be found as follows:
Ĝi Ui = GiF Zi (8.53)
Ui u Zi z
F X
⇐⇒ Ĝi ĝ = G i g1
0T 0T ζ
⇐⇒ Ĝi Ui Ĝi u + ĝ = GiF Zi GiF z + g1X ζ
with g1X denoting the first column of the fixed variables part GiX of Gi . Solv-
ing for ĝ yields
This proves relation (8.44d) for Ĝi and the proof for P̂i can be carried out
in the same way.
Finally, to show relation (8.44e) for the tridiagonal system blocks Ai−1 ,
Ai ,
and Bi we compute
T
Ai = Ĝi Ĝi + P̂i+1 P̂i+1
T
= Ĝi ĜiT + ĝ ĝ T + P̂i+1 P̂i+1
T
= Ai + ĝ ĝ T . (8.55)
The block Ai is thus affected by a rank one update, and identical relations
hold for Ai−1 and Bi . This completes the proof.
Theorem 8.5 (Deleting a Point Constraint from the Block Local Reductions)
Let H(A) be a HPSC factorization of the KKT system K(A). Let the point constraint
(Ri )[ j,:] v i ri j on the unknown v i of node 0 i m be active in A, and denote by A
the otherwise identical active set with inactive point constraint. Then there exists a
HPSC factorization H (A ) of the KKT matrix K (A ) satisfying
Zi = Zi z , z Yi = Yi OT , 0 Ti = Ti OT , (8.56a)
Ui u u U −T Z T H F F z
Ui = with = 3 Ti FiF i , (8.56b)
0T z Hi z − u T u
Ĝi = Ĝi ĝ with ĝ = (GiF z − Ĝu)/, (8.56c)
P̂i = P̂i p̂ with p̂ =
(PiF z − P̂ u)/,
Ai−1 = Ai−1 + p̂ p̂ T
, Ai = Ai + ĝ ĝ T , Bi = Bi + ĝ p̂ T , (8.56d)
Proof We again start with the proof of relation (8.56a) for the TQ factor-
ization matrices Zi , Yi , and the southeast triangular factor Ti . The row j
of RiAF belonging to the point constraint to be inactivated is removed from
both RiAF and the triangular factor Ti in the TQ factorization. This yields
RiAF Zi Yi = 0 T̃i (8.57)
where the triangular shape of T̃i has been destroyed by the removal of row
j . We restore it using the series of nY − j Givens rotations
def nY − j+1 T T
OT = OnY − j · . . . · O12 . (8.58)
226 8 Updates for the Block Structured Factorization
We find that Ti shrinks by one row and column reflecting the increased
dimension of the null space. Applying OT to the right hand side of (8.57) to
maintain equality, the null space basis Zi remains unaffected we obtain
InZ def
Zi Yi = Zi z Yi = Zi Yi . (8.60)
OT
This proves relation (8.56a) for the TQ factorization matrices Zi , Yi , and
Ti .
Relation (8.56b) for the Cholesky factor Ui of the projected Hessian
Zi T HiF F Zi
is derived as follows. Denoting the new elements of the Hes-
sian factor again with a vector u and a scalar ,
Ui u
Ui = , (8.61)
0T
we determine the new column entries of the Hessian factor Ui similar to
8.2.4 from
T Ui T Ui Ui T u
Zi z HiF F Zi z = . (8.62)
u Ui u u + 2
T T
Observing HiF F = HiF F as the set of active simple bounds did not change,
this yields
u = Ui−T Zi T HiF F z, = z T HiF F z − u T u. (8.63)
This proves relation (8.56b) for the Cholesky factor Ui of the reduced Hes-
sian.
Finally, relation (8.56c) for the Schur complements Ĝi and P̂i can again
be found constructively in the form Ĝi = Ĝi ĝ as the initial nZ columns
of Zi and Ui remained unchanged. Here again ĝ is an additional column that
is determined as follows. From
8.2 Updating the Block Local Reductions 227
Ĝi ĝ u i = GiF Zi ⇐⇒ Ĝi Ui Ĝi u + ĝ = GiF Zi GiF z (8.64)
With this result for Ĝi and the analogous one for P̂i relation (8.56c) is shown
and the proof of relation (8.56d) for the tridiagonal system blocks Ai−1 , Ai ,
and Bi proceeds as in section 8.2.4.
Algorithm 8.3: Matrix updates adding a simple bound to the active set.
input : K, H, i
output : H
t = Q i [nF ,:] ;
for k = 1 : nZ − 1 do
[s, c] = givens(t , k + 1, k);
[t , Q i , Ui ] = apply([t , Q i , Ui ], s, c, k + 1, k);
end
Ti = zeros(nY , nZ ) Ti ;
for k = nZ : nF − 1 do
[s, c] = givens(t , k + 1, k);
[t , Q i , Ti ] = apply([t , Q i , Ti ], s, c, k + 1, k);
end
Ti = Ti [:,nZ :nF −1] ;
for k = 1 : nZ − 1 do
[s, c] = givens(U[:,k] , k, k + 1);
[UiT , Ĝi , P̂i ] = apply([UiT , Ĝi , P̂i ], s, c, k, k + 1);
end
Ui = Ui [1:nZ −1,1:nZ −1] ;
ĝ = Ĝi [:,nZ ] ; p̂ = P̂i [:,nZ ] ;
Ĝi = Ĝi [:,1:nZ −1] ; P̂i = P̂i [:,1:nZ −1] ;
[V, D] = block_tri_choldown(V, D, ĝ , p̂, i);
228 8 Updates for the Block Structured Factorization
Further, let (V, D) be the upper triangular and subdiagonal blocks of the Cholesky
factorization of (A, B). Then it holds that the Cholesky factorization (V , D ) of
(A , B ) is obtained from (V, D) as
−T
z0 = y 0 , zi = δi−1 (DiT Vi−1 zi−1 − yi ), 1 i m − 2, (8.68)
and the sequences OVi of Givens rotations eliminating the diagonal of ViT denoted
by the matrix
oiT
def δi
OVi = . (8.69)
Oi −δi Vi−T yi
def
OV = O12 O23 · . . . · On−1
n
(8.70)
From the block tridiagonal Cholesky algorithm we have the identity D1 =
V0 −T B1 T which gives D1 = O11
−1 −T
V0 (B1T + z0 y1T ). The difficulty here lies with
−1
finding O11 , as O11 is not orthogonal. To address this issue, we expand the
above identity to
T −T
D1 T
o21 O11 0 1 B1T + z0 y1T T
O11 D1 + O11 V0 z0 y1T
= = .
d T
22 o12 V0−T −V0−T z0 0 T
o12 T −T
D1 + o12 V0 z0 y1T
D1 = O11
T
(D1 + V0−T z0 y1T ) (8.73)
as claimed. We now compute D1 D1 , the new downdate to the following
T
T
O11 O11 T
= I − o12 o12 = I − δn2 v v T (8.74)
Using this relation, the update of the next diagonal block A1 reads
In this section, we finally derive a rank one downdate procedure for the
block tridiagonal Cholesky factorization of system (7.33), to be used when
adding a simple bound or decoupled point constraint to the active set. The
8.3 Modifying the Block Tridiagonal Factorization 233
derivation is technically equivalent to that for the rank one update of sec-
tion 8.3 and differs only in several minor steps. As the obtained downdate
formulas are slightly different, we give the full derivation for completeness
here.
Further, let (V, D) be the upper triangular and subdiagonal blocks of the Cholesky
factorization of (A, B). Then it holds that the Cholesky factorization (V , D ) of (A, B)
is obtained from (V, D) as
Vi = Oi Vi , 0 i m − 1, (8.79)
Di = (Oi−1 − −T
oi−1 δ1 (Vi−1 zi−1 ) T )(Di − −T
Vi−1 zi−1 yi ), 1 i m − 1,
n
1 −T −T
z0 = y 0 , zi = δn
(Vi−1 zi−1 ) T (Di − Vi−1 zi−1 yi ) − δn yi , 1 i m − 2, (8.80)
and the sequences OVi of Givens rotations eliminating the diagonal of ViT denoted
by the matrix
def Oi oi
OVi = . (8.81)
ziT Vi−1 δi
def
OV = On+1
1 n−1
· . . . · On+1 n
· On+1 (8.83)
234 8 Updates for the Block Structured Factorization
to (8.82), yielding
O11 o12 v V0 0 V0
= . (8.84)
T
o21 22 δn 0 T 1 z0T
- ./ 0
= OV
z0 z0 . From (8.84) we get for V0 the expression V0 = O11 V0 and the identity
T
o21 = v to be used in the next section. As in section 8.3 we expand the iden-
−T
tity D1 = V0 B1 to exploit orthogonality of OV and by forming the inverse
T
As claimed, D1 is updated and its rows are affected by the Givens sequence
like the rows of V0 . A nontrivial dyadic term is added, though, due to non–
orthogonality of O11 . We now compute D1 D1 for the third step. We note
T
Using this relation, the downdate of the next diagonal block A1 reads
1
with a vector z1 = (D1T v − y1 ). This vector can be written more conve-
δn
niently as
8.4 Summary 235
1
z1T = δn
v T (D1 − v y1T ) − δn y1 (8.89)
which allows to reuse intermediate terms from (8.85). Closing the loop
by continuing with the downdate of V1 , we eventually obtain the claimed
relations for all further blocks by repeating the argument for the nodes
1, . . . , m − 1. This completes the proof.
8.4 Summary
In this section we derived fast matrix updates for the HPSC factorization
presented in chapter 7. We covered all four cases of active set changes that
can arise when solving the QP with direct multiple shooting block structure
by an active set method, namely addition or removal of a simple bound and
addition or removal of a decoupled point constraint. We gave formal proofs
236 8 Updates for the Block Structured Factorization
min x 3 (t f ) (9.1)
x (·),w (·)
x 1 (t)
s. t. ẋ 1 (t) = − sin(w1 (t))
sin(1)
+ x 1 (t) + x 2 (t) w22 (t) + x 1 (t) − x 2 (t) w33 (t), t ∈ T ,
ẋ 2 (t) = x 1 (t) + 2x 2 (t) w1 (t)
+ x 1 (t) − 2x 2 (t) w2 (t)
+ x 1 (t)x 2 (t) − x 3 (t) w22 (t) − w23 (t)
+ x 1 (t) + x 2 (t) w3 (t), t ∈T,
ẋ 3 (t) = x 12 (t) + x 22 (t), t ∈T,
x 1 (t) 0.4, t ∈T,
def
w (t) ∈ {(1, 0, 0), (0, 1, 0), (0, 0, 1)} = Ω, t ∈T,
x (t 0 ) = 12 , 12 , 0 .
The nonlinear Ordinary Differential Equation (ODE) system (9.1) has been
specially construction to include a number of nonlinearities that become ap-
parent in an inner convexification formulation that relaxes the binary con-
trol vector w (t), but vanish if the ODE dynamics are evaluated in binary
feasible choices ωi ∈ Ω only. In the outer convexification reformulation, we
introduce one binary control trajectory ωi (t) ∈ {0, 1} for all t ∈ T per choice
ωi found in the set Ω, and relax these trajectories to αi (t) ∈ [0, 1] for all
t ∈ T . The resulting problem is given in (9.2).
min x 3 (t f ) (9.2)
x (·),α(·)
In table 9.1 the objective function values x 3 (t f ) and the remaining infeasibil-
ity of the optimal solution for the relaxed problem after outer convexification
with respect to the integer control w (t) (9.2), and for the integer feasible so-
lution obtained from the partially convexified relaxed one by application of
sum–up rounding can be found for increasingly fine control discretizations
m. All problems have been solved to an acceptable KKT tolerance of 10−10 .
As can be seen clearly from table 9.1, the sum–up rounding solution’s objec-
tive converges to that of the partially convexified relaxed problem while the
infeasibility of the control–independent path constraint converges to zero.
Table 9.1: Objective function values and infeasibilities of the outer convexified re-
laxed problem (9.2), and the integer feasible solutions obtained from the
latter by sum–up rounding.
This would not be the case if we had applied sum–up rounding to the
solution of the original nonlinear problem (9.1). Due to sum–up rounding of
9.1 Mixed–Integer Optimal Control with Switch Costs 241
1 1 1
x 1 (t)
x 2 (t)
x 3 (t)
0.5 0.5 0.5
0 0 0
0 0.5 1 0 0.5 1 0 0.5 1
t t t
(a) State x 1 (·) for m = 20. (b) State x 2 (·) for m = 20. (c) State x 3 (·) for m = 20.
1 1 1
α1 (t)
α2 (t)
α3 (t)
0.5 0.5 0.5
0 0 0
0 0.5 1 0 0.5 1 0 0.5 1
t t t
(d) Control α1 (·) for m = 20. (e) Control α2 (·) for m = 20. (f) Control α3 (·) for m = 20.
1 1 1
x 3 (t)
x 1 (t)
x 2 (t)
0 0 0
0 0.5 1 0 0.5 1 0 0.5 1
t t t
(g) State x 1 (·) for m = 320. (h) State x 2 (·) for m = 320. (i) State x 3 (·) for m = 320.
1 1 1
α1 (t)
α2 (t)
α3 (t)
0 0 0
0 0.5 1 0 0.5 1 0 0.5 1
t t t
(j) Control α1 (·) for m = 320. (k) Control α2 (·) for m = 320. (l) Control α3 (·) for m = 320.
Figure 9.1: Relaxed optimal solutions of the partially convexified problem (9.2) for
discretizations m = 20 and m = 320 of the control trajectory.
242 9 Numerical Results
2 3
w(t)
x (t)
1 2
0 1
0 0.5 1 0 0.5 1
t t
(a) SUR-0.5 state trajectory x (·) for m = 20. (b) SUR-0.5 control trajectory ω(·) for m =
20. Control has 9 switches.
2 3
w(t)
x (t)
1 2
0 1
0 0.5 1 0 0.5 1
t t
(c) SUR-0.5 state trajectory x (·) for m = 40. (d) SUR-0.5 control trajectory ω(·) for m =
40. Control has 12 switches.
2 3
w(t)
x (t)
1 2
0 1
0 0.5 1 0 0.5 1
t t
(e) SUR-0.5 state trajectory x (·) for m = 80. (f) SUR-0.5 control trajectory ω(·) for m = 80.
Control has 23 switches.
2 3
w(t)
x (t)
1 2
0 1
0 0.5 1 0 0.5 1
t t
(g) SUR-0.5 state trajectory x (·) for m = 160. (h) SUR-0.5 control trajectory ω(·) for m =
160. Control has 47 switches.
2 3
w(t)
x (t)
1 2
0 1
0 0.5 1 0 0.5 1
t t
(i) SUR-0.5 state trajectory x (·) for m = 320. (j) SUR-0.5 control trajectory ω(·) for m =
320. Control has 93 switches.
Figure 9.2: Sum–up rounding solutions of problem (9.2) for increasingly fine control
discretizations m = 20, 40, 80, 160, 320. Sum–up rounding state tra-
jectories are colored as x 1 (t) (—), x 2 (t) (—), and x 3 (t) (—). Chattering
between w(t) = 2 and w(t) = 3 occurs on the path constrained arc and
chattering between w(t) = 1 and 3 w(t) = 2 on the singular arc. The inte-
ger control trajectory w(t) = i=1 iαi (t) is shown in the right column.
9.1 Mixed–Integer Optimal Control with Switch Costs 243
the control, the state trajectory x 1 (t) violates the path constraint x 1 (t)
0.4 on the path–constrained arc.
The solutions to the partially convexified and relaxed problem (9.2) are
also depicted in figure 9.1 for two choices m = 20 and m = 320 of the
control trajectory. Figure 9.2 shows the sum–up rounding solutions corre-
sponding to table 9.1. On the path–constrained arc and the singular arc,
sum–up rounding leads to chattering of the integer control trajectory.
m−1 3
min x m,3 + π σi, j (9.3a)
x ,α,σ,a
i=0 j=1
a i ∈ [0, 1]3 , 0 i m − 1.
9.1.5 Summary
9 1.025428 9 5 1.043467 0 10
10 1.020497 10 9 1.017587 1.80 · 10−4 11
11 1.015846 11 10 1.017741 7.00 · 10−5 11
12 1.011306 12 13 1.007177 3.27 · 10−4 13
Table 9.2: Solutions constraining the number of switches found for problem (9.3)
and m = 100 using our convex switch cost formulation.
246 9 Numerical Results
Table 9.3: Solutions penalizing the number of switches found for problem (9.3) and
m = 100 using our convex switch cost formulation.
9.1 Mixed–Integer Optimal Control with Switch Costs 247
2 3
w(t)
x (t)
1 2
0 1
0 0.5 1 0 0.5 1
t t
(a) SUR-0.5 state trajectory x (·) for π = 2−6 . (b) SUR-0.5 control trajectory ω(·) for π =
2−6 .
2 3
w(t)
x (t)
1 2
0 1
0 0.5 1 0 0.5 1
t t
(c) SUR-0.5 state trajectory x (·) for π = 2−7 . (d) SUR-0.5 control trajectory ω(·) for π =
2−7 .
2 3
w(t)
x (t)
1 2
0 1
0 0.5 1 0 0.5 1
t t
(e) SUR-0.5 state trajectory x (·) for π = 2−8 . (f) SUR-0.5 control trajectory ω(·) for π =
2−8 .
2 3
w(t)
x (t)
1 2
0 1
0 0.5 1 0 0.5 1
t t
(g) SUR-0.5 state trajectory x (·) for π = 2−9 . (h) SUR-0.5 control trajectory ω(·) for π =
2−9 .
2 3
w(t)
x (t)
1 2
0 1
0 0.5 1 0 0.5 1
t t
(i) SUR-0.5 state trajectory x (·) for π = 2−10 . (j) SUR-0.5 control trajectory ω(·) for π =
2−10 .
Figure 9.3: Selected sum–up rounding solutions of problem (9.3) penalizing the total
switch cost for m = 100 and penalties of π = 2−6 to π = 2−10 on the
switch cost of the convexified relaxed problem. Sum–up rounding state
trajectories are colored as x 1 (t) (—), x 2 (t) (—), and x 3 (t) (—).
248 9 Numerical Results
2 3
w(t)
x (t)
1 2
0 1
0 0.5 1 0 0.5 1
t t
(a) SUR-0.5 state trajectory x (·) for σmax = 9. (b) SUR-0.5 control trajectory α(·) for σmax =
9. Control has 10 switches.
2 3
w(t)
x (t)
1 2
0 1
0 0.5 1 0 0.5 1
t t
(c) SUR-0.5 state trajectory x (·) for σmax = (d) SUR-0.5 control trajectory α(·) for σmax =
10. 10. Control has 11 switches.
2 3
w(t)
x (t)
1 2
0 1
0 0.5 1 0 0.5 1
t t
(e) SUR-0.5 state trajectory x (·) for σmax = (f) SUR-0.5 control trajectory α(·) for σmax =
11. 11. Control has 11 switches.
2 3
w(t)
x (t)
1 2
0 1
0 0.5 1 0 0.5 1
t t
(g) SUR-0.5 state trajectory x (·) for σmax = (h) SUR-0.5 control trajectory α(·) for σmax =
12. 12. Control has 13 switches.
Figure 9.4: Selected sum–up rounding solutions of problem (9.3) constraining the
total number of switches for m = 100 and constraints σmax = 9 to
σmax = 12 on the number of switches of the convexified relaxed prob-
lem’s solution. If the relaxed solutions are not integer feasible, sum–
up rounding solutions may switch slightly more often. Sum–up rounding
state trajectories are colored as x 1 (t) (—), x 2 (t) (—), and x 3 (t) (—).
9.2 Mixed–Integer NMPC Scheme Contractivity 249
In this section we study the application of the contractivity estimates for the
mixed–integer real–time iteration scheme of chapter 4 at the example of a
small but nonlinear and instable problem due to [51]. We demonstrate again
the outer convexification reformulation and the sum–up rounding approx-
imation. We derive certain bounds, Lipschitz constants, and contractivity
constants for this example. The mixed–integer real–time iteration contrac-
tivity theorem and the resulting sampling time bound are evaluated and
numerical computations are performed for its verification.
can be satisfied within the bounds of w(t). The applicable control w(·) is
bounded by −1 and 1, hence the steady state can be reached only for
0.1
w(t) 0.1
x(t)
0.05 0
-0.1
0
0 1 2 3 0 1 2 3
t [s] t [s]
(a) Differential state trajectory x(·). (b) Relaxed piecewise constant optimal con-
trol trajectory w(·).
Figure 9.5: Relaxed optimal solution for problem (9.4), steering the process back
from an initial value x(0) = 0.05 into its unstable steady state.
1 1
0 0
-1 -1
-2 -2
0 1 2 3 0 1 2 3
(a) Instable steady state x(t) = 0 and the sta-(b) States below x(t) = + 5) can be 1
(−1
2
ble one x(t) = −1; no control applied steered back to the steady state using
u(t) −1.
Figure 9.6: Vector fields showing stable and instable steady state of problem (9.4).
9.2 Mixed–Integer NMPC Scheme Contractivity 251
the process. In this case, the runaway behavior further reduces the set of
admissible initial values that can be steered back to the instable steady
state.
terval durations are subject to optimization while the controls are fixed to
the SUR-0.5 solution values.
Table 9.4: Objective functions and 1–norms of infeasibilities of the solutions to prob-
lem (9.6) shown in figure 9.7. With increasingly finer granularity of the
control discretization, the SUR-0.5 solution succeeds in approaching fea-
sibility of the end point constraint and approximating the objective of the
convexified relaxed problem. The relaxed convexified solution showed one
fractional control for all investigated choices of m.
9.2.2 Constants
• The bound on the ODE system’s right hand side after convexifica-
tion f˜(t, x(t)) = x 2 (t) + x(t) on the domain (t, x) ∈ D (x 0 ) = [0, 3] ×
def
• The local Lipschitz constant on the ODE system’s right hand side after
convexification f˜(t, x(t)) on D (x 0 ) is
def
sup |2x + 1| = |2x 0 + 1| = Af̃ (x 0 ), Af̃ (− 12 + 1
2
5) = 5. (9.8)
D
9.2 Mixed–Integer NMPC Scheme Contractivity 253
1 1
w(t)
x(t)
0.5 0
0 -1
0 1 2 3 0 1 2 3
t [s] t [s]
(a) State trajectory x(·) for m = 20. (b) SUR-0.5 control trajectory w(·) for m = 20.
0 1
w(t)
x(t)
-0.5 0
-1 -1
0 1 2 3 0 1 2 3
t [s] t [s]
(c) State trajectory x(·) for m = 40. (d) SUR-0.5 control trajectory w(·) for m = 40.
1 1
w(t)
x(t)
0.5 0
0 -1
0 1 2 3 0 1 2 3
t [s] t [s]
(e) State trajectory x(·) for m = 80. (f) SUR-0.5 control trajectory w(·) for m = 80.
0 1
w(t)
x(t)
-0.5 0
-1 -1
0 1 2 3 0 1 2 3
t [s] t [s]
(g) State trajectory x(·), m = 160. (h) SUR-0.5 control trajectory w(·), m = 160.
1 1
w(t)
x(t)
0.5 0
0 -1
0 1 2 3 0 1 2 3
t [s] t [s]
(i) State trajectory x(·), m = 320. (j) SUR-0.5 control trajectory w(·), m = 320.
0.1 1
w(t)
x(t)
0 0
-0.1 -1
0 1 2 3 0 1 2 3
t [s] t [s]
(k) State trajectory x(·), m = 640. (l) SUR-0.5 control trajectory w(·), m = 640.
Figure 9.7: Sum–up rounding integer solution for problem (9.6) attempting to keep
the process in a neighborhood of its instable steady state, starting from
an initial value of x(0) = 0.05 Solutions are shown for different granu-
larities m = 20, 40, 80, 160, 320, 640 of the control discretization.
254 9 Numerical Results
• The two contraction constants κ and ω of theorem 4.3 and the bound
β on the norm of M̃ k+1 (y k+1 ) are not easily derived explicitly. We in-
stead compute underestimates after every SQP iteration of the classi-
cal real–time iteration scheme on the problem (9.6) using definitions
3.12 and 3.13. The maximal underestimators obtained over 100 real–
time iterations for various initial values and control discretizations are
shown in figure 9.8 from which we determine κ 0.34 and ω 0.56.
The norm bound β depends on m and we find β = 26.67 for m = 20.
1 1
0.5 0.5
κ
0 0
-0.5 0 0.5 -0.5 0 0.5
x meas x meas
In figure 9.9 primal state and control component and dual matching con-
dition Lagrange multiplier components of the Newton step modification
q
M̃ k+1 (y k+1 )J k (y k )e k (y k ) can be seen for the worst–case choice ek = 1 and
increasingly fine control discretizations, i.e., shorter sampling times δt .
Clearly, the primal component sk+1 and the dual one λk belonging to the
9.2 Mixed–Integer NMPC Scheme Contractivity 255
1 1
0.5
0.5
0
-0.5 0
0 20 40 60 80 0 20 40 60 80
Shooting Node Shooting Node
(a) Primal part; state and control components (b) Matching condition Lagrange multiplier
alternate. part.
Figure 9.9: State and control part and matching condition Lagrange multiplier part
of the term M̃ k+1 (y k+1 )J k (y k )e k (y k ) for the first mixed–integer real–time
q
iteration of the example problem (9.4). The modification ek = 1 and m =
10 (· · · ), m = 20 (· · · ), m = 40 (· · · ), m = 80 (· · · ) shooting intervals
were chosen. The components of the additional vector term arising in
the κ–condition due to the inexactness introduced to cover rounding of
the control approach zero as the length of the first shooting interval
decreases.
2
β b f˜ δt exp(A f˜ δt) < ω
(1 − κ)2 , (9.9)
1
0.1
x(t)
x(t)
0 0
-0.1
-1
0 500 1000 1500 2000 1000 1005 1010
t [s] t [s]
(a) State trajectory x(·) for δt = 0.05s. (b) Details of the state trajectory for t ∈
[1000s, 1010s].
1 1
w(t)
0.5 0
0 -1
0 5 10 1000 1005 1010
f [Hz] t [s]
(c) Amplitude spectrum of control trajectory (d) Details of the control trajectory for t ∈
w(·). [1000s, 1010s].
Note, however, that the bound δt < 0.052s is neither a necessary nor
a sufficient condition and will in general not be tight, as we have under-
estimated the contraction constants κ and ω, overestimated the quantity
(1−κ)||Δỹ k ||, and overestimated the actually applying bounds and Lipschitz
constants by choice of D . In addition, larger bounds on the sampling times
δt are obtained if more restrictive upper bounds imposed on the deviation
of x(·) from zero can be satisfied. Figures 9.11 and 9.12 show trajectories
and controls produced with gradually growing sampling times δt . It is eas-
ily seen that the mixed–integer real–time iteration scheme is able to keep
the process in a close neighborhood of the instable steady state as long as
the perturbation of the system state due to rounding does indeed satisfy the
increasingly strict bounds imposed by the larger sampling times.
9.2 Mixed–Integer NMPC Scheme Contractivity 257
For the example (9.4, 9.6) at hand, we have chosen to track the instable
steady state for which, due to the exponential runaway behavior of the pro-
cess, we may expect the derived estimate to be quite close to the actual
bounds on δt that can be observed by numerical computations. Indeed we
can analyze the solution obtained for the first sampling time δt = 0.15s that
lead to failure of the scheme. We find from figure 9.12 that the offending
perturbation of the process is x 0 = 0.3875, leading to the maximal underes-
timators κ = 0.14 and ω = 0.56 for the contraction constants as seen from
figure 9.8, and to b f˜ = 0.54 and A f˜ = 1.78 derived from equations (9.7) and
(9.8). Indeed, for these constants our mixed–integer real–time iteration con-
tractivity estimate yields the (certainly not tight) upper bound δt < 0.140s,
indicating in agreement with our numerical observations that the chosen
sampling time of 0.15s is too large to expect contractivity of the scheme if
faced with a deviation of 0.3875.
9.2.4 Observations
Two noteworthy observations can be made about the obtained integer feed-
back control trajectories. First, in figures 9.10, 9.11 and 9.12 discrete
Fourier transformations of the chattering control trajectories are shown in
place of the actual trajectory that could not possibly be represented in print.
From these figures, it can be easily seen that all stable feedback schemes
generate controls that exhibit two distinct periodic chattering frequencies.
In contrary, the control does not exhibit such a periodicity for all diverging
schemes, as indicated by the obvious lack of a distinct peak in the amplitude
spectrum.
Table 9.5: Upper bounds on δt for example (9.6), depending on upper bounds on
x(t). The values ω = 0.56 and β = 26.67 are independent of the bound
on x(t).
258 9 Numerical Results
Second, phase diagrams of the process state and integer feedback con-
trol as shown in figures 9.13 lead us to the observation that for all stable
schemes, one or more small neighborhoods of process states can be associ-
ated with each admissible integer control. The chattering feedback control
trajectories could essentially be generated by a finite state machine with
four states (figure 9.13a for δt = 0.05s) or three states (figures 9.13c and
9.13d for δt 0.1s). In figure 9.13b for δt = 0.075s an overlay of both
is observed as the sampling time increases. In contrary, this phenomenon
cannot be observed for any of the diverging schemes in figure 9.14. Both
observations certainly merit further detailed investigations.
Figure 9.11 shows 2000 seconds of successfully contracting mixed–
integer real–time iterations that keep the process (9.6) in a neighborhood
of its instable steady state, starting from an initial value of x(0) = 0.05.
The mixed–integer real–time iteration scheme is able to control the process
also for the larger sampling times δt = 0.075s, δt = 0.1s, and δt = 0.125s.
The maximum deviation of the process trajectory from the instable steady
state x(t) = 0 remains bounded by ±0.1, such that the obtained estimate
δt < 0.052 is overly conservative.
Figure 9.12 shows non–contracting mixed–integer real–time iterations
failing to keep the process (9.6) in a neighborhood of its instable steady
state, starting from an initial value of x(0) = 0.05. As expected from the
contractivity estimate, the mixed–integer real–time iteration scheme fails
for sampling times δt 0.15. Note how the amplitude spectrum no longer
exhibits any significant frequency of the erratically chattering integer con-
trol. The scheme fails to contract and runaway of the process is observed
within the time bound of 2000 seconds once the respective bound seen from
table 9.5 is violated. Starting with δt = 0.15s in figure 9.12, the system’s be-
havior becomes more and more erratic and fails to track the instable steady
state.
9.2.5 Summary
1
0.1
x(t)
x(t)
0 0
-0.1
-1
0 500 1000 1500 2000 1000 1005 1010
t [s] t [s]
(a) State trajectory x(·) for δt = 0.075s. (b) State trajectory details for [1000s, 1010s].
1 1
w(t)
0.5 0
0 -1
0 5 10 1000 1005 1010
f [Hz] t [s]
(c) Amplitude spectrum of control trajectory (d) Details of the control trajectory for t ∈
w(·). [1000s, 1010s].
1
0.1
x(t)
x(t)
0 0
-0.1
-1
0 500 1000 1500 2000 1000 1005 1010
t [s] t [s]
(e) State trajectory x(·) for δt = 0.1s. (f) State trajectory details for [1000s, 1010s].
1 1
w(t)
0.5 0
0 -1
0 5 10 1000 1005 1010
f [Hz] t [s]
(g) Amplitude spectrum of control trajectory (h) Details of the control trajectory for t ∈
w(·). [1000s, 1010s].
1
0.1
x(t)
x(t)
0 0
-0.1
-1
0 500 1000 1500 2000 1000 1005 1010
t [s] t [s]
(i) State trajectory x(·) for δt = 0.125s. (j) State trajectory details for [1000s, 1010s].
1 1
w(t)
0.5 0
0 -1
0 5 10 1000 1005 1010
f [Hz] t [s]
(k) Amplitude spectrum of control trajectory (l) Details of the control trajectory for t ∈
w(·). [1000s, 1010s].
Figure 9.11: Contracting mixed–integer real–time iterations for example (9.6).
9.2 Mixed–Integer NMPC Scheme Contractivity 261
1 1
x(t)
x(t)
0 0
-1 -1
0 100 200 300 370 375 380 385
t [s] t [s]
(a) State trajectory x(·) for δt = 0.15s. (b) State trajectory near point of divergence.
1 1
w(t)
0.5 0
0 -1
0 5 10 370 375 380 385
f [Hz] t [s]
(c) Amplitude spectrum of control trajectory (d) Control trajectory near point of diver-
w(·). gence.
1 1
x(t)
x(t)
0 0
-1 -1
0 200 400 550 555 560 565
t [s] t [s]
(e) State trajectory x(·) for δt = 0.175s. (f) State trajectory near point of divergence.
1 1
w(t)
0.5 0
0 -1
0 5 10 550 555 560 565
f [Hz] t [s]
(g) Amplitude spectrum of control trajectory (h) Control trajectory near point of diver-
w(·). gence.
1 1
x(t)
x(t)
0 0
-1 -1
0 200 400 600 800 860 865 870 875
t [s] t [s]
(i) State trajectory x(·) for δt = 0.2s. (j) State trajectory near point of divergence.
1 1
w(t)
0.5 0
0 -1
0 5 10 860 865 870 875
f [Hz] t [s]
(k) Amplitude spectrum of control trajectory (l) Control trajectory near point of diver-
w(·). gence.
Figure 9.12: Mixed–integer real–time iterations failing to control example (9.6).
262 9 Numerical Results
Figure 9.13: Phase space diagrams of the mixed–integer real–time iterates for grad-
ually increasing sampling times. Choices δt = 0.05s, 0.075s, 0.1s,
0.125s for the sampling time succeed in controlling the system (9.6).
Figure 9.14: Phase space diagrams of the mixed–integer RTI for gradually increasing
sampling times. Choices δt = 0.15s, 0.175s, 0.2s for the sampling time
result in state trajectories that ultimately violate the estimated upper
bound on x(t) derived from the choice of δt and diverge.
9.3 OCPs and NLPs with Vanishing Constraints 263
s
a, v
y
of n > 1 robots shall maintain a communication network which, for the pur-
pose of our investigation, is modelled by a maximum transmission or com-
munication radius T > 0, and a minimum connectivity K > 0. At all times,
264 9 Numerical Results
each of the n robots may communicate with one or more of the other robots
inside its communication radius. The swarm is expected to maintain connec-
tivity by ensuring at all times that each robot can communicate with at least
K other robots. The goal is for all robots to reach the final point of their re-
spective predefined paths under these constraints. This of course may mean
for some of the robots to advance slower or to wait in appropriate positions
in order to uphold connectivity of the entire swarm.
4
y
0
0 2 4 6 8 10
x
Figure 9.16: Predefined paths to be completed by the swarm of ten robots, cf. [2].
min hm (9.10a)
a,c,s ,
v,x ,y,h
3
s. t. x i, j = αx, j,k,l (si, j − τ j,k−1 )l ∀i, j, si, j ∈ [τ j,k−1 , τ jk ],
l=0
(9.10b)
3
yi, j = αy, j,k,l (si, j − τ j,k−1 )l ∀i, j, si, j ∈ [τ j,k−1 , τ jk ],
l=0
(9.10c)
0 = x m j − ex, j ∀ j, (9.10d)
0 = ym j − ey, j ∀ j, (9.10e)
n
K ci, j1 , j2 − 1 ∀i, j1 , (9.10f)
j2 =1
Table 9.6: Variables of the NLP formulation for the robot path coordination problem.
266 9 Numerical Results
We further require the definitions of the two distance functions di, j of robot
j to the endpoint and di, j1 , j2 of robot j1 to robot j2 ,
def
di, j = (x i j − ex, j )2 + ( yi j − ey, j )2 , (9.12a)
def
di, j1 , j2 = (x i, j1 − x i, j2 )2 + ( yi, j1 − yi, j2 )2 , (9.12b)
wherein (ex, j , ey, j ) ∈ 2 are the terminal points of the n spline paths.
In problem (9.10) we have discretized the time horizon required for com-
pletion of the scenario into m > 0 intervals of equidistant length h subject
to optimization The optimal objective then is t max = hm. Constraints (9.10b)
and (9.10c) determine the cartesian coordinates of robot j at time point i re-
quired for distance computations, given the robot’s advance si j on the spline
path. Constraints (9.10d) and (9.10e) ensure that all robots actually have ar-
rived at their final destinations (ex, j , ey, j ) at the end of the time horizon. The
mentioned communication constraint is (9.10f) which requires each robot j1
to be within the communication range of at least K other robots. This com-
munication range is computed in (9.10g) which forces the communication
flag ci, j1 , j2 to zero if the pair ( j1 , j2 ) of robots is farther apart than the trans-
mission radius T . This constraint takes the shape of a vanishing constraint
as presented in chapter 5. Note that in this case there is no outer convexi-
fication reformulation behind this constraint. Constraint (9.10h) and (9.10i)
are discretizations of the integration of the acceleration and the tangential
velocity v(t) along the spline path. Constraints (9.10j), (9.10k), and (9.10l)
impose simple upper and lower bounds on the position of the robot on the
spline path, the tangential velocity of the robot, and the acceleration of the
robot.
Snapshots of the optimal solution of this particular problem for T = 2.5
and K = 2 at different times t ∈ [t 0 , t f ] are shown in figure 9.17. Circles
denote the communication radius of each robot. Note the active communi-
cation constraint for the lower right robot at t ∈ [0.6h, 0.7h] and at t = 0.9h.
Problem (9.10) is a variation of the formulation presented in [2]. It dif-
9.3 OCPs and NLPs with Vanishing Constraints 267
Figure 9.17: Snapshots of the optimal solution to problem (9.10) for a communica-
tion radius T = 2.5 and constraint K = 2 at different times t ∈ [0s, t f ],
where t f = h = 7.995748s.
Problem (9.10) may for certain choices of the constraint parameters T and
K have several local minima due to nonlinearity of the spline paths. The
choice of initial values therefore is crucial to maintain comparability. We
choose for all computations
The time optimal solution for this formulation in absence of any commu-
nication constraint (i.e., K = 0), and hence in absence of any combinatorial
structure in the problem, is 7.99575 seconds after 30 interior point itera-
tions. Table 9.7 lists the solutions found by IPOPT (version 3.6) for choices
of the maximal communication distance T from 2 to 5 in steps of one half,
and for choices of the communication constraint K from 1 to 9. For all prob-
lem instances that could be solved successfully, the objective function t max
is shown together with the number of required interior point iterations.
From table 9.7 it can be clearly deduced that the violations of constraint
qualification due to the combinatorial structure of the problem pose a sig-
nificant challenge to this pure NLP solver. For low values of the commu-
nication constraint K that do not cut off a significant part of the possible
9.3 OCPs and NLPs with Vanishing Constraints 269
T Communication Constraint K
1 2 3 4 5 6 7 8 9
2.0 (F)
6512
4.5 (F) (F) 7.99575 (F) 7.99575 7.99575 7.99575 30.9573 37.4242
166 126 1197 164 409 993 1363 73 55
5.0 7.99575 7.99575 7.99575 7.99575 (F) 7.99575 7.99575 7.99575 20.4304
339 397 363 379 91 474 373 567 41
Table 9.7: Objective function values and iteration counts for the locally optimal so-
lutions found by AMPL and IPOPT (version 3.6) for NLP (9.10). Failure to
converge to a locally optimal solution is indicated by (F). Solutions that
are better than the ones found by our software package MuShROOM are
printed in boldface, all others are inferior ones or are identical.
We close this investigation with the important note that the observed be-
havior of IPOPT is expected and can be understood from our analysis in
chapter 5. We refer to e.g. [3, 105] for techniques for numerically efficient
treatment of vanishing constraints in an interior point method; techniques
that clearly cannot be expected to be present in the default configuration of
IPOPT.
270 9 Numerical Results
We now give an ODE dynamic optimal control problem formulation for (9.10)
that fits into the general problem class (1.15) of chapter 1.
min h (9.14)
a(·),s (·),v(·)
c(·),x (·),y(·),h
s. t. ṡ j (t) = hv j (t), t ∈ T , ∀ j,
v̇ j (t) = ha j (t), t ∈ T , ∀ j,
3
x j (t) = αx, j,k,l (s j (t) − τ j,k−1 )l , t ∈ T , ∀ j,
l=0
s j (t) ∈ [τ j,k−1 , τ jk ],
3
y j (t) = αy, j,k,l (s j (t) − τ j,k−1 )l , t ∈ T , ∀ j,
l=0
s j (t) ∈ [τ j,k−1 , τ jk ],
0 = x j (t f ) − ex, j ∀ j,
0 = y j (t f ) − ey, j ∀ j,
n
K c j1 , j2 (t) − 1, t ∈ T , ∀ j1 ,
j2 =1
0 T − d j1 , j2 (t) c j1 , j2 (t), t ∈ T , ∀ j1 , j2 ,
0 s j (t) τ j,5 , t ∈ T , ∀ j,
0 v j (t) 0.5, t ∈ T , ∀ j,
−1 a j (t) 0.5, t ∈ T , ∀ j,
0 = s j (t 0 ) ∀ j,
0 = v j (t 0 ) ∀ j,
0 c j (t) 1, t ∈ T , ∀ j.
shooting intervals, all constraints are enforced in the shooting nodes only,
as was the case for the time–discrete NLP (9.10). The ODE defining s(·) and
v(·) is solved by a fixed–step 4th–order Runge–Kutta method, differing from
(9.10) which used a single Euler step. As the exact solution to the ODEs is
quadratic in a j (t) which is constant on each shooting interval, the obtained
numerical solutions are identical up to machine precision.
T Communication Constraint K
1 2 3 4 5 6 7 8 9
2.0 28.0376
15/1254
4.5 7.99575 7.99575 7.99575 7.99575 7.99575 7.99575 7.99575 16.7284 (F)
13/658 12/632 13/636 13/630 13/692 18/951 14/1035 14/1381
5.0 7.99575 7.99575 7.99575 7.99575 7.99575 7.99575 7.99575 7.99575 (F)
13/624 13/599 13/602 13/594 13/625 13/652 13/773 12/891
Table 9.8: Objective function values and SQP and QPVC iteration counts for the lo-
cally optimal solutions found for problem (9.14) by the software package
MuShROOM developed in this thesis. Instances found to be infeasible by the
AMPL presolve step have not been evaluated. Termination due to infeasi-
bility of a QPVC subproblem is indicated by (F). Solutions better than the
ones found by IPOPT are printed in boldface, all others are identical or
inferior ones.
9.3.4 Summary
swarm and can in its NLP or direct multiple shooting discretized OCP vari-
ant be cast as a MPVC. By varying the communication radius and connec-
tivity constraint, 41 feasible instances of this problem were created. We
demonstrated the findings of our investigation in chapter 5 at the exam-
ple of a popular interior point method without provision for MPVC and —
as expected — found this method to fail on a significant number of the ex-
amined problem instances. It should be noted that appropriate relaxation
schemes as e.g. briefly presented in chapter 5 can be employed to ensure
convergence of interior point method on MPVC, cf. e.g. [3, 105] for details.
We examined the numerical behavior of our developed nonconvex SQP and
active set QP algorithms and could solve to optimality all but three problem
instances. Future work includes a globalization method for our nonconvex
SQP algorithm that promises to allow for the solution of the remaining three
unsolved instances.
274 9 Numerical Results
Figure 9.18: Coordinates and forces in the single-track vehicle model. The figure
aligns with the vehicle’s local coordinate system while dashed vectors
denote the earth-fixed coordinate system chosen for computations.
Four controls represent the driver’s choice on steering and velocity, and
are listed in table 9.9. We denote with wδ the steering wheel’s angular ve-
locity. The force FB controls the total braking force, while the accelerator
pedal position ϕ is translated into an accelerating force according to the
torque model presented in (9.25). Finally, the selected gear μ influences
the effective engine torque’s transmission ratio. The single-track dynamics
are described by a system of ordinary differential equations. The individual
system states are listed in table 9.10. Figure 9.18 visualizes the choice of
coordinates, angles, and forces. Equations of motion are derived as follows.
9.4 Block Structured Factorization and Updates 275
Acceleration is obtained from the sum of forces attacking the car’s mass m
in the direction of driving,
1 # μ
v̇(t) = Flr − FAx cos β(t) + Flf cos δ(t) + β(t) (9.16)
m
$
− Fsr − FAy sin β(t) − Fsf sin δ(t) + β(t) .
δ̇(t) = wδ . (9.17)
The slip angle’s change is controlled by the steering wheel and counter-
acted by the sum of forces attacking perpendicular to the car’s direction of
driving. The forces’ definitions are given in (9.21ff).
1 #
β̇(t) = wz (t) − Flr − FAx sin β(t) + Flf sin δ(t) + β(t) (9.18)
m v(t)
$
+ Fsr − FAy cos β(t) + Fsf cos δ(t) + β(t) .
which in turn is the integral over the sum of forces attacking the front wheel
276 9 Numerical Results
Table 9.10: Coordinates and states used in the single–track vehicle model.
1
ẇz (t) = Fsf lf cos δ(t) − Fsr lsr − FAy eSP + Flf lf sin δ(t) . (9.20)
Izz
We now list and explain the individual forces used in this ODE system. We
first discuss lateral and longitudinal forces attacking at the front and rear
wheels. In view of the convex reformulation we’ll undertake later, we con-
sider the gear μ to be fixed and denote dependencies on the selected gear
by a superscript μ. The side (lateral) forces on the front and rear wheels
as functions of the slip angles αf and αr according to the so-called magic
formula due to [164] are
# $
def
Fsf,sr (αf,r ) = Df,r sin Cf,r arctan Bf,r αf,r − Ef,r (Bf,r αf,r − arctan(Bf,r αf,r )) , (9.21)
The front slip and rear slip angles are obtained from
( )
def lf ψ̇(t) − v(t) sin β(t)
αf = δ(t) − arctan , (9.22a)
v(t) cos β(t)
( )
def lr ψ̇(t) + v(t) sin β(t)
αr = arctan . (9.22b)
v(t) cos β(t)
The longitudinal force at the front wheel is composed from braking force FBf
and resistance due to rolling friction FRf
def
Flf = −FBf − FRf . (9.23)
Assuming a rear wheel drive, the longitudinal force at the rear wheel is
9.4 Block Structured Factorization and Updates 277
given by the transmitted engine torque Mwheel and reduced by braking force
μ
FBr and rolling friction FRr . The effective engine torque Mmot is transmitted
twice. We denote by igμ the gearbox transmission ratio corresponding to the
selected gear μ, and by it the axle drive’s fixed transmission ratio. R is the
rear wheel radius.
μ def
igμ it μ
Flr = Mmot (ϕ) − FBr − FRr . (9.24)
R
The engine’s torque, depending on the acceleration pedal’s position ϕ , is
modeled as follows:
μ def μ μ
Mmot (ϕ) = f1 (ϕ) f2 (wmot ) + (1 − f1 (ϕ)) f3 (wmot ), (9.25a)
def
f1 (ϕ) = 1 − exp(−3 ϕ), (9.25b)
def 2
f2 (wmot ) = −37.8 + 1.54 wmot − 0.0019 wmot , (9.25c)
def
f3 (wmot ) = −34.9 − 0.04775 wmot . (9.25d)
μ
Here, wmot is the engines rotary frequency in Hertz. For a given gear μ it is
computed from
μ def
igμ it
wmot = v(t). (9.26)
R
The total braking force FB is controlled by the driver. The distribution to
front and rear wheels is chosen as
def 2 def 1
FBf = FB , FBr = FB . (9.27)
3 3
The braking forces FRf and FRr due to rolling resistance are obtained from
def m lr g def m lf g
FRf (v) = fR (v) , FRr (v) = fR (v) , (9.28)
lf + lr lf + lr
Finally, drag force due to air resistance is given by FAx , while we assume
278 9 Numerical Results
def def
FAx = 12 cw Av 2 (t), FAy = 0. (9.30)
The values and units of all model parameters can be found in table 9.11.
Track Model
Figure 9.19: Track constraints of the double–lane change maneuvre for which a
time–optimal solution is sought in problem (9.33).
Problem Formulation
We denote with x the state vector of the ODE system and by f the corre-
sponding right-hand side function as described in section 9.4.1. The vector
280 9 Numerical Results
Solutions
6
4
cy (t)
2
0
0 20 40 60 80 100 120 140
cx (t)
(a) Car’s trajectory on track, m = 20. Corners are cut as path constraints are enforced in the
shooting nodes only.
40
0.1
ψ(t)
v(t)
20 0
-0.1
0
0 2 4 6 0 2 4 6
t t
(b) Car’s velocity. (c) Car’s yaw angle.
0.1 4
wδ (t)
μ(t)
0
2
-0.1
0 2 4 6 0 2 4 6
t t
(d) Steering wheel angular velocity. (e) Selected gear.
6
4
cy (t)
2
0
0 20 40 60 80 100 120 140
cx (t)
(f) Car’s trajectory on track, m = 160. Constraints are active in the track’s corners.
40
0.1
ψ(t)
v(t)
20 0
-0.1
0
0 2 4 6 0 2 4 6
t t
(g) Car’s velocity. (h) Car’s yaw angle.
0.1 4
wδ (t)
μ(t)
0
2
-0.1
0 2 4 6 0 2 4 6
t t
(i) Steering wheel angular velocity. (j) Selected gear.
Table 9.12: Optimal solutions of problem (9.33) for nμ = 4 as in [80, 81, 122]. With
increasily fine discretization of the path constraint modelling the track,
the time optimal objective increases as cutting of corners is reduced.
9.4 Block Structured Factorization and Updates 283
We study the run time of various combinations of numerical codes for the
solution of the direct multiple shooting block structured QP, which include
1. The classical condensing algorithm for the block structured QP com-
bined with the dense null–space active set QP solver QPOPT [86] with
284 9 Numerical Results
2. Our parametric active set method qpHPSC with dense, sparse, and
block structured solvers for the structured KKT system:
Table 9.13: Numbers of NLP (equiv. QP) unknowns and constraints, and percentage
of nonzero elements in the Hessian and constraints Jacobian of the QP
for problem (9.33), listed for various choices of the number m of multiple
shooting intervals and the number nq = 3 + nμ of control parameters.
9.4 Block Structured Factorization and Updates 285
3. Our parametric active set method qpHPSC with the following LAPACK
[9] routines as reference KKT solvers:
• The dense symmetric indefinite code DSYTRF that does not exploit
any structure and will therefore yield inferior performance.
160 4 970 940,900 940,900 100% 484 (2084) 469,480 159,219 34%
8 1610 2,592,100 2,592,100 100% 484 (2084) 779,240 264,179 34%
12 2250 5,062,500 5,062,500 100% 484 (2084) 1,089,000 369,140 34%
16 2890 6,022,760 6,022,760 100% 484 (2084) 1,398,760 474,099 34%
Table 9.14: Numbers of unknowns and constraints, and percentage of nonzero ele-
ments in the condensed Hessian and condensed constraints jacobian of
the QP (cf. section 7.2.1) for problem (9.33), listed for various choices of
the number m of multiple shooting intervals and the number nq = 3 + nμ
of control parameters. Structure and sparsity are lost as the number of
control parameters increases.
286 9 Numerical Results
Figure 9.21 and table 9.15 summarize the computational effort required
by each of the investigated QP solving algorithms for increasingly fine dis-
cretizations m of the control and an increasing number of available gear
choices nμ i.e., control parameters nq = 3 + nμ per shooting interval.
60
Time in ms
40
20
0
20,4
20,8
20,12
20,16
40,4
40,8
40,12
40,16
80,4
80,8
80,12
80,16
160,4
160,8
160,12
160,16
m, nμ
Figure 9.21: Average runtime in milliseconds (ms) per QP solver iteration for prob-
lem (9.33), depending on the numbers (m, nμ ) of multiple shooting in-
tervals m and control parameters nμ . ( ◦ ) qpHPSC with matrix updates,
( + ) qpHPSC without updates, ( ) MA57, ( ) LAPACK DGBTRF, ( × + )
QPOPT on the condensed QP without runtime spent in condensing, ( )
UMFPACK. Runtime for LAPACK DSYTRF is not shown.
The HPSC factorization with updates developed in this thesis may be re-
garded as a suitable substitute for structure exploitation in direct multiple
shooting, and yields without exception the fastest run times among all in-
vestigated structure exploiting KKT solvers. This is true even without the
application of our new update techniques, which reduce the runtime by a
further factor of at most 2 for all investigated problem instances. A particu-
lar and unique feature of the HPSC factorization developed in this thesis is
the very small and linear growth of the runtime with increasing number nq
Table 9.15: Average runtime in milliseconds (ms) per QP solver iteration for prob-
lem (9.33), depending on the number nq of control parameters and the
number m of multiple shooting intervals. Averages have been taken over
the first 30 SQP iterations.
1
The QPOPT per iteration runtime applies to the condensed QP whose
computation requires additional runtime as indicated by the third col-
umn.
2
LAPACK DSYTRF performance has not been investigated for m = 80 and
m = 160.
288 9 Numerical Results
9.4.5 Summary
9.5.1 Overview
This section holds a description of a 1D truck model with track slope and
curvature information, introduced in different variants in [42, 103, 209] that
has been used for all computations. More background information on mod-
elling in automotive engineering can be found e.g. in [117].
We start the presentation of the truck model with the control inputs to
be optimized later. The truck’s acceleration is governed by the indicated
engine torque, whose rate of change Rind can be controlled. The total brak-
ing torque’s rate of change Rbrk can be controlled as well. The actual truck
system uses three separate sources of brake torques: engine brake torque
9.5 Application: A Predictive Cruise Controller 291
MEB , retarder torque Mret , and service brakes torque MSB , all with separate
state-dependent upper bounds.
def
Mbrk (s) = iT ( y)MEB (s) + Mret (s) + MSB (s) (9.34)
It is not necessary to separate these sources within the model used for opti-
mization, though. We rather chose to perform an a-posteriori separation into
three brake torques once the optimal sum Mbrk (s) has been decided upon.
This opens up the additional possibility of modeling hierarchical brake sys-
tems e.g. to prefer using the retarder Mret over using the engine brakes MEB ,
which again are preferred over using the service brakes MSB . Finally, the
gear y enters the problem as an integer control variable that chooses from
the available gearbox transmission ratios iT ( y) and corresponding degrees
of efficiency ηT ( y). The list of controls influencing the truck’s behavior is
given in table 9.16.
The ODE system of the truck model comprises four differential states.
def
The location s ∈ S = [s0 , sf ] (in meters) on the map is chosen as the indepen-
dent variable. This limits the model’s applicability to the domain of strictly
positive velocities. Time t(s) depending on position s and velocity v(s) are
recaptured using the differential equation
1
ṫ(s) = , t(s0 ) = 0. (9.35)
v(s)
1 iA
v̇(s) = Macc − Mbrake − Mair − Mroad . (9.36)
m v(s) rstat
1
Ṁind (s) = Rind (s), (9.37a)
v(s)
1
Ṁbrk (s) = Rbrk (s). (9.37b)
v(s)
1
Q̇(s) = Q fuel (Mind (s), neng (s)) (9.38)
v(s)
where Q fuel gives the specific consumption rate depending on the indicated
engine torque and engine speed. In table 9.17 the list of differential states
of this vehicle model is given.
t Time s
v Velocity m/s (0, vmax ]
Mind Indicated engine torque Nm [0, Mind,max ]
Mbrk Total brake torque Nm [0, Mbrk,max ]
Q Fuel consumption l [0, ∞)
In the above system of differential equations, several terms are still miss-
ing and are computed from fixed algebraic formulas as follows. The accel-
erating torque Macc is computed from the corresponding control depending
on the transmission ratio iT ( y) and the degree of efficiency ηT ( y) of the
selected gear y ,
def
Macc (s) = iT ( y) ηT ( y) Mind (s). (9.39)
The sum of braking torques Mbrk is computed from Mret and MEB , increased
by resisting torques due to friction Mfric in the engine. The value neng de-
notes the engine’s speed in revolutions per minute.
9.5 Application: A Predictive Cruise Controller 293
def
Mbrake (s) = iT ( y)MEB (s) + Mret (s) + MSB (s) + iT ( y) Mfric (neng (s)). (9.40)
def 1
Mair (s) = 2
cw A air v 2 (s). (9.41)
The road conditions term accounts for rolling friction with coefficient fr and
downhill force depending on the slope γ(s) available from the 3D map data
of the road. The parameter g is the gravity constant.
def
Mroad (s) = m g (sin γ(s) + fr cos γ(s)). (9.42)
Finally, the engine’s speed in revolutions per minute, depending on the se-
lected gear y , can be recaptured from the truck’s current velocity,
Table 9.18 holds the list of fixed model parameters. The truck engine’s char-
acteristics are defined by the functions Mind,max , Mbrk,max , and Mfric giving the
maximum indicated torque, braking torque amd torque loss due to friction,
all depending on the engine speed neng .
In addition, the specific fuel consumption rate Q fuel depends on both Mind
and neng . Representative examples of those functions are shown in figure
9.22.
On the prediction horizon, the truck system needs to respect certain me-
chanical constraints, such as velocity and engine speed limits. Beside the
bounds on the truck controls given in table 9.16 and on the truck system’s
differential states listed in table 9.17, the truck’s velocity v(s) is subject to
several constraints, the most significant ones being the velocity limits im-
posed by law,
From the available 3D map data, the predictive optimal control algorithm,
the curvature κ(s) of the road at position s is extracted and converted to a
maximum allowable velocity vcurve (s),
The indicated and brake torques must respect state-dependent upper limits
as specified by the engine characteristics
0 Mind (s) Mind,max neng (s) s ∈ S, (9.46a)
0 Mbrk (s) Mbrk,max neng (s) s ∈ S. (9.46b)
3000 -500
-1000
2000 -1500
Mbrk,max [Nm]
Mind,max [Nm]
-2000
1000 -2500
-3000
0 -3500
500 1000 1500 2000 500 1000 1500 2000
neng [1/min] neng [1/min]
(a) Maximum indicated engine torque Mind (b) Maximum engine brake torque MEB and
depending on the engine speed neng . retarder torque Mret depending on the en-
gine speed neng .
400
300
Mfric [Nm]
200
100
0
500 1000 1500 2000
neng [1/min]
(c) Torque loss due to friction Mfric depending (d) Specific fuel consumption rate Q fuel de-
on the engine speed neng . pending on the indicated engine torque
Mind and the engine speed neng .
200 200
150 150
100 100
z [m]
z [m]
50 50
0 0
-1 -1
-50 -50
0 0
1 1
×10 4 0 ×10 4 0
-1 1 -1 1
y [m] y [m]
×104 ×104
x [m] x [m]
(a) 3D map data colored by height profile. (b) 3D map data colored by slope profile.
0.1
Slope γ
-0.1
0 1 2 3 4 5 6 7 8
Position s [m] ×104
0.1
Curvature κ
-0.1
0 1 2 3 4 5 6 7 8
Position s [m] ×104
Figure 9.23: Exemplary real–world 3D map data describing road conditions for the
truck predictive control problem on a track of over 80 kilometers
length. Sharp spikes in the curvature profile 9.23d correspond to ma-
jor changes in the general direction of travelling in figures 9.23a and
9.23b.
9.5 Application: A Predictive Cruise Controller 297
objective contribution
s0 +H
def 1
Φfuel = Q neng (s), Mind (s) ds. (9.49)
s0
v(s)
3. Driving comfort :
def
Φ = λ1 Φdev + λ2 Φfuel + λ3 Φcomf . (9.51)
Problem Formulation
The MIOCP resulting from the presented vehicle and environment model is
given in (9.54). We summarize the state vectors
x (s) = v(s) Mind (s) Mbrk Q(s) t(s) (9.52)
9.5 Application: A Predictive Cruise Controller 299
and denote by w (s) = y(s) the gear choice control. In (9.54) the ODE system
(9.54b) comprises the vehicle ODE model derived in section 9.5.2. The en-
gine speed constraints (9.54e) depends on the integer control y(s) in (9.54f).
ny
y(s) = jα j (s), s ∈ S, (9.55)
j=1
and is integral if the multipliers α j (s) are binary. We convexify the contribut-
ing term Φfuel of the objective (9.51) of problem (9.54) with respect to the
integer control y(·) as follows,
300 9 Numerical Results
1
s0 +H ny
def
Φfuel (s) = α j (s)Q neng (v(s), j), Mind (s) ds, (9.56)
s0
v(s) j=1
while the contributing terms Φdev and Φcomf are independent of w(t) and
hence remains unchanged. We further convexify the dynamics of problem
(9.54) with respect to the integer control y(·) as follows,
ny
ẋ(s) = α j (s) f (s, x (s), u(s), j, p) ∀s ∈ S , (9.57)
j=1
ny
α j (s) ∈ [0, 1], 1 j ny , α j (s) = 1, ∀s ∈ S . (9.58)
j=1
ny
0 Mind (s) α j (s)Mind,max (v(s), j), (9.59a)
j=1
ny
0 Mbrk (s) α j (s)Mbrk,max (v(s), j). (9.59b)
j=1
arbitrary ratios of the engine speed and the vehicle resp. wheel speed. An
appropriate formulation might also introduce the engine speed neng (s) as a
free control trajectory on S subject to optimization, and impose a transmis-
sion ratio constraint,
ny
neng,min α j (s)neng (v(s), j) neng,max . (9.62)
j=1
2500 2500
2400 2400
Mind,max [Nm]
Mind,max [Nm]
2300 2300
2200 2200
2100 2100
2000 2000
10 15 20 25 10 15 20 25
v [m/s] v [m/s]
(a) Inner convexification. (b) Outer convexification.
Figure 9.24: Inner and outer convexification of the indicated engine torque con-
straint for two adjacent gears. Constraint violations for fractional gear
choices caused by the inner convexification reformulation are clearly
visible.
up residual (9.62). This effect is shown in figure 9.29 on page 308 for the
mixed–integer optimal control scenario of figure 9.28, page 307.
40
v [m/s]
20
0
5 10 15
y
Figure 9.25: Feasible vehicle speeds v(s) for a given choice y(s) = j of the gear. The
figure reveals the combinatorial structure of the feasible set created
by the constraints neng,min neng (v(s), j) neng,max that vanish if the
associated convex multiplier α j (s) is zero.
α1 v α1 v
α2 α2
α3 α3
α4 α4
(a) Feasible velocities v(s) for (b) Feasible velocities for con-
four gears. vex combinations of two ad-
jacent gears.
Figure 9.26: Schematic of the nonconvex feasible set for the vehicle velocity v de-
scribed by the engine control reformulation (9.63) with four gears
ny
(ny = 4). Arrows indicate axes of the space (v, α) ∈ + × [0, 1] . The
feasible set is depicted in 9.26a for integral choices of the gear (α j = 1
for some 1 j ny , αk = 0 for all k = j ), and in 9.26b for convex com-
binations formed between two adjacent gears, i.e., an SOS 2 constraint
imposed on the convex multipliers α j , 1 j ny .
304 9 Numerical Results
isfied even though the convex multiplier α j (s) might be less than 1. Con-
sequentially, the individual engine speeds of all gears entering the convex
combination are indeed feasible on their own. Rounding of a fractional re-
laxed optimal solution to the partially convexified problem (9.54) hence does
not violate the critical engine speed constraint.
Figure 9.27 on page 306 shows the optimal solution to a mixed–integer opti-
mal control scenario on a road section of two kilometers length with a steep
slope of 8% for 500 meters, starting at 500 meters into the section. No cur-
vature is present. The desired velocity is set at vdes = 80 km/h = 22.2 m/s
as indicated in figure 9.27a, while the initial velocity at the start of the sce-
nario is set to 19 m/s. Objective function weights are chosen as λdev = 10−2 ,
λfuel = 10−2 , λcomf = 10−4 such that contribution tracking the desired ve-
locity dominates the objective. The truck enters the slope with a velocity
exceeding the desired one, as can be seen in figure 9.27a. This happens in
order to maximize the remaining exit velocity after the slope has been tack-
led. Figure 9.27b shows the accumulated fuel consumption. In figure 9.27c
the effective torque Mind (s) − Mbrk (s) can be seen together with its engine
speed dependent upper bound. Figure 9.27d shows the associated torque
rate. In figure 9.27e downshifting of the gear from 13 down to 10 can be
seen in order to maintain an engine speed of over 1500 1/min seen in figure
9.27f, as the velocity drops from 25 m/s down to 13 m/s at the exit of the
slope. The fast acceleration sequence starting at 1000 meters into the sec-
tion is accompanied by rapid upshifting to the highest gear number 16 as
the desired velocity has been reached again.
9.5 Application: A Predictive Cruise Controller 305
In figure 9.28 on page 307, the slope has been replaced by a speed limit
of 40 km/h and the truck’s initial speed has been set to 40 km/h as well.
Acceleration and braking can be seen in figure 9.28a and 9.28c to minimize
the time until the entry of the speed limit zone. This zone is crossed at the
lowest possible engine speed in order to save fuel. The acceleration back to
the desired velocity is accompanied by upshift of the gear to keep the engine
speed above 1500 1/min again, while the remainder of the road section is
completed at around 800 1/min in gear 16 as the desired velocity has been
reached.
In figure 9.29 on page 308 the choice convex multipliers α(s) for the gear
y(s) can be seen if the first example of figure 9.28 is solved with the stan-
dard formulation (9.62) of the engine speed constraint (9.47) after outer
convexification, instead of using the vanishing constraint formulation pro-
posed in this thesis. Figure 9.29 shows for each of the 16 available gears
the resulting engine speed if a (partial) selection of the respective gear is
indicated by the convex relaxed multipliers α(s). Compensatory effects are
clearly revealed. They allow for a selection of infeasible gears violating the
engine speed constraints (e.g. gears 5 to 9 in figure 9.29), if this violation is
compensated for by (partial) selection of other gears that either do not hit
the engine speed constraint or violate the opposite constraint (e.g. gears 14
to 16) such that violations cancel out in (9.62)
306 9 Numerical Results
25 3
20 2
v [m/s]
Q [l]
15 1
10 0
0 500 1000 1500 2000 0 500 1000 1500 2000
s [m] s [m]
(a) Velocity v(s), and desired velocity vdes . (b) Consumed fuel Q(s).
3000
500
R [Nm/s]
2000
M [Nm]
1000
-500
0
0 1000 2000 0 1000 0 1000 2000 0 1000
s [m] s [m]
(c) Engine torque Mind (s) − Mbrk (s), and path (d) Engine torque rate Rind (s) − Rbrk (s).
constraint Mind,max enforced in shooting
nodes only.
16 2000
neng [1/min]
14
1500
12
y
10 1000
8
500
0 500 1000 1500 2000 0 1000 2000 0 1000
s [m] s [m]
(e) Convexified relaxed gear choice y(s), and (f) Engine speed neng (s).
envelope of admissible gears.
Figure 9.27: Optimal engine torque and gear choice computed for problem (9.54)
with outer convexification and relaxation applied to dynamics and path
constraints. On a road section of two kilometers length with a slope
of 8% for one kilometer, the controller aims at a compromise between
maintaining a velocity of 80 km/h and burning as little fuel as possible.
The entry velocity exceeds the desired one in figure 9.28a in order to
maximize the exit velocity that drops due to the steep slope. Downshifts
from gear 13 to gear 10 in figure 9.28e keep the engine speed above
1500 1/min in figure 9.28f. Once the slope has been tackled, the highest
available gear 16 is selected and the engine speed drops to 800 1/min
in order to save fuel while maintaining the desired velocity.
9.5 Application: A Predictive Cruise Controller 307
25 2
20
v [m/s]
Q [l]
1
15
10 0
0 500 1000 1500 2000 0 500 1000 1500 2000
s [m] s [m]
(a) Velocity v(s), and desired velocity vdes . (b) Consumed fuel Q(s).
4000
500
R [Nm/s]
2000
M [Nm]
0
-500
-2000
0 1000 2000 0 1000 0 1000 2000 0 1000
s [m] s [m]
(c) Torque Mind (s) − Mbrk (s), and path con- (d) Torque rate Rind (s) − Rbrk (s)
straint Mind,max enforced in shooting nodes
only.
16 2000
neng [1/min]
14
1500
12
y
10 1000
8
500
0 500 1000 1500 2000 0 1000 2000 0 1000
s [m] s [m]
(e) Convexified relaxed gear choice y(s), and (f) Engine speed neng (s).
envelope of admissible gears at velocity
v(s).
Figure 9.28: Optimal engine torque and gear choice computed for problem (9.54)
with outer convexification and relaxation applied to dynamics and path
constraints. On a road section of two kilometers length with a speed
limit of 40 km/h imposed for a section of 500 meters, the controller
aims at maintaining a velocity of 80 km/h.
308 9 Numerical Results
neng ( y 5 )
neng ( y 6 )
neng ( y 7 )
0 1000 2000 0 1000 2000 0 1000 2000
s [m] s [m] s [m]
(a) Gear 5. (b) Gear 6. (c) Gear 7.
neng ( y 10 )
neng ( y 8 )
neng ( y 9 )
neng ( y 12 )
neng ( y 13 )
neng ( y 15 )
neng ( y 16 )
Figure 9.29: Compensatory effects arising for inner convexification of the engine
speed constraint at the example of figure 9.28. Engine speeds associ-
ated with each partially selected gear are indicated and can be seen to
violate phyical limits.
9.5 Application: A Predictive Cruise Controller 309
In figure 9.30 spread across pages 311 to 313 the highway’s slope profile,
the realized feedback controls, and the obtained system states are shown
for the entire distance of 150 kilometers. For this solution, we chose λdev =
10−2 , λfuel = 10−2 , and λcomf = 10−4 to obtain a speed–oriented behavior of
the cruise controller.
We can see in figure 9.30d that the desired velocity vdes of 80 km/h is kept
during the majority of the truck’s journey. Minor deviations are accepted to
prevent unnecessary acceleration or braking maneuvres that would impact
the driver’s comfort and burn additional fuel. Major deviations have to be
accepted on steep sloped parts of the highway that make it impossible for
the truck to sustain the desired velocity at a load of m = 40 metric tonnes.
Gear 12 is selected most of as seen in figure 9.30g, keeping the engine speed
neng well above 1500 rpm to ensure maximum responsiveness of the truck
according to its engine characteristics. This of course comes at the cost of
increased fuel consumption. Sloped parts of the highway see very regular
downshift and upshift sequences of the gear as the truck enters and exits
the sloped sections. The highest available gear 16 is occasionally chosen on
flat sections to save on fuel if the desired velocity has already been reached.
In figure 9.31 on page 314, details of this feedback solution can be stud-
ied for a highway section of 6 kilometers length starting after a traveled
distance of 54 kilometers. Here, a steep slope of two kilometers length is
present with the relative altitude of the highway rising to 400 meters, up
from around 230 meters above the truck’s initial position, see figure 9.31b.
The predictive nature of the controller’s behavior can be seen clearly. In
figure 9.31c the velocity can be seen to rise above the desired velocity
well before the truck actually enters the steep sloped section. This ame-
liorates the exit velocity that nonetheless drops to about 40 km/h down
from over 90 km/h. The engine runs at maximum indicated torque (figure
9.31e) and the total amount of consumed fuel rises (figure 9.31d) accord-
310 9 Numerical Results
ingly. Downshifts of the gear seen in figure 9.31g keep the engine’s speed
around 1500 rpm as seen in figure 9.31h, the engine’s most efficient mode
of operation. An upshift sequence ending at the highest available gear 16
completes the studied excerpt once the steep slope has been crossed suc-
cessfully. As already noted above, the predictive controller returns to gear
12 as the desired velocity has been reached again.
Figure 9.32 shows mixed–integer feedback control trajectories for the
same scenario with modified objective function weights λdev = 10−3 , λfuel =
10−1 , and λcomf = 10−4 to achieve a more fuel consumption aware behav-
ior of the predictive cruise controller. Consequentially, the highest available
gear 16 is chosen significantly more frequently, leading to an overall engine
speed that is much lower than before. Downshift and upshift sequences dur-
ing sloped parts of the highway are more prominent, and less chattering of
the gear choice is observed in figure 9.32g. The fuel consumption over 150
kilometers has been noticeably reduced (figure 9.32c). This of course comes
at the cost of larger deviations from the desired velocity (figure 9.32d).
γ
0
-0.1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
s [m] ×104
1000
500
Height [m]
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
s [m] ×104
9.5 Application: A Predictive Cruise Controller
(b) Height.
100
50
Q [l]
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
s [m] ×104
20
10
v [m/s]
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
s [m] ×104
(d) Velocity v(s) with desired velocity vdes (s) = 80 km/h and maximal velocity vmax = 100 km/h.
5000
M [Nm]
-5000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
s [m] ×104
500
R [Nm/s]
-500
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
s [m] ×104
y
5
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
s [m] ×104
2000
1000
neng [1/min]
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
s [m] ×104
0.1 1000
Height [m]
0 500
γ
-0.1 0
5.4 5.6 5.8 6 5.4 5.6 5.8 6
s [m] ×10 4
s [m] ×104
20
Q [l]
50
10
0 0
5.4 5.6 5.8 6 5.4 5.6 5.8 6
s [m] ×10 4
s [m] ×104
0
2000
-500
0
5.4 5.6 5.8 6 5.4 5.6 5.8 6
s [m] ×104 s [m] ×104
(e) Torque Mind (s) − Mbrk (s). (f) Torque rate Rind (s) − Rbrk (s).
15 2000
neng [1/min]
10
y
5 1000
γ
0
-0.1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
s [m] ×104
1000
500
Height [m]
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
s [m] ×104
9.5 Application: A Predictive Cruise Controller
(b) Height.
100
50
Q [l]
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
s [m] ×104
20
10
v [m/s]
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
s [m] ×104
(d) Velocity v(s) with desired velocity vdes (s) = 80 km/h and maximal velocity vmax = 100 km/h.
5000
M [Nm]
-5000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
s [m] ×104
500
R [Nm/s]
-500
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
s [m] ×104
y
5
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
s [m] ×104
2000
1000
neng [1/min]
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
s [m] ×104
Figure 9.32: Simulated mixed–integer model–predictive control results for the predictive cruise controller problem on a
southern German highway section of 150 kilometers length. The desired and permitted velocities are vdes =
80 km/h and vmax = 100 km/h. A prediction horizon of H = 2000 m length was used, discretized into m = 40
direct multiple shooting intervals. Control feedback was given every 10 m. Objective function weights λdev =
10−3 , λfuel = 10−1 , and λcomf = 10−4 were chosen and yield a compromise between speed–oriented and fuel–
saving behavior. In figure 9.32h it can be seen that truck is operated at much lower engine speeds than in
the previous set of results. The highest available gear 16 is selected in figure 9.32g unless slopes require
acceleration or braking maneuvers. Consequentially, the total amount of fuel consumed is reduced in figure
9.32c. This comes at the cost of much larger deviations from the desired velocity in figure 9.32d.
317
318 9 Numerical Results
60
QPVC Iterations
40
20
0
0 200 400 600 800 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800 3000
SQP Iteration
(a) Number of QPVC iterations for the results of figure 9.30.
Feedback Time [ms]
40
20
0
0 200 400 600 800 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800 3000
SQP Iteration
(b) Overall per–SQP iteration runtime of the QPVC solver for the results of figure 9.30.
Figure 9.33: Number of QPVC iterations required to compute the mixed–integer con-
trol feedback of the predictive cruise controller (m = 40 shooting in-
tervals, horizon length H = 2000 m, feedback given every 10 m, 16
available gears). Major spikes in the number of QPVC iterations are
caused by searching adjacent convex feasible sets in order to improve
an identified stationary point.
9.5.9 Summary
Modular Architecture
We have adopted the paradigm of two central data structures containing the
static description of the Mixed–Integer Optimal Control Problem (MIOCP)
model on the one hand, and the iterative data for the mixed–integer real–
time iteration scheme on the other hand. The algorithmic components of this
scheme can be naturally separated into five modules as depicted in figure
A.1 that have read access to the static model description, and read/write ac-
cess to the iterative data. While this paradigm does not provide per–module
protection of data, it gives the freedom to change data access patterns as
algorithms continue to be developed.
Algorithmic Variants
The five modules depicted in figure A.1 are abstract placeholders for one of
several concrete implementations of the respective module. Currently avail-
able implementations are listed in table A.1. For the evaluation module, the
integrator module, and the SQP module, only one standard implementation
is available. The Hessian approximation can be chosen as appropriate for
Evaluator Integrator
read
Model description Hessian
read/write
Iteration data SQP
QP
Shared objects
C interface Console output
holding algorithms
in table A.3. The dimensions notation indicates the MATLAB array type ex-
pected; {·} denotes a cell array and (·) denotes a vector or matrix. The
flags structure mandates some more detailed explanation. The software
supports two–sided point constraints (rtype 3) only if the two residuals are
affine linear, i.e., their jacobians coincide. A point constraint can be de-
clared as a vanishing constraint by associating it with the lower bound of an
unknown on the same shooting node via the flag vanish.
Possible values for the algorithm fields are listed in table A.1. The indi-
vidual algorithms accept several options and settings as listed in table A.2.
Options inappropriate for the selected algorithmic module are silently ig-
nored.
C Model Functions
with arguments as described in table A.4. The ODE nominal right hand side
and one nominal objective function term are mandatory. A Mayer type ob-
jective can be set on the final shooting node only. For all functions, deriva-
tives in the form of dense Jacobians may optionally be provided. Unavail-
able dense Jacobians are approximated by one–sided finite differences. For
the ODE system’s right hand side, sparse Jacobians or dense directional
forward derivatives may be provided in addition. Unavailable directional
forward derivatives of the ODE system’s right hand side are computed by
multiplication with the sparse (preferred) or dense (discouraged) Jacobian,
or are approximated by directional one–sided finite differences.
regardless of their type and level. They all accept the same call arguments
structure args with fields listed in table A.5 as single argument, and to re-
turn a success or error code according to table A.7. The valid input fields
and expected output fields of this arguments structure depending on the
model function and type are listed in table A.6. Jacobians of the function’s
value are stored in either dense column–major format or in sparse triplets
format. Directional derivatives are always stored in dense format and are
used for the ODE system’s right hand side function only. The point con-
straint functions evaluation two–sided point constraint (rtype 3) compute
two residuals. The single Jacobian is computes in the lower residual, such
that two–sided point constraints must always be affine linear. The extended
matching condition functions couple ( x (t i+1 ), u i ) and (si+1 , i i+1 ) values be-
longing to shooting node i + 1 and the two adjacent shooting intervals
[t i , t i+1 ] and [t i+1 , t i+2 ]. Consequentially, Jacobians with respect to the four
inputs must be computed.
An Exemplary Model
integrator
.steps double 20 Number of integrator steps
hessian
.limit int 30 Memory length of the L–BFGS Hessian
.levmar double 0.0 Levenberg–Marquardt regularization of the
Gauß–Newton Hessian
sqpsolver
.kktacc double 10−6 Acceptable KKT tolerance for termination
.itmax int 100 Maximum number of SQP iterations
qpsolver
.featol double 10−8 Tolerance for violation of QP constraints
.opttol double 10−8 Optimality tolerance for QP solution
.ranktol double 10−14 Active set degeneracy tolerance
.itmax int 104 Maximum number of QP solver iterations
.subsolver string QpHPSCSolver: KKT solver for the block structured
KKT system; see section A.2 for possible values
QpCondenseSolver: QP solver for the condensed
QP; must be QpOptSolver to use QPOPT [86]
algorithm.?.name
evaluator 1 string Name of the Evaluate module to use
hessian 1 string Name of the Hessian module to use
integrator 1 string Name of the Integrator module to use
sqpsolver 1 string Name of the SQP module to use
qpsolver 1 string Name of the QP module to use
nx
dim.x 1 int Number n of differential states x (·) ∈
x
dt n ×1
f
depends Derivative of res0 w.r.t. the time t
dx nf × n x depends Derivative of res0 w.r.t. the differential
states x (t)
du nf × n u depends Derivative of res0 w.r.t. the control u(t)
Table A.5: Fields of the model function call arguments structure args. The dimen-
sion nf is a placeholder for the function value’s actual dimension that
depends on the function type.
rightHandSide nominal I I I I O
denseJac I I I I I O O O
sparseJac I I I I I O O O
fwdDirDer I I I I I I O
leastSquares- nominal I I I I O
Objective denseJac I I I I I O O O
mayer- nominal I I I I O
Objective denseJac I I I I I O O O
point- nominal I I I I O O
Constraint denseJac I I I I I O O O
continuity- nominal I I I I I I O
Condition denseJac I I I I I I I O O O O O
Table A.6: Valid input and output fields in the arguments structure for all functions
and levels. “I” denotes inputs and “O” denotes outputs. Empty fields are
unused and should not be read or written to by the called function.
330 A Implementation
model.library = ’libnmpc1’;
model.algorithm.condenser.name = ’CondenserDense’;
model.algorithm.evaluator.name = ’Evaluator’;
model.algorithm.hessian.name = ’HessianGaussNewton’;
model.algorithm.integrator.name = ’IntegratorRK’;
model.algorithm.sqpsolver.name = ’SqpStdSolver’;
model.algorithm.qpsolver.name = ’QpCondenseSolver’;
model.algorithm.hessian.levmar = 0.0;
model.algorithm.integrator.steps = int32(5);
model.algorithm.sqpsolver.itmax = int32(1000);
model.algorithm.sqpsolver.kktacc = 1e-8;
model.dim.nodes = int32(31);
model.dim.lsq = int32(2);
model.dim.p = int32(1);
model.dim.q = int32(1);
model.dim.x = int32(1);
model.dim.sos = int32(0);
model.dim.hf = int32(0);
model.dim.r(model.dim.nnodes) = int32(1);
model.min.t = 0.0;
model.max.t = 3.0;
model.min.of = 0.0;
model.max.of = 0.2;
model.sca.of = 1.0;
model.sca.may = 1.0;
model.sca.lsq(1:2) = 1.0;
model.sca.r{model.dim.nnodes}(1) = 1.0;
model.flags.rtype(model.dim.nnodes) = int32(3);
model.flags.xspec = 2;
model.flags.ive = 1;
for ii = 1:model.dim.nnodes
model.val.x(ii,1) = 0.05;
model.min.x(ii,1) = -1.0;
model.max.x(ii,1) = 1.0;
model.sca.x(ii,1) = 1.0;
model.fix.x(ii,1) = 0;
end
for ii = 1:model.dim.nnodes-1
model.val.q(ii,1) = 0.0;
model.min.q(ii,1) = -1.0;
model.max.q(ii,1) = 1.0;
model.sca.q(ii,1) = 1.0;
model.fix.q(ii,1) = 0;
end
Figure A.5: An exemplary MuShROOM C model file for problem (A.1) (continued on
page 332).
332 A Implementation
Figure A.6: An exemplary MuShROOM C model file (continued from page 331).
Two user interfaces are provided for this software package. The command
line interface allows to solve off–line optimal control problems. The C inter-
face provides a facility for embedding measured or estimated system states
using the initial value embedding techniques, thus solving a simulated or
real on–line optimal control problem.
The MuShROOM software can be used through a command line interface in-
voked by the shell command
./mushroom problem [--switch[=value] ...]
where problem must be substituted by the full file name of a MATLAB prob-
lem description file. All algorithmic settings, tolerances, etc. are specified in
this MATLAB file as detailed in the previous section. One or more command
line switches from table A.8 may be specified in addition to the problem’s
name.
Switch Description
--[no]aset (Do not) print the active set after each SQP iteration
--continue Continue solution in iterate read from results file
--info Print information about the MuShROOM build, and quit
--plugin=filename Load an additional shared object (library) and initialize it
--verbose=p Set verbosity level of text output to p 0
--[no]writemodel (Do not) write a textual protocol of the model description
The output of MuShROOM if called using the command line interface for
problem (A.1) with embedded initial value x meas = 0 and the settings from
figure A.3 is shown in figure A.7. The individual columns of the textual out-
put are described in table A.9.
C Interface
The MuShROOM software can also be invoked from inside another program.
To this end, a selection of function calls are provided that deal with proper
334 A Implementation
Figure A.7: Output of the command line interface to MuShROOM for the exemplary
problem (A.1).
Column Description
three phases of that scheme. The most important functions are listed in ta-
ble A.10 together with a brief explanation of their arguments. For a more
extensive description we refer to the program’s documentation.
Function Description
Table A.11: Functions of the C interface to the MuShROOM software (continued from
page 335).
The static model description data structure shown in table A.12 reflects
that of a MIOCP problem. It is initialized from a user provided problem
description and is not modified during the program’s execution.
The iteration data structure holds all values computed for one iteration
of the mixed–integer real–time iteration scheme. The evaluation modules
computes function values and derivatives in the current iterate and stores
the in the eval.fun and eval.der structures. The Hessian module com-
putes an node–wise approximation of the Hessian of the Lagrangian based
on these values, and stores the Hessian blocks in the structure hessian.
The sparse QP structure qp.sparse is populated with references to these
values. Depending on the selected QP solver, this QP is either solved di-
rectly by the QpHPSC module, or condensed to a smaller dense QP by the
QpCondense module, which can then be found in the qp.dense structure.
A.1 Multiple–Shooting Real–Time Online Optimization Method 337
The SQP module uses the solution of this Quadratic Program (QP) to popu-
late the sqp.iterStep and sqp.mulStep or sqp.iter and sqp.mul, depend-
ing on the setup of the QP.
bndl of, q, x Lower bounds of the objective, control parameters, and node
states
bndu of, q, x Upper bounds of the objective, control parameters, and node
states
dim Problem dimensions
fix q, x Fixation flags for control parameters and node states
flag Miscellaneous flags, see text
func Pointers to the ANSI C model functions
init p, q, x Initial values of the model parameters, control parameters,
and node states
scal of, p, q, x Scale factors of the objective, the model parameters, control
parameters, and node states
time tmin, tmax Start and end time of the time horizon
An exemplary NMPC loop realizing the real–time iteration scheme using this
C interface to MuShROOM is given in figure A.8.
The parametric active set code qpHPSC is part of the MuShROOM software. Its
purpose is to efficiently compute optimal solutions of a sequence of paramet-
ric QPs with vanishing constraints and with block structure as induced by a
direct multiple shooting discretization. It can be used as a QP solver mod-
ule replacing the condensing and QPOPT modules. In addition, it can be used
as a stand–alone tool for Model Predictive Control (MPC) of discrete–time
linear systems with vanishing constraints. qpHPSC implements the paramet-
ric active set strategy of chapter 6 and its extension to the special class of
Quadratic Programs with Vanishing Constraints (QPVCs) obtained from ap-
plying Sequential Quadratic Programming (SQP) methods to a discretized
MIOCP with constraints treated by outer convexification. For the solution of
the KKT system, the HPSC factorization with matrix updates as developed
in chapters 7 and 8 is implemented along with interfaces to several dense
and sparse linear algebra packages for comparison purposes.
The software architecture of qpHPSC is depicted in figure A.9. The main ac-
tive set loop is implemented and executed as detailed in chapter 6, with the
possibility to either update or recompute the factorization of the Karush–
Kuhn–Tucker (KKT) system using one of several KKT solvers. The main in-
ternal data structures of our implementation are listed in table A.15.
KKT Solvers
For the factorization of the block structured KKT system, one of several
available decomposition codes can be chosen by the user. Choices are two
applicable LAPACK routines for dense symmetric and banded unsymmetric
factorization [9], the sparse symmetric indefinite factorization code MA57
[56] of the Harwell Subroutine Library (HSL), and the unsymmetric multi-
frontal factorization code UMFPACK [50] may be used. The newly developed
Hessian Projection Schur Complement (HPSC) factorization of chapter 7 is
tailored to the direct multiple shooting block structure. Matrix updates for
the KKT system factorization are provided for this last factorization only, as
detailed in chapter 8. Note that matrix updates could in principle be real-
ized for a dense or sparse LU factorization of the structured KKT system as
well, as detailed in chapter 7 and done e.g. by [108].
A.2 Block Structured Parametric Quadratic Programming Code 341
Table A.15: Main data structures of the block structured QPVC solver code qpHPSC
(continued on page 342).
342 A Implementation
kktrhs f,ff,fx m × n, nF
i
, nX
i
Gradient vectors g , g F , g X
ba m × nX
i
Active simple bounds bX
ea m × nA
i
Active point constraint residuals e A
ha m × nx Matching condition residuals h
kktsol x, xf, xx m × n, nF
i
, nX
i
Primal step δx
la m × nx Matching condition multipliers step δλ
ma m × nA
i
Active point constraints mult. step δμA
na m × nX
i
Active simple bounds mult. step δν X
Table A.16: Main data structures of the block structured QPVC solver code qpHPSC
(continued from page 341).
Figure A.9: Control flow of the QP solver module qpHPSC. The two alternative loops
show recomputation or updating of the KKT system’s factorization after
an active set change.
A.2 Block Structured Parametric Quadratic Programming Code 343
A.2.2 C Interface
C Interface Functions
Output
At the user’s choice, the qpHPSC code provides an account of the steps and
active set exchanges performed. Some exemplary iterations are shown in
figure A.10 and the columns are further explained in table A.17. In iteration
1232 a continuation of the QPVC solution process in an adjacent convex
subset can be seen, indicated by a reset of the homotopy parameter.
Figure A.10: Output of some exemplary active set iterations as provided by the
qpHPSC code.
344 A Implementation
Column Description
Table A.17: Columns of the per–iteration textual output of the qpHPSC code.
Function Description
Table A.19: Available KKT solvers for the block structured KKT system. Note that the
dense LB L T decomposition yields inferior performance, and that dense
updates for a dense or sparse LU decomposition could be realized [108].
Bibliography
298, 1984.
[85] P. Gill, W. Murray, M. Saunders, and M. Wright. A practical anti-
cycling procedure for linearly constrained optimization. Mathema-
tical Programming, 45(1–3):437–474, 1989.
[86] P. Gill, W. Murray, and M. Saunders. User’s Guide For QPOPT 1.0: A
Fortran Package For Quadratic Programming, 1995.
[87] D. Goldfarb. A family of variable metric updates derived by variational
means. Mathematics of Computation, 24:23–26, 1970.
[88] D. Goldfarb and A. Idnani. A numerically stable dual method for solv-
ing strictly convex quadratic programs. Mathematical Programming,
27:1–33, 1983.
[89] G. Golub and C. van Loan. Matrix Computations. Johns Hopkins Uni-
versity Press, Baltimore, 3rd edition, 1996.
[90] R. Gomory. Outline of an algorithm for integer solutions to linar pro-
grams. Bulletin of the American Mathematical Society, 64:275–278,
1958.
[91] J. Gondzio. Multiple centrality corrections in a primal–dual interior
point method for linear programming. Computational Optimization
and Applications, 6:137–156, 1996.
[92] A. Griewank. Evaluating Derivatives, Principles and Techniques of
Algorithmic Differentiation. Number 19 in Frontiers in Applied Math-
ematics. SIAM, Philadelphia, 2000.
[93] I. Grossmann. Review of nonlinear mixed-integer and disjunctive
programming techniques. Optimization and Engineering, 3:227–252,
2002.
[94] I. Grossmann, P. Aguirre, and M. Barttfeld. Optimal synthesis of com-
plex distillation columns using rigorous models. Computers and Che-
mical Engineering, 29:1203–1215, 2005.
[95] M. Grötschel, L. Lovász, and A. Schrijver. Geometric Algorithms and
Combinatorial Optimization, volume 2 of Algorithms and Combina-
torics. Springer Verlag, 1988. ISBN 3-540-13624-X, 0-387-13624-X
(U.S.).
[96] J. Guddat, F. G. Vasquez, and H. Jongen. Parametric Optimization:
Singularities, Pathfollowing and Jumps. Teubner, Stuttgart, 1990.
[97] M. Guignard. Generalized Kuhn–Tucker conditions for mathematical
356 Bibliography
[177] J. Rawlings and D. Mayne. Model Predictive Control: Theory and De-
sign. Nob Hill Publishing, LLC, 2009.
[178] J. Rawlings, E. Meadows, and K. Muske. Nonlinear model predictive
control: A tutorial and survey. In Proc. Int. Symp. Adv. Control of
Chemical Processes, ADCHEM, Kyoto, Japan, 1994.
[179] A. Richards and J. How. Model predictive control of vehicle maneu-
vers with guaranteed completion time and robust feasibility. In Pro-
ceedings of the IEEE American Control Conference (ACC 2003), Den-
ver, CO, USA, June 4–6, 2003, volume 5, pages 4034–4040, 2003.
[180] S. Robinson. Perturbed kuhn-tucker points and rates of convergence
for a class of nonlinear programming algorithms. Mathematical Pro-
gramming, 7:1–16, 1974.
[181] C. D. T. Runge. Über die numerische Auflösung von Differentialgleich-
ungen. Mathematische Annalen, 46(2):167–178, 1895.
[182] R. Russell and L. Shampine. A collocation method for boundary value
problems. Numerische Mathematik, 19:1–28, 1972.
[183] S. Sager. Numerical methods for mixed–integer optimal control prob-
lems. Der andere Verlag, Tönning, Lübeck, Marburg, 2005. URL
http://sager1.de/sebastian/downloads/Sager2005.pdf. ISBN 3-
89959-416-9.
[184] S. Sager, H. Bock, M. Diehl, G. Reinelt, and J. Schlöder. Numerical
methods for optimal control with binary control functions applied to
a Lotka-Volterra type fishing problem. In A. Seeger, editor, Recent
Advances in Optimization (Proceedings of the 12th French-German-
Spanish Conference on Optimization), volume 563 of Lectures Notes
in Economics and Mathematical Systems, pages 269–289, Heidel-
berg, 2006. Springer Verlag.
[185] S. Sager, M. Diehl, G. Singh, A. Küpper, and S. Engell. Determin-
ing SMB superstructures by mixed-integer control. In K.-H. Wald-
mann and U. Stocker, editors, Proceedings OR2006, pages 37–44,
Karlsruhe, 2007. Springer Verlag.
[186] S. Sager, H. Bock, and M. Diehl. Solving mixed-integer con-
trol problems by sum up rounding with guaranteed integer gap.
Preprint, IWR, University of Heidelberg, 2008. URL http://www.ub.
uni-heidelberg.de/archiv/8384.
[187] S. Sager, C. Kirches, and H. Bock. Fast solution of periodic optimal
364 Bibliography