Cookie Consent by Free Privacy Policy Generator Appendix A3 — Calculus of Variations and the Pontryagin Maximum Principle | Igor Moiseev
Lab › Geometry of Seeing › Appendix A3

Appendix A3 — Calculus of Variations and the Pontryagin Maximum Principle

From Euler–Lagrange to the PMP, then Lie–Poisson reduction on $\mathfrak{se}(2)^{\ast}$. Why the equations $\dot h_1 = h_2 h_3$, $\dot h_2 = -h_1 h_3$, $\dot h_3 = -h_1 h_2$ that Part 2 §1 used as a starting point are exactly what you get when you do the optimal-control problem carefully on a Lie group.

By Igor Moiseev · 3 May 2026 · arXiv:0807.4731 · with Yu. L. Sachkov
Geometry of Seeing
  1. The Visual Cortex as a Contact Manifold
  2. Euler's Elastica and Jacobi Elliptic Functions
  3. Maxwell Strata: When Optimal Paths Fork
  4. The Open Problem: Exact Cut Time on SE(2)
Appendices — Theory Background
  1. A1. Lie Groups, Lie Algebras, and the Exponential Map of SE(2)
  2. A2. Distributions, Frobenius, and Contact Geometry
  3. A3. Calculus of Variations and the Pontryagin Maximum Principle ← you are here
  4. A4. Jacobi Elliptic Functions, Elliptic Integrals, and the AGM
  5. A5. The Sub-Riemannian Exponential Map of SE(2)
What this appendix is for
Part 2 §1, paraphrased: the Pontryagin Maximum Principle introduces a covector $\lambda$ in the cotangent bundle, and — after several steps taken there on faith — the Hamiltonian equations on $\mathfrak{se}(2)^{\ast}$ read $\dot h_1 = h_2 h_3$, $\dot h_2 = -h_1 h_3$, $\dot h_3 = -h_1 h_2$. This appendix supplies the missing derivation. It assumes Appendix A1 (Lie groups + $\mathfrak{se}(2)$) and A2 (distributions + Chow's theorem). The phase portraits and pendulum-period plots borrow directly from the physical-pendulum example in the elliptic project: the same Jacobi-elliptic period $4K(k^2)$ controls both that page's nonlinear pendulum and our SE(2) elastica problem.

The Euler–Lagrange equations in one paragraph

A Lagrangian $L(q, \dot q, t)$ on configuration space defines the action

\[S[\gamma] \;:=\; \int_{t_0}^{t_1} L(q(t), \dot q(t), t)\,dt.\]

Stationary paths under fixed-endpoint variations $\delta q(t_0) = \delta q(t_1) = 0$ satisfy

\[\boxed{\;\frac{d}{dt}\frac{\partial L}{\partial \dot q^i} \;=\; \frac{\partial L}{\partial q^i}\;}\qquad (i = 1, \ldots, n).\]

Derivation in three lines:

\[\delta S = \int_{t_0}^{t_1} \Bigl(\frac{\partial L}{\partial q^i}\delta q^i + \frac{\partial L}{\partial \dot q^i}\delta \dot q^i\Bigr) dt = \int_{t_0}^{t_1}\Bigl(\frac{\partial L}{\partial q^i} - \frac{d}{dt}\frac{\partial L}{\partial \dot q^i}\Bigr)\delta q^i \,dt + \Bigl[\frac{\partial L}{\partial \dot q^i}\delta q^i\Bigr]_{t_0}^{t_1}.\]

The boundary term vanishes; for $\delta S = 0$ to hold for all $\delta q$, the integrand has to vanish, giving the Euler–Lagrange (E-L) equations.

Legendre transform → Hamiltonian

Define the conjugate momentum $p_i := \partial L / \partial \dot q^i$ and the Hamiltonian by Legendre transform

\[H(q, p, t) \;:=\; p_i \dot q^i - L(q, \dot q, t).\]

(Eliminating $\dot q$ in favour of $p$.) The E-L equations become Hamilton’s equations

\[\dot q^i \;=\; \frac{\partial H}{\partial p_i}, \qquad \dot p_i \;=\; -\frac{\partial H}{\partial q^i}.\]

A direct consequence: $H$ is conserved on solutions when it has no explicit $t$-dependence ($\dot H = \partial H / \partial t$ along solutions). This is what makes “energy is conserved” a theorem and not just a slogan.

Lagrangian $L = \tfrac12 \dot q^2$; straight line is the geodesic
Figure A3.1. The action $S[q] = \int_0^1 \tfrac12 \dot q^2 \,dt$ for a free particle going from $q = 0$ at $t = 0$ to $q = 1$ at $t = 1$. The straight-line solution $q(t) = t$ has $S = 1/2$ (the minimum). Perturb it by $\delta q(t) = \eta \sin(n \pi t)$ and the action becomes $S = \tfrac12 + \tfrac14 (\eta n \pi)^2$ — strictly larger for any $\eta \neq 0$. The right panel plots $S(\eta)$ as a parabola; the left panel shows the path being perturbed. Critical paths satisfy E-L, here $\ddot q = 0$, hence the straight line.

Optimal control on a manifold

We now generalise. The state is a point $g \in M$ on a smooth manifold; the control is $u(t) \in U \subseteq \mathbb R^k$; the dynamics are

\[\dot g \;=\; f(g, u),\]

and we minimise

\[J \;=\; \int_0^T L(g, u)\,dt, \qquad g(0), g(T) \text{ fixed}.\]

In our setting $M = \mathrm{SE}(2)$, $u = (u_1, u_2)$, $f(g, u) = u_1 X_1(g) + u_2 X_2(g)$, $L = \sqrt{u_1^2 + u_2^2}$, and $T$ is free (we minimise total length, so $T$ itself is the cost when $u_1^2 + u_2^2 = 1$).

The Pontryagin Maximum Principle

Pontryagin Maximum Principle (Pontryagin et al. 1962)
If $(g^{\ast}, u^{\ast})$ is an optimal pair, there exist a constant $\nu \in \{0, 1\}$ and a curve $\lambda^{\ast} : [0, T] \to T^{\ast}M$ with $\lambda^{\ast}(t) \in T^{\ast}_{g^{\ast}(t)} M$, not both zero, such that the Pontryagin Hamiltonian $$\mathcal H(g, \lambda, u, \nu) \;:=\; \langle \lambda, f(g, u)\rangle - \nu L(g, u)$$ is maximised over admissible $u$ at every $t$: $$\mathcal H(g^{\ast}(t), \lambda^{\ast}(t), u^{\ast}(t), \nu) \;=\; \max_{u \in U} \mathcal H(g^{\ast}(t), \lambda^{\ast}(t), u, \nu),$$ and $(g^{\ast}, \lambda^{\ast})$ obey the Hamilton equations of $\mathcal H$ in $T^{\ast}M$. Normal extremals: $\nu = 1$. Abnormal: $\nu = 0$. Because the terminal time $T$ is free here, the maximised Hamiltonian also vanishes along the extremal, $\mathcal H \equiv 0$ — this is what pins $\sqrt{h_1^2 + h_2^2} = \nu$ and justifies the unit level set used below. (For our contact distribution the abnormal case forces $h_1 \equiv h_2 \equiv 0$, i.e. constant curves, so all the geometry lives in the normal case.)

The key new object is the costate $\lambda \in T^{\ast}M$. Heuristically, it is the Lagrange multiplier enforcing the dynamic constraint $\dot g = f$. In a coordinate chart $\lambda = \lambda_i \,dq^i$ and Hamilton’s equations read $\dot q^i = \partial \mathcal H / \partial \lambda_i$, $\dot \lambda_i = -\partial \mathcal H / \partial q^i$.

Maximising over $u$ for the SR problem

The sub-Riemannian (SR) length functional has $L = \sqrt{u_1^2 + u_2^2}$. A standard trick: parametrise by arc length, so $u_1^2 + u_2^2 = 1$ throughout. The controls live on the unit circle, and the cost becomes simply $T$ (the total time = total arc length).

The Pontryagin Hamiltonian on $T^{\ast}\mathrm{SE}(2)$ with controls $u_1 X_1 + u_2 X_2$ is

\[\mathcal H = u_1 \langle \lambda, X_1\rangle + u_2 \langle \lambda, X_2\rangle - \nu.\]

Define $h_i := \langle \lambda, X_i\rangle$ (this is the contraction of the covector $\lambda$ with the left-invariant vector field $X_i$). Then $\mathcal H = u_1 h_1 + u_2 h_2 - \nu$ (the last term is constant in $u$).

Maximising $u_1 h_1 + u_2 h_2$ over $u_1^2 + u_2^2 \leq 1$:

\[\max_{u \in S^1} (u_1 h_1 + u_2 h_2) \;=\; \sqrt{h_1^2 + h_2^2},\]

attained at $u^{\ast} = (h_1, h_2) / \sqrt{h_1^2 + h_2^2}$.

Substituting back, the maximised Hamiltonian is

\[\mathcal H^{\ast}(g, \lambda) \;=\; \sqrt{h_1^2 + h_2^2} - \nu \;=\; \sqrt{h_1^2 + h_2^2} - 1.\]

Standard rescaling: the trajectories of the maximised SR Hamiltonian are the same as those of $\tfrac12(h_1^2 + h_2^2)$ (squaring is allowed because the Hamiltonian is conserved, so $h_1^2 + h_2^2 = $ const along solutions). We use the squared form:

\[\boxed{\;\mathcal H_n \;=\; \tfrac12 (h_1^2 + h_2^2).\;}\]

This is the “normal Hamiltonian” of Part 2 §1.

Lie–Poisson reduction on $\mathfrak{se}(2)^{\ast}$

Hamilton’s equations for $\mathcal H_n$ on $T^{\ast}\mathrm{SE}(2)$ are coupled equations in $(g, \lambda)$. But the left-invariant vector fields make $T^{\ast}\mathrm{SE}(2)$ trivialise:

\[T^{\ast}\mathrm{SE}(2) \;\xrightarrow{\sim}\; \mathrm{SE}(2) \times \mathfrak{se}(2)^{\ast}, \qquad \lambda \mapsto (g, \mu)\]

where $\mu = (h_1, h_2, h_3) := (\langle\lambda, X_1\rangle, \langle\lambda, X_2\rangle, \langle\lambda, X_3\rangle)$ in the basis dual to the left-invariant frame ${X_1, X_2, X_3}$. In this trivialisation the Hamiltonian flow on $T^{\ast}G$ for a left-invariant Hamiltonian (depending only on $\mu$) decouples:

For matrix Lie groups the Lie–Poisson equation in the $h_i$ coordinates reads

\[\dot h_i \;=\; -\sum_{j, k} c^k_{ij}\,h_k\,\frac{\partial H}{\partial h_j},\]

where \(c^k_{ij}\) are the structure constants \([X_i, X_j] = c^k_{ij} X_k\). For $\mathfrak{se}(2)$ in the body-frame basis ${X_1, X_2, X_3}$ used in Part 1 (forward / rotation / sideways), the brackets are $[X_1, X_2] = -X_3$, $[X_2, X_3] = -X_1$, $[X_1, X_3] = 0$, giving the non-zero coordinate brackets ${h_1, h_2} = h_3$ and ${h_2, h_3} = h_1$. With $H_n = \tfrac12(h_1^2 + h_2^2)$ this yields

\[\dot h_1 \;=\; h_2\,h_3, \qquad \dot h_2 \;=\; -h_1\,h_3, \qquad \dot h_3 \;=\; -h_1\,h_2.\]

These are the equations Part 2 §1 uses. The conserved quantities are the Hamiltonian $\mathcal H_n = \tfrac12(h_1^2 + h_2^2)$ and the Casimir of $\mathfrak{se}(2)^{*}$,

\[C \;=\; h_1^{2} + h_3^{2}\]

— the squared translation momentum, which Poisson-commutes with every coordinate function and so is preserved by any Hamiltonian flow on the dual algebra (not just our particular $\mathcal H_n$). $h_3$ alone is not conserved: by the third equation above it drifts wherever $h_1 h_2 \neq 0$ — generically along the geodesic ($\dot h_3$ pauses exactly where $h_1 = 0$, i.e. at the cusps, or where $h_2 = 0$).

Reduction to the pendulum

The two integrals $\mathcal H_n = \tfrac12$ (unit-speed normalisation) and $C = h_1^2 + h_3^2$ cut the 3D dynamics down to a 1D motion. Set $h_1 = \sin\alpha$, $h_2 = \cos\alpha$, so that $\mathcal H_n = 1/2$ is automatic. From $\dot h_1 = h_2 h_3$ we read off $\dot\alpha = h_3$, and the Casimir gives $h_3^2 = C - \sin^2\alpha$. With $\varphi = 2\alpha$:

\[\dot\varphi^{2} \;=\; 4 h_3^{2} \;=\; (4C - 2) \,+\, 2\cos\varphi.\]

Differentiating once in $t$:

\[\boxed{\;\ddot\varphi + \sin\varphi \;=\; 0, \qquad E \;=\; \tfrac12\dot\varphi^{2} - \cos\varphi \;=\; 2C - 1.\;}\]

That is the pendulum equation — derived, not postulated, from the Lie–Poisson flow on $\mathfrak{se}(2)^{*}$. The pendulum angle $\varphi = 2\alpha$ is twice the phase of $(h_1, h_2)$ on the unit circle; the pendulum energy $E$ is fixed by the Casimir on the coadjoint orbit.

The reconstruction equation ties the planar curve’s heading $\theta$ back to the costate. With $u_1^{\ast} = h_1 = \sin(\varphi/2)$ and $u_2^{\ast} = h_2 = \cos(\varphi/2)$, the SE(2) ODE $(\dot x, \dot y, \dot\theta) = (u_1^{\ast}\cos\theta, u_1^{\ast}\sin\theta, u_2^{\ast})$ reparametrised by Euclidean arc length $s$ (with $ds = |u_1^{\ast}|\,dt$) gives the projected curve the curvature

\[\kappa_{\mathrm{SR}}(s) = \frac{u_2^{\ast}}{u_1^{\ast}} = \cot(\varphi/2).\]

This blows up wherever $u_1^{\ast} = 0$: the sub-Riemannian projections are allowed to have cusps — the reversal points of the parallel-parking trajectories of Appendix A2.

The smooth elastica that Part 2 plots — $\kappa = 2k\,\mathrm{cn}$, $2\,\mathrm{sech}$, $2\,\mathrm{dn}$ — are the Euler elastic problem: the sister problem in which the curve carries unit forward speed and the heading $\theta$ itself is the pendulum variable, so $\kappa = \dot\theta$ stays bounded. Both problems are driven by the same pendulum equation $\ddot\varphi + \sin\varphi = 0$ — that shared vertical subsystem is the real content of the reduction — but their projected curves differ, and it is the elastic representatives the figures draw. Appendix A4 §3 carries the elliptic substitution through; the elastica curvature ODE $\kappa’‘(s) + \tfrac12\kappa^3 - \mu\kappa = 0$ is the Duffing form equivalent to the pendulum.

$\ddot\varphi + \sin\varphi = 0$, energy $E = \tfrac12\dot\varphi^2 - \cos\varphi$
Figure A3.2. Phase portrait of the planar pendulum in coordinates $(\varphi, \dot\varphi)$ — same diagram that drives the elliptic project's physical-pendulum example. Three regimes correspond exactly to the three SE(2) elastica families of Part 2: libration ($-1 < E < 1$, blue closed orbits) — inflectional elastica; separatrix ($E = 1$, red curve) — borderline elastica; rotation ($E > 1$, green orbits) — non-inflectional elastica. The energy $E$ slider also controls the modulus $k = \sqrt{(E+1)/2}$ for libration; $k = 1$ at the separatrix; $k > 1$ in the rotation regime where the period becomes $2K(1/k^2)/k$. The period diverges at $E = 1$ (both sides) — this is the $K(k^2) \to \infty$ asymptotic of Appendix A4.

The reconstruction equation

Once $\mu(t) = (h_1(t), h_2(t), h_3)$ is known, the SE(2) trajectory itself is obtained from

\[\dot g(t) \;=\; g(t)\,\xi(t), \qquad \xi(t) := u_1^{\ast}(t) E_1 + u_2^{\ast}(t) E_3,\]

with $u^{\ast}(t) = (h_1(t), h_2(t)) / \sqrt c$ from the maximisation, where $c := h_1^2 + h_2^2 = 2\mathcal H_n$ is constant along the flow. In the $(x, y, \theta)$ chart this is exactly Part 1’s Frenet–Serret integration:

\[\dot x = u_1^{\ast} \cos\theta, \qquad \dot y = u_1^{\ast} \sin\theta, \qquad \dot \theta = u_2^{\ast}.\]

In the Euler elastic problem one instead fixes $u_1^{\ast} = 1$ (unit forward speed); then $s = t$, and $u_2^{\ast} = \dot\theta = \kappa$ is the curvature of the projected plane curve. Here the heading $\theta$ is itself the pendulum, so its curvature is the pendulum velocity — a Jacobi cn (libration), sech (separatrix), or dn (rotation), i.e. the $\kappa = 2k\,\mathrm{cn}(s\mid k^2)$ family of Part 2 §2.

Left: costate on cylinder. Right: reconstructed plane curve.
Figure A3.3. A schematic of the reconstruction step, drawn in the constant-$h_3$ approximation. Left: a curve on the cylinder $h_1^2 + h_2^2 = c$ — in the left-invariant frame used here this is the energy cylinder $2\mathcal H_n = c$, not the coadjoint/Casimir cylinder of Appendix A1's Figure A1.3 — with $(h_1, h_2)$ circling at rate $-h_3$. Right: the plane curve obtained by feeding that costate into the reconstruction equation $\dot g = g\cdot\xi(t)$, drawn at unit speed ($c = 1$: the shape depends only on the dimensionless ratio $h_3/\sqrt c$, so varying $c$ would rescale, not reshape). Vary $h_3$ and the curve interpolates between near-circular (small $h_3$) and the elastica regime. (In the full flow $h_3$ varies too, by $\dot h_3 = -h_1 h_2$; freezing it keeps this picture readable.)

Connection to the elliptic project

The phase portrait of Figure A3.2 is computationally identical to the one in elliptic project’s physical-pendulum example — both compute level sets of $E = \tfrac12\dot\varphi^2 - \cos\varphi$ and trace closed orbits with period $4K(k^2)$. The SE(2) elastica problem is, structurally, the same ordinary differential equation (ODE) as a nonlinear pendulum: this appendix’s job has been to make that equivalence inevitable, by deriving the pendulum equation from the PMP on $\mathrm{SE}(2)$ rather than postulating it.

Once you have the pendulum, the period-and-amplitude analysis is the business of Appendix A4 (Jacobi elliptic functions) and the closed-form geodesic endpoints are the business of Appendix A5 (the SR exponential map).

Code

# Verify the Lie–Poisson equations on se(2)* numerically.
# Conserved quantities:  H = ½(h1²+h2²)  and  Casimir C = h1²+h3².
# Note: h3 is NOT conserved — the third equation is dh3/dt = -h1·h2.
import numpy as np
from scipy.integrate import solve_ivp

def lie_poisson_se2(t, h):
    h1, h2, h3 = h
    return [h2*h3, -h1*h3, -h1*h2]

h0 = [0.6, 0.4, 0.7]
sol = solve_ivp(lie_poisson_se2, [0, 8], h0, rtol=1e-10, atol=1e-12,
                t_eval=np.linspace(0, 8, 400))

h1, h2, h3 = sol.y
H = 0.5 * (h1**2 + h2**2)          # Hamiltonian
C = h1**2 + h3**2                  # Casimir
print(f"max |H - H0| / H0 = {np.max(np.abs(H - H[0]))/H[0]:.2e}")  # ~ 1e-10
print(f"max |C - C0| / C0 = {np.max(np.abs(C - C[0]))/C[0]:.2e}")  # ~ 1e-10

# h3 itself drifts — confirm it is genuinely not conserved
print(f"h3 range = [{h3.min():.3f}, {h3.max():.3f}]   h3(0) = {h0[2]}")
# Reconstruct the SE(2) trajectory from the costate solution
# (same algorithm used by elliptic-core.js's integrateElastica routine)
def reconstruct_se2(h_t, t_arr):
    """Given h(t) sampled at t_arr, return (x, y, theta)."""
    c = h_t[0,0]**2 + h_t[1,0]**2
    sqrt_c = np.sqrt(c)
    u1 = h_t[0] / sqrt_c
    u2 = h_t[1] / sqrt_c
    x, y, th = 0.0, 0.0, 0.0
    out = [(0,0,0)]
    for i in range(len(t_arr) - 1):
        dt = t_arr[i+1] - t_arr[i]
        thmid = th + 0.5 * u2[i] * dt
        x  += u1[i] * np.cos(thmid) * dt
        y  += u1[i] * np.sin(thmid) * dt
        th += u2[i] * dt
        out.append((x, y, th))
    return np.array(out)

What we covered, and what comes next

The Pontryagin Maximum Principle takes an optimal-control problem and produces a Hamiltonian system on $T^{\ast}M$. For the SE(2) sub-Riemannian length problem, maximisation over $u_1, u_2$ on the unit circle gives the normal Hamiltonian $\mathcal H_n = \tfrac12(h_1^2 + h_2^2)$. Lie–Poisson reduction on $\mathfrak{se}(2)^{\ast}$ collapses the $T^{\ast}\mathrm{SE}(2)$ flow to the costate equations $\dot h_1 = h_2 h_3, \dot h_2 = -h_1 h_3, \dot h_3 = -h_1 h_2$ — exactly the equations Part 2 §1 wrote down. Writing $h_1 = \sin\alpha$, $h_2 = \cos\alpha$ on the unit Hamiltonian level and differentiating $\varphi = 2\alpha$ once more gives the nonlinear pendulum equation $\ddot\varphi + \sin\varphi = 0$.

Appendix A4 will solve the pendulum equation in closed form using Jacobi elliptic functions and the arithmetic–geometric mean (AGM), recovering the period $4K(k^2)$ and the explicit $\kappa(s) = 2k\,\mathrm{cn}(s\mid k^2)$ formula of Part 2.

References

  1. L. S. Pontryagin, V. G. Boltyanskii, R. V. Gamkrelidze, E. F. Mishchenko (1962). The Mathematical Theory of Optimal Processes. Wiley–Interscience. The original PMP source.
  2. A. A. Agrachev, Yu. L. Sachkov (2004). Control Theory from the Geometric Viewpoint. Springer. Chapter 12 derives the SR geodesic equations on Lie groups by exactly this route.
  3. J. E. Marsden, T. S. Ratiu (1999). Introduction to Mechanics and Symmetry. Springer. Chapters 13–14 for Lie–Poisson reduction.
  4. V. I. Arnold (1989). Mathematical Methods of Classical Mechanics. Springer GTM 60. Appendix 2 has Lie–Poisson dynamics.
  5. Yu. L. Sachkov (2010). "Conjugate and cut time in the sub-Riemannian problem on the group of motions of a plane." ESAIM: COCV 16: 1018–1039. Uses the costate ODE derived here.
  6. Elliptic project — Physical Pendulum. Phase-portrait diagram identical to Figure A3.2; same $K(k^2)$ period.