30
On Perspective Functions, Vanishing Constraints, and Complementarity Programming Fast Mixed-Integer Nonlinear Feedback Control Christian Kirches 1 , Sebastian Sager 2 1 Interdisciplinary Center for Scientific Computing (IWR) Heidelberg University 2 Institute for Mathematical Optimization University of Magdeburg 17 th International Workshop on Combinatorial Optimization Aussois, France January 9, 2013 C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

On Perspective Functions, Vanishing Constraints, and

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: On Perspective Functions, Vanishing Constraints, and

On Perspective Functions, VanishingConstraints, and Complementarity Programming

Fast Mixed-Integer Nonlinear Feedback Control

Christian Kirches1, Sebastian Sager2

1Interdisciplinary Center for Scientific Computing (IWR)Heidelberg University

2Institute for Mathematical OptimizationUniversity of Magdeburg

17th International Workshop on Combinatorial Optimization

Aussois, France

January 9, 2013

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 2: On Perspective Functions, Vanishing Constraints, and

Cyclic adsorption chillers

[Gräber, K., Bock, Schlöder, Tegethoff, Köhler, 2011]

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 3: On Perspective Functions, Vanishing Constraints, and

Cyclic adsorption chillers

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 4: On Perspective Functions, Vanishing Constraints, and

Cooling plants

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 5: On Perspective Functions, Vanishing Constraints, and

Automotive control

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 6: On Perspective Functions, Vanishing Constraints, and

Automotive control

courtesy Lewis Hamilton via twitter

[Kehrle 2010]

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 7: On Perspective Functions, Vanishing Constraints, and

Predictive cruise control for heavy duty trucks

Aim: Time/Energy optimal driving with automatic gear choice

500

1000

1500

2000

0

1000

2000

30000

0.01

0.02

0.03

0.04

Realization: Online computation of mixed-integer feedback controls ona moving horizon

8 available gears, 20 possible shifts = more than 1018 continuousproblems! [K., 2010]

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 8: On Perspective Functions, Vanishing Constraints, and

Mixed-integer feedback controls on the Autobahn

slope profile

velocity

effective torque

engine speed

gear choice

[K., 2010]

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 9: On Perspective Functions, Vanishing Constraints, and

A mixed integer feedback control loop

(Simulated) process

Feedback Observer

Evaluate process model

Solve model-predictive control problem

observables

stateestimate

new continuous, integerfeedback control

most recent continuous,integer feedback control

state

state andcontrol trajectories

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 10: On Perspective Functions, Vanishing Constraints, and

Mixed integer optimal control problems (MIOCPs)Dynamic & switched process control problem on the prediction horizon [0, T]:

minx(·), z(t), u(·), v(·)

∫ T

0

l(x(t), z(t), u(t), v(t), p) dt+m(x(T), z(t), p)

s.t. x(t) = f(x(t), z(t), u(t), v(t), p) t ∈ [0, T]

0= g(x(t), z(t), u(t), v(t), p) t ∈ [0, T]

0= x(0)− x0

0≤ c(x(t), z(t), u(t), v(t), p) t ∈ [0, T]

0≤ d(x(t), z(t), u(t), p) t ∈ [0, T]

0µ r(x(ti), z(t)0≤i≤N, p) ti0≤i≤N ⊂ [0, T]

v(t) ∈ Ω t ∈ [0, T]

Objective: typically economic/tracking part l and terminal weight part m

Constraints: Initial value, path constraints c, d, point constraints r on a time grid

Dynamic process (x(·), z(·)) modeled by an ODE/DAE system f

Continuous controls u(·) from set U ⊂ Rnu ,

Controls v(·) from discrete set Ω := v1, . . . , vnΩ ⊂ Rnv holding finitely many choices vj formode-specific parameters

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 11: On Perspective Functions, Vanishing Constraints, and

Nonlinear model-predictive control (NMPC) scheme

v(t)v

v

v

v

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 12: On Perspective Functions, Vanishing Constraints, and

Classic NMPC benchmark problem: CSTR

[Klatt & Engell, 1993]

Worst-case runtimes for one iteration of the NMPC loop:

1997 [Chen] 60 seconds Pentium 166 MHz2001 [Diehl] 500 milliseconds Celeron 800 MHz2011 [Houska, Ferreau, Diehl] 400 microseconds Intel i7 3.6 GHz

100.000x times faster than 15 years ago!

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 13: On Perspective Functions, Vanishing Constraints, and

Computational approaches in MIOC

Known fixed sequence of mode switches

Solve a single multi-stage continuous OCP =⇒ easy

Relax first, then discretize and solve a single OCP

Direct relaxation of the integer controls

then solve a single continuous OCP

Build on NMPC technology available for continuous OCPs

Model functions must be evaluated in fractional points

Integer feasibility? Bounds on the loss of optimality?

Optimal control problem based branch & bound

First treat combinatorics in a branch & bound framework

then solve continuous OCPs in the tree nodes

Affordable for small trees only, per-node cost is prohibitive

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 14: On Perspective Functions, Vanishing Constraints, and

Example: branch & bound for MIOCP

Solve MIOCP to find time optimal gear shift sequence:

N t∗f [sec] CPU time20 6.779751 000:23:5240 6.786781 232:25:3180 ? ?

[Gerdts, 2005]

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 15: On Perspective Functions, Vanishing Constraints, and

Computational approaches in MIOC

Discretize first, then treat combinatoricsFirst obtain a discretized problem, e.g. using a direct andsimultaneous method (collocation, multiple shooting)then solve a structured possibly nonconvex MINLPSophisticated methods: outer approximation, cut generation, divingBonami, Wächter, . . . (Bonmin), Leyffer, Linderoth, . . . (FilMint, MINOTAUR),

Belotti, Biegler, Floudas, Fügenschuh, Grossmann, Helmberg, Koch, Lee, Liberti, Lodi, Luedtke,

Marquardt, Martin, Michaels, Nannicini, Oldenburg, Rendl, Sahinidis, Wächter, Weismantel, . . .

But: Extremely expensive for optimal control problemsLong horizons, fine discretization in time, little opportunity for earlypruning

Exploit control theory knowledge properlyyI ∈ 0, 1nI comes from a time discretization, nI likely is very largeBang-bang arcs of an optimal solution of a relaxation are integerfeasibleInteger variables only enter inside an integral

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 16: On Perspective Functions, Vanishing Constraints, and

Partial outer convexification for MIOCP

Introduction of convex multipliers ωj(·) ∈ 0,1 for choices v(·) = vj ∈ Ω,j= 1, . . . , nΩ:

bijection: v(t) = vj ∈ Ω ⇐⇒ ωj(t) = 1,nΩ∑

k=1

ωk(t) = 1

Modeling of MIOCP as a partially convexified optimal control problem:

minx(·), u(·), ω(·)

∫ T

0

nΩ∑

j=1

ωj(t) · l(x(t), u(t), vj, p) dt+m(x(T), p)

s.t. x(t) =∑nΩ

j=1ωj(t) · f(x(t), u(t), vj, p) t ∈ [0, T]

0= x(0)− x0(τ)

0≤ωj(t) · c(x(t), u(t), vj, p), j= 1, . . . , nΩ, t ∈ [0, T]

0≤ d(x(t), u(t), p), t ∈ [0, T]

ω(t) ∈ 0,1nΩ , 1=∑nΩ

j=1ωj(t) t ∈ [0, T]

[Sager, 2005, K., 2010]

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 17: On Perspective Functions, Vanishing Constraints, and

Partial outer convexification for MIOCP

Introduction of convex multipliers ωj(·) ∈ 0,1 for choices v(·) = vj ∈ Ω,j= 1, . . . , nΩ:

bijection: v(t) = vj ∈ Ω ⇐⇒ ωj(t) = 1,nΩ∑

k=1

ωk(t) = 1

Relaxation then yields a continuous, larger optimal control problem:

minx(·), u(·), α(·)

∫ T

0

nΩ∑

j=1

αj(t) · l(x(t), u(t), vj, p) dt+m(x(T), p)

s.t. x(t) =∑nΩ

j=1αj(t) · f(x(t), u(t), vj, p) t ∈ [0, T]

0= x(0)− x0(τ)

0≤ αj(t) · c(x(t), u(t), vj, p), j= 1, . . . , nΩ, t ∈ [0, T]

0≤ d(x(t), u(t), p) t ∈ [0, T]

α(t) ∈ [0, 1]nΩ , 1=∑nΩ

j=1αj(t) t ∈ [0, T]

[Sager, 2005, K., 2010]

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 18: On Perspective Functions, Vanishing Constraints, and

Approximation theoremsTheorem (MIOCP, function space)Let (x∗(·), u∗(·),α∗(·)) be the optimal solution of the convexified relaxed MIOCP withobjective ΦCR.∀ ε > 0 ∃ ωε binary feasible and xε(·) such that (xε(·), u∗(·),ωε(·)) is a feasible solution ofthe (convexified) MIOCP with objective ΦCB, and

(ΦCR ≤ ) ΦCB ≤ ΦCR + ε.

[Sager, Reinelt, Bock, 2009]

Theorem (NLP, discretized control)Consider for t ∈ [0, T] the two affine-linear systems

x(t) = A(t, x(t)) α∗(t), x(0) = x0, y(t) = A(t, y(t))ω(t), y(0) = y0,

for α∗, ω measurable, A ∈ C1 essentially bounded by M, Lipschitz in x with constant L, and

with total t-derivative bounded by C. Assume ω satisfies

∫ T

0ω(t)−α∗(t) dt

≤ ε.(bang-bang arcs, or sum-up rounding)Then for all t ∈ [0, T]:

||x(t)− y(t)|| ≤

||x0 − y0||+ (M+ C(t− t0))ε

eL(t−t0).

[Sager, Bock, Diehl, 2011]

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 19: On Perspective Functions, Vanishing Constraints, and

Example: b & b vs. outer convexification for MIOCP

Solve MIOCP to find time optimal gear shift sequence:

N t∗f [sec] CPU time

20 6.779751 000:23:5240 6.786781 232:25:3180 ? ?

N t∗f [sec] CPU time10 6.798389 00:00:0720 6.779035 00:00:2440 6.786730 00:00:4680 6.789513 00:04:19

[K., Bock, Schlöder, Sager, 2010]

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 20: On Perspective Functions, Vanishing Constraints, and

Example: b & b vs. outer convexification for MIOCP

Solve MIOCP to find time optimal gear shift sequence:

[K., Bock, Schlöder, Sager, 2010]

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 21: On Perspective Functions, Vanishing Constraints, and

The mixed-integer NMPC loop

(Simulated) process

Feedback Observer

Evaluate dynamic process model(ODE/DAE) and compute sensitivities

Sum-Up Rounding

One iteration= solve a QPVC

yk

xk0

∆uk(0), ∆vk(0)

xk−1(0), uk−1(0), vk−1(0)

xk(0)

(xkα(·), uk(·),αk(·))

(xkω(·), uk(·),ωk(·))

[Diehl, 2001, K., 2010]

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 22: On Perspective Functions, Vanishing Constraints, and

Complementarity/Vanishing Constraint FormulationConstraints 0≤ c(x(t), u(t), v(t), p) depend on v(·)

Approximation theorem does not address feasibility of c(·) afterrounding

Tightest formulation: Complementarity and vanishing constraints(MPCCs, MPVCs)

0≤ αj(t) · c(x(t), u(t), vj, p), j= 1, . . . , nΩ, t ∈ [0, T]

Violates constraint qualifications LICQ, MFCQ, ACQ in αj(t) = 0,c(·) = 0, but GCQ and hence KKT-based optimality holds

Numerical methods: Solve a sequence of NLPs obtained byregularization, smoothing, or a combination thereof

MPCC: Fletcher, Leyffer, Munson, Ralph, Stein, ...

MPVC: Achtziger, Hoheisel, Kanzow, ...

Best convergence properties for sequential linear-quadratic methodsfor MPCC/MPVC [Leyffer, Munson, 2004]

Open: Actual implementation?

Tailored active set quadratic MPVC solver [K., Potschka, Bock, Sager, 2012]

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 23: On Perspective Functions, Vanishing Constraints, and

Predictive cruise control for a heavy-duty truck

Partial outer convexification and relaxation for gear shift

Vanishing constraint formulation for gear-dependent engine speedlimits

Direct multiple shooting discretization in time

Sequential QPVC active set solver for the truck model MPVC

Exploitation of block structures in linear algebra

Sampling times of 10 to 100 ms on my desktop system

Save 3%-5% fuel when compared to experienced driver’sperformance (105 km/year, 30-40 l/100km)

Methodology is extensibleto future hybrid technologies

Patent [Bock, K., Sager, Schlöder]

jointly with Mercedes Trucks, Stuttgart

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 24: On Perspective Functions, Vanishing Constraints, and

(I) One-Row Relaxation Formulation

Constraints 0≤ c(x(t), u(t), v(t), p) depend on v(·)One-row relaxation formulation

0≤nΩ∑

j=1

αj(t) · c(x(t), u(t), vj, p), t ∈ [0, T]

Is obtained as the convex combinstion of residuals for theconstraints on the choices vj

Satisfies LICQ, but often suffers from compensatory effects

Open: Can we efficiently add a few cuts (in MIOCP, in an MI-NMPCscheme) and effectively (reducing the integrality gap)?

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 25: On Perspective Functions, Vanishing Constraints, and

(II) Generalized Disjunctive Programming

Constraints 0≤ c(x(t), u(t), v(t), p) depend on v(·)Generalized disjunctive programming Balas, Grossmann, ...

minx(·),u(·),Y(·)

e(x(T))

s.t. ∨i∈1,...,nω

Yi(t)x(t) = f(x(t), u(t), vi)0≤ c(x(t), u(t), vi)

, ∀t ∈ [0, T]

x(0) = x0

0≤ d(x(t), u(t)), ∀t ∈ [0, T]Y(t) ∈ false, true, ∀t ∈ [0, T]

Obtain convex hull description using big-M or perspective(MILP procedure: Ceria, Soares, 1999, Stubbs, Mehrotra, 1999)

Requires time discretization of the disjunction literal Y(·)Involves lifting the ODE system and the initial value constraints

[Jung, K., Sager, 2012]

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 26: On Perspective Functions, Vanishing Constraints, and

(III) Liftings of the Differential Equations

minx(·),u(·),α(·)

e(x(T))

s.t. xi(t) = αkif(xi(t)/αki, ui(t)/αki, vi) t ∈ [tk, tk+1]

xi(tk) = αkisk

sk+1 =nω∑

i=1

xi(tk+1; tk, sk, ui(·)/αki, vi)

0≤ αkic(xi(t)/αki, ui(t)/αki, vi) t ∈ [tk, tk+1]

0≤ d

nω∑

i=1

xi(t),nω∑

i=1

ui(t)

!

t ∈ [tk, tk+1]

nω∑

i=1

αki = 1, 0≤ xi(t)≤ αkiMs, 0≤ ui(t)≤ αkiM

u t ∈ [tk, tk+1]

Several numerical difficulties:

ODE system has significantly grown in size

Positivity of states and controls

Perspective curvature ill-defined near zero

Vanishing constraint structure still present

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 27: On Perspective Functions, Vanishing Constraints, and

An Example for the Constraint Formulations

-10

0

10

20

30

40

50

60

70

5 10 15 20 25 30 35 40

Tra

ck e

leva

tio

n [

m]

Interval

Mu

ltip

liers

α

2

4

6

8

10

12

14

16

Mu

ltip

liers

α

2

4

6

8

10

12

14

16

0

5

10

15

20

25

30

5 10 15 20 25 30 35 40

Ve

locity v

[m

/s]

root relaxation

Mu

ltip

liers

α

2

4

6

8

10

12

14

16

Mu

ltip

liers

α

2

4

6

8

10

12

14

16

0

5

10

15

20

25

30

5 10 15 20 25 30 35 40

Ve

locity v

[m

/s]

outer convex., one-row relaxationM

ultip

liers

α

2

4

6

8

10

12

14

16

Mu

ltip

liers

α

2

4

6

8

10

12

14

16

0

5

10

15

20

25

30

5 10 15 20 25 30 35 40

Ve

locity v

[m

/s]

Dynamic Programming

Mu

ltip

liers

α

2

4

6

8

10

12

14

16

Mu

ltip

liers

α

2

4

6

8

10

12

14

16

0

5

10

15

20

25

30

5 10 15 20 25 30 35 40

Ve

locity v

[m

/s]

vanishing constraints (IPOPT stuck)

Mu

ltip

liers

α

2

4

6

8

10

12

14

16

Mu

ltip

liers

α

2

4

6

8

10

12

14

16

0

5

10

15

20

25

30

5 10 15 20 25 30 35 40

Ve

locity v

[m

/s]

relaxed VC

Mu

ltip

liers

α

2

4

6

8

10

12

14

16

Mu

ltip

liers

α

2

4

6

8

10

12

14

16

0

5

10

15

20

25

30

5 10 15 20 25 30 35 40

Ve

locity v

[m

/s]

smoothed VC

Mu

ltip

liers

α

2

4

6

8

10

12

14

16

Mu

ltip

liers

α

2

4

6

8

10

12

14

16

0

5

10

15

20

25

30

5 10 15 20 25 30 35 40

Ve

locity v

[m

/s]

GDP, Big-M

Mu

ltip

liers

α

2

4

6

8

10

12

14

16

Mu

ltip

liers

α

2

4

6

8

10

12

14

16

0

5

10

15

20

25

30

5 10 15 20 25 30 35 40

Ve

locity v

[m

/s]

GDP, VC

[Jung, K., Sager, 2012]C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 28: On Perspective Functions, Vanishing Constraints, and

Key points and future work

Mixed integer optimal control problems

Partial outer convexification for MIOCP

Solve a large, continuous OCP – typically no exponential runtime

Sum-up-rounding or MILP to reconstruct the integer control

has optimality certificate in function space and after discretization

has feasibility certificate for nonconvex MPCC/MPVC formulation

Mixed integer nonlinear model predictive control

Advanced SQP and QP techniques for NMPC available

Partial outer convexification allows transfer to mixed–integer NMPC

Future developments for constraints on integer controls

An SLP-EQP solver for the MPCC/MPVC formulation?

Use tight convex relaxations from GDP, instead of MPCC/MPVC?

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 29: On Perspective Functions, Vanishing Constraints, and

Acknowledgements

Hans Georg BockAlexander Buchner

Michael JungFlorian KehrleSven Leyffer

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control

Page 30: On Perspective Functions, Vanishing Constraints, and

Thank you very much!

Questions?

C. Kirches (Heidelberg), S. Sager (Magdeburg) Fast Mixed-Integer Nonlinear Feedback Control