Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only bail out as instable when dt is small or error is somewhat controlled #692

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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
Loading