Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Scaling, Refinement, and Verification

Scaling and initialization

Use scaled variables and residuals,

z^i=zizirefsi,g^j=gjrj,\widehat{z}_i=\frac{z_i-z_i^{\mathrm{ref}}}{s_i}, \qquad \widehat{g}_j=\frac{g_j}{r_j},

so typical magnitudes are comparable. Dynamic defects need state-specific scales because position, velocity, temperature, and rotation have different units.

Useful initial guesses come from baseline simulation, simple boundary interpolation, known operating controls, simplified problems, and nearby parameter cases. Continuation gradually tightens constraints, increases disturbances, activates nonlinear physics, reduces regularization, or refines the mesh while warm-starting from the previous solution.

A practical automatic-scaling recipe applies an affine map to each variable so that it lies in a fixed reference interval (for example [1/2,1/2][-1/2,1/2]), then scales each constraint by approximately the reciprocal of its gradient norm sampled at a few candidate points, so that both the scaled variables and the scaled Jacobian entries are O(1)O(1) before the NLP solver ever sees them. Defect constraints inherit the scale factor of the state they enforce, so that dynamic consistency is checked in the same relative terms across states with very different physical units.

Mesh refinement

One mesh is not enough evidence.

A sequence of refined meshes and log-log convergence curves demonstrating expected first- and second-order accuracy.

Mesh refinement tests whether the reported design is stable under improved approximation.

Error indicators include model-versus-reconstruction derivative mismatch, low- versus high-order estimates, coefficient decay, constraint overshoot, independent-simulation error, and changes in objective and design.

Production pseudospectral codes automate hphp-refinement as an explicit decision rule rather than trial and error. One published strategy compares the ratio of maximum to mean curvature of the state solution within a mesh interval against a user-specified threshold: exceeding the threshold increases the polynomial degree in that interval, while staying below it subdivides the interval into more, lower-degree intervals. A related strategy instead exploits the (near-)exponential convergence of orthogonal collocation directly: it estimates the polynomial degree needed to reach the target accuracy within an interval, raises the degree toward a user-specified upper limit NmaxN_{\max} if that estimate is attainable, and otherwise subdivides. Software exposing this kind of combined interval-count/degree adaptation commonly labels the configuration hphp-(Nmin,Nmax)(N_{\min},N_{\max}), naming the allowed minimum and maximum polynomial degree per mesh interval. Either rule automates exactly the “add intervals near nonsmooth behavior, add degree in smooth regions” heuristic above, driven by a re-solve-and-re-estimate loop around the current mesh.

Monitor several convergence quantities:

EJ(r)=J(r)J(r1)max(1,J(r)),Ez(r)=zd(r)zd(r1)2max(1,zd(r)2),E_J^{(r)}=\frac{|J^{(r)}-J^{(r-1)}|}{\max(1,|J^{(r)}|)}, \qquad E_z^{(r)}=\frac{\|\mathbf{z}_d^{(r)}-\mathbf{z}_d^{(r-1)}\|_2}{\max(1,\|\mathbf{z}_d^{(r)}\|_2)},

along with maximum defect and path-constraint violation.

Independent simulation

Reconstruct the optimized control and simulate the original dynamics with a separate high-accuracy integrator. Compare trajectories, terminal values, objectives, and constraints. This reveals insufficient meshes, incorrect defects, inconsistent control interpolation, and hidden violations.

Inspect primal and dual infeasibility, stationarity, complementarity, step acceptance, regularization, and restoration warnings. A solver can terminate because it cannot progress—not because it found a credible optimum.

Activity 7.6: Minimum-Time Control with an Active State Constraint