pub fn integrate<const N: usize, F>(
y: &mut [f64; N],
t: f64,
dt: f64,
h_max: f64,
f: F,
) -> usizeExpand description
Integrate y' = f(t, y) from t to t + dt in equal RK4 substeps no longer than
h_max, returning how many were taken (CORE-R37).
dt ≤ 0or non-finite: nothing happens,fis never called, returns 0.- Steps:
ceil(dt / h_max)(with a 1e-9 relative slack for exact multiples), at least 1 and at mostMAX_STEPS. h_maxbelowMIN_STEP(including 0, negative, NaN) is raised toMIN_STEP;h_max = +∞means a single step.
Substep times are computed as t + i·h, not accumulated, so they do not drift.