Ralston

Struct Ralston 

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

Explicit, two-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, y_n)
k_2 = f(t_n + \tfrac{3}{4} h, y_n + \tfrac{3}{4} h k_1)
y_{n+1} = y_n + \frac{h}{3}\left(k_1 + 2 k_2\right)

  1. Also known as the Ralston method. 

Trait Implementations§

Source§

impl Debug for Ralston

Source§

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

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

impl Default for Ralston

Source§

fn default() -> Ralston

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

impl<Y, U> Explicit<Y, U> for Ralston
where Self: OdeSolver<Y, U>, Y: Tensor, for<'a> &'a Y: Mul<Scalar, Output = Y> + Add<Y, Output = Y>, U: TensorVec<Item = Y>,

Source§

const SLOPES: usize = 2

Source§

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

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

impl FixedStep for Ralston

Source§

fn dt(&self) -> Scalar

Returns the time step.
Source§

impl<Y, U> FixedStepExplicit<Y, U> for Ralston
where Self: OdeSolver<Y, U>, Y: Tensor, for<'a> &'a Y: Mul<Scalar, Output = Y> + Add<Y, Output = Y>, U: TensorVec<Item = Y>,

Source§

fn step( &self, function: impl FnMut(Scalar, &Y) -> Result<Y, String>, y: &Y, t: Scalar, dt: Scalar, k: &mut [Y], y_trial: &mut Y, ) -> Result<(), String>

Source§

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

Source§

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