Verner8

Struct Verner8 

Source
pub struct Verner8 {
    pub abs_tol: Scalar,
    pub rel_tol: Scalar,
    pub dt_beta: Scalar,
    pub dt_expn: Scalar,
    pub dt_cut: Scalar,
    pub dt_min: Scalar,
}
Expand description

Explicit, thirteen-stage, eighth-order, variable-step, Runge-Kutta method.1

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

Fields§

§abs_tol: Scalar

Absolute error tolerance.

§rel_tol: Scalar

Relative error tolerance.

§dt_beta: Scalar

Multiplier for adaptive time steps.

§dt_expn: Scalar

Exponent for adaptive time steps.

§dt_cut: Scalar

Cut back factor for the time step.

§dt_min: Scalar

Minimum value for the time step.

Trait Implementations§

Source§

impl Debug for Verner8

Source§

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

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

impl Default for Verner8

Source§

fn default() -> Self

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

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

Source§

const SLOPES: usize = 13

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<Y, Z, U, V> ExplicitDaeVariableStepExplicit<Y, Z, U, V> for Verner8
where Y: Tensor, Z: Tensor, U: TensorVec<Item = Y>, V: TensorVec<Item = Z>, for<'a> &'a Y: Mul<Scalar, Output = Y> + Sub<&'a Y, Output = Y>,

Source§

fn slopes_solve( evolution: impl FnMut(Scalar, &Y, &Z) -> Result<Y, String>, solution: impl FnMut(Scalar, &Y, &Z) -> Result<Z, String>, y: &Y, z: &Z, t: Scalar, dt: Scalar, k: &mut [Y], y_trial: &mut Y, z_trial: &mut Z, ) -> Result<(), String>

Source§

fn integrate_explicit_dae_variable_step( &self, evolution: impl FnMut(Scalar, &Y, &Z) -> Result<Y, String>, solution: impl FnMut(Scalar, &Y, &Z) -> Result<Z, String>, time: &[Scalar], initial_condition: (Y, Z), ) -> Result<(Vector, U, U, V), IntegrationError>

Source§

fn interpolate_explicit_dae_variable_step( &self, evolution: impl FnMut(Scalar, &Y, &Z) -> Result<Y, String>, solution: impl FnMut(Scalar, &Y, &Z) -> Result<Z, String>, time: &Vector, tp: &Vector, yp: &U, zp: &V, ) -> Result<(U, U, V), IntegrationError>

Source§

fn slopes_solve_and_error( &self, evolution: impl FnMut(Scalar, &Y, &Z) -> Result<Y, String>, solution: impl FnMut(Scalar, &Y, &Z) -> Result<Z, String>, y: &Y, z: &Z, t: Scalar, dt: Scalar, k: &mut [Y], y_trial: &mut Y, z_trial: &mut Z, ) -> Result<Scalar, String>

Source§

fn step_solve( &self, evolution: impl FnMut(Scalar, &Y, &Z) -> Result<Y, String>, y: &mut Y, z: &mut Z, t: &mut Scalar, y_sol: &mut U, z_sol: &mut V, t_sol: &mut Vector, dydt_sol: &mut U, dt: &mut Scalar, _k: &mut [Y], y_trial: &Y, z_trial: &Z, e: Scalar, ) -> Result<(), String>

Source§

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

Source§

fn interpolate( &self, time: &Vector, tp: &Vector, yp: &U, function: impl FnMut(Scalar, &Y) -> Result<Y, String>, ) -> Result<(U, U), IntegrationError>

Solution interpolation.
Source§

impl VariableStep for Verner8

Source§

fn abs_tol(&self) -> Scalar

Returns the absolute error tolerance.
Source§

fn rel_tol(&self) -> Scalar

Returns the relative error tolerance.
Source§

fn dt_beta(&self) -> Scalar

Returns the multiplier for adaptive time steps.
Source§

fn dt_expn(&self) -> Scalar

Returns the exponent for adaptive time steps.
Source§

fn dt_cut(&self) -> Scalar

Returns the cut back factor for function errors.
Source§

fn dt_min(&self) -> Scalar

Returns the minimum value for the time step.
Source§

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

Source§

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

Source§

fn slopes( 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_variable_step( &self, function: impl FnMut(Scalar, &Y) -> Result<Y, String>, time: &[Scalar], initial_condition: Y, ) -> Result<(Vector, U, U), IntegrationError>

Source§

fn interpolate_variable_step( time: &Vector, tp: &Vector, yp: &U, function: impl FnMut(Scalar, &Y) -> Result<Y, String>, ) -> Result<(U, U), IntegrationError>

Source§

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

Source§

fn step( &self, function: impl FnMut(Scalar, &Y) -> Result<Y, String>, y: &mut Y, t: &mut Scalar, y_sol: &mut U, t_sol: &mut Vector, dydt_sol: &mut U, dt: &mut Scalar, _k: &mut [Y], y_trial: &Y, e: Scalar, ) -> Result<(), String>

Source§

fn time_step(&self, error: Scalar, dt: &mut Scalar)

Provides the adaptive time step as a function of the error. Read more
Source§

impl<Y, U> OdeIntegrator<Y, U> for Verner8
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<I, F, Y, Z, U, V> ExplicitDaeFirstOrderMinimize<F, Y, Z, U, V> for I
where I: ExplicitDaeVariableStepExplicitFirstOrderMinimize<F, Y, Z, U, V>, Y: Tensor, Z: Tensor, U: TensorVec<Item = Y>, V: TensorVec<Item = Z>, &'a Y: for<'a> Mul<f64, Output = Y> + for<'a> Sub<Output = Y>,

Source§

fn integrate( &self, evolution: impl FnMut(f64, &Y, &Z) -> Result<Y, String>, function: impl FnMut(f64, &Y, &Z) -> Result<F, String>, jacobian: impl FnMut(f64, &Y, &Z) -> Result<Z, String>, solver: impl FirstOrderOptimization<F, Z>, time: &[f64], initial_condition: (Y, Z), equality_constraint: impl FnMut(f64) -> EqualityConstraint, ) -> Result<(Vector, U, U, V), IntegrationError>

Source§

impl<I, F, J, Y, Z, U, V> ExplicitDaeFirstOrderRoot<F, J, Y, Z, U, V> for I
where I: ExplicitDaeVariableStepExplicitFirstOrderRoot<F, J, Y, Z, U, V>, Y: Tensor, Z: Tensor, U: TensorVec<Item = Y>, V: TensorVec<Item = Z>, &'a Y: for<'a> Mul<f64, Output = Y> + for<'a> Sub<Output = Y>,

Source§

fn integrate( &self, evolution: impl FnMut(f64, &Y, &Z) -> Result<Y, String>, function: impl FnMut(f64, &Y, &Z) -> Result<F, String>, jacobian: impl FnMut(f64, &Y, &Z) -> Result<J, String>, solver: impl FirstOrderRootFinding<F, J, Z>, time: &[f64], initial_condition: (Y, Z), equality_constraint: impl FnMut(f64) -> EqualityConstraint, ) -> Result<(Vector, U, U, V), IntegrationError>

Source§

impl<I, F, J, H, Y, Z, U, V> ExplicitDaeSecondOrderMinimize<F, J, H, Y, Z, U, V> for I
where I: ExplicitDaeVariableStepExplicitSecondOrderMinimize<F, J, H, Y, Z, U, V>, Y: Tensor, Z: Tensor, U: TensorVec<Item = Y>, V: TensorVec<Item = Z>, &'a Y: for<'a> Mul<f64, Output = Y> + for<'a> Sub<Output = Y>,

Source§

fn integrate( &self, evolution: impl FnMut(f64, &Y, &Z) -> Result<Y, String>, function: impl FnMut(f64, &Y, &Z) -> Result<F, String>, jacobian: impl FnMut(f64, &Y, &Z) -> Result<J, String>, hessian: impl FnMut(f64, &Y, &Z) -> Result<H, String>, solver: impl SecondOrderOptimization<F, J, H, Z>, time: &[f64], initial_condition: (Y, Z), equality_constraint: impl FnMut(f64) -> EqualityConstraint, banded: Option<Banded>, ) -> Result<(Vector, U, U, V), IntegrationError>

Source§

impl<I, F, Y, Z, U, V> ExplicitDaeVariableStepExplicitFirstOrderMinimize<F, Y, Z, U, V> for I
where I: ExplicitDaeVariableStepExplicit<Y, Z, U, V>, Y: Tensor, Z: Tensor, U: TensorVec<Item = Y>, V: TensorVec<Item = Z>, &'a Y: for<'a> Mul<f64, Output = Y> + for<'a> Sub<Output = Y>,

Source§

fn integrate_explicit_dae_variable_step_explicit_minimize_1( &self, evolution: impl FnMut(Scalar, &Y, &Z) -> Result<Y, String>, function: impl FnMut(Scalar, &Y, &Z) -> Result<F, String>, jacobian: impl FnMut(Scalar, &Y, &Z) -> Result<Z, String>, solver: impl FirstOrderOptimization<F, Z>, time: &[Scalar], initial_condition: (Y, Z), equality_constraint: impl FnMut(Scalar) -> EqualityConstraint, ) -> Result<(Vector, U, U, V), IntegrationError>

Source§

impl<I, F, J, Y, Z, U, V> ExplicitDaeVariableStepExplicitFirstOrderRoot<F, J, Y, Z, U, V> for I
where I: ExplicitDaeVariableStepExplicit<Y, Z, U, V>, Y: Tensor, Z: Tensor, U: TensorVec<Item = Y>, V: TensorVec<Item = Z>, &'a Y: for<'a> Mul<f64, Output = Y> + for<'a> Sub<Output = Y>,

Source§

fn integrate_explicit_dae_variable_step_explicit_root_1( &self, evolution: impl FnMut(Scalar, &Y, &Z) -> Result<Y, String>, function: impl FnMut(Scalar, &Y, &Z) -> Result<F, String>, jacobian: impl FnMut(Scalar, &Y, &Z) -> Result<J, String>, solver: impl FirstOrderRootFinding<F, J, Z>, time: &[Scalar], initial_condition: (Y, Z), equality_constraint: impl FnMut(Scalar) -> EqualityConstraint, ) -> Result<(Vector, U, U, V), IntegrationError>

Source§

impl<I, F, J, H, Y, Z, U, V> ExplicitDaeVariableStepExplicitSecondOrderMinimize<F, J, H, Y, Z, U, V> for I
where I: ExplicitDaeVariableStepExplicit<Y, Z, U, V>, Y: Tensor, Z: Tensor, U: TensorVec<Item = Y>, V: TensorVec<Item = Z>, &'a Y: for<'a> Mul<f64, Output = Y> + for<'a> Sub<Output = Y>,

Source§

fn integrate_explicit_dae_variable_step_explicit_minimize_2( &self, evolution: impl FnMut(Scalar, &Y, &Z) -> Result<Y, String>, function: impl FnMut(Scalar, &Y, &Z) -> Result<F, String>, jacobian: impl FnMut(Scalar, &Y, &Z) -> Result<J, String>, hessian: impl FnMut(Scalar, &Y, &Z) -> Result<H, String>, solver: impl SecondOrderOptimization<F, J, H, Z>, time: &[Scalar], initial_condition: (Y, Z), equality_constraint: impl FnMut(Scalar) -> EqualityConstraint, banded: Option<Banded>, ) -> Result<(Vector, U, U, V), IntegrationError>

Source§

impl<I, Y, Z, U, V> ExplicitDaeVariableStepExplicitZerothOrderRoot<Y, Z, U, V> for I
where I: ExplicitDaeVariableStepExplicit<Y, Z, U, V>, Y: Tensor, Z: Tensor, U: TensorVec<Item = Y>, V: TensorVec<Item = Z>, &'a Y: for<'a> Mul<f64, Output = Y> + for<'a> Sub<Output = Y>,

Source§

fn integrate_explicit_dae_variable_step_explicit_root_0( &self, evolution: impl FnMut(Scalar, &Y, &Z) -> Result<Y, String>, function: impl FnMut(Scalar, &Y, &Z) -> Result<Z, String>, solver: impl ZerothOrderRootFinding<Z>, time: &[Scalar], initial_condition: (Y, Z), equality_constraint: impl FnMut(Scalar) -> EqualityConstraint, ) -> Result<(Vector, U, U, V), IntegrationError>

Source§

impl<I, Y, Z, U, V> ExplicitDaeZerothOrderRoot<Y, Z, U, V> for I
where I: ExplicitDaeVariableStepExplicitZerothOrderRoot<Y, Z, U, V>, Y: Tensor, Z: Tensor, U: TensorVec<Item = Y>, V: TensorVec<Item = Z>, &'a Y: for<'a> Mul<f64, Output = Y> + for<'a> Sub<Output = Y>,

Source§

fn integrate( &self, evolution: impl FnMut(f64, &Y, &Z) -> Result<Y, String>, function: impl FnMut(f64, &Y, &Z) -> Result<Z, String>, solver: impl ZerothOrderRootFinding<Z>, time: &[f64], initial_condition: (Y, Z), equality_constraint: impl FnMut(f64) -> EqualityConstraint, ) -> Result<(Vector, U, U, V), IntegrationError>

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<I, F, Y, U> ImplicitDaeFirstOrderMinimize<F, Y, U> for I
where I: ImplicitDaeVariableStepExplicitFirstOrderMinimize<F, Y, U>, Y: Tensor, U: TensorVec<Item = Y>, &'a Y: for<'a> Mul<f64, Output = Y> + for<'a> Sub<Output = Y>,

Source§

fn integrate( &self, function: impl FnMut(f64, &Y, &Y) -> Result<F, String>, jacobian: impl FnMut(f64, &Y, &Y) -> Result<Y, String>, solver: impl FirstOrderOptimization<F, Y>, time: &[f64], initial_condition: Y, equality_constraint: impl FnMut(f64) -> EqualityConstraint, ) -> Result<(Vector, U, U), IntegrationError>

Source§

impl<I, F, J, Y, U> ImplicitDaeFirstOrderRoot<F, J, Y, U> for I
where I: ImplicitDaeVariableStepExplicitFirstOrderRoot<F, J, Y, U>, Y: Tensor, U: TensorVec<Item = Y>, &'a Y: for<'a> Mul<f64, Output = Y> + for<'a> Sub<Output = Y>,

Source§

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

Source§

impl<I, F, J, H, Y, U> ImplicitDaeSecondOrderMinimize<F, J, H, Y, U> for I
where I: ImplicitDaeVariableStepExplicitSecondOrderMinimize<F, J, H, Y, U>, Y: Tensor, U: TensorVec<Item = Y>, &'a Y: for<'a> Mul<f64, Output = Y> + for<'a> Sub<Output = Y>,

Source§

fn integrate( &self, function: impl FnMut(f64, &Y, &Y) -> Result<F, String>, jacobian: impl FnMut(f64, &Y, &Y) -> Result<J, String>, hessian: impl FnMut(f64, &Y, &Y) -> Result<H, String>, solver: impl SecondOrderOptimization<F, J, H, Y>, time: &[f64], initial_condition: Y, equality_constraint: impl FnMut(f64) -> EqualityConstraint, banded: Option<Banded>, ) -> Result<(Vector, U, U), IntegrationError>

Source§

impl<I, Y, U> ImplicitDaeVariableStepExplicit<Y, U> for I
where I: VariableStepExplicit<Y, U>, Y: Tensor, U: TensorVec<Item = Y>, &'a Y: for<'a> Mul<f64, Output = Y> + for<'a> Sub<Output = Y>,

Source§

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

Source§

fn interpolate_implicit_dae_variable_step( &self, evolution: impl FnMut(Scalar, &Y, &Y) -> Result<Y, String>, time: &Vector, tp: &Vector, yp: &U, dydtp: &U, ) -> Result<(U, U), IntegrationError>

Source§

impl<I, F, Y, U> ImplicitDaeVariableStepExplicitFirstOrderMinimize<F, Y, U> for I
where I: ImplicitDaeVariableStepExplicit<Y, U>, Y: Tensor, U: TensorVec<Item = Y>, &'a Y: for<'a> Mul<f64, Output = Y> + for<'a> Sub<Output = Y>,

Source§

fn integrate_implicit_dae_variable_step_explicit_minimize_1( &self, function: impl FnMut(Scalar, &Y, &Y) -> Result<F, String>, jacobian: impl FnMut(Scalar, &Y, &Y) -> Result<Y, String>, solver: impl FirstOrderOptimization<F, Y>, time: &[Scalar], initial_condition: Y, equality_constraint: impl FnMut(Scalar) -> EqualityConstraint, ) -> Result<(Vector, U, U), IntegrationError>

Source§

impl<I, F, J, Y, U> ImplicitDaeVariableStepExplicitFirstOrderRoot<F, J, Y, U> for I
where I: ImplicitDaeVariableStepExplicit<Y, U>, Y: Tensor, U: TensorVec<Item = Y>, &'a Y: for<'a> Mul<f64, Output = Y> + for<'a> Sub<Output = Y>,

Source§

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

Source§

impl<I, F, J, H, Y, U> ImplicitDaeVariableStepExplicitSecondOrderMinimize<F, J, H, Y, U> for I
where I: ImplicitDaeVariableStepExplicit<Y, U>, Y: Tensor, U: TensorVec<Item = Y>, &'a Y: for<'a> Mul<f64, Output = Y> + for<'a> Sub<Output = Y>,

Source§

fn integrate_implicit_dae_variable_step_explicit_minimize_2( &self, function: impl FnMut(Scalar, &Y, &Y) -> Result<F, String>, jacobian: impl FnMut(Scalar, &Y, &Y) -> Result<J, String>, hessian: impl FnMut(Scalar, &Y, &Y) -> Result<H, String>, solver: impl SecondOrderOptimization<F, J, H, Y>, time: &[Scalar], initial_condition: Y, equality_constraint: impl FnMut(Scalar) -> EqualityConstraint, banded: Option<Banded>, ) -> Result<(Vector, U, U), IntegrationError>

Source§

impl<I, Y, U> ImplicitDaeVariableStepExplicitZerothOrderRoot<Y, U> for I
where I: ImplicitDaeVariableStepExplicit<Y, U>, Y: Tensor, U: TensorVec<Item = Y>, &'a Y: for<'a> Mul<f64, Output = Y> + for<'a> Sub<Output = Y>,

Source§

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

Source§

impl<I, Y, U> ImplicitDaeZerothOrderRoot<Y, U> for I
where I: ImplicitDaeVariableStepExplicitZerothOrderRoot<Y, U>, Y: Tensor, U: TensorVec<Item = Y>, &'a Y: for<'a> Mul<f64, Output = Y> + for<'a> Sub<Output = Y>,

Source§

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

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.