# JumpProblems with moderately large numbers of jumps

**URL:** https://discourse.julialang.org/t/jumpproblems-with-moderately-large-numbers-of-jumps/126503
**Category:** New to Julia
**Tags:** sciml
**Created:** [March 3, 2025, 4:27pm UTC](https://discourse.julialang.org/t/jumpproblems-with-moderately-large-numbers-of-jumps/126503 "2025-03-03T16:27:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jafoz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jafoz/32/22763_2.png) [@jafoz](https://discourse.julialang.org/u/jafoz)
#### Post date: [March 3, 2025, 4:27pm UTC](https://discourse.julialang.org/t/jumpproblems-with-moderately-large-numbers-of-jumps/126503/1 "2025-03-03T16:27:58Z")

</div>

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](https://discourse.julialang.org/t/jumpproblem-with-large-number-of-jumps-crashes/61444) and [JumpProblem with large number of jumps crashes · Issue #180 · SciML/JumpProcesses.jl · GitHub](https://github.com/SciML/JumpProcesses.jl/issues/180) , but I’m wondering if I’m doing something else very wrong.

```julia
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)

```

---

<div class="post-metadata">

### Author: ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)
#### Post date: [March 3, 2025, 6:17pm UTC](https://discourse.julialang.org/t/jumpproblems-with-moderately-large-numbers-of-jumps/126503/2 "2025-03-03T18:17:23Z")

</div>

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

> [@jafoz](#):
>
> 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.

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.
