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

**URL:** <https://discourse.julialang.org/t/differentialequations-sundials-and-lsoda-report-convergence-failure-julia-solvers-silently-fail/80489>\
**Category:** General Usage\
**Tags:** diffeq\
**Created:** [May 4, 2022, 3:38pm UTC](https://discourse.julialang.org/t/differentialequations-sundials-and-lsoda-report-convergence-failure-julia-solvers-silently-fail/80489 "2022-05-04T15:38:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![qtoloza](https://avatars.discourse-cdn.com/v4/letter/q/ea5d25/32.png) [@qtoloza](https://discourse.julialang.org/u/qtoloza)\
**Post date:** [May 4, 2022, 3:38pm UTC](https://discourse.julialang.org/t/differentialequations-sundials-and-lsoda-report-convergence-failure-julia-solvers-silently-fail/80489/1 "2022-05-04T15:38:26Z")

</div>

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: [https://github.com/qtoloza/MWE](https://github.com/qtoloza/MWE)

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 6, 2022, 8:15pm UTC](https://discourse.julialang.org/t/differentialequations-sundials-and-lsoda-report-convergence-failure-julia-solvers-silently-fail/80489/2 "2022-05-06T20:15:24Z")

</div>

> [@qtoloza](#):
>
> 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.

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.

---

<div class="post-metadata">

**Author:** ![qtoloza](https://avatars.discourse-cdn.com/v4/letter/q/ea5d25/32.png) [@qtoloza](https://discourse.julialang.org/u/qtoloza)\
**Post date:** [May 6, 2022, 9:20pm UTC](https://discourse.julialang.org/t/differentialequations-sundials-and-lsoda-report-convergence-failure-julia-solvers-silently-fail/80489/3 "2022-05-06T21:20:14Z")

</div>

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