Skip to content

Commit

Permalink
Merge pull request #692 from oscardssmith/reduce-instability-sensitivity
Browse files Browse the repository at this point in the history
only bail out as instable when dt is small or error is somewhat conrtolled
  • Loading branch information
ChrisRackauckas authored May 15, 2024
2 parents 541e7fd + ccf79ed commit ed82867
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/integrator_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -619,10 +619,15 @@ function check_error(integrator::DEIntegrator)
end
if integrator.opts.unstable_check(integrator.dt, integrator.u, integrator.p,
integrator.t)
if integrator.opts.verbose
@warn("Instability detected. Aborting")
bigtol = max(integrator.opts.reltol, integrator.opts.abstol)
# only declare instability if the dt is very small
# or we have at least one digit of accuracy in the solution
if integrator.dt<eps(integrator.t) || isdefined(integrator, :EEst) && integrator.EEst * bigtol < .1
if integrator.opts.verbose
@warn("Instability detected. Aborting")
end
return ReturnCode.Unstable
end
return ReturnCode.Unstable
end
if last_step_failed(integrator)
if integrator.opts.verbose
Expand Down

0 comments on commit ed82867

Please sign in to comment.