# How should I fix this ill-conditioned trajectory optimization problem (launch vehicle ascent, direct pseudospectral transcription)?

I have a written some trajectory optimization code which can solve the "classic" Delta3 launch to GTO optimization problem in Betts, 2010. It uses direct pseudospectral transcription and so is somewhat equivalent to the same example as solved by GPOPS-II (the "Multiple-Stage Launch Vehicle Ascent Problem" in the GPOPS-II User Guide). Although I don't have any hp steps, mesh refinement or any other advanced features implemented, and I'm using LGL rather than LGR or LG points.

I'm using ipopt to solve the NLP and Casadi for analytical Jacobians and Hessians.

The accurate solution of the delta3 problem gives me some confidence that overall the model and solver are working. I tried another problem, however, involving a launch from the equator (zero latitude) to a zero degree inclination target orbit and ran into some interesting degeneracy.

I was using an initial guess generated from an ODE integration of the vacuum equations of motions. This led to some very small z values on the order of 1e-17 for the trajectory from numerical integration instability, which showed up as similarly valued cells in the Jacobian of the constraints. This then seemed to cause ipopt to get lost in restoration phases and converge to an infeasible point if it converged at all. The solution was to setup the initial guess to a 45 degree heading launch angle as a guess to eliminate near-zero z values from the guessed trajectory. By setting a target inclination for the NLP to 45 degrees that further improved convergence.

Of course that isn't a solution to the original 0 degree NLP but I could rotate the axis of the planetary body by 45 degrees and via a coordinate transform render the problem much better behaved and recover a solution of the original problem.

My question though is if this is telling me that I need to look into conditioning the Jacobian better, or if this problem is telling me that Cartesian coordinates are not the best choice, or if there is some tuning which could be done to ipopt to make it behave better? (Or is the problem that for this nonlinear problem that ipopt needs to be tuning the constraint Jacobian on every iteration or something like that?)

So this is partially a tooling question, but mostly a question about the care and feeding of this specific kind of launch ascent trajectory optimization problem. And if anyone can just give me a hint about what software like OTIS or POST does (which I do not have access to) that'd be useful.

• It is looking like this is more of a generic NLP issue. Turns out IPOPT autoscales the problem based on the initial guess by default and does no updating of that scaling on subsequent iterations. The nlp_scaling_method = "none" or nlp_scaling_method = "user-scaling" should be used and the user should appropriately scale the problem. Still interested in any insight from experts with domain knowledge about the coordinate system of this specific kind of NLP. Commented Dec 3, 2019 at 19:51