added rootfinding to detect when y_i(t_i) = x and then do something. for instance, when a spike occurs, we have a discontinuity, so reinit the integrator at this time