The implementation is inspired by SciPy but has been reorganized for clarity.
We use a simple and newly incorporated into nbkode bisection method instead of brentq as it is not avaible for numba (yet)
There are two classes: Event and EventHandler (which maybe is better to rename to MultiEvent). As they both share the same API, it might be good to avoid EventHandler when a single event is tracked.
The examples (see below) is taken from the SciPy docs, but it uses AdamsBashforth1 instead of RungeKutta45. To yield good results with RungeKutta45 we will need to implement the proper interpolator.
I think the SciPy implementation appends to t the termination time if triggered by an event. If that is the case, I think we should do it.
See #13
A few comments:
brentq
as it is not avaible for numba (yet)Event
andEventHandler
(which maybe is better to rename toMultiEvent
). As they both share the same API, it might be good to avoidEventHandler
when a single event is tracked.AdamsBashforth1
instead ofRungeKutta45
. To yield good results withRungeKutta45
we will need to implement the proper interpolator.t
the termination time if triggered by an event. If that is the case, I think we should do it.