-
-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autodiff error while using callbacks even when autodiff=false #1480
Comments
I have one more test that fails. using OrdinaryDiffEq
function f(u::Vector{Float64},p,t::Float64)
[u[2],
-p,
u[4],
0.0]
end
function condition(out,u,t,integrator) # Event when event_f(u,t) == 0
out[1] = u[1]
out[2] = (u[3] - 10.0)u[3]
end
function affect!(integrator, idx)
if idx == 1
integrator.u[2] = -0.9integrator.u[2]
elseif idx == 2
integrator.u[4] = -0.9integrator.u[4]
end
end
cb = VectorContinuousCallback(condition,affect!,2)
u0 = [50.0,0.0,0.0,2.0]
tspan = (0.0,15.0)
p = 9.8
prob = ODEProblem(f,u0,tspan,p)
sol = solve(prob,Rosenbrock23(autodiff=false),callback=cb) fails with:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following MWE:
gives the following error:
The text was updated successfully, but these errors were encountered: