How do I set up the condition and affect functions such that ODE solver terminates on second zero crossing?
Currently, I have the following setup for terminating on the first zero crossing.
function condition(z,t,integrator)
z[2]
end
function affect!(integrator)
terminate!(integrator)
end
cb = ContinuousCallback(condition,affect!)
prob = ODEProblem(EOM,ic,tspan,p)