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

Integration of ODEs with stochastic rewrites #18

Open
kris-brown opened this issue May 16, 2024 · 2 comments
Open

Integration of ODEs with stochastic rewrites #18

kris-brown opened this issue May 16, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@kris-brown
Copy link
Collaborator

This is required functionality for things like Stock Flow diagrams and Petri Nets with Rates to be used. It is the common language those user-friendly presentations get compiled down to. One plan for this is written here

It remains to be decided how the clock gets advanced.

If one draws that the next event is very far in the future, one may wish to integrate the ODE a bit and then resample all of the clocks that got affected by changed parameters.

@kris-brown
Copy link
Collaborator Author

kris-brown commented Jun 3, 2024

The plan is to distinguish

  1. State-dependent, memoryless (constant hazard rate) timers
  2. Stateless, time-dependent (e.g. non-constant) timers

And to, for the near future, not support the combination of these.

The second kind of timer can be scheduled. We do not need to worry about how the world changing (while jumping to the next-to-fire event) affects the validity of that event happening then.

The first kind of timer must be continuously (i.e. for each small $\Delta t$) evaluated. But because it is memoryless this is simple: at each $\Delta t$, we check whether or not the event fires within the next $\Delta t$ given the current value of its constant hazard rate.

This suggests an implementation: we continue to schedule events and jump to the next-to-fire event. However, 'jumping' now involves the following procedure: we simulate the ODE (using some off-the-shelf ODE solver) and periodically (at some $\Delta t$) pause the simulation, check whether any of our stateful+memoryless rules will fire within the next $\Delta t$. Whenever that happens, the rewrite is fired, which can change the ODEs (via the method described in the blog post) as well as the scheduled events. We do this procedure up until the next scheduled event.

@kris-brown kris-brown self-assigned this Jun 3, 2024
@kris-brown kris-brown added the enhancement New feature or request label Jun 3, 2024
@slwu89
Copy link
Member

slwu89 commented Jun 5, 2024

Here's the paper I mentioned on the call where I saw the method that augments the ODE system with an additional variable, and just integrates out to a unit exponentially distributed amount of time and checks what happens at that point in time https://arxiv.org/abs/1504.06873 May or may not be useful here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants