Double integrator: consumption minimisation
The consumption minimisation double integrator problem consists in minimising
\[ \int_{0}^{1} |u(t)| \, \mathrm{d}t\]
subject to the constraints
\[ \dot x_1(t) = x_2(t), \quad \dot x_2(t) = u(t), \quad u(t) \in [-5,5]\]
and the limit conditions
\[ x(0) = (-1,0), \quad x(1) = (0,0).\]
You can access the problem in the CTProblems package:
using CTProblems
prob = Problem(:integrator, :consumption, :x_dim_2, :u_dim_1, :lagrange, :u_cons, :non_diff_wrt_u)
title = Double integrator consumption - mininimise ∫ |u| under the constraint |u| ≤ γ
model (Type) = OptimalControlModel{Autonomous, Fixed}
solution (Type) = OptimalControlSolution
Then, the model is given by
prob.model
The (autonomous) optimal control problem is given by:
t ∈ [t0, tf], time
x ∈ R², state
u ∈ R, control
x(t0) == x0, initial_con
x(tf) == xf, final_con
-γ ≤ u(t) ≤ γ, u_con
ẋ(t) == A * x(t) + B * u(t)
∫abs(u(t)) → min
The (autonomous) optimal control problem is of the form:
minimize J(x, u) = g(x(0), x(1))
subject to
ẋ(t) = f(x(t), u(t)), t in [0, 1] a.e.,
ηl ≤ η(x(t)) ≤ ηu,
ϕl ≤ ϕ(x(0), x(1)) ≤ ϕu,
where x(t) ∈ R² and u(t) ∈ R.
Declarations (* required):
╭────────┬────────┬──────────┬──────────┬───────────┬────────────┬─────────────╮
│ times* │ state* │ control* │ variable │ dynamics* │ objective* │ constraints │
├────────┼────────┼──────────┼──────────┼───────────┼────────────┼─────────────┤
│ V │ V │ V │ X │ V │ V │ V │
╰────────┴────────┴──────────┴──────────┴───────────┴────────────┴─────────────╯
You can plot the solution.
using Plots
plot(prob.solution)