Hi all,
I’ve been experimenting with ModelingToolkit.jl and InfiniteOpt.jl for direct-collocation optimal control problems. In my model I am using smooth boolean logic that is based on hyperbolic functions quite extensively to capture some non linearities, and I have noticed that IPOPT converges many times in clearly suboptimal tranjectories. Given the above, I’m trying to reconcile something about stiff dynamics and discrete adjoints.
For a stiff linear system, forward Euler integration is unstable. Writing the same forward-Euler discretization as a global linear system (direct transcription) does not fix this — the solution still exhibits the same exponential growth.
In optimal control, however, we typically use implicit schemes (e.g. backward Euler / Radau), which stabilize the primal dynamics. But it’s well known that the corresponding discrete adjoint then behaves like forward Euler on the dual system (since the adjoint propagates via the transpose of the step map), and therefore has unstable eigenvalues.
My confusion is:
If forward Euler instability is not cured by “solving everything at once” for the primal, does it mean we have the same problem for the adjoint inside a direct collocation NLP? In other words, if the discrete adjoint corresponds to an unstable forward scheme, why doesn’t this cause the same kind of blow-up when solving the KKT system? Is what I absorved with the solver converging into clearly not optimal solutions related to this numerical stiffness of the dual dyanamics?
I understand that in collocation we don’t march the adjoint but instead solve a global boundary-value linear system — but I’m struggling to make this precise.
If anyone has a clean linear example or intuition to clarify this distinction, I’d really appreciate it.
Thanks!