Moved from SciML/StochasticDelayDiffEq.jl#52.
Using saveat with SDDE problems causes the history function to return incorrect values. When solving without saveat, the history function evaluates correctly, but adding saveat changes the results.
Reproducer (adapted for new DelayDiffEq-based SDDE):
using DelayDiffEq, StochasticDiffEqLowOrder
function f(du, u, h, p, t)
du[1] = -u[1]
println(h(p, t - 0.001))
end
function g(du, u, h, p, t)
du[1] = 0.1
end
tspan = (0.0, 0.1)
h(p, t) = 0.0
u0 = [0.0]
prob = SDDEProblem(f, g, u0, h, tspan, 0.0, constant_lags = [0.001])
sol = solve(prob, MethodOfSteps(EM()), dt = 0.01) # correct
sol = solve(prob, MethodOfSteps(EM()), dt = 0.01, saveat = 0.1) # incorrect history
The history function should return the same values regardless of saveat.
Moved from SciML/StochasticDelayDiffEq.jl#52.
Using
saveatwith SDDE problems causes the history function to return incorrect values. When solving withoutsaveat, the history function evaluates correctly, but addingsaveatchanges the results.Reproducer (adapted for new DelayDiffEq-based SDDE):
The history function should return the same values regardless of
saveat.