Skip to content

noise kwarg for SDEProblem(f::SDESystem) #3664

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

Open
ChristophHotter opened this issue May 27, 2025 · 2 comments
Open

noise kwarg for SDEProblem(f::SDESystem) #3664

ChristophHotter opened this issue May 27, 2025 · 2 comments

Comments

@ChristophHotter
Copy link

Creating an SDEProblem from a SDEFunction allows specifying the noise process as a kwarg.
Is there a way to specify the noise if I want to create a SDEProblem from a SDESystem? Maybe the noise kwarg could also be added to the SDEProblem function for SDESystems?

@AayushSabharwal
Copy link
Member

It should just be propagated if you provide the keyword argument

@ChristophHotter
Copy link
Author

I think it is not propagated correctly.
If I provide the kwarg noise=W in the SDEProblem, the noise is unchanged afterwards.

Here is an example, which shows that:

using StochasticDiffEq
using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D

@parameters σ ρ β
@variables x(t) y(t) z(t)

u0 = [1.0, 0.0, 0.0]
T = (0, 5.0)

eqs = [D(x) ~ σ*(y-x),
       D(y) ~ x*(ρ-z)-y,
       D(z) ~ x*y - β*z]
noiseeqs = [3,
            3,
            3]
@named sde_lorentz = SDESystem(eqs,noiseeqs,t,[x,y,z],[σ,ρ,β]; tspan = T)
sde_lorentz_c = complete(sde_lorentz)

ps = [σ, ρ, β]
p0 = [10, 28.0, 8/3]
parammap = ps .=> p0

W = StochasticDiffEq.RealWienerProcess(0.0, 0.0, 0.0; save_everystep=true)
prob_sde_lorenz = SDEProblem(sde_lorentz_c, u0, T, parammap; noise=W)

sol = solve(prob_sde_lorenz, SRIW1())

@show W 

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

No branches or pull requests

2 participants