Skip to content

Commit

Permalink
only bail out as instable when dt is small or error is somewhat contr…
Browse files Browse the repository at this point in the history
…olled
  • Loading branch information
oscardssmith committed May 15, 2024
1 parent 541e7fd commit ccf79ed
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)

Check warning on line 622 in src/integrator_interface.jl

View check run for this annotation

Codecov / codecov/patch

src/integrator_interface.jl#L622

Added line #L622 was not covered by tests
# 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")

Check warning on line 627 in src/integrator_interface.jl

View check run for this annotation

Codecov / codecov/patch

src/integrator_interface.jl#L625-L627

Added lines #L625 - L627 were not covered by tests
end
return ReturnCode.Unstable

Check warning on line 629 in src/integrator_interface.jl

View check run for this annotation

Codecov / codecov/patch

src/integrator_interface.jl#L629

Added line #L629 was not covered by tests
end
return ReturnCode.Unstable
end
if last_step_failed(integrator)
if integrator.opts.verbose
Expand Down

0 comments on commit ccf79ed

Please sign in to comment.