Skip to main content

rk4_integrate

Function rk4_integrate 

Source
pub fn rk4_integrate<F>(
    f: &F,
    t0: f64,
    y0: &[f64],
    t1: f64,
    steps: usize,
) -> Vec<f64>
where F: Fn(f64, &[f64]) -> Vec<f64>,
Expand description

Integrate y' = f(t, y) from t0 to t1 in steps equal RK4 steps; returns the final state. steps is clamped to ≥ 1.