Dynamic Programming & the Hamilton-Jacobi-Bellman Equation
How Bellman's principle of optimality turns a control problem into a value-function PDE, how feedback follows from its minimizer, when verification is sufficient, why switching surfaces make the value nonsmooth, and how HJB connects to PMP.
Dynamic programming asks a stronger question than “what is the optimal trajectory from this initial state?” It asks for the optimal remaining cost from every state and time. The resulting value function directly generates feedback, but it must satisfy a nonlinear partial differential equation: the Hamilton–Jacobi–Bellman (HJB) equation.
Value function and principle of optimality #
For
with cost
define
For a short interval , Bellman's principle of optimality says
Whatever control is optimal now must leave a state from which the remaining tail is itself optimal. Otherwise replacing that tail would improve the whole trajectory.
Infinitesimal derivation #
For continuous over a short step and differentiable ,
and
Substitute into Bellman's identity, cancel , divide by , and let :
Thus
The terminal cost is the boundary condition propagated backward through the PDE.
Feedback from the minimizer #
Once is known, the optimal feedback is
This is a state-feedback law defined over the region where is valid. In contrast, a PMP shooting solution supplies one state-costate trajectory for one boundary condition unless additional synthesis turns those extremals into a switching surface.
Verification: when HJB is sufficient #
Suppose a continuously differentiable candidate satisfies
for every admissible , with . Along any admissible trajectory,
Integrating gives
If a feedback attains equality in the HJB minimization along its trajectory, then
for every admissible . Therefore and is globally optimal on the verified domain. This is stronger than merely satisfying PMP.
Free-final-time target problems #
For an autonomous problem that terminates upon reaching a target set , the stationary value satisfies
For minimum time, . The boundary data belong on the target, not at an arbitrary final clock time.
Worked minimum-time integrator #
Let
and stop at with minimum time. Geometrically, . Away from the origin,
The stationary HJB equation is
Its minimizer is
which reaches the origin in seconds. At , is not differentiable. The controller switches there, so the nonsmoothness is structural rather than a defect in the answer.
Viscosity solutions and switching surfaces #
Classical differentiability is often lost where different optimal trajectories have equal cost, at target boundaries, and across switching surfaces. Demanding a classical solution can therefore reject the true value function.
A viscosity solution replaces pointwise derivatives with comparisons against smooth test functions touching from above or below. It preserves three properties needed by control:
- nonsmooth value functions such as are admissible;
- appropriate boundary and growth conditions can restore uniqueness;
- monotone, stable, consistent numerical schemes can converge to the correct generalized solution.
The word “viscosity” is historical; no physical fluid term is added to the original control problem. A small artificial diffusion can be a numerical regularization, but its limit and boundary effects must be checked.
Connection to PMP #
With the maximum-convention Hamiltonian
set
Then HJB's minimization of is PMP's maximization of . Differentiating along a smooth optimal trajectory yields
Thus PMP trajectories are characteristics of HJB where the value is smooth. When has a corner, multiple costates or generalized gradients may correspond to the same state.
Why HJB is difficult #
If each of state dimensions is discretized with nodes, a full grid has points. This exponential growth is the curse of dimensionality. HJB remains practical for low-dimensional synthesis, structured approximations, decomposition, or special analytic forms such as LQR. For large systems, direct trajectory optimization, model predictive control, approximate dynamic programming, or learned value approximations may be needed—but each replaces exact global PDE solution with a new approximation whose residuals and constraint behavior must be verified.
Diagnostic checklist #
- Is a cost-to-go from the stated , with the correct terminal or target boundary?
- Does the PDE use minimization or maximization consistently with the value definition?
- Does the control actually attain the pointwise extremum over the declared set ?
- Are state constraints represented as boundary/state-constraint conditions rather than merely ignored?
- Is a claimed classical solution differentiable where the derivation uses its gradient?
- Does the selected feedback keep the state inside the domain where was solved?