Expand description
Event detection and handling for ODE solvers.
This module provides zero-crossing detection (event detection) during ODE integration. Events are defined by a function g(t, y) that crosses zero. When a sign change is detected between steps, bisection is used to locate the precise crossing time.
§Example
use numra_ode::events::{EventFunction, EventDirection, EventAction};
struct GroundContact;
impl EventFunction<f64> for GroundContact {
fn evaluate(&self, _t: f64, y: &[f64]) -> f64 {
y[0] // Event when height = 0
}
fn direction(&self) -> EventDirection {
EventDirection::Falling // Only detect when falling through zero
}
fn action(&self) -> EventAction {
EventAction::Stop // Stop integration at event
}
}Author: Moussa Leblouba Date: 5 March 2026 Modified: 2 May 2026
Structs§
- Event
- Recorded event information.
Enums§
- Event
Action - Action to take when an event is detected.
- Event
Direction - Direction of zero-crossing to detect.
Traits§
- Event
Function - Trait for event functions.
Functions§
- find_
event_ time - Find the time of a zero-crossing of the event function in [t_lo, t_hi] using bisection.