ImplicitMidpoint

Struct ImplicitMidpoint 

Source
pub struct ImplicitMidpoint { /* private fields */ }
Expand description

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

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

  1. Also known as the implicit midpoint method. 

Trait Implementations§

Source§

impl Debug for Midpoint

Source§

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

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

impl Default for Midpoint

Source§

fn default() -> Midpoint

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

impl FixedStep for Midpoint

Source§

fn dt(&self) -> Scalar

Returns the time step.
Source§

impl<Y, J, U> ImplicitFirstOrder<Y, J, U> for Midpoint
where Y: Tensor, for<'a> &'a Y: Mul<Scalar, Output = Y> + Add<&'a Y, Output = Y> + Sub<&'a Y, Output = Y>, J: Tensor + TensorArray, U: TensorVec<Item = Y>,

Source§

fn hessian( &self, jacobian: impl FnMut(Scalar, &Y) -> Result<J, IntegrationError>, t: Scalar, y: &Y, _t_trial: Scalar, y_trial: &Y, dt: Scalar, ) -> Result<J, String>

Source§

fn integrate( &self, function: impl FnMut(Scalar, &Y) -> Result<Y, IntegrationError>, jacobian: impl FnMut(Scalar, &Y) -> Result<J, IntegrationError>, time: &[Scalar], initial_condition: Y, solver: impl FirstOrderRootFinding<Y, J, Y>, ) -> Result<(Vector, U, U), IntegrationError>

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

impl<Y, U> ImplicitZerothOrder<Y, U> for Midpoint
where Y: Tensor, for<'a> &'a Y: Mul<Scalar, Output = Y> + Add<&'a Y, Output = Y> + Sub<&'a Y, Output = Y>, U: TensorVec<Item = Y>,

Source§

fn residual( &self, function: impl FnMut(Scalar, &Y) -> Result<Y, IntegrationError>, t: Scalar, y: &Y, _t_trial: Scalar, y_trial: &Y, dt: Scalar, ) -> Result<Y, String>

Source§

fn integrate( &self, function: impl FnMut(Scalar, &Y) -> Result<Y, IntegrationError>, time: &[Scalar], initial_condition: Y, solver: impl ZerothOrderRootFinding<Y>, ) -> Result<(Vector, U, U), IntegrationError>

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

impl<Y, U> OdeSolver<Y, U> for Midpoint
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<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, 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.