3 4 Pontryagin
3 4 Pontryagin
3 4 Pontryagin
Moritz Diehl
Overview
controls u(t)
p p
-
0 t T
Z T
minimize L(x(t), u(t)) dt + E (x(T ))
x(·),u(·) 0
subject to
x(0) − x0 = 0, (fixed initial value)
ẋ(t) − f (x(t), u(t)) = 0, t ∈ [0, T ]. (ODE model)
Hamilton-Jacobi-Bellman equation
Recall:
I Hamilton-Jacobi-Bellman Equation:
− ∂J
∂t (x, t) = minu H(x, ∇J(x, t), u)
I with Hamiltonian function
H(x, λ, u) := L(x, u) + λT f (x, u)
I and terminal condition J(x, T ) = E (x).
Pontryagin’s Maximum Principle
∂∇J T ∂H ∂H
− = + ∇2x J(x, t), u ∗ )
∂t ∂x ∂λ
|{z}
=f (x,u ∗ )T
or equivalently
∂∇J ∂
+∇2x J(x, t), u ∗ )f (x, u ∗ ) = ∇x J(x, t) = −∇x H(x, λ, u ∗ )
∂t ∂t
| {z }
=λ̇(t)
Terminal Condition
and
λ(T ) = ∇x E (x(T ))
Thus, calculus of variations leads to the same adjoint differential
equations as differentiation of HJB!
Overview
I In simplest case,
is defined by
∂H
(x(t), λ(t), u ∗ (t)) = 0
∂u
I In presence of path constraints, expression for u ∗ (t) changes
whenever active constraints change. This leads to state
dependent switches.
I If minimum of Hamiltonian locally not unique, “singular arcs”
occur. Treatment needs higher order derivatives of H.
Nice Case: Example
1
H(x, λ, u) = (x T Qx + u T Ru) + λT (Ax + Bu).
2
and
∂H
= u T R + λT B.
∂u
∂H
Thus, ∂u = 0 implies that
u ∗ = −R −1 B T λ
Singular Arcs
1
H(x, λ, u) = x T Qx + λT (Ax + Bu).
2
and
∂H
= λT B
∂u
This is not invertible w.r.t. to u ∗ !
Singular Arc: Example (contd.)
Note that
∂
H(x, λ, u) = f (x, u)
∂λ
Thus, ∂H
d x ∂λ
=
dt λ − ∂H
∂x
The BVP
0 = r (y (0), y (T )), (boundary conditions)
ẏ (t) = f˜(y (t)) t ∈ [0, T ], (ODE model)
r y (T ; y0 )
y0 r trajectory y (t; y0 )
p -
r (y0 , y (T ; y0 ) = 0
| {z }
=F (y0 )
F (y0 ) = 0
which iterates
∂F k
y0k+1 = y0k − (y )F (y0k )
∂y0 0
∂F k
Attention: to evaluate ∂y0 (y0 ) we have to compute ODE
sensitivities.
Collocation (Sketch)
N−1
X
minimize li (si , qi ) + E (sN )
s,q
i=0
subject to
s0 − x 0 = 0, (initial value)
si+1 − fi (si , qi ) = 0, i = 0, . . . , N − 1, (discrete system)
hi (si , qi ) ≥ 0, i = 0, . . . , N, (path constraints)
r (sN ) ≥ 0. (terminal constraints)
Procedure:
I Introduce multiplier vectors λ0 , . . . , λN for all dynamic state
constraints.
I Formulate Lagrangian
I Compute
∇si L and ∇qi L,
which must be zero for optimal solution.
Discrete Optimality Conditions 2
Obtain
1. ∇si L = −λi + ∇si li (si , qi ) + ∇si fi (si , qi )λi+1 = 0
(i = 0, . . . , N − 1)
2. ∇sN L = −λN + ∇sN E (sN )
3. ∇qi L = ∇qi li (si , qi )+∇qi fi (si , qi )λi+1 = 0 (i = 0, . . . , N −1)
4. ∇λ0 L = s0 − x0
5. ∇λi+1 L = si+1 − fi (si , qi ) = 0 (i = 0, . . . , N − 1)
These conditions can be simplified by introducing the discrete time
Hamiltonian:
as follows. . .
Discrete Pontryagin Principle