I've been trying to integrate rocket equation problems, and one thing that comes up is that for any rocket there is a very finite maximum theoretical burntime beyond which you've burned the last proton in the rocket, and accelerated it to infinite speed, infinitely far away. The value is also not much more than typical burntimes of a real rocket stage (usually about ~20% more). The behavior of the alglib ck integrator is that when you try to integrate beyond that timescale (which can happen when a wrapping optimizer is optimizing the time of the burn and takes too long of a step) is to just spin and never return (i suspect it is working very hard on a Xeno's Paradox kind of problem).
I can solve this reasonably easily in my own code by doing the calculation for when the rocket will burn completely and clipping the maximum x value passed to odesolverrkck(), but for other problems I'd imagine that could be computationally expensive or error prone to compute and it would better to have bounds in the routine itself. It also just feels unsafe to have an infinite loop as a possible failure mode.
|