Closed efaulhaber closed 1 month ago
A different, but probably more complicated solution could be to add a different kind of dtmin
parameter, which is only used to terminate when automatic time integration chooses too small steps, but which doesn't terminate due to manually added tstops.
I believe this was fixed (via different means) in https://github.com/SciML/SciMLBase.jl/pull/693. Specifically, on new SciMLBase, this gives
julia> solve(ode, Tsit5(), save_everystep=false, maxiters=1000, callback=cb).stats
xxxxxxxxx
1
xxxxxxx
2
xxxxxxx
3
xxxxxxxxxxxxx
5
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
19
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
28
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
78
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
104
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
113
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
122
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxx
298
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx┌ Warning: dt(1.3877787807814457e-17) <= eps(t)(0.1) , and step error estimate = 12.775142822640118. Aborting. There is either an error in your model specification or the true solution is unstable (or the true solution can not be represented in the precision of Float64).
└ @ SciMLBase ~/.julia/packages/SciMLBase/JUp1I/src/integrator_interface.jl:632
Amazing, thanks!
Without default
dtmin
(https://github.com/SciML/OrdinaryDiffEq.jl/pull/2098), automatic time stepping methods reduce the time step beloweps()
at instabilities and reject all steps infinitely. MWE:As shown by the many x at the end,
f
is still called, but there are no more accepted steps to trigger the callback until we reachmaxiters
. In simulation frameworks, this will cause apparent freezing of the simulation, as suddenly no more output is generated when an instability is reached, but the simulation doesn't terminate.I suggest adding an option to limit the maximum number of consecutively rejected steps to terminate time integration in these cases where it gets stuck in an infinite loop until
maxiters
is reached (which might take a very long time for large simulations and defaultmaxiters
).Note that setting
dtmin
is not an option, as perfectly stable simulations are terminated when different callbacks happen to add tstops that are very close together (#1616):CC @ranocha