Skip to main content

DynamicsModel

Trait DynamicsModel 

Source
pub trait DynamicsModel<const N: usize, const P: usize> {
    const NAME: &'static str;

    // Required method
    fn rhs(
        &self,
        time: f64,
        state: &[f64; N],
        parameters: &[f64; P],
        derivative: &mut [f64; N],
    ) -> Result<()>;

    // Provided method
    fn validate(
        &self,
        _time: f64,
        _state: &[f64; N],
        _parameters: &[f64; P],
    ) -> Result<()> { ... }
}
Expand description

An evaluated first-order dynamics model with N states and P parameters.

Implementations must not allocate in Self::rhs. The integrator validates dimensions and finite inputs before calling the model.

Required Associated Constants§

Source

const NAME: &'static str

Stable model name used in diagnostics.

Required Methods§

Source

fn rhs( &self, time: f64, state: &[f64; N], parameters: &[f64; P], derivative: &mut [f64; N], ) -> Result<()>

Evaluates dstate/dt into caller-owned storage.

§Errors

Returns an error when the dynamics are singular or cannot be evaluated.

Provided Methods§

Source

fn validate( &self, _time: f64, _state: &[f64; N], _parameters: &[f64; P], ) -> Result<()>

Validates state and parameter domains before a propagation.

The default accepts every finite state and parameter vector.

§Errors

Returns an error when the initial state or parameters are outside the model’s physical domain.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl DynamicsModel<6, 1> for Cr3bpDynamics

Source§

const NAME: &'static str = "CR3BP dynamics"

Source§

impl DynamicsModel<6, 1> for KeplerDynamics

Source§

const NAME: &'static str = "Kepler dynamics"

Source§

impl DynamicsModel<6, 3> for ZohSolarSailDynamics

Source§

const NAME: &'static str = "ZOH solar-sail dynamics"

Source§

impl DynamicsModel<6, 4> for BcpDynamics

Source§

const NAME: &'static str = "BCP dynamics"

Source§

impl DynamicsModel<7, 5> for ZohEquinoctialDynamics

Source§

const NAME: &'static str = "ZOH equinoctial dynamics"

Source§

impl DynamicsModel<7, 5> for ZohKeplerDynamics

Source§

const NAME: &'static str = "ZOH Kepler dynamics"

Source§

impl DynamicsModel<7, 6> for ZohCr3bpDynamics

Source§

const NAME: &'static str = "ZOH CR3BP dynamics"

Source§

impl DynamicsModel<AUGMENTED_DIMENSION, 3> for CartesianTimeOptimal

Source§

const NAME: &'static str = "Cartesian time-optimal Pontryagin dynamics"

Source§

impl DynamicsModel<AUGMENTED_DIMENSION, 3> for EquinoctialTimeOptimal

Source§

const NAME: &'static str = "equinoctial time-optimal Pontryagin dynamics"

Source§

impl DynamicsModel<AUGMENTED_DIMENSION, 5> for CartesianMassOptimal

Source§

const NAME: &'static str = "Cartesian mass-optimal Pontryagin dynamics"

Source§

impl DynamicsModel<AUGMENTED_DIMENSION, 5> for EquinoctialMassOptimal

Source§

const NAME: &'static str = "equinoctial mass-optimal Pontryagin dynamics"