-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
refactor: store discrete portion in BlockedArray for efficiency, better handle event variables #2945
refactor: store discrete portion in BlockedArray for efficiency, better handle event variables #2945
Conversation
e5cc554
to
bf248cd
Compare
ef3da8b
to
a29966b
Compare
This looks like a really great addition! I'm just wondering is there any simple way to control saving of the discrete values (and if so could you add it to your nice doc example)? |
What do you mean "control" saving? |
My understanding is that the past values of parameters are now being saved if modified via a callbacks as shown in your doc example. Is there a way to disable such saving. (I.e. the current behavior where only the current value is stored.) |
I see. Yeah, if the parameter is not time-dependent. |
3c17637
to
de72e89
Compare
Just to clarify, if I have a parameter |
The idea being that in things like jump problems memory allocations can have a performance impact, so one often wants to turn off all saving beyond what exactly is needed. (This may not seem critical at the level of one simulation, but it can add up when running hundreds of thousands of simulations or more for sampling purposes.) |
Only if it's declared to have a time dependency ( |
Got it, thanks for clarifying! My apologies for not understanding that. |
Right now I don't think anyone does this (please correct me if I'm wrong) so it shouldn't save by default for most simulations. |
Correct, and setting it up to save only if you make it explicitly time-dependent seems like a nice way to handle this issue. |
This example in Catalyst https://docs.sciml.ai/Catalyst/stable/model_simulation/examples/periodic_events_simulation/#periodic_event_simulation_plotting_light would actually be a perfect use case for the new functionality, so I'll update that tutorial once this is released. |
b424b73
to
ecd061d
Compare
Requires JuliaSymbolics/SymbolicUtils.jl#634 |
ecd061d
to
13e79a5
Compare
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Add any other context about the problem here.