When specifying the saveat
keyword, the extraction of local sensitivites seems to fail.
The example is from the official documentation:
using DifferentialEquations
using DiffEqSensitivity
function f(du,u,p,t)
du[1] = dx = p[1]*u[1] - p[2]*u[1]*u[2]
du[2] = dy = -p[3]*u[2] + u[1]*u[2]
end
p = [1.5,1.0,3.0]
prob = ODELocalSensitivityProblem(f,[1.0;1.0],(0.0,10.0),p)
sol = solve(prob, saveat = [1.,2.], save_idxs = [2])
x,dp = extract_local_sensitivities(sol) # throws error
The error that is thrown says attempt to access 1x2 OrdinaryDiffEq.ODECompositeSolution{[...] at index [1:2, Base.Slice(Base.OneTo(2))]