Skip to content

Geometry overview ​

Optimal control theory relies on tools from differential geometry: to analyse Hamiltonian systems, compute singular controls, or study controllability. This section presents the operators that OptimalControl provides for this: the Hamiltonian lift, Lie derivatives, Lie brackets, Poisson brackets and partial time derivatives. They come from the package CTLie, and using OptimalControl makes them available.

julia
using OptimalControl

What this is for ​

  • Computing a singular control: on an arc where the switching function vanishes, its successive time derivatives are Poisson brackets (, , , …), and they give the control (see Poisson bracket).

  • Checking controllability, with the Lie brackets of the vector fields of the system.

  • Building a Hamiltonian from a vector field, the lift, to integrate its flow (see From Hamiltonians).

Summary ​

OperationNotationJuliaPage
Hamiltonian lift Lift(X)Lift
Lie derivative  ad(X, f)Lie derivative and Lie bracket
Lie bracket    ad(X, Y) or @Lie [X, Y]Lie derivative and Lie bracket
Poisson bracket    Poisson(H, G) or @Lie {H, G}Poisson bracket
Partial time derivative∂ₜ(f)Lie derivative and Lie bracket

ad(X, f) computes a Lie derivative when f returns a scalar, and a Lie bracket when it returns a vector. The macro @Lie writes the brackets as on paper.

Two kinds of objects ​

Vector fields live on the state space,   , and Hamiltonians on the cotangent space,   . ad acts on vector fields, Poisson on Hamiltonians, and the lift takes a vector field to a Hamiltonian.

Each can be a plain Julia function or a typed object, VectorField(f) or Hamiltonian(h). On plain functions, the default is a function of the state only (x or (x, p)): the keywords is_autonomous=false (an argument t first) and is_variable=true (an argument v last) describe the other cases. A typed object carries this information itself, and the operations return typed objects, which can be nested. Two operands must have the same dependence on time and on the variable.

The bridge identity ​

The lift turns a Lie bracket into a Poisson bracket:

Indeed,   and  , so    . For   and   , the bracket is    , so at  ,  , and at   both sides equal :

julia
X(x) = [x[1]^2, x[2]^2]
Y(x) = [x[2], -x[1]]

x, p = [1.0, 2.0], [3.0, 4.0]
Poisson(Lift(X), Lift(Y))(x, p), Lift(ad(X, Y))(x, p)
(12.0, 12.0)

Automatic differentiation ​

ad, Poisson, ∂ₜ and @Lie compute their derivatives by automatic differentiation; Lift needs none. AD backend shows how to choose the backend.

See also ​