pub trait ODEIVP<S, T: ComplexFloat> {
// Required methods
fn rhs(&mut self, t: f64, y: &[T], rhs: &mut [T]);
fn initial_state(&mut self) -> (f64, Vec<T>);
fn end_step(&mut self, t: f64, y: &[T], solver: &S) -> StopCondition;
fn final_state(&mut self, t: f64, y: Vec<T>);
}
Expand description
General trait implementing an initial value problem in the form of an ordinary differential equation
Note: The generic type S can be used to pass additional information from the solver to the post-step processing. To prevent infinite recursion on trait bound checking, it is not constrained to ExplicitODESolver. Any other type is useless in this context anyway.
Required Methods§
sourcefn rhs(&mut self, t: f64, y: &[T], rhs: &mut [T])
fn rhs(&mut self, t: f64, y: &[T], rhs: &mut [T])
Returns right hand side (i.e. the value of f
) of IVP y'=f(t,y)
sourcefn initial_state(&mut self) -> (f64, Vec<T>)
fn initial_state(&mut self) -> (f64, Vec<T>)
Returns initial state (t_0, y_0)
such that y(t_0) = y_0
sourcefn end_step(&mut self, t: f64, y: &[T], solver: &S) -> StopCondition
fn end_step(&mut self, t: f64, y: &[T], solver: &S) -> StopCondition
Called at the end of each integration step (and once for t_0
)
sourcefn final_state(&mut self, t: f64, y: Vec<T>)
fn final_state(&mut self, t: f64, y: Vec<T>)
Called at the end of integration giving back the state taken in initial_state