Contents · Optimal Control
Part 0 · LQR
Part 1 · Dynamic Programming
Part 2 · Trajectory Optimization
Part 3 · MPC
Part 4 · Continuous Optimal Control
- Pontryagin and Hamilton-Jacobi-Bellman
Part 4 · Continuous Optimal Control
Pontryagin and Hamilton-Jacobi-Bellman
Dynamic programming in discrete time gives the Bellman equation. Push the time step to zero and the same optimality splits into two continuous-time views: a pointwise condition on the control (Pontryagin), and a partial differential equation for the value function (Hamilton-Jacobi-Bellman). Both start from one object, the Hamiltonian, and both feed the sampled, model-free machinery of reinforcement learning.
The Hamiltonian and Pontryagin's principle
Take a system with running cost , and minimize over controls . Introduce a costate (or adjoint) , the continuous analogue of a Lagrange multiplier on the dynamics, and form the Hamiltonian
Pontryagin's Maximum Principle (here a minimum principle, since we minimize cost) states that along an optimal trajectory the control minimizes pointwise, and the costate runs backward under Hamilton's equations:1
When the dynamics are control-affine, , and does not depend on , the Hamiltonian is linear in :
Minimizing a linear function over a box pins each control to a vertex, . The control is bang-bang: it sits at its bounds and jumps when the switching function changes sign.
The Hamilton-Jacobi-Bellman equation
The value function is the optimal cost-to-go from . The discrete Bellman recursion over a step reads
Expand , cancel , and let :
That is the (stationary) HJB equation, the continuous limit of the Bellman equation.2 The bracket is exactly the Hamiltonian with : the Pontryagin costate is the gradient of the value function along the optimal path, . HJB is the field (every state), PMP is one characteristic curve through it.
Worked example: the minimum-time double integrator
Drive with to rest at the origin in minimum time. Here (each second costs one), so
The costate equations are and , so is constant and is affine in time. Minimizing over gives , and an affine changes sign at most once: bang-bang with a single switch.
Under constant , eliminating from gives parabolas . The two arcs that actually reach the origin form the switching curve
With the switching function , the optimal feedback law is : above the curve () use , below it () use , and ride the curve into the origin.
Take the start . Then , so and the state follows . It meets the lower terminal arc where
Switch to and coast up the curve to . Each phase changes by one unit at rate , so
phase plane (drag the start state)
- start (x, v)
- (1.00, 0.00)
- region
- above the curve, u = -1
- control
- u = -1, then u = +1
- switch at
- (0.50, -1.00)
- phase 1 time
- 1.00
- phase 2 time
- 1.00
- total time T*
- 2.00
Push at full authority against the curve, ride it in: one switch, minimum time. This is the Pontryagin bang-bang solution.
From optimal control to reinforcement learning
HJB is model-based dynamic programming in continuous time: it needs and and returns the value field . Reinforcement learning is what remains when the model is unknown. Sampling transitions in place of the expansion above turns HJB into a temporal-difference update, and the learned (or ) is the critic that a policy improves against.2 The Pontryagin side survives too: the costate is the pathwise gradient that adjoint methods and differentiable controllers backpropagate, and the bang-bang structure warns that optimal continuous-control policies can be genuinely discontinuous, not the smooth outputs a naive function approximator prefers.
Footnotes
-
Liberzon, Calculus of Variations and Optimal Control Theory (2012). ↩
-
Bertsekas, Dynamic Programming and Optimal Control. ↩ ↩2