Do solvers in DifferentialEquations.jl
count the number of integration steps they used? length(sol)
is close because it returns the number of recorded solutions, but if I use save_everystep=false
for speedup, length(sol)
is 2
because only the initial and final solutions are recorded.
For example,
using DifferentialEquations
f(u,p,t) = 1.01*u
u0 = 1/2
tspan = (0.0,1.0)
prob = ODEProblem(f,u0,tspan)
sol = solve(prob)
gives length(sol)==5
, but if I change the last line to
sol = solve(prob, save_everystep=false)
then I get length(sol)==2
.
I think I can count the number of integration steps using DiscreteCallback
, but I want to make sure I am not reinventing the wheel.