Skip to main content

VariableStepExplicit

Trait VariableStepExplicit 

Source
pub trait VariableStepExplicit<Y, U, V, T = Time>
where Self: Explicit<Y, U, V, T> + VariableStep<T>, Y: Differentiable<T> + Tensor, Derivative<Y, T>: Mul<Quantity<T>, Output = Y>, for<'a> &'a Y: Mul<Scalar, Output = Y> + Sub<&'a Y, Output = Y>, for<'a> &'a Derivative<Y, T>: Mul<Scalar, Output = Derivative<Y, T>> + Mul<Quantity<T>, Output = Y>, U: TensorVec<Item = Y>, V: TensorVec<Item = Derivative<Y, T>>,
{ type Tableau: EmbeddedTableau; // Provided methods fn integrate_variable_step( &self, function: impl FnMut(Quantity<T>, &Y) -> Result<Derivative<Y, T>, String>, time: &[Quantity<T>], initial_condition: Y, ) -> Result<(Times<T>, U, V), IntegrationError> where Self: InterpolateSolution<Y, U, V, T> { ... } fn interpolate_variable_step( time: &Times<T>, tp: &Times<T>, yp: &U, function: impl FnMut(Quantity<T>, &Y) -> Result<Derivative<Y, T>, String>, ) -> Result<(U, V), IntegrationError> { ... } fn slopes( function: impl FnMut(Quantity<T>, &Y) -> Result<Derivative<Y, T>, String>, y: &Y, t: Quantity<T>, dt: Quantity<T>, k: &mut [Derivative<Y, T>], y_trial: &mut Y, ) -> Result<(), String> { ... } fn error( &self, dt: Quantity<T>, k: &[Derivative<Y, T>], ) -> Result<Scalar, String> { ... } fn slopes_and_error( &self, function: impl FnMut(Quantity<T>, &Y) -> Result<Derivative<Y, T>, String>, y: &Y, t: Quantity<T>, dt: Quantity<T>, k: &mut [Derivative<Y, T>], y_trial: &mut Y, ) -> Result<Scalar, String> { ... } fn step( &self, function: impl FnMut(Quantity<T>, &Y) -> Result<Derivative<Y, T>, String>, y: &mut Y, t: &mut Quantity<T>, y_sol: &mut U, t_sol: &mut Times<T>, dydt_sol: &mut V, k_sol: &mut Vec<V>, dt: &mut Quantity<T>, k: &mut [Derivative<Y, T>], y_trial: &Y, e: Scalar, ) -> Result<(), String> { ... } fn time_step(&self, error: Scalar, tolerance: Scalar, dt: &mut Quantity<T>) { ... } }
Expand description

Variable-step explicit integrators for ordinary differential equations.

Required Associated Types§

Source

type Tableau: EmbeddedTableau

Butcher tableau of this method’s embedded pair.

Provided Methods§

Source

fn integrate_variable_step( &self, function: impl FnMut(Quantity<T>, &Y) -> Result<Derivative<Y, T>, String>, time: &[Quantity<T>], initial_condition: Y, ) -> Result<(Times<T>, U, V), IntegrationError>
where Self: InterpolateSolution<Y, U, V, T>,

Source

fn interpolate_variable_step( time: &Times<T>, tp: &Times<T>, yp: &U, function: impl FnMut(Quantity<T>, &Y) -> Result<Derivative<Y, T>, String>, ) -> Result<(U, V), IntegrationError>

Source

fn slopes( function: impl FnMut(Quantity<T>, &Y) -> Result<Derivative<Y, T>, String>, y: &Y, t: Quantity<T>, dt: Quantity<T>, k: &mut [Derivative<Y, T>], y_trial: &mut Y, ) -> Result<(), String>

Runge–Kutta stages and the propagating solution.

\mathbf{k}_i = \mathbf{f}\!\left(t + c_i h,\ \mathbf{y} + h \sum_{j<i} a_{ij}\, \mathbf{k}_j\right)
,\qquad
\mathbf{y}_{n+1} = \mathbf{y} + h \textstyle\sum_i b_i\,\mathbf{k}_i
Source

fn error( &self, dt: Quantity<T>, k: &[Derivative<Y, T>], ) -> Result<Scalar, String>

Embedded local-error estimate reduced through the error norm.

e_{n+1} = \Big\Vert h \textstyle\sum_i d_i\,\mathbf{k}_i \Big\Vert
Source

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

Source

fn step( &self, function: impl FnMut(Quantity<T>, &Y) -> Result<Derivative<Y, T>, String>, y: &mut Y, t: &mut Quantity<T>, y_sol: &mut U, t_sol: &mut Times<T>, dydt_sol: &mut V, k_sol: &mut Vec<V>, dt: &mut Quantity<T>, k: &mut [Derivative<Y, T>], y_trial: &Y, e: Scalar, ) -> Result<(), String>

Source

fn time_step(&self, error: Scalar, tolerance: Scalar, dt: &mut Quantity<T>)

Provides the adaptive time step as a function of the error.

h_{n+1} = \beta h \left(\frac{e_\mathrm{tol}}{e_{n+1}}\right)^{1/p}

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<Y, U, V, T> VariableStepExplicit<Y, U, V, T> for BogackiShampine
where Self: Explicit<Y, U, V, T>, Y: Differentiable<T> + Div<Quantity<T>, Output = Derivative<Y, T>> + Tensor, Derivative<Y, T>: Mul<Quantity<T>, Output = Y>, for<'a> &'a Y: Mul<Scalar, Output = Y> + Sub<&'a Y, Output = Y>, for<'a> &'a Derivative<Y, T>: Mul<Scalar, Output = Derivative<Y, T>> + Mul<Quantity<T>, Output = Y>, U: TensorVec<Item = Y>, V: TensorVec<Item = Derivative<Y, T>>,

Source§

impl<Y, U, V, T> VariableStepExplicit<Y, U, V, T> for DormandPrince
where Self: Explicit<Y, U, V, T>, Y: Differentiable<T> + Tensor, Derivative<Y, T>: Mul<Quantity<T>, Output = Y>, for<'a> &'a Y: Mul<Scalar, Output = Y> + Sub<&'a Y, Output = Y>, for<'a> &'a Derivative<Y, T>: Mul<Scalar, Output = Derivative<Y, T>> + Mul<Quantity<T>, Output = Y>, U: TensorVec<Item = Y>, V: TensorVec<Item = Derivative<Y, T>>,

Source§

impl<Y, U, V, T> VariableStepExplicit<Y, U, V, T> for Verner8
where Self: Explicit<Y, U, V, T>, Y: Differentiable<T> + Tensor, Derivative<Y, T>: Mul<Quantity<T>, Output = Y>, for<'a> &'a Y: Mul<Scalar, Output = Y> + Sub<&'a Y, Output = Y>, for<'a> &'a Derivative<Y, T>: Mul<Scalar, Output = Derivative<Y, T>> + Mul<Quantity<T>, Output = Y>, U: TensorVec<Item = Y>, V: TensorVec<Item = Derivative<Y, T>>,

Source§

impl<Y, U, V, T> VariableStepExplicit<Y, U, V, T> for Verner9
where Self: Explicit<Y, U, V, T>, Y: Differentiable<T> + Tensor, Derivative<Y, T>: Mul<Quantity<T>, Output = Y>, for<'a> &'a Y: Mul<Scalar, Output = Y> + Sub<&'a Y, Output = Y>, for<'a> &'a Derivative<Y, T>: Mul<Scalar, Output = Derivative<Y, T>> + Mul<Quantity<T>, Output = Y>, U: TensorVec<Item = Y>, V: TensorVec<Item = Derivative<Y, T>>,