Skip to main content

BackwardDifferentiationFormula

Struct BackwardDifferentiationFormula 

Source
pub struct BackwardDifferentiationFormula<E, T: Real, Y: State<T>> {
Show 13 fields pub h0: T, pub rtol: Tolerance<T>, pub atol: Tolerance<T>, pub h_max: T, pub h_min: T, pub max_steps: usize, pub safety_factor: T, pub min_scale: T, pub max_scale: T, pub filter: fn(T) -> T, pub newton_tol: T, pub max_newton_iter: usize, pub max_order: usize, /* private fields */
}
Expand description

Adaptive variable-order Backward Differentiation Formula solver.

Uses Backward Differentiation Formula orders 1-5 with automatic order and step size selection. Newton iteration resolves the implicit Backward Differentiation Formula equations. Dense output via polynomial interpolation is supported.

The solver starts at order 1 and considers increasing the order after enough successful steps. On step rejection, the order is decreased.

Fields§

§h0: T§rtol: Tolerance<T>§atol: Tolerance<T>§h_max: T§h_min: T§max_steps: usize§safety_factor: T§min_scale: T§max_scale: T§filter: fn(T) -> T§newton_tol: T§max_newton_iter: usize§max_order: usize

Implementations§

Source§

impl<E, T: Real, Y: State<T>> BackwardDifferentiationFormula<E, T, Y>

Source

pub fn adaptive() -> Self

Source

pub fn rtol<V: Into<Tolerance<T>>>(self, rtol: V) -> Self

Source

pub fn atol<V: Into<Tolerance<T>>>(self, atol: V) -> Self

Source

pub fn h0(self, h0: T) -> Self

Source

pub fn h_min(self, h_min: T) -> Self

Source

pub fn h_max(self, h_max: T) -> Self

Source

pub fn max_steps(self, max_steps: usize) -> Self

Source

pub fn safety_factor(self, safety_factor: T) -> Self

Source

pub fn newton_tol(self, newton_tol: T) -> Self

Source

pub fn max_newton_iter(self, max_newton_iter: usize) -> Self

Source

pub fn max_order(self, max_order: usize) -> Self

Source

pub fn filter(self, filter: fn(T) -> T) -> Self

Source

pub fn order(&self) -> usize

Trait Implementations§

Source§

impl<E, T: Real, Y: State<T>> Default for BackwardDifferentiationFormula<E, T, Y>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T: Real, Y: State<T>> Interpolation<T, Y> for BackwardDifferentiationFormula<Ordinary, T, Y>

Source§

fn interpolate(&mut self, t_interp: T) -> Result<Y, Error<T, Y>>

Evaluate the step-local interpolant at the given time. Read more
Source§

impl<T: Real, Y: State<T>> OrdinaryNumericalMethod<T, Y> for BackwardDifferentiationFormula<Ordinary, T, Y>

Source§

fn init<F>( &mut self, ode: &F, t0: T, tf: T, y0: &Y, ) -> Result<Evals, Error<T, Y>>
where F: ODE<T, Y> + ?Sized,

Initialize the solver before integration Read more
Source§

fn step<F>(&mut self, ode: &F) -> Result<Evals, Error<T, Y>>
where F: ODE<T, Y> + ?Sized,

Advance the solution by one step Read more
Source§

fn t(&self) -> T

Time of last accepted step
Source§

fn y(&self) -> &Y

State at last accepted step
Source§

fn t_prev(&self) -> T

Time of previous accepted step
Source§

fn y_prev(&self) -> &Y

State at previous accepted step
Source§

fn h(&self) -> T

Step size for next step
Source§

fn set_h(&mut self, h: T)

Set step size for next step
Source§

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

Current solver status
Source§

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

Set solver status

Auto Trait Implementations§

§

impl<E, T, Y> Freeze for BackwardDifferentiationFormula<E, T, Y>
where T: Freeze, Y: Freeze,

§

impl<E, T, Y> RefUnwindSafe for BackwardDifferentiationFormula<E, T, Y>

§

impl<E, T, Y> Send for BackwardDifferentiationFormula<E, T, Y>
where Y: Send, E: Send,

§

impl<E, T, Y> Sync for BackwardDifferentiationFormula<E, T, Y>
where Y: Sync, E: Sync,

§

impl<E, T, Y> Unpin for BackwardDifferentiationFormula<E, T, Y>
where T: Unpin, Y: Unpin, E: Unpin,

§

impl<E, T, Y> UnsafeUnpin for BackwardDifferentiationFormula<E, T, Y>
where T: UnsafeUnpin, Y: UnsafeUnpin,

§

impl<E, T, Y> UnwindSafe for BackwardDifferentiationFormula<E, T, Y>
where T: UnwindSafe, Y: UnwindSafe, E: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.