Radau and Lobatto Interpolation¶
Why the node family matters¶
Pockit represents each state and control with piecewise interpolation polynomials. The mesh determines where one polynomial segment ends and the next begins; the node family determines how adjacent segments meet.
| Property | Radau | Lobatto |
|---|---|---|
| Value at a shared mesh boundary | May differ on the two sides | Shared by adjacent intervals |
| Reconstructed function | Can be discontinuous at mesh boundaries | Continuous across the phase |
| Typical use | Bang-bang or event-aligned control; smooth problems also work | Smooth states and controls |
| Nodes within an interval | One endpoint convention is asymmetric | Includes both endpoints and is symmetric |
Radau is the direct choice when a true jump must be represented explicitly. The jump must lie at, or very close to, a mesh boundary. Lobatto can approximate a rapid but continuous transition, but it cannot represent two different values at the same shared boundary.
For smooth solutions, either family can be effective. The examples use the family that makes their intended continuity and dense validation easiest to interpret.
Mesh intervals and polynomial degree¶
Phase.set_discretization() accepts either uniform counts or explicit arrays.
For example:
# 20 uniform intervals, four points in each interval
phase.set_discretization(20, 4)
# Two nonuniform intervals with different point counts
phase.set_discretization([0.0, 0.3, 1.0], [4, 6])
The mesh values are normalized to the phase interval. Increasing the number of intervals adds places where local behavior can change; increasing points per interval raises the local polynomial degree.
Use these rules as starting heuristics, not convergence guarantees:
- Put a Radau mesh boundary at every known control jump or physical event.
- Use modest degree and more intervals near discontinuities or narrow boundary layers.
- Use fewer intervals or higher degree for globally smooth solutions.
- Avoid interval lengths that differ by many orders of magnitude unless the model is scaled and the need is demonstrated.
- Very high polynomial degree can make interpolation and the nonlinear program ill-conditioned. Degrees above roughly 20--30 deserve an explicit convergence study.
- Compare at least two discretizations and reconstruct the solution densely; nodal feasibility alone does not establish continuous-time feasibility.
Discontinuous controls¶
Marking a phase constraint as bang-bang tells Pockit's discontinuity checker which bounded expression should approach one of its limits. It does not prove that the problem is bang-bang, and it does not apply to a true interior singular arc.
For an unknown switching time, start with a physically plausible mesh, solve, inspect the bounded control, and then update the mesh if the switch is not resolved. The error checking and mesh refinement guide documents the available checks and their limitations.
What to verify after solving¶
Evaluate reconstructed states, controls, dynamics residuals, path constraints, and event conditions at a dense set of physical times. For a discontinuity, evaluate the left and right limits separately rather than interpolating across the jump. A solution is credible when the objective and physical diagnostics remain stable as the mesh changes.