Trait ODENumericalMethod

Source
pub trait ODENumericalMethod<T, V, D = String>
where T: Real, V: State<T>, D: CallBackData,
{ // Required methods fn init<F>( &mut self, ode: &F, t0: T, tf: T, y: &V, ) -> Result<Evals, Error<T, V>> where F: ODE<T, V, D>; fn step<F>(&mut self, ode: &F) -> Result<Evals, Error<T, V>> where F: ODE<T, V, D>; fn t(&self) -> T; fn y(&self) -> &V; fn t_prev(&self) -> T; fn y_prev(&self) -> &V; fn h(&self) -> T; fn set_h(&mut self, h: T); fn status(&self) -> &Status<T, V, D>; fn set_status(&mut self, status: Status<T, V, D>); }
Expand description

ODENumericalMethod Trait for ODE NumericalMethods

ODE NumericalMethods implement this trait to solve ordinary differential equations. This step function is called iteratively to solve the ODE. By implementing this trait, different functions can use a user provided ODE solver to solve the ODE that fits their requirements.

Required Methods§

Source

fn init<F>( &mut self, ode: &F, t0: T, tf: T, y: &V, ) -> Result<Evals, Error<T, V>>
where F: ODE<T, V, D>,

Initialize ODENumericalMethod before solving ODE

§Arguments
  • system - System of ODEs to solve.
  • t0 - Initial time.
  • tf - Final time.
  • y - Initial state.
§Returns
  • Result<Evals, Error<T, V>> - Ok if initialization is successful,
Source

fn step<F>(&mut self, ode: &F) -> Result<Evals, Error<T, V>>
where F: ODE<T, V, D>,

Step through solving the ODE by one step

§Arguments
  • system - System of ODEs to solve.
§Returns
  • Result<Evals, Errors<T, V>> - Ok if step is successful with the number of function evaluations,
Source

fn t(&self) -> T

Access time of last accepted step

Source

fn y(&self) -> &V

Access solution of last accepted step

Source

fn t_prev(&self) -> T

Access time of previous accepted step

Source

fn y_prev(&self) -> &V

Access solution of previous accepted step

Source

fn h(&self) -> T

Access step size of next step

Source

fn set_h(&mut self, h: T)

Set step size of next step

Source

fn status(&self) -> &Status<T, V, D>

Status of solver

Source

fn set_status(&mut self, status: Status<T, V, D>)

Set status of solver

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for APCF4<T, V, D>

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for APCV4<T, V, D>

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for DOP853<T, V, D>

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for DOPRI5<T, V, D>

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for CashKarp<T, V, D>

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for Euler<T, V, D>

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for Heun<T, V, D>

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for Midpoint<T, V, D>

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for RK4<T, V, D>

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for RKF<T, V, D>

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for RKV65<T, V, D>

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for RKV98<T, V, D>

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for Ralston<T, V, D>

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for ThreeEights<T, V, D>

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for BackwardEuler<T, V, D>

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for CrankNicolson<T, V, D>

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for GaussLegendre4<T, V, D>

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for GaussLegendre6<T, V, D>

Source§

impl<T: Real, V: State<T>, D: CallBackData> ODENumericalMethod<T, V, D> for Radau5<T, V, D>