Description
Exercises for Lecture Course on Numerical Optimal Control (NOC)
Exercise 9: Pontryagin’s Minimum Principle
Prof. Dr. Moritz Diehl, Joel Andersson, Sebastien Gros, Andrea Zanelli, Dimitris Kouzoupis
Consider the following optimal control problem:
2)x1(t) − x2(t) + u(t), x1(0) = 0 (1)
s.t. x˙1(t) = (1 − x2(t)
x˙2(t) = x1(t), x2(0) = 1
−1 ≤ u(t) ≤ 1,
where T = 10 as before.
In this exercise, we will apply Pontryagin’s maximum principle to this problem and solve it with the indirect single shooting method.
1. (a) Introduce the costate λ(t) and write down the Hamiltonian H(x(t),λ(t),u(t)) of (1).
(2)
(3)
(c) Derive the costate equations, i.e. λ˙(t) = …
λ˙1 = −λ1 (1 − x22) − 2×1 − λ2 (4) λ˙2 = λ1 x1 2×2 − 2×2 + λ1
(d) Derive the terminal conditions for the costate equations.
λ1(T) = 0, λ2(T) = 0. (5)
(e) Augment the original equations with the costate equation to form a two-point boundaryvalue problem (TPBVP) with four differential equations.
x˙1 = (1 − x22)x1 − x2 + u, x1(0) = 0, x˙2 = x1, x2(0) = 1,
λ˙1 = −λ1 (1 − x22) − 2×1 − λ2, λ1(T) = 0, (6) λ˙2 = λ1 x1 2×2 − 2×2 + λ1, λ2(T) = 0
1
(f) Using the provided template, solve the TPBVP with indirect single shooting. Use [0,0] as your initial guess for the initial costate. To integrate the system, our best chance is to use a variable stepsize integrator for stiff systems, such as the CVODES integrator from the SUNDIALS suite, available in CasADi. Note that the system is only piecewise smooth, which could potentially cause problems in the integrator, but we will ignore this and hope for the best. The resulting nonlinear system of equations is also challenging to solve, and in CasADi, our best bet is to use IPOPT with a dummy objective function (“minimize 0, subject to g(x) = 0”).
2




Reviews
There are no reviews yet.