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

Set max number of jumps #323

Open gaurav-arya opened 1 year ago

gaurav-arya commented 1 year ago

Is there a way of setting a max number of jumps, at which point to abort with an incomplete solution? This would be very useful when dealing with time-dependent jumps with Coevolve, where I would like my simulation to naturally abort if my jump rates are larger than I expected

isaacsas commented 1 year ago

Couldn't you track this via a DiscreteCallback and just call terminate! when you hit your limit?

gaurav-arya commented 1 year ago

It seems like it's getting stuck in between DiscreteCallback's, so that I can't catch the infinite loop in the DiscreteCallback. It'll take me a bit to make an MWE, but from my logs it seems like Coevolve is getting stuck in a loop at a point where all reaction rates are 0.

isaacsas commented 4 months ago

We should add maxiters keyword support for SSAStepper at least.