Skip to content

Optimizations to Discontinuity Detection Scheme#3720

Open
Shreyas-Ekanathan wants to merge 10 commits into
SciML:masterfrom
Shreyas-Ekanathan:disco-optimizations
Open

Optimizations to Discontinuity Detection Scheme#3720
Shreyas-Ekanathan wants to merge 10 commits into
SciML:masterfrom
Shreyas-Ekanathan:disco-optimizations

Conversation

@Shreyas-Ekanathan

Copy link
Copy Markdown
Contributor

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
      contributor guidelines, in particular the SciML Style Guide and
      COLPRAC.
  • Any new documentation only uses public API

Additional context

Optimizations:

  • Add a tstop on the first identification of a discontinuity to help with step-resizing and prevent excessively large steps after finding a discontinuity. This should help us not take unreasonable steps, as Oscar suggested, and helps with error resetting after passing a discontinuity (since we are effectively in a new regime) to begin stepping anew.
  • Shrink the solve window for the interval nonlinear problem after finding a discontinuity
  • Move _ode_addsteps! out of the zero_func_struct call and only call it once per discontinuity detection run

Comment thread lib/OrdinaryDiffEqBDF/src/controllers.jl Outdated
Comment thread lib/OrdinaryDiffEqCore/src/integrators/controllers.jl
Comment thread lib/OrdinaryDiffEqCore/src/integrators/type.jl
Comment thread lib/OrdinaryDiffEqCore/src/disco.jl Outdated
Comment thread lib/OrdinaryDiffEqCore/src/disco.jl Outdated
is_disco = integrator.is_disco_step
if is_disco
integrator.is_disco_step = false
cache.nconsteps = 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this line doing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because it's not a standard timestep BDF shouldn't really count this step towards its order selection logic right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChrisRackauckas thoughts on this? I don't know how we want disco to interact with BDF well enough here.

Comment thread lib/OrdinaryDiffEqBDF/src/controllers.jl Outdated
Comment thread lib/OrdinaryDiffEqCore/src/integrators/controllers.jl Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants