Collocation and Defect Constraints
A defect measures disagreement between discrete state variables and the state change predicted by the dynamics. Zero defect means local dynamic consistency under the chosen approximation.
Higher-order schemes use more information within each interval.
Euler forward¶
Euler forward is globally first order and typically needs a fine mesh.
Trapezoidal rule¶
It is globally second order and implicit. Implicitness is natural in transcription because the NLP solver determines states and defects together.
Hermite–Simpson¶
Define
Then
Hermite–Simpson offers high accuracy, local sparsity, and moderate implementation complexity.
Zero-order-hold and higher-order single-step defects¶
For linear time-invariant dynamics with piecewise-constant control on an interval, the defect can be made exact rather than approximate using the matrix exponential:
This zero-order-hold defect introduces no truncation error for the assumed control interpolation, at the cost of a matrix exponential per interval and the loss of exactness once the dynamics become nonlinear or plant-parameter-dependent. Runge–Kutta families such as the classical fourth-order method extend the single-step idea to nonlinear dynamics by combining several interior stage evaluations per interval, trading additional function evaluations for higher order than Euler forward or the trapezoidal rule.
Pseudospectral collocation and the differentiation matrix¶
Pseudospectral methods approximate the state on an interval with a single global Lagrange interpolating polynomial through collocation points and enforce the dynamics at those points using a differentiation matrix , where differentiating the interpolant and evaluating at the collocation points gives . Three families of collocation points are in common use, each built from roots of Legendre polynomials: Legendre–Gauss (LG) points (both endpoints excluded), Legendre–Gauss–Radau (LGR) points (one endpoint included), and Legendre–Gauss–Lobatto (LGL) points (both endpoints included).
The three schemes are not merely cosmetic variations. The LG and LGR differentiation matrices are rectangular and full rank, so the collocated dynamics can be rewritten equivalently in an integral form using a corresponding integration matrix — the differential and integral transcriptions agree exactly. The LGL differentiation matrix, in contrast, is square but singular.
This rank deficiency is not just a numerical curiosity: it propagates into the discrete costate (adjoint) system obtained from the Karush–Kuhn–Tucker conditions of the collocated NLP. Because the transformed adjoint systems for LG and LGR collocation inherit the full-rank differentiation matrix, they are themselves full rank and determine a unique discrete costate. The LGL transformed adjoint system inherits the singular differentiation matrix, so its costate equations possess a nontrivial null space; the recovered LGL costate approximation can oscillate around the true continuous costate even while the state and control trajectories converge normally. This defect is specific to LGL collocation — it does not occur with LG or LGR — and has been demonstrated by direct comparison against a known analytic costate on a benchmark problem.
They can converge very rapidly for smooth trajectories but need multiple intervals or adaptation near discontinuities, and production transcription software typically varies both the number of intervals and the polynomial degree per interval to reach a target accuracy (see the next section).
| Feature | Local collocation | Global/pseudospectral |
|---|---|---|
| Approximation | Low order per interval | High order over large intervals |
| Sparsity | Strong local bands | Denser within each polynomial interval |
| Smooth solutions | Algebraic mesh convergence | Potentially spectral convergence |
| Nonsmooth solutions | Local refinement | Multiple intervals or adaptation |
| Implementation | Relatively direct | Specialized matrices and quadrature |