pub trait Stacked<T = Time>where
Self: Debug,{
// Provided methods
fn integrate_stacked<X, UX, UV, UA>(
&self,
function: impl FnMut(Quantity<T>, &X, &Derivative<X, T>) -> Result<Derivative<Derivative<X, T>, T>, String>,
time: &[Quantity<T>],
initial_position: X,
initial_velocity: Derivative<X, T>,
) -> Result<(Times<T>, UX, UV, UA), IntegrationError>
where Self: Explicit<TensorTuple<X, Derivative<X, T>>, TensorVector<TensorTuple<X, Derivative<X, T>>>, TensorVector<Derivative<TensorTuple<X, Derivative<X, T>>, T>>, T>,
X: Differentiable<T> + Tensor,
Derivative<X, T>: Differentiable<T> + Tensor,
UX: TensorVec<Item = X>,
UV: TensorVec<Item = Derivative<X, T>>,
UA: TensorVec<Item = Derivative<Derivative<X, T>, T>> { ... }
fn integrate_stacked_bounded<X, UX, UV, UA>(
&self,
function: impl FnMut(Quantity<T>, &X, &Derivative<X, T>) -> Result<Derivative<Derivative<X, T>, T>, String>,
bound: impl FnMut(Quantity<T>, &X, &Derivative<X, T>) -> Result<Quantity<T>, String>,
safety: Scalar,
time: &[Quantity<T>],
initial_position: X,
initial_velocity: Derivative<X, T>,
) -> Result<(Times<T>, UX, UV, UA), IntegrationError>
where Self: Explicit<TensorTuple<X, Derivative<X, T>>, TensorVector<TensorTuple<X, Derivative<X, T>>>, TensorVector<Derivative<TensorTuple<X, Derivative<X, T>>, T>>, T>,
X: Differentiable<T> + Tensor,
Derivative<X, T>: Differentiable<T> + Tensor,
UX: TensorVec<Item = X>,
UV: TensorVec<Item = Derivative<X, T>>,
UA: TensorVec<Item = Derivative<Derivative<X, T>, T>> { ... }
fn integrate_stacked_coupled<X, Y, UX, UV, UA, UY, UR>(
&self,
function: impl FnMut(Quantity<T>, &X, &Derivative<X, T>, &Y) -> Result<(Derivative<Derivative<X, T>, T>, Derivative<Y, T>), String>,
time: &[Quantity<T>],
initial_position: X,
initial_velocity: Derivative<X, T>,
initial_state: Y,
) -> Result<(Times<T>, UX, UV, UA, UY, UR), IntegrationError>
where Self: Explicit<TensorTuple<TensorTuple<X, Derivative<X, T>>, Y>, TensorVector<TensorTuple<TensorTuple<X, Derivative<X, T>>, Y>>, TensorVector<Derivative<TensorTuple<TensorTuple<X, Derivative<X, T>>, Y>, T>>, T>,
X: Differentiable<T> + Tensor,
Derivative<X, T>: Differentiable<T> + Tensor,
Y: Differentiable<T> + Tensor,
UX: TensorVec<Item = X>,
UV: TensorVec<Item = Derivative<X, T>>,
UA: TensorVec<Item = Derivative<Derivative<X, T>, T>>,
UY: TensorVec<Item = Y>,
UR: TensorVec<Item = Derivative<Y, T>> { ... }
fn integrate_stacked_coupled_bounded<X, Y, UX, UV, UA, UY, UR>(
&self,
function: impl FnMut(Quantity<T>, &X, &Derivative<X, T>, &Y) -> Result<(Derivative<Derivative<X, T>, T>, Derivative<Y, T>), String>,
bound: impl FnMut(Quantity<T>, &X, &Derivative<X, T>, &Y) -> Result<Spectrum<T>, String>,
safety: Scalar,
time: &[Quantity<T>],
initial_position: X,
initial_velocity: Derivative<X, T>,
initial_state: Y,
) -> Result<(Times<T>, UX, UV, UA, UY, UR), IntegrationError>
where Self: Explicit<TensorTuple<TensorTuple<X, Derivative<X, T>>, Y>, TensorVector<TensorTuple<TensorTuple<X, Derivative<X, T>>, Y>>, TensorVector<Derivative<TensorTuple<TensorTuple<X, Derivative<X, T>>, Y>, T>>, T>,
X: Differentiable<T> + Tensor,
Derivative<X, T>: Differentiable<T> + Tensor,
Y: Differentiable<T> + Tensor,
UX: TensorVec<Item = X>,
UV: TensorVec<Item = Derivative<X, T>>,
UA: TensorVec<Item = Derivative<Derivative<X, T>, T>>,
UY: TensorVec<Item = Y>,
UR: TensorVec<Item = Derivative<Y, T>> { ... }
}Expand description
Marks an explicit integrator for ordinary differential equations as usable for dynamics, by integrating the position and velocity together as a single state.
\frac{d}{dt}\begin{bmatrix} x \\ v \end{bmatrix} = \begin{bmatrix} v \\ a(t, x, v) \end{bmatrix}Every integrator that is Stacked is also an ExplicitDynamics integrator. It is implemented only for methods whose stability region reaches the imaginary axis, which excludes the first- and second-order methods, since those are unstable for undamped oscillation.
These methods are not symplectic, and evaluate the acceleration once per stage rather than once per step.
Provided Methods§
Sourcefn integrate_stacked<X, UX, UV, UA>(
&self,
function: impl FnMut(Quantity<T>, &X, &Derivative<X, T>) -> Result<Derivative<Derivative<X, T>, T>, String>,
time: &[Quantity<T>],
initial_position: X,
initial_velocity: Derivative<X, T>,
) -> Result<(Times<T>, UX, UV, UA), IntegrationError>where
Self: Explicit<TensorTuple<X, Derivative<X, T>>, TensorVector<TensorTuple<X, Derivative<X, T>>>, TensorVector<Derivative<TensorTuple<X, Derivative<X, T>>, T>>, T>,
X: Differentiable<T> + Tensor,
Derivative<X, T>: Differentiable<T> + Tensor,
UX: TensorVec<Item = X>,
UV: TensorVec<Item = Derivative<X, T>>,
UA: TensorVec<Item = Derivative<Derivative<X, T>, T>>,
fn integrate_stacked<X, UX, UV, UA>(
&self,
function: impl FnMut(Quantity<T>, &X, &Derivative<X, T>) -> Result<Derivative<Derivative<X, T>, T>, String>,
time: &[Quantity<T>],
initial_position: X,
initial_velocity: Derivative<X, T>,
) -> Result<(Times<T>, UX, UV, UA), IntegrationError>where
Self: Explicit<TensorTuple<X, Derivative<X, T>>, TensorVector<TensorTuple<X, Derivative<X, T>>>, TensorVector<Derivative<TensorTuple<X, Derivative<X, T>>, T>>, T>,
X: Differentiable<T> + Tensor,
Derivative<X, T>: Differentiable<T> + Tensor,
UX: TensorVec<Item = X>,
UV: TensorVec<Item = Derivative<X, T>>,
UA: TensorVec<Item = Derivative<Derivative<X, T>, T>>,
Solves an initial value problem for dynamics, given the acceleration as a function of time, position, and velocity.
The solution contains the positions, velocities, and accelerations at each time. The time step is that of the integrator when time holds only the initial and final times, and otherwise time is the sequence of steps.
Sourcefn integrate_stacked_bounded<X, UX, UV, UA>(
&self,
function: impl FnMut(Quantity<T>, &X, &Derivative<X, T>) -> Result<Derivative<Derivative<X, T>, T>, String>,
bound: impl FnMut(Quantity<T>, &X, &Derivative<X, T>) -> Result<Quantity<T>, String>,
safety: Scalar,
time: &[Quantity<T>],
initial_position: X,
initial_velocity: Derivative<X, T>,
) -> Result<(Times<T>, UX, UV, UA), IntegrationError>where
Self: Explicit<TensorTuple<X, Derivative<X, T>>, TensorVector<TensorTuple<X, Derivative<X, T>>>, TensorVector<Derivative<TensorTuple<X, Derivative<X, T>>, T>>, T>,
X: Differentiable<T> + Tensor,
Derivative<X, T>: Differentiable<T> + Tensor,
UX: TensorVec<Item = X>,
UV: TensorVec<Item = Derivative<X, T>>,
UA: TensorVec<Item = Derivative<Derivative<X, T>, T>>,
fn integrate_stacked_bounded<X, UX, UV, UA>(
&self,
function: impl FnMut(Quantity<T>, &X, &Derivative<X, T>) -> Result<Derivative<Derivative<X, T>, T>, String>,
bound: impl FnMut(Quantity<T>, &X, &Derivative<X, T>) -> Result<Quantity<T>, String>,
safety: Scalar,
time: &[Quantity<T>],
initial_position: X,
initial_velocity: Derivative<X, T>,
) -> Result<(Times<T>, UX, UV, UA), IntegrationError>where
Self: Explicit<TensorTuple<X, Derivative<X, T>>, TensorVector<TensorTuple<X, Derivative<X, T>>>, TensorVector<Derivative<TensorTuple<X, Derivative<X, T>>, T>>, T>,
X: Differentiable<T> + Tensor,
Derivative<X, T>: Differentiable<T> + Tensor,
UX: TensorVec<Item = X>,
UV: TensorVec<Item = Derivative<X, T>>,
UA: TensorVec<Item = Derivative<Derivative<X, T>, T>>,
Solves an initial value problem like integrate_stacked, subject to a stability bound.
At each step, bound reports the fastest time scale of the system at the current state, the reciprocal of its highest angular frequency. The stability limit is that time scale times the extent of the method’s stability region. The time step may use at most the fraction safety of that limit, where safety is in $(0, 1]$. A time step above it is an error.
fn integrate_stacked_coupled<X, Y, UX, UV, UA, UY, UR>(
&self,
function: impl FnMut(Quantity<T>, &X, &Derivative<X, T>, &Y) -> Result<(Derivative<Derivative<X, T>, T>, Derivative<Y, T>), String>,
time: &[Quantity<T>],
initial_position: X,
initial_velocity: Derivative<X, T>,
initial_state: Y,
) -> Result<(Times<T>, UX, UV, UA, UY, UR), IntegrationError>where
Self: Explicit<TensorTuple<TensorTuple<X, Derivative<X, T>>, Y>, TensorVector<TensorTuple<TensorTuple<X, Derivative<X, T>>, Y>>, TensorVector<Derivative<TensorTuple<TensorTuple<X, Derivative<X, T>>, Y>, T>>, T>,
X: Differentiable<T> + Tensor,
Derivative<X, T>: Differentiable<T> + Tensor,
Y: Differentiable<T> + Tensor,
UX: TensorVec<Item = X>,
UV: TensorVec<Item = Derivative<X, T>>,
UA: TensorVec<Item = Derivative<Derivative<X, T>, T>>,
UY: TensorVec<Item = Y>,
UR: TensorVec<Item = Derivative<Y, T>>,
fn integrate_stacked_coupled_bounded<X, Y, UX, UV, UA, UY, UR>(
&self,
function: impl FnMut(Quantity<T>, &X, &Derivative<X, T>, &Y) -> Result<(Derivative<Derivative<X, T>, T>, Derivative<Y, T>), String>,
bound: impl FnMut(Quantity<T>, &X, &Derivative<X, T>, &Y) -> Result<Spectrum<T>, String>,
safety: Scalar,
time: &[Quantity<T>],
initial_position: X,
initial_velocity: Derivative<X, T>,
initial_state: Y,
) -> Result<(Times<T>, UX, UV, UA, UY, UR), IntegrationError>where
Self: Explicit<TensorTuple<TensorTuple<X, Derivative<X, T>>, Y>, TensorVector<TensorTuple<TensorTuple<X, Derivative<X, T>>, Y>>, TensorVector<Derivative<TensorTuple<TensorTuple<X, Derivative<X, T>>, Y>, T>>, T>,
X: Differentiable<T> + Tensor,
Derivative<X, T>: Differentiable<T> + Tensor,
Y: Differentiable<T> + Tensor,
UX: TensorVec<Item = X>,
UV: TensorVec<Item = Derivative<X, T>>,
UA: TensorVec<Item = Derivative<Derivative<X, T>, T>>,
UY: TensorVec<Item = Y>,
UR: TensorVec<Item = Derivative<Y, T>>,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".