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

feat: support initialization of DiscreteProblem #2575

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

AayushSabharwal
Copy link
Member

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.

@isaacsas
Copy link
Member

Doesn’t this need to be in SciMLBase or DiffEqBase? OrdinaryDiffEq is not a dependency of JumpProcesses so this would never get loaded for a pure JumpProblem?

@AayushSabharwal
Copy link
Member Author

This is for DiscreteProblem, not JumpProblem. JumpProblem wraps another problem, and __init(jprob::JumpProblem) calls __init(jprob.prob) so the initialization there would run.

@ChrisRackauckas
Copy link
Member

But there are methods for DiscreteProblem in for example SimpleDiffEq.jl. I think this dispatch might make sense in SciMLBase since it's not specific to any method here?

@AayushSabharwal
Copy link
Member Author

AayushSabharwal commented Jan 17, 2025

It's specific to the integrator and the initializealg. Trying to solve a DiscreteProblem with FunctionMap will run into the __init defined here which will call initialize_dae! with DefaultInit as the initializealg. SimpleDiffEq doesn't hook into initialization yet, so that PR is separate.

@ChrisRackauckas ChrisRackauckas merged commit fe68662 into SciML:master Jan 17, 2025
57 of 78 checks passed
@AayushSabharwal AayushSabharwal deleted the as/discprob-init branch January 17, 2025 11:06
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.

3 participants