Skip to main content

BackwardEuler

Struct BackwardEuler 

Source
pub struct BackwardEuler {
    pub dt: Scalar,
}
Expand description

Implicit, single-stage, first-order, fixed-step, Runge-Kutta method.1

\frac{dy}{dt} = f(t, y)
t_{n+1} = t_n + h
k_1 = f(t_{n+1}, y_{n+1})
y_{n+1} = y_n + hk_1

  1. Also known as the backward Euler method. ↩

Fields§

§dt: Scalar

Fixed value for the time step.

Trait Implementations§

Source§

impl Debug for BackwardEuler

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BackwardEuler

Source§

fn default() -> BackwardEuler

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

impl<T> FixedStep<T> for BackwardEuler

Source§

fn dt(&self) -> Quantity<T>

Returns the time step.
Source§

impl<Y, J, U, V, T> Implicit<Y, J, U, V, T> for BackwardEuler
where Y: Differentiable<T> + Tensor, Derivative<Y, T>: Mul<Quantity<T>, Output = Y>, J: Differentiable<T> + Tensor + TensorArray, Derivative<J, T>: Mul<Quantity<T>, Output = J>, for<'a> &'a Y: Sub<&'a Y, Output = Y>, U: TensorVec<Item = Y>, V: TensorVec<Item = Derivative<Y, T>>,

Source§

fn residual( &self, function: impl FnMut(Quantity<T>, &Y) -> Result<Derivative<Y, T>, IntegrationError>, _t: Quantity<T>, y: &Y, t_trial: Quantity<T>, y_trial: &Y, dt: Quantity<T>, ) -> Result<Y, String>

Source§

fn hessian( &self, jacobian: impl FnMut(Quantity<T>, &Y) -> Result<Derivative<J, T>, IntegrationError>, _t: Quantity<T>, _y: &Y, t_trial: Quantity<T>, y_trial: &Y, dt: Quantity<T>, ) -> Result<J, String>

Source§

fn integrate( &self, function: impl FnMut(Quantity<T>, &Y) -> Result<Derivative<Y, T>, IntegrationError>, jacobian: impl FnMut(Quantity<T>, &Y) -> Result<Derivative<J, T>, IntegrationError>, time: &[Quantity<T>], initial_condition: Y, solver: impl RootFinding<Y, J, Y>, ) -> Result<(Times<T>, U, V), IntegrationError>

Solves an initial value problem by implicitly integrating a system of ordinary differential equations. Read more
Source§

impl<X, F, J, UX, UR, T> ImplicitRates<X, F, J, UX, UR, T> for BackwardEuler
where X: Differentiable<T> + Tensor, Derivative<X, T>: Tensor, for<'a, 'a> &'a X: Sub<&'a X, Output = X> + Div<Quantity<T>, Output = Derivative<X, T>>, UX: TensorVec<Item = X>, UR: TensorVec<Item = Derivative<X, T>>,

Source§

fn integrate( &self, rate: impl FnMut(Quantity<T>, &X) -> Result<Derivative<X, T>, String>, residual: impl FnMut(Quantity<T>, &X, &Derivative<X, T>) -> Result<F, String>, tangent: impl FnMut(Quantity<T>, &X, &Derivative<X, T>, Quantity<T>) -> Result<J, String>, solver: impl RootFinding<F, J, X>, equality_constraint: impl Fn(Quantity<T>) -> EqualityConstraints, sparse: Option<SparseSolver>, time: &[Quantity<T>], initial_state: X, ) -> Result<(Times<T>, UX, UR), IntegrationError>

Solves an initial value problem for a first-order system, given the residual of the system as a function of time, state, and rate, and its tangent with respect to the state. Read more
Source§

impl<Y, U> OdeIntegrator<Y, U> for BackwardEuler
where Y: Tensor, U: TensorVec<Item = Y>,

Auto Trait Implementations§

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<A, B, C, I> Component<Coupled<A, B>, Left<I>> for C
where A: Layout, B: Layout, C: Component<A, I>,

Source§

const OFFSET: usize = const OFFSET: usize = C::OFFSET;

Source§

impl<A, B, C, I> Component<Coupled<A, B>, Right<I>> for C
where A: Layout, B: Layout, C: Component<B, I>,

Source§

const OFFSET: usize = const OFFSET: usize = A::STRIDE + C::OFFSET;

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<T> Is<T> for T

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.