pub struct EventDetection {
pub tol: f64,
pub max_iter: usize,
}Expand description
Zero-crossing event detection via bisection root-finding.
After each ODE step, each registered event function g_i(t, y) is
evaluated. If the sign of g_i changes, bisection is used to locate the
crossing time to within tol.
Fields§
§tol: f64Bisection tolerance for the event time.
max_iter: usizeMaximum bisection iterations.
Implementations§
Source§impl EventDetection
impl EventDetection
Sourcepub fn new(tol: f64, max_iter: usize) -> Self
pub fn new(tol: f64, max_iter: usize) -> Self
Construct with specified tolerance and iteration limit.
Sourcepub fn default_params() -> Self
pub fn default_params() -> Self
Construct with default parameters.
Sourcepub fn detect<E>(
&self,
s_a: &OdeState,
s_b: &OdeState,
events: &[E],
) -> Vec<CrossingEvent>
pub fn detect<E>( &self, s_a: &OdeState, s_b: &OdeState, events: &[E], ) -> Vec<CrossingEvent>
Detect zero crossings of events[i](t, y) between states s_a and s_b.
Returns a list of CrossingEvent sorted by time. Uses linear
interpolation of the state and bisection on each event function.
Auto Trait Implementations§
impl Freeze for EventDetection
impl RefUnwindSafe for EventDetection
impl Send for EventDetection
impl Sync for EventDetection
impl Unpin for EventDetection
impl UnsafeUnpin for EventDetection
impl UnwindSafe for EventDetection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.