In another post, I mentioned that I was having trouble with a lunar mission, because the TLI burn produces a highly elliptical orbit that is very close to becoming parabolic or hyperbolic. Of course, the apocenter is undefined for these orbits. I've seen the DC solver choke if its trial values happens to hit on this case.

I'd like to suggest a solution: Instead of computing an apocenter, compute its reciprocal. As the orbit's eccentricity grows, this reciprocal approaches zero, passes through zero for the parabola, and goes negative for hyperbolas. If you add this reciprocal to the orbit properties, the DC solver can search for the solution with no problems. I use this technique in a Simulink model, and it works just fine.

The approach also works when searching for the SMA.

Just a suggestion,

Jack