Skip to main content

euler_method

Function euler_method 

Source
pub fn euler_method(
    f: &dyn Fn(f64, f64) -> f64,
    t0: f64,
    y0: f64,
    t_end: f64,
    steps: u32,
) -> Vec<(f64, f64)>
Expand description

Solve dy/dt = f(t, y) from t0 to t_end using the Euler method.

Returns a vector of (t, y) pairs.