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

reinitialize DAEs in between calling callback.affect! and the second savevalues! #997

Merged

Conversation

oscardssmith
Copy link
Contributor

@oscardssmith oscardssmith commented Feb 5, 2024

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

Add any other context about the problem here.
fixes SciML/OrdinaryDiffEq.jl#2127

@ChrisRackauckas
Copy link
Member

This really should get a test.

@oscardssmith
Copy link
Contributor Author

test added.

Comment on lines +223 to +225
#test that reinit happens for both FSAL and non FSAL integrators
@testset "dae re-init" for alg in [FBDF(), Rodas5P()]
sol = solve(prob, alg)
Copy link
Member

Choose a reason for hiding this comment

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

Add a DAEProblem case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

dae test added. That said, for extra fun, IDA fails to solve this because it does callbacks separately and wrong.

Copy link
Member

Choose a reason for hiding this comment

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

Actually no, your code here is bad.

@ChrisRackauckas ChrisRackauckas merged commit c05806f into SciML:master Feb 6, 2024
33 of 40 checks passed
ChrisRackauckas added a commit that referenced this pull request Feb 6, 2024
ChrisRackauckas added a commit that referenced this pull request Feb 9, 2024
@oscardssmith oscardssmith deleted the os/re-initialize-on-callback branch February 14, 2024 21:11
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.

Rosenbrock solvers fail or interpolate poorly due to (algebraically) inconsistent u after callback
2 participants