Skip to content

SRIW1 fails with a NoiseProcess #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bertini97 opened this issue Jan 23, 2025 · 1 comment · Fixed by SciML/StochasticDiffEq.jl#605
Closed

SRIW1 fails with a NoiseProcess #213

bertini97 opened this issue Jan 23, 2025 · 1 comment · Fixed by SciML/StochasticDiffEq.jl#605
Labels

Comments

@bertini97
Copy link

bertini97 commented Jan 23, 2025

Describe the bug 🐞

The following snippet

using StochasticDiffEq, DiffEqNoiseProcess

f(u, p, t) = -u
g(u, p, t) = 1.0

w = WienerProcess(0.0, 0.0)
prob = SDEProblem(f, g, 0.0, (0.0, 1.0), noise=w)
u = solve(prob, SRIW1())

produces

ERROR: MethodError: no method matching /(::Nothing, ::Float64)
The function `/` exists, but no method is defined for this combination of argument types.

Stacktrace:
  [1] _fastindex
    @ ~/.julia/packages/FastBroadcast/wfdTr/src/FastBroadcast.jl:37 [inlined]
  [2] _broadcasted
    @ ~/.julia/packages/FastBroadcast/wfdTr/src/FastBroadcast.jl:352 [inlined]
  [3] perform_step!(integrator::StochasticDiffEq.SDEIntegrator{…}, cache::StochasticDiffEq.SRIW1ConstantCache)
    @ StochasticDiffEq ~/.julia/packages/StochasticDiffEq/vo3vZ/src/perform_step/sri.jl:225
  [4] solve!(integrator::StochasticDiffEq.SDEIntegrator{…})
    @ StochasticDiffEq ~/.julia/packages/StochasticDiffEq/vo3vZ/src/solve.jl:634
  [5] __solve(prob::SDEProblem{…}, alg::SRIW1, timeseries::Vector{…}, ts::Vector{…}, ks::Nothing, recompile::Type{…}; kwargs::@Kwargs{})
    @ StochasticDiffEq ~/.julia/packages/StochasticDiffEq/vo3vZ/src/solve.jl:7
  [6] __solve (repeats 5 times)
    @ ~/.julia/packages/StochasticDiffEq/vo3vZ/src/solve.jl:1 [inlined]
  [7] #solve_call#44
    @ ~/.julia/packages/DiffEqBase/R2Vjs/src/solve.jl:634 [inlined]
  [8] solve_call
    @ ~/.julia/packages/DiffEqBase/R2Vjs/src/solve.jl:591 [inlined]
  [9] #solve_up#53
    @ ~/.julia/packages/DiffEqBase/R2Vjs/src/solve.jl:1122 [inlined]
 [10] solve_up
    @ ~/.julia/packages/DiffEqBase/R2Vjs/src/solve.jl:1101 [inlined]
 [11] #solve#51
    @ ~/.julia/packages/DiffEqBase/R2Vjs/src/solve.jl:1038 [inlined]
 [12] solve(prob::SDEProblem{…}, args::SRIW1)
    @ DiffEqBase ~/.julia/packages/DiffEqBase/R2Vjs/src/solve.jl:1028

which does not happen when the noise process is not provided or when then integrator is EM().

Environment:

  • Output of using Pkg; Pkg.status()
Status `~/.julia/environments/v1.11/Project.toml`
  [13f3f980] CairoMakie v0.13.1
  [459566f4] DiffEqCallbacks v4.2.2
  [77a26b50] DiffEqNoiseProcess v5.24.1
  [2b0e0bc5] LanguageServer v4.5.1
  [bb33d45b] LuxCore v1.2.2
  [6f286f6a] MultivariateStats v0.10.3
  [1dea7af3] OrdinaryDiffEq v6.90.1
  [731186ca] RecursiveArrayTools v3.27.4
  [789caeaf] StochasticDiffEq v6.72.1
  [6fc51010] Surrogates v6.10.0
  [3a884ed6] UnPack v1.0.2
  [d49dbf32] WeightInitializers v1.1.1
  • Output of versioninfo()
versioninfo()
Julia Version 1.11.3
Commit d63adeda50d (2025-01-21 19:42 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 12 × Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, skylake)
Threads: 1 default, 0 interactive, 1 GC (on 12 virtual cores)
Environment:
  LD_LIBRARY_PATH = 
  JULIA_EDITOR = code
  JULIA_NUM_THREADS =

Is it just me? Can someone reproduce?

@ChrisRackauckas
Copy link
Member

using StochasticDiffEq, DiffEqNoiseProcess

f(u, p, t) = -u
g(u, p, t) = 1.0

w = WienerProcess(0.0, 0.0, 0.0)
prob = SDEProblem(f, g, 0.0, (0.0, 1.0), noise=w)
u = solve(prob, SRIW1())

You were just missing the Z process. It now prints a better error:

"Higher order solver requires extra Brownian process Z. Thus WienerProcess(t, W0)is insufficient, you must useWienerProcess(t, W0, Z0)whereZ is another Brownian process"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants