JumpProblems with moderately large numbers of jumps

I’m trying to create a JumpProblem which has ~ 100 variable rate jumps, and running into some issues where constructing the JumpProblem is taking a long time (~300s).

This is a minimal example of the problem - the full code is attempting to perform “Hybrid” simulations of a reaction system, swapping between Gillespie for reactions which involve species with low numbers and ODEs for reactions which involve species with large numbers.

I’ve seen JumpProblem with large number of jumps crashes and JumpProblem with large number of jumps crashes · Issue #180 · SciML/JumpProcesses.jl · GitHub , but I’m wondering if I’m doing something else very wrong.

using OrdinaryDiffEq
using JumpProcesses

function ode(dy, y, p, t)
    dy .= y
end

jumps = [ VariableRateJump(((y,p,t) -> 1.0), (integrator -> (integrator.u[1]+=1)))   for i in 1:100 ]

prob = ODEProblem(ode, [1.0], (0.,100.))

jset = JumpSet(; variable_jumps=jumps)

jump_prob = JumpProblem(prob, Direct(), jset)

With VariableRateJumps, we need to do some changes to make that scale better. That should be fixed in a month or so?

We are starting to build this into Catalyst.jl. It’ll take some time but we’re hoping to make this have a formality and interface to it.