pub struct EulerMethod {
pub h: f64,
}Expand description
Single-step Euler method solver.
Fields§
§h: f64Step size h
Implementations§
Source§impl EulerMethod
impl EulerMethod
Sourcepub fn step(&self, f: &dyn Fn(f64, f64) -> f64, t: f64, y: f64) -> f64
pub fn step(&self, f: &dyn Fn(f64, f64) -> f64, t: f64, y: f64) -> f64
Perform one Euler step: y_{n+1} = y_n + h f(t_n, y_n).
Sourcepub fn solve_to(
&self,
f: &dyn Fn(f64, f64) -> f64,
t0: f64,
y0: f64,
t_end: f64,
) -> Vec<(f64, f64)>
pub fn solve_to( &self, f: &dyn Fn(f64, f64) -> f64, t0: f64, y0: f64, t_end: f64, ) -> Vec<(f64, f64)>
Solve from t0 to t_end, returning (t, y) pairs.
Sourcepub fn global_error_o_h(&self) -> f64
pub fn global_error_o_h(&self) -> f64
Global error is O(h): returns h as a proxy for the error constant.
Auto Trait Implementations§
impl Freeze for EulerMethod
impl RefUnwindSafe for EulerMethod
impl Send for EulerMethod
impl Sync for EulerMethod
impl Unpin for EulerMethod
impl UnsafeUnpin for EulerMethod
impl UnwindSafe for EulerMethod
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more