You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, when save_noise is not set, it defaults to false instead of true. As you can see in the example below, without save noise set it only saves the start and end points to the solution.
Secondly, when saveat is set to a time longer than the timestep, the noise process will save the noise at single every time step instead of when the timeseries is saved, which does not match the description above.
Expected behavior
Without setting save_noise, the solution object should contain a sol.W which is saved at the exact same timesteps as sol.t and sol.u.
Minimal Reproducible Examples 👇
Example 1: incorrectly defaults to false
using DifferentialEquations
functionou!(du, u, p, t)
du[1] =-10.0* u[1]
endfunctionσ_ou!(du, u, p, t)
du[1] =3.0end
prob_ou =SDEProblem(ou!, σ_ou!, [1.0], (0.0, 10.0))
sol =solve(prob_ou, saveat=0.1);
println("Solution length: $(length(sol.u)) Noise Length: $(length(sol.W))")
Solution length: 101 Noise Length: 2
Example 2: saves every timestep instead of at the timeseries
using DifferentialEquations
functionou!(du, u, p, t)
du[1] =-10.0* u[1]
endfunctionσ_ou!(du, u, p, t)
du[1] =3.0end
prob_ou =SDEProblem(ou!, σ_ou!, [1.0], (0.0, 10.0))
sol =solve(prob_ou, saveat=0.1, save_noise=true);
println("Solution length: $(length(sol.u)) Noise Length: $(length(sol.W))")
Solution length: 101 Noise Length: 24120
Environment (please complete the following information):
Output of using Pkg; Pkg.status()
julia>using Pkg; Pkg.status()
Status `\\levlabserver2.stanford.edu\commondrive\Users\hshunt\LabNotebooks\BugEnv\Project.toml`
[0c46a032] DifferentialEquations v7.13.0
Output of using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
Yeah that's a typo in the docs. It's intended to default to false because most of the time it's not needed and it's expensive to save. That was a simple fix SciML/DiffEqDocs.jl#744.
Example 2: saves every timestep instead of at the timeseries
Yes that's not intended, moving to StocahsticDiffEq.jl
Describe the bug 🐞
The docs describe the save_noise keyword for the solve function in following way:
Firstly, when save_noise is not set, it defaults to false instead of true. As you can see in the example below, without save noise set it only saves the start and end points to the solution.
Secondly, when saveat is set to a time longer than the timestep, the noise process will save the noise at single every time step instead of when the timeseries is saved, which does not match the description above.
Expected behavior
Without setting save_noise, the solution object should contain a sol.W which is saved at the exact same timesteps as sol.t and sol.u.
Minimal Reproducible Examples 👇
Example 1: incorrectly defaults to false
Solution length: 101 Noise Length: 2
Example 2: saves every timestep instead of at the timeseries
Solution length: 101 Noise Length: 24120
Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
The text was updated successfully, but these errors were encountered: