Skip to content

SDE simulations broken #2754

@TorkelE

Description

@TorkelE

Or at least those I have encountered. MWE:

using ModelingToolkit

@parameters p d
@variables t X(t)
D = Differential(t)
eqs = [D(X) ~ p - d*X]
noise_eqs = [0.1]
@named ssys = SDESystem(eqs, noise_eqs, t, [X], [p, d])
ssys = complete(ssys)

u0 = [X => 1.0]
ps = [p => 1.0, d => 0.2]
sprob = SDEProblem(ssys, u0, (0.0, 1.0), ps)

using StochasticDiffEq
solve(sprob, ImplicitEM())

yields a

ERROR: MethodError: no method matching fast_materialize!(::Static.False, ::Static.False, ::Vector{Float64}, ::Vector{Float64})

Closest candidates are:
  fast_materialize!(::Any, ::Any, ::Any, ::Number)
   @ FastBroadcast ~/.julia/packages/FastBroadcast/rnHDx/src/FastBroadcast.jl:265
  fast_materialize!(::Static.False, ::DB, ::A, ::Base.Broadcast.Broadcasted{S}) where {S, DB, A}
   @ FastBroadcast ~/.julia/packages/FastBroadcast/rnHDx/src/FastBroadcast.jl:217
  fast_materialize!(::Static.False, ::DB, ::EJA, ::Base.Broadcast.Broadcasted{S}) where {S, DB, EJA<:JumpProcesses.ExtendedJumpArray}
   @ JumpProcessFastBroadcastExt ~/.julia/packages/JumpProcesses/dVagW/ext/JumpProcessFastBroadcastExt.jl:5
  ...

Stacktrace:
  [1] apply_step!(nlsolver::OrdinaryDiffEq.NLSolver{…}, integrator::StochasticDiffEq.SDEIntegrator{…})
    @ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/tAI61/src/nlsolve/nlsolve.jl:122
  [2] nlsolve!(nlsolver::OrdinaryDiffEq.NLSolver{…}, integrator::StochasticDiffEq.SDEIntegrator{…}, cache::StochasticDiffEq.ImplicitEMCache{…}, repeat_step::Bool)
    @ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/tAI61/src/nlsolve/nlsolve.jl:89
  [3] perform_step!(integrator::StochasticDiffEq.SDEIntegrator{…}, cache::StochasticDiffEq.ImplicitEMCache{…})
    @ StochasticDiffEq ~/.julia/packages/StochasticDiffEq/aR0ZE/src/perform_step/sdirk.jl:200
  [4] solve!(integrator::StochasticDiffEq.SDEIntegrator{…})
    @ StochasticDiffEq ~/.julia/packages/StochasticDiffEq/aR0ZE/src/solve.jl:618
  [5] __solve(prob::SDEProblem{…}, alg::ImplicitEM{…}, timeseries::Vector{…}, ts::Vector{…}, ks::Nothing, recompile::Type{…}; kwargs::@Kwargs{…})
    @ StochasticDiffEq ~/.julia/packages/StochasticDiffEq/aR0ZE/src/solve.jl:7
  [6] __solve (repeats 5 times)
    @ ~/.julia/packages/StochasticDiffEq/aR0ZE/src/solve.jl:1 [inlined]
  [7] #solve_call#44
    @ ~/.julia/packages/DiffEqBase/PBhFc/src/solve.jl:612 [inlined]
  [8] solve_call
    @ ~/.julia/packages/DiffEqBase/PBhFc/src/solve.jl:569 [inlined]
  [9] solve_up(prob::SDEProblem{…}, sensealg::Nothing, u0::Vector{…}, p::ModelingToolkit.MTKParameters{…}, args::ImplicitEM{…}; kwargs::@Kwargs{})
    @ DiffEqBase ~/.julia/packages/DiffEqBase/PBhFc/src/solve.jl:1080
 [10] solve_up
    @ ~/.julia/packages/DiffEqBase/PBhFc/src/solve.jl:1066 [inlined]
 [11] #solve#51
    @ ~/.julia/packages/DiffEqBase/PBhFc/src/solve.jl:1003 [inlined]
 [12] solve(prob::SDEProblem{…}, args::ImplicitEM{…})
    @ DiffEqBase ~/.julia/packages/DiffEqBase/PBhFc/src/solve.jl:993
 [13] top-level scope
    @ ~/Desktop/Julia Playground/Environment - Temporary/temproary_playground.jl:16
Some type information was truncated. Use `show(err)` to see complete types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions