DifferentialEquations: Sundials and LSODA report convergence failure, Julia solvers silently fail?

Hi all!

I have an ODE whose solution (mysteriously to me) fails to converge for a set of inputs. The real problem is that solve() does not throw an error and halt integration when I use a native Julia solver (I’ve tried AutoDP5(Rosenbrock23), Tsit5, Rosenbrock23, Vern6, etc.) - instead, it seemingly continues to integrate forever while accumulating allocations. CVODE_BDF and lsoda both report convergence failure and stop early.

Am I doing something wrong? As a side note, if anyone understands why this particular set of inputs is causing a convergence failure, when the rest of my ~1000 do not, I would really appreciate the insight! I’ve included a second data file that integrates perfectly fine, for comparison.

The MWE and required data: GitHub - qtoloza/MWE

Every solver cuts off slightly differently. Runge-Kutta methods can keep iterating until maxiters, while more stable methods like Rosenbrock23 can very accurately try to get a diverging trajectories. You can define things like unstable_check to customize the divergence checking.

1 Like

Aha! I specified a strict unstable_check since I know the expected bounds of the system and it worked like a charm. Thank you!