pub struct VelocityVerlet { /* private fields */ }Expand description
Explicit, second-order, fixed-step method for dynamics.1
\ddot{x} = a(t, x, \dot{x})v_{n+1/2} = v_n + \tfrac{h}{2}\,a_nx_{n+1} = x_n + h\,v_{n+1/2}a_{n+1} = a(t_{n+1}, x_{n+1}, v_{n+1/2})v_{n+1} = v_{n+1/2} + \tfrac{h}{2}\,a_{n+1}It requires one evaluation of the acceleration per step, and is stable for $h \le 2/\omega_{max}$. It is symplectic, and conserves a nearby energy, for conservative accelerations and a fixed time step. Accelerations that depend on velocity are evaluated at the half-step velocity, which is no longer symplectic.
Also known as the leapfrog or kick-drift-kick method, and equivalent to the central difference method for dynamics. ↩
Implementations§
Trait Implementations§
Source§impl Debug for VelocityVerlet
impl Debug for VelocityVerlet
Source§impl Default for VelocityVerlet
impl Default for VelocityVerlet
Source§fn default() -> VelocityVerlet
fn default() -> VelocityVerlet
Returns the “default value” for a type. Read more
Source§impl<X, UX, UV, UA, T> ExplicitDynamics<X, UX, UV, UA, T> for VelocityVerletwhere
X: Differentiable<T> + Tensor,
Derivative<X, T>: Differentiable<T> + Tensor,
for<'a> &'a Derivative<X, T>: Mul<Quantity<T>, Output = X>,
for<'a> &'a Derivative<Derivative<X, T>, T>: Mul<Quantity<T>, Output = Derivative<X, T>>,
UX: TensorVec<Item = X>,
UV: TensorVec<Item = Derivative<X, T>>,
UA: TensorVec<Item = Derivative<Derivative<X, T>, T>>,
impl<X, UX, UV, UA, T> ExplicitDynamics<X, UX, UV, UA, T> for VelocityVerletwhere
X: Differentiable<T> + Tensor,
Derivative<X, T>: Differentiable<T> + Tensor,
for<'a> &'a Derivative<X, T>: Mul<Quantity<T>, Output = X>,
for<'a> &'a Derivative<Derivative<X, T>, T>: Mul<Quantity<T>, Output = Derivative<X, T>>,
UX: TensorVec<Item = X>,
UV: TensorVec<Item = Derivative<X, T>>,
UA: TensorVec<Item = Derivative<Derivative<X, T>, T>>,
Source§fn integrate(
&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>
fn integrate( &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>
Solves an initial value problem for dynamics, given the acceleration as a function of time, position, and velocity. Read more
Source§fn integrate_bounded(
&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>
fn integrate_bounded( &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>
Auto Trait Implementations§
impl Freeze for VelocityVerlet
impl RefUnwindSafe for VelocityVerlet
impl Send for VelocityVerlet
impl Sync for VelocityVerlet
impl Unpin for VelocityVerlet
impl UnsafeUnpin for VelocityVerlet
impl UnwindSafe for VelocityVerlet
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