# CTProblems.jl

The `CTProblems.jl`

package is part of the control-toolbox ecosystem.

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
```

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)`

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`

```
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
```

And you can plot the solution.

`plot(prob.solution, size=(700, 500))`