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

Error when simulating variable rate jump problem with OOP ODEProblem #321

Closed gaurav-arya closed 11 months ago

gaurav-arya commented 1 year ago

Simulating a variable rate jump problem seems to error when I use an ODEProblem with an out-of-place ODEFunction. Here's an MWE:

using JumpProcesses
using OrdinaryDiffEq

begin
rate(u, p, t) = exp(t)
function affect!(integrator)
    integrator.u[1] += 1
    nothing
end
jump = VariableRateJump(rate, affect!)
end

# Works
begin
u₀ = [0.0]
prob = ODEProblem((du, u, p, t) -> (du .= 0), u₀, (0.0, 2.0), nothing)
jump_prob = JumpProblem(prob, Direct(), jump)
sol = solve(jump_prob, Tsit5())
end

# Does not work 
begin
u₀ = [0.0]
prob = ODEProblem((u, p, t) -> [0.0], u₀, (0.0, 2.0), nothing) # only difference is use of OOP ode function
jump_prob = JumpProblem(prob, Direct(), jump)
sol = solve(jump_prob, Tsit5())
end
Error ```julia ERROR: MethodError: no method matching (::JumpProcesses.var"#136#139"{Tuple{VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, ODEFunction{false, SciMLBase.AutoSpecialize, var"#37#38", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}})(::Vector{Float64}, ::Nothing, ::Float64) Closest candidates are: (::JumpProcesses.var"#136#139")(::ExtendedJumpArray, ::Any, ::Any) @ JumpProcesses ~/.julia/packages/JumpProcesses/unuXX/src/problem.jl:264 Stacktrace: [1] (::ODEFunction{false, SciMLBase.FullSpecialize, JumpProcesses.var"#136#139"{Tuple{VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, ODEFunction{false, SciMLBase.AutoSpecialize, var"#37#38", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing})(::Vector{Float64}, ::Vararg{Any}) @ SciMLBase ~/.julia/packages/SciMLBase/VdcHg/src/scimlfunctions.jl:2126 [2] ode_determine_initdt(u0::ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}, t::Float64, tdir::Float64, dtmax::Float64, abstol::Float64, reltol::Float64, internalnorm::typeof(DiffEqBase.ODE_DEFAULT_NORM), prob::ODEProblem{ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}, Tuple{Float64, Float64}, false, Nothing, ODEFunction{false, SciMLBase.FullSpecialize, JumpProcesses.var"#136#139"{Tuple{VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, ODEFunction{false, SciMLBase.AutoSpecialize, var"#37#38", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, false, ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}, Nothing, Float64, Nothing, Float64, Float64, Float64, Float64, Vector{ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}}, ODESolution{Float64, 2, Vector{ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}}}, ODEProblem{ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}, Tuple{Float64, Float64}, false, Nothing, ODEFunction{false, SciMLBase.FullSpecialize, JumpProcesses.var"#136#139"{Tuple{VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, ODEFunction{false, SciMLBase.AutoSpecialize, var"#37#38", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{false, SciMLBase.FullSpecialize, JumpProcesses.var"#136#139"{Tuple{VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, ODEFunction{false, SciMLBase.AutoSpecialize, var"#37#38", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Vector{ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}}, Vector{Float64}, Vector{Vector{ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}}}, OrdinaryDiffEq.Tsit5ConstantCache}, DiffEqBase.Stats, Nothing}, ODEFunction{false, SciMLBase.FullSpecialize, JumpProcesses.var"#136#139"{Tuple{VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, ODEFunction{false, SciMLBase.AutoSpecialize, var"#37#38", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, OrdinaryDiffEq.Tsit5ConstantCache, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{ContinuousCallback{JumpProcesses.var"#172#174"{Int64}, JumpProcesses.var"#173#175"{Random.TaskLocalRNG, Int64, VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, JumpProcesses.var"#173#175"{Random.TaskLocalRNG, Int64, VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(SciMLBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}, Float64, Nothing, OrdinaryDiffEq.DefaultInit}) @ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/EQy59/src/initdt.jl:268 [3] auto_dt_reset! @ ~/.julia/packages/OrdinaryDiffEq/EQy59/src/integrators/integrator_interface.jl:442 [inlined] [4] handle_dt!(integrator::OrdinaryDiffEq.ODEIntegrator{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, false, ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}, Nothing, Float64, Nothing, Float64, Float64, Float64, Float64, Vector{ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}}, ODESolution{Float64, 2, Vector{ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}}}, ODEProblem{ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}, Tuple{Float64, Float64}, false, Nothing, ODEFunction{false, SciMLBase.FullSpecialize, JumpProcesses.var"#136#139"{Tuple{VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, ODEFunction{false, SciMLBase.AutoSpecialize, var"#37#38", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, OrdinaryDiffEq.InterpolationData{ODEFunction{false, SciMLBase.FullSpecialize, JumpProcesses.var"#136#139"{Tuple{VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, ODEFunction{false, SciMLBase.AutoSpecialize, var"#37#38", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Vector{ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}}, Vector{Float64}, Vector{Vector{ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}}}, OrdinaryDiffEq.Tsit5ConstantCache}, DiffEqBase.Stats, Nothing}, ODEFunction{false, SciMLBase.FullSpecialize, JumpProcesses.var"#136#139"{Tuple{VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, ODEFunction{false, SciMLBase.AutoSpecialize, var"#37#38", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, OrdinaryDiffEq.Tsit5ConstantCache, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, PIController{Rational{Int64}}, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{ContinuousCallback{JumpProcesses.var"#172#174"{Int64}, JumpProcesses.var"#173#175"{Random.TaskLocalRNG, Int64, VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, JumpProcesses.var"#173#175"{Random.TaskLocalRNG, Int64, VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(SciMLBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}, Float64, Nothing, OrdinaryDiffEq.DefaultInit}) @ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/EQy59/src/solve.jl:547 [5] __init(prob::ODEProblem{ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}, Tuple{Float64, Float64}, false, Nothing, ODEFunction{false, SciMLBase.FullSpecialize, JumpProcesses.var"#136#139"{Tuple{VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, ODEFunction{false, SciMLBase.AutoSpecialize, var"#37#38", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, alg::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, timeseries_init::Vector{Any}, ts_init::Vector{Any}, ks_init::Vector{Any}, recompile::Type{Val{true}}; saveat::Tuple{}, tstops::Tuple{}, d_discontinuities::Tuple{}, save_idxs::Nothing, save_everystep::Bool, save_on::Bool, save_start::Bool, save_end::Nothing, callback::CallbackSet{Tuple{ContinuousCallback{JumpProcesses.var"#172#174"{Int64}, JumpProcesses.var"#173#175"{Random.TaskLocalRNG, Int64, VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, JumpProcesses.var"#173#175"{Random.TaskLocalRNG, Int64, VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(SciMLBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}}, Tuple{}}, dense::Bool, calck::Bool, dt::Float64, dtmin::Nothing, dtmax::Float64, force_dtmin::Bool, adaptive::Bool, gamma::Rational{Int64}, abstol::Nothing, reltol::Nothing, qmin::Rational{Int64}, qmax::Int64, qsteady_min::Int64, qsteady_max::Int64, beta1::Nothing, beta2::Nothing, qoldinit::Rational{Int64}, controller::Nothing, fullnormalize::Bool, failfactor::Int64, maxiters::Int64, internalnorm::typeof(DiffEqBase.ODE_DEFAULT_NORM), internalopnorm::typeof(LinearAlgebra.opnorm), isoutofdomain::typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), unstable_check::typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), verbose::Bool, timeseries_errors::Bool, dense_errors::Bool, advance_to_tstop::Bool, stop_at_next_tstop::Bool, initialize_save::Bool, progress::Bool, progress_steps::Int64, progress_name::String, progress_message::typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), userdata::Nothing, allow_extrapolation::Bool, initialize_integrator::Bool, alias_u0::Bool, alias_du0::Bool, initializealg::OrdinaryDiffEq.DefaultInit, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) @ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/EQy59/src/solve.jl:509 [6] __init @ ~/.julia/packages/OrdinaryDiffEq/EQy59/src/solve.jl:10 [inlined] [7] #init_call#18 @ ~/.julia/packages/DiffEqBase/ihYDa/src/solve.jl:425 [inlined] [8] init_call @ ~/.julia/packages/DiffEqBase/ihYDa/src/solve.jl:405 [inlined] [9] #init_up#21 @ ~/.julia/packages/DiffEqBase/ihYDa/src/solve.jl:472 [inlined] [10] init_up @ ~/.julia/packages/DiffEqBase/ihYDa/src/solve.jl:445 [inlined] [11] #init#19 @ ~/.julia/packages/DiffEqBase/ihYDa/src/solve.jl:438 [inlined] [12] init @ ~/.julia/packages/DiffEqBase/ihYDa/src/solve.jl:429 [inlined] [13] #__init#177 @ ~/.julia/packages/JumpProcesses/unuXX/src/solve.jl:29 [inlined] [14] init_call(::JumpProblem{false, ODEProblem{ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}, Tuple{Float64, Float64}, false, Nothing, ODEFunction{false, SciMLBase.FullSpecialize, JumpProcesses.var"#136#139"{Tuple{VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, ODEFunction{false, SciMLBase.AutoSpecialize, var"#37#38", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Direct, CallbackSet{Tuple{ContinuousCallback{JumpProcesses.var"#172#174"{Int64}, JumpProcesses.var"#173#175"{Random.TaskLocalRNG, Int64, VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, JumpProcesses.var"#173#175"{Random.TaskLocalRNG, Int64, VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(SciMLBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}}, Tuple{}}, Nothing, Tuple{VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, Nothing, Nothing, Random.TaskLocalRNG, Base.Pairs{Symbol, Nothing, Tuple{Symbol}, NamedTuple{(:callback,), Tuple{Nothing}}}}, ::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, ::Vararg{Any}; merge_callbacks::Bool, kwargshandle::KeywordArgError, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) @ DiffEqBase ~/.julia/packages/DiffEqBase/ihYDa/src/solve.jl:425 [15] init_call @ ~/.julia/packages/DiffEqBase/ihYDa/src/solve.jl:405 [inlined] [16] #init#20 @ ~/.julia/packages/DiffEqBase/ihYDa/src/solve.jl:442 [inlined] [17] init @ ~/.julia/packages/DiffEqBase/ihYDa/src/solve.jl:441 [inlined] [18] __solve(jump_prob::JumpProblem{false, ODEProblem{ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}, Tuple{Float64, Float64}, false, Nothing, ODEFunction{false, SciMLBase.FullSpecialize, JumpProcesses.var"#136#139"{Tuple{VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, ODEFunction{false, SciMLBase.AutoSpecialize, var"#37#38", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Direct, CallbackSet{Tuple{ContinuousCallback{JumpProcesses.var"#172#174"{Int64}, JumpProcesses.var"#173#175"{Random.TaskLocalRNG, Int64, VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, JumpProcesses.var"#173#175"{Random.TaskLocalRNG, Int64, VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(SciMLBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}}, Tuple{}}, Nothing, Tuple{VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, Nothing, Nothing, Random.TaskLocalRNG, Base.Pairs{Symbol, Nothing, Tuple{Symbol}, NamedTuple{(:callback,), Tuple{Nothing}}}}, alg::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, timeseries::Vector{Any}, ts::Vector{Any}, ks::Vector{Any}, recompile::Type{Val{true}}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}) @ JumpProcesses ~/.julia/packages/JumpProcesses/unuXX/src/solve.jl:5 [19] __solve (repeats 5 times) @ ~/.julia/packages/JumpProcesses/unuXX/src/solve.jl:1 [inlined] [20] #solve#33 @ ~/.julia/packages/DiffEqBase/ihYDa/src/solve.jl:965 [inlined] [21] solve(prob::JumpProblem{false, ODEProblem{ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}, Tuple{Float64, Float64}, false, Nothing, ODEFunction{false, SciMLBase.FullSpecialize, JumpProcesses.var"#136#139"{Tuple{VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, ODEFunction{false, SciMLBase.AutoSpecialize, var"#37#38", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, Direct, CallbackSet{Tuple{ContinuousCallback{JumpProcesses.var"#172#174"{Int64}, JumpProcesses.var"#173#175"{Random.TaskLocalRNG, Int64, VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, JumpProcesses.var"#173#175"{Random.TaskLocalRNG, Int64, VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(SciMLBase.FINALIZE_DEFAULT), Float64, Int64, Rational{Int64}, Nothing, Int64}}, Tuple{}}, Nothing, Tuple{VariableRateJump{typeof(rate), typeof(affect!), Nothing, Nothing, Nothing, Nothing, Float64, Int64}}, Nothing, Nothing, Random.TaskLocalRNG, Base.Pairs{Symbol, Nothing, Tuple{Symbol}, NamedTuple{(:callback,), Tuple{Nothing}}}}, args::Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}) @ DiffEqBase ~/.julia/packages/DiffEqBase/ihYDa/src/solve.jl:964 ```

Using JumpProcesses v9.6.1 and OrdinaryDiffEq v.6.51.2

isaacsas commented 1 year ago

@ChrisRackauckas looks like the ExtendedJumpArray type is being dropped within OrdinaryDiffEq at

https://github.com/SciML/OrdinaryDiffEq.jl/blob/68962b7ba3534dc0acac95ea0a41213ce990f73a/src/initdt.jl#L267

so that u₁ is just a normal Vector{Float64}. I checked and both f₀ and u0 are ExtendedJumpArrays. Not sure if that is an issue in the ExtendedJumpArray def here or a problem with the @.. macro.

ChrisRackauckas commented 1 year ago

It needs a broadcast similar overload