I’m trying to run this code (julia version 1.9.2) found on Continuous-Time Jump Processes and Gillespie Methods · JumpProcesses.jl and I get the error "JumpSystem equations must contain MassActionJumps, ConstantRateJumps, or VariableRateJumps.
"
using Catalyst,JumpProcesses
sir_model = @reaction_network begin
β, S + I → 2I
ν, I → R
end
p = (:β => 0.1 / 1000, :ν => 0.01)
u₀ = [:S => 990, :I => 10, :R => 0]
tspan = (0.0, 250.0)
prob = DiscreteProblem(sir_model, u₀, tspan, p)
If for some reason you can’t use the latest versions of the packages you need, make sure to read the documentation for the versions you are using (as you see in the screenshot above you can select an older version of the docs from the dropdown menu).
Thank you for your answer, is there a reason for which the packages Catalyst and JumpProcesses were not installed in their latest version when I run "Pkg.add(“Catalyst”)?
The most common reason for getting older package versions is that you are installing these packages into your global environment in which you have another package installed that is incompatible with their most recent versions. That other package then prevents the latest version of them being installed. The easiest thing to do is create a new, empty environment for each project you are working on and just install the exact packages you need into it. That usually allows you to get the latest versions. A benefit of this approach is you can share the environment Project.toml and Manifest.toml with others to have a reproducible project.
For example, you could do
using Package
# creates a new environment in the current folder named catalyst_project
Pkg.activate("catalyst_project")
Pkg.add("Catalyst")
Pkg.add("JumpProcesses")
This should result in you having the latest versions of these packages and your code working.