CTProblems.jl

The CTProblems.jl package is part of the control-toolbox ecosystem.

Install

To install a package from the control-toolbox ecosystem, please visit the installation page.

This package provides a list of optimal control problems. Each problem is composed of a short title, a model and the solution. You can get access to any problem by a simple Description, that is a tuple of (Julia) symbols.

For instance, to get the energy minimisation exponential problem, simply

using CTProblems
prob = Problem(:exponential, :energy)
title           = simple exponential - energy min
model    (Type) = OptimalControlModel{Autonomous, Fixed}
solution (Type) = OptimalControlSolution
Note

In the example above, we have given a partial description to the function Problem. The complete description of this problem is

(:exponential, :energy, :x_dim_1, :u_dim_1, :lagrange)
Warning

If you give a partial description, then, if several complete descriptions contains the partial one, then, only the problem with the highest priority is returned. The higher in the list, the higher is the priority. See the list of descriptions to check the priorities.

Once you have selected a problem, you can get access to its title:

prob.title
"simple exponential - energy min"

Its 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
    ẋ(t) == -(x(t)) + u(t)
    ∫(0.5 * u(t) ^ 2) → min

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

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

    subject to

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

        ϕ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      │
╰────────┴────────┴──────────┴──────────┴───────────┴────────────┴─────────────╯

And you can plot the solution.

using Plots
plot(prob.solution, size=(700, 500))