Trait DDENumericalMethod

Source
pub trait DDENumericalMethod<const L: usize, T, V, H, D = String>
where T: Real, V: State<T>, H: Fn(T) -> V, D: CallBackData,
{ // Required methods fn init<F>( &mut self, dde: &F, t0: T, tf: T, y0: &V, phi: H, ) -> Result<Evals, Error<T, V>> where F: DDE<L, T, V, D>; fn step<F>(&mut self, dde: &F) -> Result<Evals, Error<T, V>> where F: DDE<L, 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

DDENumericalMethod Trait for DDE NumericalMethods

DDE NumericalMethods implement this trait to solve delay differential equations. The step function is called iteratively by a solver function (like solve_dde) to advance the solution.

Required Methods§

Source

fn init<F>( &mut self, dde: &F, t0: T, tf: T, y0: &V, phi: H, ) -> Result<Evals, Error<T, V>>
where F: DDE<L, T, V, D>,

Initialize DDENumericalMethod before solving DDE.

§Arguments
  • dde - System of DDEs to solve.
  • t0 - Initial time.
  • tf - Final time.
  • y0 - Initial state at t0.
  • phi - Initial history function phi(t) returning state V for t <= t0.
§Returns
  • Result<NumEvals, Error<T, V>> - Ok(evals) if initialization is successful, Err otherwise.
Source

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

Perform one integration step for the DDE.

§Arguments
  • dde - System of DDEs to solve.
§Returns
  • Result<NumEvals, Error<T, V>> - Ok(evals) if step is successful, Err otherwise.
Source

fn t(&self) -> T

Access time of the current state (end of the last accepted step).

Source

fn y(&self) -> &V

Access solution state y at the current time t.

Source

fn t_prev(&self) -> T

Access time at the beginning of the last accepted step.

Source

fn y_prev(&self) -> &V

Access solution state y at the beginning of the last accepted step.

Source

fn h(&self) -> T

Access the proposed step size h for the next step attempt.

Source

fn set_h(&mut self, h: T)

Set the step size h for the next step attempt.

Source

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

Get the current status of the solver (Solving, Complete, Error, etc.).

Source

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

Set the status of the 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<const L: usize, T: Real, V: State<T>, H: Fn(T) -> V, D: CallBackData> DDENumericalMethod<L, T, V, H, D> for BS23<L, T, V, H, D>

Source§

impl<const L: usize, T: Real, V: State<T>, H: Fn(T) -> V, D: CallBackData> DDENumericalMethod<L, T, V, H, D> for DOPRI5<L, T, V, H, D>