Multi Parametric With References
Multi Parametric With References
t|t
At time instance t:
solve Constrained Finite Time Optimal
Control problem to obtain open-loop
solution:
U
T
t|t
u
T
t+1|t
. . . u
T
t+N1|t
T
apply only u
t|t
,
repeat the optimization at the next time
instance for a shifted prediction horizon
Receding horizon policy introduces feedback
Motivation
MPC requires solving a constrained optimization
problem (e.g. linear or quadratic) on-line.
Drawbacks
the optimization problem may not be solved
within a prescribed time due to a high
sampling rate limited to slow processes
(e.g. chemical plants)
it is dicult to estimate strict (and tight)
upper bound on the time needed for the
optimization procedure
on-line optimization usually implies
expensive and large computational
infrastructure inconvenient for embedded
control applications
Remedy
Move the optimization eort o-line . How?
Parametric Programming - Part I
Before providing the answer to the question, let
us consider the following example:
Example: Perturbed quadratic program
f
(x) = min
z
f(z, x) =
1
2
z
2
+2xz
subj. to z 1 +x,
x R is an unknown parameter.
The goals:
1. nd z
(x) = argmin
z
f(z, x),
2. nd all x for which the problem has a
solution
3. compute the value function f
(x)
Dene Lagrangian:
L(z, x, ) = f(z, x) +(z x 1)
KKT conditions:
z +2x + = 0, (1)
z x 1 0, (2)
(z x 1) = 0, (3)
0. (4)
Parametric Programming - Part II
Consider two strictly complementary cases
(from (3)):
1.
z x 1 = 0
> 0
(x) = x +1,
x <
1
3
f
(x) =
5
2
x
2
+3x +
1
2
2.
z x 1 < 0
= 0
(x) = 2x,
x >
1
3
f
(x) = 2x
2
-2 -1 0 1 2
-2
-1
0
1
2
x
z, f
x =
1
3
f
(x)
z
(x)
z
(x) =
x +1, if x
1
3
,
2x, if x
1
3
The optimization problem is solved for all
admissible values of parameter x.
The optimal solution for a given x amounts
to simple evaluation of z
(x) and f
(x).
Parametric Programming - General
General formulation:
f
(x) = inf
z
f(z, x),
subj. to g(z, x) 0,
where z Z R
m
is the optimization variable
and x X R
n
is a vector of parameters.
x R
n
, n > 1 multi-parametric program
closely related to sensitivity analysis:
sensitivity analysis: local behavior of the
solution for small perturbations
parametric program: solution for the full
range of parameters x
We consider two important classes:
1. multi-parametric LP (mpLP)
2. multi-parametric QP (mpQP)
mpLP
Formulation
PRIMAL PROBLEM (PP) DUAL PROBLEM (DP)
J
(x) = min
z
J(z, x) = c
T
z,
subj. to Gz W +Sx
max
(W +Sx)
T
,
subj. to G
T
= c,
0
where c R
m
, G R
qm
, S R
qn
, W R
q
.
Feasible Set: X
(x)
G
i
z S
i
x W
i
= 0} ,
Set of Inactive Constraints:
N(x) = {i I | z : J(z, x) = J
(x)
G
i
z S
i
x W
i
< 0} ,
Critical region: for a given set A
I
CR
A
= {x X | A(x) = A
}
mpLP: Geometric Algorithm (I)
exploration of the parameter space X using
geometric methods
requires an LP solver
for simplicity, assume: no degeneracy
Optimality Conditions
primal feasibility:
Gz W +Sx
dual feasibility:
G
T
= c, 0
complementarity slackness:
i
(G
i
z S
i
x W
i
) = 0, i I
Step 1: solve an LP
For an initial parameter vector x
0
X:
solve PP & DP z
(x
0
) and
(x
0
),
obtain A
0
= A(x
0
) and N
0
= N(x
0
) and
matrices:
{G
A
0
, S
A
0
, W
A
0
} = {G
i
, S
i
, W
i
| i A(x
0
)}
{G
N
0
, S
N
0
, W
N
0
} = {G
i
, S
i
, W
i
| i N(x
0
)}
mpLP: Geometric Algorithm (II)
Step 2: determine CR
A
0
, z
0
(x) and J
0
(x)
From the primal feasibility conditions:
G
A
0
z
0
(x) = W
A
0
+S
A
0
x,
G
N
0
z
0
(x) < W
N
0
+S
N
0
x.
compute:
optimizer z
0
(x):
z
0
(x) = G
1
A
0
S
A
0
x +G
1
A
0
W
A
0
= F
0
x +g
0
critical region CR
A
0
:
CR
A
0
=
x | (G
N
0
F
0
S
N
0
)x < W
N
0
G
N
0
g
0
0
(x) (remember, strong duality holds):
J
0
(x) = (S
A
0
x +W
A
0
)
T
A
0
Simplifying notation: CR
A
j
CR
j
mpLP: Geometric Algorithm (III)
Critical region CR
0
is dened by strict
inequalities an open polyhedral set
PSfrag replacements
x
0
x
1
x
2
CR
0
X
A = A(x) uniquely determines CR
A
critical regions do not overlap
the optimizer z
CR
0
X
R
1
R
2
R
3
R
4
CR
0
= {x X | Hx K}
R
i
= {x X | H
i
x K
i
H
j
x K
j
, j < i}
X \
CR
0
=
i
R
i
NOTE: regions R
i
are not critical regions
proceed recursively: repeat the whole
procedure for each R
i
guaranteed: set X explored in nite number
of iterations
problem: critical regions can be articially
divided among dierent R
i
PSfrag replacements
x
0
x
1
x
2
CR
0
CR
1
X
R
1
R
2
R
3
R
4
CR
1
is split between R
2
and R
3
keep track of
the critical regions already
discovered
mpLP: Geometric Algorithm (V)
II) Crossing the facets
PSfrag replacements
x
0
x
1
x
1
x
2
x
2
CR
0
CR
0 CR
4
CR
4
CR
1
CR
1
CR
2
CR
2
CR
3
CR
3
X X
for each of the facets of CR
0
a point outside
the region but close to the facet is selected
and the procedure is repeated
critical regions are computed in one piece,
no articial splitting
heuristics: how far to step over the facet?
no formal proof that whole X
is covered
however: in practice usually outperforms the
strategy based on reversing inequalities
mpLP: Solution Properties
The following theorem summarizes the
properties of the solution to the mpLP:
Theorem 1
i) Feasible set X
is unique x X
,
the optimizer function z
(x) : X
R
m
is:
continuous
polyhedral piecewise ane (PPWA) over
X
, ane in each CR
i
Otherwise, it is always possible to choose
a continuous and PPWA optimizer function
z
(x).
iii) The value function J
(x) : X
R is:
convex
PPWA over X
, ane in each CR
i
mpLP: Example
min
z
3z
1
8z
2
,
s.t.
z
1
+z
2
13 +x
1
5z
1
4z
2
20
8z
1
+22z
2
121 +x
2
4z
1
z
2
8
z
1
0
z
2
0
Critical regions and the optimizer
20 10 0 10 20 30 40 50
60
40
20
0
20
40
60
PSfrag replacements
x
1
x
2
CR
1
CR
2
CR
3
A
1
= {1, 3}
A
2
= {2, 3}
A
3
= {1, 4}
10
0
10
20
30
40
50
50
0
50
2
4
6
8
10
12
14
PPWA optimizer function
PSfrag replacements
x
1
x
2
z
(
x
)
z
(x) =
0.733 0.0333
0.267 0.0333
x +
5.50
7.50
if x CR
1
0 0.0513
0.0641
x +
11.8
9.81
if x CR
2
0.333 0
1.33 0
x +
1.67
14.7
if x CR
3
mpQP
Formulation
We consider multi-parametric quadratic
programs of the form:
J
(x) = min
z
J(z, x) =
1
2
z
T
Hz
,
subj. to Gz W +Sx
where z Z R
m
, and x X R
n
, G R
qm
.
Assumptions:
H 0 no dual degeneracy
no primal degeneracy
Optimality conditions (KKT)
Hz
+G
T
= 0, (5)
i
(G
i
z
S
i
x W
i
) = 0, i = 1, . . . , q (6)
0, (7)
Gz
W +Sx (8)
mpQP: Geometric Algorithm (I)
the algorithm is conceptually identical to the
geometric algorithm for mpLP
required: QP solver
Step 1: Solve QP
For an initial parameter vector x
0
solve QP and:
obtain the optimizer z
(x
0
),
identify indices of active and inactive
constraints A = A(x
0
) and N = N(x
0
) and
the corresponding matrices {G, S, W}
A
and
{G, S, W}
N
Step 2: Compute z
(x),
(x) and CR
A
from (5):
z
= H
1
G
T
(9)
from (9) and (6) (
N
= 0):
A
(x) = (G
A
H
1
G
T
A
)
1
(W
A
+S
A
x), (10)
the optimizer function: from (9) and (10):
z
(x) = H
1
G
T
A
(G
A
H
1
G
T
A
)
1
(W
A
+S
A
x)
mpQP: Geometric Algorithm (II)
critical region: put
(x) and z
GH
1
G
T
A
(G
A
H
1
G
T
A
)
1
S
A
S
(G
A
H
1
G
T
A
)
1
S
A
b =
W +GH
1
G
T
A
(G
A
H
1
G
T
A
)
1
W
A
(G
A
H
1
G
T
A
)
1
W
A
is closed and
convex
ii) the optimizer function z
(x) : X
R
m
is:
continuous
PPWA over the critical regions CR
i
iii) the value function J
(x) : X
R is:
continuous
convex
polyhedral piecewise quadratic (PPWQ)
(piecewise quadratic over polyhedra), in
particular over the critical regions CR
i
mpQP: Example
min
z
1
2
(z
2
1
+z
2
2
),
s.t.
z
1
+z
2
13 +x
1
5z
1
4z
2
20
8z
1
+2z
2
10 +x
2
4z
1
z
2
8
z
1
0
z
2
0
Critical regions and the optimizer
20 10 0 10 20 30 40 50 60
60
40
20
0
20
40
60
PSfrag replacements
x
1
x
2
CR
1
CR
2
CR
3
CR
4
CR
5
0
20
40
50
0
50
2
2.5
3
3.5
4
4.5
5
PPWA optimizer function
PSfrag replacements
x
1 x
2
z
(
x
)
z
(x) =
0 0
0 0
x +
1.88
0.47
if x CR
1
0.3333 0
1.3333 0
x +
1.67
14.67
if x CR
2
0 0.0625
0 0.25
x +
0.38
6.5
if x CR
3
0 0.125
0 0
x +
1.25
0
if x CR
4
0 0.1818
0 0.2273
x +
3.64
9.55
if x CR
5
MPC based on Linear Norms (I)
Consider optimal control problem:
min
u
N1
k=0
||Qx
t+k|t
||
p
+||Ru
t+k|t
||
p
s.t. x
t+k+1|t
= Ax
t+k|t
+Bu
t+k
, k 0
x
t+k|t
X
u
t+k|t
U
(11)
where p {1, }, X and U are polyhedral sets.
Recall vectorized notation:
X =
x
T
t|t
x
T
t+1|t
. . . x
t+N1|t
T
U =
u
T
t|t
u
T
t+1|t
. . . u
T
t+N1|t
T
The predicted states and outputs can be
conveniently written as
X = Ax
t|t
+BU
where
A =
I
A
A
2
.
.
.
A
N1
, B =
0 0 0 . . . 0
B 0 0 . . . 0
AB B 0 . . . 0
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
A
N2
B . . . AB B 0
E
u
E
x
B
F
u
F
x
E
x
Ax
k|k
Z
x
Q(Ax
t|t
+BU) Z
x
Z
u
RU Z
u
MPC based on Linear Norms (III)
Written in a more compact form, the problem
becomes:
min
z
c
T
z,
subj. to Gz W +Sx
t|t
(12)
where z =
U
T
, Z
T
x
, Z
T
u
T
.
The problem (12) can be solved on-line as an
LP for a particular x
t|t
or o-line for all x
t|t
as
an mpLP, with x
t|t
as the parameter vector.
MPC based on Quadratic Cost
Consider the optimal control problem:
min
u
N1
k=0
x
T
t+k|t
Qx
t+k|t
+u
T
t+k|t
Ru
t+k|t
s.t. x
t+k+1|t
= Ax
t+k|t
+Bu
t+k
, k 0
x
t+k|t
X
u
t+k|t
U
(13)
Using the same notation, the problem (13) is
transformed into QP:
min
U
U
T
HU +2U
T
Fx
t|t
s.t.
E
u
E
x
B
F
u
F
x
E
x
Ax
k|k
where H = A
T
QA+R, F = B
T
QA.
Completing the square and transforming
coordinates: z = 2(U +H
1
F
T
x
t|t
):
min
z
1
2
z
T
Hz,
subj. to Gz W +Sx
t|t
(14)
Solve QP (14) on-line for a particular x
t|t
or
o-line for all x
t|t
as an mpQP with x
t|t
as a
parameter vector.
Explicit Solution to MPC
For constrained linear systems and quadratic
cost or cost based on linear norms:
MPC is a continuous, piecewise
ane feedback law.
The computational burden is moved o-line:
o-line: solve mpLP(QP)
on-line: detect which critical region x
t|t
belongs to and evaluate the corresponding
ane feedback law LOOK-UP TABLE
EXPLICIT FEEDBACK LAW
LOOKUP TABLE
OPTIMIZATION PROBLEM
(mpLP, mpQP, ...)
PLANT
OFFLINE
PSfrag replacements
u
(x
t|t
)
u
(x
t|t
)
r
t
y
t
x
t|t
x
t|t
u
= F
i
x
t|t
+g
i
Receding horizon policy: extract u
t|t
from
the optimizer vector z
(x
t|t
) and apply it to the
plant
Example: Double Integrator (II)
G(s) =
1
s
2
ZOH, T
s
=0.1s
= x
t+1
=
1 0.1
0 1
x
t
+
0.005
1
u
t
Constraints:
|u| 1
x
5
-norm based cost
J(x, u) =
10
k=0
x
t+k|t
+u
t+k|t
5 4 3 2 1 0 1 2 3 4 5
5
4
3
2
1
0
1
2
3
4
5
Position
S
p
e
e
d
Control partition with 116 regions
PSfrag replacements
x
1
x
2
CR
1
CR
2
CR
3
A
1
= {1, 3}
A
2
= {2, 3}
A
3
= {1, 4}
5
0
5
5
0
5
1
0.5
0
0.5
1
Value of the control action over 116 regions
PSfrag replacements
x
1
x
2
u
(
x
)
0 1 2 3 4 5 6 7 8 9 10
2
1
0
1
2
3
4
x
1
,
x
2
0 1 2 3 4 5 6 7 8 9 10
1
0.5
0
0.5
1
u
* t
|
t
time [s]
PSfrag replacements
x
1
x
2
u
(x)
Example: Double Integrator (II)
Quadratic cost
J(x, u) =
10
k=0
x
t+k|t
2
2
+u
2
t+k|t
5 4 3 2 1 0 1 2 3 4 5
5
4
3
2
1
0
1
2
3
4
5
Position
S
p
e
e
d
Control partition with 17 regions
PSfrag replacements
x
1
x
2
CR
1
CR
2
CR
3
A
1
= {1, 3}
A
2
= {2, 3}
A
3
= {1, 4}
5
0
5
5
0
5
1
0.5
0
0.5
1
Value of the control action over 17 regions
PSfrag replacements
x
1
x
2
u
(
x
)
0 1 2 3 4 5 6 7 8 9 10
2
1
0
1
2
3
4
x
1
,
x
2
0 1 2 3 4 5 6 7 8 9 10
1
0
1
u
* t
|
t
time [s]
PSfrag replacements
x
1
x
2
u
(x)
As a conclusion ...
Explicit solution to MPC for linear constrained
systems:
enables application of MPC to systems with
fast sampling rates
suitable for embedded applications
better insight into MPC properties
(performance, stability, feasibility)
Caveat: The complexity of the explicit solution
(the number of regions) typically grows with
the dimension of the state space may easily
outgrow any practical application
Extensions
time optimal control
complexity reduction using suboptimal
solutions
innite horizon solution
robust min-max controller
This (and much more) can be found in ...
The One and Only ...
MULTI-PARAMETRIC
TOOLBOX
http://control.ee.ethz.ch/~mpt
References
[1] A. Bemporad, M. Morari, V. Dua, and E.N. Pistikopoulos.
The explicit linear quadratic regulator for constrained sys-
tems. Automatica, 38(1):320, January 2002.
[2] F. Borrelli. Constrained Optimal Control Of Linear And Hy-
brid Systems, volume 290 of Lecture Notes in Control and
Information Sciences. Springer, 2003.
[3] M. Kvasnica, P. Grieder, M. Baotic, and M. Morari. Multi
Parametric Toolbox (MPT). In Hybrid Systems: Compu-
tation and Control, Lecture Notes in Computer Science.
Springer Verlag, 2003. http://control.ee.ethz.ch/~mpt.
[4] R.D.C. Monteiro and I. Adler. A geometric view of paramet-
ric linear programming. Algoritmica, 8(2):161176, 1992.
[5] P. Tndel, T.A. Johansen, and A. Bemporad. An algo-
rithm for multiparametric quadratic programming and ex-
plicit mpc solutions. Automatica, 39(3):489497, 2003.