Chapter 6: Costate Recovery and Nonlinear Programming Implementation
From KKT multipliers to continuous costates and solver-ready LGR implementations
A direct transcription produces primal variables and KKT multipliers, whereas continuous optimal-control theory describes states, controls, and costates. This chapter connects the two descriptions. It derives costate mappings for LG, LGR, and LGL grids, generalizes the transcription to practical Bolza problems, and closes by organizing the resulting arrays, constraints, objective, and initial guess for an NLP solver.