SciML / JumpProcesses.jl

Build and simulate jump equations like Gillespie simulations and jump diffusions with constant and state-dependent rates and mix with differential equations and scientific machine learning (SciML)
https://docs.sciml.ai/JumpProcesses/stable/
Other
141 stars 35 forks source link

Spatial SSAs progress and TODOs #189

Open Vilin97 opened 3 years ago

Vilin97 commented 3 years ago

This summer I am working on implementing spatial SSAs. There are currently two issues open about it: https://github.com/SciML/DiffEqJump.jl/issues/107 and https://github.com/SciML/DiffEqJump.jl/issues/130. The first PR https://github.com/SciML/DiffEqJump.jl/pull/183 implements the NSM, adds two tests and some utility functions, essentially setting up the interface for spatial SSAs. LightGraphs are supported as well. There are a few TODOs that should not be forgotten:

@isaacsas and @ChrisRackauckas might have more TODOs to add to this list.

isaacsas commented 3 years ago

Additional features to plan for:

Optimizations to try after benchmarking:

  1. @inbounds throughout.
isaacsas commented 3 years ago

Some more stuff:

Vilin97 commented 1 year ago

I am starting to think about SpatialConstantRateJump, analogous to SpatialMassActionJump. We need rate and affect! from each user. I have some questions:

  1. Should affect! be allowed to affect other cells? Or only the cell where the reaction happened. I guess there is no real way to stop the user from passing a function that modifies other cells, because affect! takes an integrator as input, and I don't think we should change that interface.
  2. We expect the user to supply the dependency graph if using constant rate jumps, right?
  3. Should rate take the full state vector as input or only the state at the current cell? I am thinking the latter. In that case the function signature is the same rate(u,p,t), where u is the vector of species in the current cell. If we go with the former, than the signature would be rate(u,p,t,i), where u is now the species-site matrix, and i is the site index.

@isaacsas , what do you think?

isaacsas commented 1 year ago

We need to provide the location or there would be no way to have a rate that is spatially varying. For example, zero at some sites and non zero at others.