You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I tried to set the "save_positions = (false, true)" to only save the state values after the event, but failed. It still saved the values before and after the event (“double save” ). Please see the below:
using DifferentialEquations, Plots
functionf(du, u, p, t)
du[1] =-u[1]
end
u0 = [10.0]
prob =ODEProblem(f, u0, (0.0, 10.0))
condition(u, t, integrator) = t ==4affect!(integrator) = integrator.u[1] +=10
cb =DiscreteCallback(condition, affect!; save_positions = (false, true))
sol =solve(prob, Tsit5(), callback = cb, tstops = [4])
sol.t
yunan-l
changed the title
Callback's argument "save_positions = (true, true)" dosen't work when is set to "save_positions = (false, true)"
Callback dosen't work when is set to "save_positions = (false, true)"
Aug 11, 2024
Hi, I tried to set the "save_positions = (false, true)" to only save the state values after the event, but failed. It still saved the values before and after the event (“double save” ). Please see the below:
Is this a bug?
The text was updated successfully, but these errors were encountered: