Simple integrator: lqr minimisation

The lqr minimisation simple integrator problem consists in minimising

\[ t_f + \frac{1}{2}\int_{0}^{t_f} (x^2(t) + u^2(t)) \, \mathrm{d}t\]

subject to the constraints

\[ \dot x(t) = u(t),\]

and the limit conditions

\[ x(0) = 0, \quad x(t_f) = x_f, \text{ free } t_f > 0.\]

You can access the problem in the CTProblems package:

using CTProblems
prob = Problem(:integrator, :lqr, :free_final_time, :x_dim_1, :u_dim_1, :bolza)

Then, the model is given by

prob.model

The (autonomous) optimal control problem is given by:

    tf ∈ R, variable
    t ∈ [t0, tf], time
    x ∈ R, state
    u ∈ R, control
    x(t0) == x0, initial_con
    x(tf) == xf, final_con
    ẋ(t) == u(t)
    tf + ∫(0.5 * (u(t) ^ 2 + x(t) ^ 2)) → min

The (autonomous) optimal control problem is of the form:

    minimize  J(x, u, tf) = g(x(0), x(tf), tf) + ∫ f⁰(x(t), u(t), tf) dt, over [0, tf]

    subject to

        ẋ(t) = f(x(t), u(t), tf), t in [0, tf] a.e.,

        ϕl ≤ ϕ(x(0), x(tf), tf) ≤ ϕu, 

    where x(t) ∈ R, u(t) ∈ R and tf ∈ R.

Declarations (* required):
╭────────┬────────┬──────────┬──────────┬───────────┬────────────┬─────────────╮
│ times* │ state* │ control* │ variable │ dynamics* │ objective* │ constraints │
├────────┼────────┼──────────┼──────────┼───────────┼────────────┼─────────────┤
│   V    │   V    │    V     │    V     │     V     │     V      │      V      │
╰────────┴────────┴──────────┴──────────┴───────────┴────────────┴─────────────╯

You can plot the solution.

using Plots
plot(prob.solution)