Skip to main content

solve_ivp

Function solve_ivp 

Source
pub fn solve_ivp<F, J>(
    f: F,
    jac: Option<J>,
    t_span: (f64, f64),
    y0: &[f64],
    method: IvpMethod,
    options: IvpOptions,
    events: &[Event<'_>],
) -> Result<IvpSolution, ErrorsJSL>
where F: Fn(f64, &[f64]) -> Vec<f64>, J: Fn(f64, &[f64]) -> Vec<Vec<f64>>,
Expand description

Solves y' = f(t, y), y(t0) = y0 on [t0, t1] (t1 > t0) with the given method (SciPy’s solve_ivp), returning every accepted step, the dense output, and the occurrences of each event. jac, if given, returns ∂f/∂y as rows; otherwise forward differences are used.

After each step, every event function is evaluated at the new point; where its sign changes in the requested direction, the zero is found by Brent’s method on the step’s interpolant. A terminal event that reaches its count ends the integration there.