I am getting strange behavior with the different versions of save_at
and save_start
and save_end
. Here is a MWE:
using DifferentialEquations
function exponen!(du, u, param, t)
du[1] = -u[1]
end
tspan = (0., 3.)
prob = ODEProblem(exponen!, [2.], tspan)
solve(prob, Tsit5(), saveat=[0.2, 1.3], save_start=false, save_end=false)
I expect the solution at the two times 0.2 and 1.3 to be printed. This is what happens. Next, I explicitly add the start and end times to saveat
, and specify that save_start
and save_end
are false. I expect the solution at four times to be printed. However, only there are printed.
sol = solve(prob, Tsit5(), saveat=[0., 0.2, 1.3, 3.], save_start=false, save_end=false)
println("sol.t: ", sol.t)
prints:
sol.t: [0.2, 1.3, 3.0]
If anything, either the first and last time points should be printed or not printed. How can the observed behavior (with Julia 1.8.3) be explained? Thanks.