solve_euler

Function solve_euler 

Source
pub fn solve_euler<F>(
    f: F,
    x0: f64,
    y0: f64,
    x_end: f64,
    step: f64,
) -> Result<Vec<(f64, f64)>, ODEError>
where F: Fn(f64, f64) -> f64,
Expand description

Solves a first-order ODE using Euler method with Result type

§Arguments

  • f - The derivative function f(x, y)
  • x0 - Initial x value
  • y0 - Initial y value
  • x_end - Final x value
  • step - Step size

§Returns

Result containing vector of (x, y) solution points