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

[WIP] - Support ODEs as equations in JumpSystem #3181

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

isaacsas
Copy link
Member

@isaacsas isaacsas commented Nov 4, 2024

Note this assumes a user has properly classified their jumps (i.e. they haven't made something a constant rate jump that has a condition that depends on a variable rate jump variable and/or an ODE modified variable).

Comment on lines 493 to 500
osys = ODESystem(equations(sys).x[4], get_iv(sys), unknowns(sys), parameters(sys);
observed = observed(sys), name = nameof(sys), description = description(sys),
systems = get_systems(sys), defaults = defaults(sys),
discrete_events = discrete_events(sys),
parameter_dependencies = parameter_dependencies(sys),
metadata = get_metadata(sys), gui_metadata = get_gui_metadata(sys))
osys = complete(osys)
return ODEProblem(osys, u0map, tspan, parammap; check_length, kwargs...)
Copy link
Member Author

Choose a reason for hiding this comment

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

This seemed like the best way to handle generating the underlying ODEProblem, but happy to consider alternative approaches if anyone has feedback.

@isaacsas
Copy link
Member Author

isaacsas commented Nov 4, 2024

@ChrisRackauckas where should callbacks be handled here, the ODEProblem or the JumpProblem? (And actually, I'm not even sure in the lower-level interface what is supposed to be done within JumpProcesses -- are passing some callbacks to both problems and/or just the wrapped ODEProblem allowed and supposed to work?)

@isaacsas
Copy link
Member Author

isaacsas commented Nov 5, 2024

For now I've made it that continuous events are passed to the generated ODEProblem but discrete events go via the JumpProblem. This will need some tests to check that works consistently.

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.

1 participant