-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
base: master
Are you sure you want to change the base?
Conversation
src/systems/jumps/jumpsystem.jl
Outdated
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...) |
There was a problem hiding this comment.
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.
@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?) |
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. |
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).