pub struct BogackiShampine {
pub abs_tol: Scalar,
pub rel_tol: Scalar,
pub dt_beta: Scalar,
pub dt_expn: Scalar,
pub dt_cut: Scalar,
pub dt_min: Scalar,
pub error_norm: Norm,
}Expand description
Explicit, three-stage, third-order, variable-step, Runge-Kutta method.1
\frac{dy}{dt} = f(t, y)t_{n+1} = t_n + hk_1 = f(t_n, y_n)k_2 = f(t_n + \tfrac{1}{2} h, y_n + \tfrac{1}{2} h k_1)k_3 = f(t_n + \tfrac{3}{4} h, y_n + \tfrac{3}{4} h k_2)y_{n+1} = y_n + \frac{h}{9}\left(2k_1 + 3k_2 + 4k_3\right)k_4 = f(t_{n+1}, y_{n+1})e_{n+1} = \frac{h}{72}\left(-5k_1 + 6k_2 + 8k_3 - 9k_4\right)P. Bogacki and L.F. Shampine, Appl. Math. Lett. 2, 321 (1989). ↩
Fields§
§abs_tol: ScalarAbsolute error tolerance.
rel_tol: ScalarRelative error tolerance.
dt_beta: ScalarMultiplier for adaptive time steps.
dt_expn: ScalarExponent for adaptive time steps.
dt_cut: ScalarCut back factor for the time step.
dt_min: ScalarMinimum value for the time step.
error_norm: NormNorm type for error evaluation.
Trait Implementations§
Source§impl Debug for BogackiShampine
impl Debug for BogackiShampine
Source§impl Default for BogackiShampine
impl Default for BogackiShampine
Source§impl<Y, U, V, T> Explicit<Y, U, V, T> for BogackiShampinewhere
Y: Differentiate<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>>,
impl<Y, U, V, T> Explicit<Y, U, V, T> for BogackiShampinewhere
Y: Differentiate<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>>,
const SLOPES: usize = 4
Source§fn integrate(
&self,
function: impl FnMut(Quantity<T>, &Y) -> Result<Derivative<Y, T>, String>,
time: &[Quantity<T>],
initial_condition: Y,
) -> Result<(Times<T>, U, V), IntegrationError>
fn integrate( &self, function: impl FnMut(Quantity<T>, &Y) -> Result<Derivative<Y, T>, String>, time: &[Quantity<T>], initial_condition: Y, ) -> Result<(Times<T>, U, V), IntegrationError>
Solves an initial value problem by explicitly integrating a system of ordinary differential equations. Read more
Source§impl<Y, Z, U, V, W, T> ExplicitDaeVariableStepExplicit<Y, Z, U, V, W, T> for BogackiShampinewhere
Self: ExplicitDaeVariableStepFirstSameAsLast<Y, Z, U, V, W, T>,
Y: Differentiate<T> + Div<Quantity<T>, Output = Derivative<Y, T>> + Tensor,
Z: PartialEq + Tensor,
Derivative<Y, T>: Mul<Quantity<T>, Output = Y>,
U: TensorVec<Item = Y>,
V: TensorVec<Item = Z>,
W: TensorVec<Item = Derivative<Y, T>>,
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>,
impl<Y, Z, U, V, W, T> ExplicitDaeVariableStepExplicit<Y, Z, U, V, W, T> for BogackiShampinewhere
Self: ExplicitDaeVariableStepFirstSameAsLast<Y, Z, U, V, W, T>,
Y: Differentiate<T> + Div<Quantity<T>, Output = Derivative<Y, T>> + Tensor,
Z: PartialEq + Tensor,
Derivative<Y, T>: Mul<Quantity<T>, Output = Y>,
U: TensorVec<Item = Y>,
V: TensorVec<Item = Z>,
W: TensorVec<Item = Derivative<Y, T>>,
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>,
fn slopes_solve( evolution: impl FnMut(Quantity<T>, &Y, &Z) -> Result<Derivative<Y, T>, String>, solution: impl FnMut(Quantity<T>, &Y, &Z) -> Result<Z, String>, y: &Y, z: &Z, t: Quantity<T>, dt: Quantity<T>, k: &mut [Derivative<Y, T>], y_trial: &mut Y, z_trial: &mut Z, ) -> Result<(), String>
fn slopes_solve_and_error( &self, evolution: impl FnMut(Quantity<T>, &Y, &Z) -> Result<Derivative<Y, T>, String>, solution: impl FnMut(Quantity<T>, &Y, &Z) -> Result<Z, String>, y: &Y, z: &Z, t: Quantity<T>, dt: Quantity<T>, k: &mut [Derivative<Y, T>], y_trial: &mut Y, z_trial: &mut Z, ) -> Result<Scalar, String>
fn step_solve( &self, _: impl FnMut(Quantity<T>, &Y, &Z) -> Result<Derivative<Y, T>, String>, y: &mut Y, z: &mut Z, t: &mut Quantity<T>, y_sol: &mut U, z_sol: &mut V, t_sol: &mut Times<T>, dydt_sol: &mut W, k_sol: &mut Vec<W>, dt: &mut Quantity<T>, k: &mut [Derivative<Y, T>], y_trial: &Y, z_trial: &Z, e: Scalar, ) -> Result<(), String>
fn interpolate_explicit_dae_variable_step( &self, _evolution: impl FnMut(Quantity<T>, &Y, &Z) -> Result<Derivative<Y, T>, String>, solution: impl FnMut(Quantity<T>, &Y, &Z) -> Result<Z, String>, time: &Times<T>, tp: &Times<T>, yp: &U, dydtp: &W, _k_sol: &[W], zp: &V, ) -> Result<(U, W, V), IntegrationError>
fn integrate_explicit_dae_variable_step( &self, evolution: impl FnMut(Quantity<T>, &Y, &Z) -> Result<Derivative<Y, T>, String>, solution: impl FnMut(Quantity<T>, &Y, &Z) -> Result<Z, String>, time: &[Quantity<T>], initial_condition: (Y, Z), ) -> Result<(Times<T>, U, W, V), IntegrationError>
Source§impl<Y, Z, U, V, W, T> ExplicitDaeVariableStepFirstSameAsLast<Y, Z, U, V, W, T> for BogackiShampinewhere
Y: Differentiate<T> + Div<Quantity<T>, Output = Derivative<Y, T>> + Tensor,
Z: PartialEq + Tensor,
Derivative<Y, T>: Mul<Quantity<T>, Output = Y>,
U: TensorVec<Item = Y>,
V: TensorVec<Item = Z>,
W: TensorVec<Item = Derivative<Y, T>>,
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>,
impl<Y, Z, U, V, W, T> ExplicitDaeVariableStepFirstSameAsLast<Y, Z, U, V, W, T> for BogackiShampinewhere
Y: Differentiate<T> + Div<Quantity<T>, Output = Derivative<Y, T>> + Tensor,
Z: PartialEq + Tensor,
Derivative<Y, T>: Mul<Quantity<T>, Output = Y>,
U: TensorVec<Item = Y>,
V: TensorVec<Item = Z>,
W: TensorVec<Item = Derivative<Y, T>>,
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>,
fn slopes_solve_and_error_fsal( &self, evolution: impl FnMut(Quantity<T>, &Y, &Z) -> Result<Derivative<Y, T>, String>, solution: impl FnMut(Quantity<T>, &Y, &Z) -> Result<Z, String>, y: &Y, z: &Z, t: Quantity<T>, dt: Quantity<T>, k: &mut [Derivative<Y, T>], y_trial: &mut Y, z_trial: &mut Z, ) -> Result<Scalar, String>
fn step_solve_fsal( &self, y: &mut Y, z: &mut Z, t: &mut Quantity<T>, y_sol: &mut U, z_sol: &mut V, t_sol: &mut Times<T>, dydt_sol: &mut W, k_sol: &mut Vec<W>, dt: &mut Quantity<T>, k: &mut [Derivative<Y, T>], y_trial: &Y, z_trial: &Z, e: Scalar, ) -> Result<(), String>
Source§impl<Y, U, V, T> FreeInterpolant<Y, U, V, T> for BogackiShampinewhere
Y: Differentiate<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>>,
impl<Y, U, V, T> FreeInterpolant<Y, U, V, T> for BogackiShampinewhere
Y: Differentiate<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> InterpolateSolution<Y, U, V, T> for BogackiShampinewhere
Y: Differentiate<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>>,
impl<Y, U, V, T> InterpolateSolution<Y, U, V, T> for BogackiShampinewhere
Y: Differentiate<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>>,
impl<Y, U> OdeIntegrator<Y, U> for BogackiShampine
Source§impl<T> VariableStep<T> for BogackiShampine
impl<T> VariableStep<T> for BogackiShampine
Source§fn error_norm(&self) -> &Norm
fn error_norm(&self) -> &Norm
Returns the norm type for error evaluation.
Source§impl<Y, U, V, T> VariableStepExplicit<Y, U, V, T> for BogackiShampinewhere
Self: Explicit<Y, U, V, T>,
Y: Differentiate<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>>,
impl<Y, U, V, T> VariableStepExplicit<Y, U, V, T> for BogackiShampinewhere
Self: Explicit<Y, U, V, T>,
Y: Differentiate<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>>,
fn error( &self, dt: Quantity<T>, k: &[Derivative<Y, T>], ) -> Result<Scalar, String>
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 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 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>
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§impl<Y, U, V, T> VariableStepExplicitFirstSameAsLast<Y, U, V, T> for BogackiShampinewhere
Y: Differentiate<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>>,
impl<Y, U, V, T> VariableStepExplicitFirstSameAsLast<Y, U, V, T> for BogackiShampinewhere
Y: Differentiate<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>>,
fn slopes_and_error_fsal( &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_fsal( &self, 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>
Auto Trait Implementations§
impl Freeze for BogackiShampine
impl RefUnwindSafe for BogackiShampine
impl Send for BogackiShampine
impl Sync for BogackiShampine
impl Unpin for BogackiShampine
impl UnsafeUnpin for BogackiShampine
impl UnwindSafe for BogackiShampine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more