Formulation
This page fixes the mathematical setting and the notation used throughout the documentation. The @def syntax and the functional API both transcribe it into code.
The problem
An optimal control problem (OCP) with fixed initial and final times consists in minimising the cost functional, written in Bolza form,
where the state
and to other constraints such as
The first two lines are box constraints,
If → max as well.
When
Free times and extra variables
The initial time
More generally, a vector
with, in addition, box constraints on
The control-free case
Nothing above requires a control: taking
Notation and conventions
The pages on the indirect method (Flows, Geometry and the examples) use the following conventions. They refer to this section rather than redefine them.
Dimensions.
Pseudo-Hamiltonian. With the costate
The normal case is PseudoHamiltonian.
Maximum principle. Along an optimal trajectory, the control maximises
a Hamiltonian in the code. Its Hamiltonian vector field
State constraints. A state constraint is a path constraint that does not depend on the control. It is written in the normalised form
Minimal time. A free final time to minimise is written as a Mayer cost,
Writing the same cost in Lagrange form,
Variable costate. When the variable
for a Mayer term
See also
Abstract syntax (
@def) — write this formulation directly as Julia code.Functional API — build the same model without the macro.
Control-free problems — the
case.Flows — build the Hamiltonian flows of the indirect method.