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
135 stars 35 forks source link

Spatial constant rate jump #343

Open Vilin97 opened 10 months ago

Vilin97 commented 10 months ago

Add spatial constant rate jump support.

NB: I have not implemented flattening for constant rate jumps, because it's unclear how to flatten constant rate jumps.

Implementation details: In order to use constant rate jumps, the user is expected to pass in a JumpSet and two dependency graphs (reaction-reaction and reaction-species). The syntax is as follows:

rate1(u,p,t,site) = ...
rate2(u,p,t,site) = ...
affect1!(integrator,site) = ...
affect2!(integrator,site) =...
crjumps = JumpSet([ConstantRateJump(rate1, affect1!), ConstantRateJump(rate2, affect2!)])
# define prob, hopping_constants, spatial_system, and dependency_graphs
jump_prob = JumpProblem(prob, NSM(), crjumps, hopping_constants = hopping_constants,
            spatial_system = spatial_system , save_positions = (false, false), dep_graph = dep_graph, jumptovars_map = jumptovars_map)
coveralls commented 10 months ago

Pull Request Test Coverage Report for Build 6180688297


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/problem.jl 2 3 66.67%
src/spatial/directcrdirect.jl 3 6 50.0%
src/spatial/nsm.jl 3 6 50.0%
<!-- Total: 31 38 81.58% -->
Totals Coverage Status
Change from base Build 6167199515: 0.1%
Covered Lines: 2326
Relevant Lines: 2585

💛 - Coveralls