Some discussion here DiffEqs: Hybrid (continuous+discrete) system / periodic callback - #39 by Ronis_BR