Open topolarity opened 11 months ago
Like the output suggests, using autodiff=false
does the trick,
using LinearAlgebra, OrdinaryDiffEq, SciMLSensitivity
function circuit(du, u, p, t)
L, C = p
du[1] = (-u[1] - u[2] + sin(t)) / C
du[2] = (u[1] - u[2])/L
end
u0 = zeros(2)
tspan = (0.0, 2*pi)
p = [1.0, 1.0]
sprob = ODEForwardSensitivityProblem(circuit, p, tspan, p)
sol = solve(sprob, Rosenbrock23(autodiff=false))
I think it is vaguely related to this issue #35 .
Note that I need to use tspan = (0.0, 2pi)
instead of tspan = (0, 2pi)
gives a MethodError when attempting to use autodiff: