[][src]Function peroxide::numerical::gauss_legendre::gl4

pub fn gl4<F>(
    f: F,
    t_init: f64,
    y_init: Vec<f64>,
    h: f64,
    rtol: f64,
    num: usize
) -> Matrix where
    F: Fn(Dual, Vec<Dual>) -> Vec<Dual> + Copy

Gauss-Legendre 4th order method

Description

1. Find k1, k2

  • k1 = f(t + p0*h, y + h(p1*k1 + p2*k2))
  • k2 = f(t + q0*h, y + h(q1*k1 + q2*k2))

2. Iteration

  • y_{n+1} = y_n + 0.5*h*(k1 + k2)