Lift
Given a vector field
It is an algebraic construction: no derivative is computed.
using OptimalControl
using OrdinaryDiffEqTsit5From a plain function
X(x) = [x[2], -x[1]]
H = Lift(X)
x, p = [1.0, 2.0], [3.0, 4.0]
H(x, p) # 3 × 2 + 4 × (-1)2.0The lift of a plain function is a function, not a Hamiltonian:
H isa Function, H isa AbstractHamiltonian(true, false)From a typed vector field
The lift of a VectorField is a Hamiltonian, with the same dependence on time and on the variable as the vector field:
XV = VectorField(x -> [x[2], -x[1]])
HV = Lift(XV)
HV isa AbstractHamiltonian, HV(x, p)(true, 2.0)Time and variable
For a vector field is_autonomous=false, and the lift is called as
Ht = Lift((t, x) -> [t * x[2], -x[1]]; is_autonomous=false)
Ht(2.0, x, p)8.0For a vector field is_variable=true, and the lift is called as
Hv = Lift((x, v) -> [x[2] + v, -x[1]]; is_variable=true)
Hv(x, p, 1.0)5.0| You lift | You get | Called as |
|---|---|---|
a function X | a function (OptimalControl.LiftedHamiltonianFunction) | H(x, p), H(t, x, p), H(x, p, v) or H(t, x, p, v), from the keywords |
a VectorField | a Hamiltonian | the same, from the traits of the vector field |
The flow of a lift
The Hamiltonian flow of Hamiltonian is needed to build the flow (see From Hamiltonians), so lift a VectorField, or wrap the lift of a function in Hamiltonian:
f = Flow(Lift(VectorField(x -> -x)))
xf, pf = f(0, x, p, 1)([0.3678794412274374, 0.7357588824548748], [8.154845485865408, 10.873127314487212])The lift is also the bridge between the two brackets:
A Hamiltonian vector field cannot be lifted
A HamiltonianVectorField already lives on the cotangent space, so Lift rejects it. The message names ad instead of Lift (CTLie#41):
julia> Lift(HamiltonianVectorField((x, p) -> (p, -x)))
NotImplemented → top-level scope, REPL[1]:2
│
│ ad on AbstractHamiltonianVectorField is not implemented (signature is (x,p), not (x))
│
│ Context ad on AbstractVectorField
│ Hint Use ad on a plain VectorField
└─See also
Geometry overview: the summary of the operations.
Poisson bracket: the brackets of lifts.
From Hamiltonians: flows built from a Hamiltonian.