Skip to main content

ODESolver

Trait ODESolver 

Source
pub trait ODESolver {
    // Required method
    fn solve<F>(
        f: F,
        y0: Vec<f64>,
        t_span: (f64, f64),
        dt: f64,
    ) -> (Vec<f64>, Vec<Vec<f64>>)
       where F: FnMut(f64, &Vec<f64>) -> Vec<f64>;
}

Required Methods§

Source

fn solve<F>( f: F, y0: Vec<f64>, t_span: (f64, f64), dt: f64, ) -> (Vec<f64>, Vec<Vec<f64>>)
where F: FnMut(f64, &Vec<f64>) -> Vec<f64>,

Solves an ODE system dy/dt = f(t, y) from t_start to t_end.

§Arguments
  • f - The derivative function f(t, y).
  • y0 - Initial state vector.
  • t_span - Tuple (t_start, t_end).
  • dt - Step size.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§