nyx_space::dynamics

Trait Dynamics

source
pub trait Dynamics:
    Clone
    + Sync
    + Send{
    type HyperdualSize: DimName;
    type StateType: State;

    // Required method
    fn eom(
        &self,
        delta_t: f64,
        state_vec: &OVector<f64, <Self::StateType as State>::VecLength>,
        state_ctx: &Self::StateType,
        almanac: Arc<Almanac>,
    ) -> Result<OVector<f64, <Self::StateType as State>::VecLength>, DynamicsError>
       where DefaultAllocator: Allocator<<Self::StateType as State>::VecLength>;

    // Provided methods
    fn dual_eom(
        &self,
        _delta_t: f64,
        _osculating_state: &Self::StateType,
        _almanac: Arc<Almanac>,
    ) -> Result<(OVector<f64, <Self::StateType as State>::Size>, OMatrix<f64, <Self::StateType as State>::Size, <Self::StateType as State>::Size>), DynamicsError>
       where DefaultAllocator: Allocator<Self::HyperdualSize> + Allocator<<Self::StateType as State>::Size> + Allocator<<Self::StateType as State>::Size, <Self::StateType as State>::Size>,
             Owned<f64, Self::HyperdualSize>: Copy { ... }
    fn finally(
        &self,
        next_state: Self::StateType,
        _almanac: Arc<Almanac>,
    ) -> Result<Self::StateType, DynamicsError> { ... }
}
Expand description

The Dynamics trait handles and stores any equation of motion and the state is integrated.

Its design is such that several of the provided dynamics can be combined fairly easily. However, when combining the dynamics (e.g. integrating both the attitude of a spaceraft and its orbital parameters), it is up to the implementor to handle time and state organization correctly. For time management, I highly recommend using hifitime which is thoroughly validated.

Required Associated Types§

source

type HyperdualSize: DimName

The state of the associated hyperdual state, almost always StateType + U1

source

type StateType: State

Required Methods§

source

fn eom( &self, delta_t: f64, state_vec: &OVector<f64, <Self::StateType as State>::VecLength>, state_ctx: &Self::StateType, almanac: Arc<Almanac>, ) -> Result<OVector<f64, <Self::StateType as State>::VecLength>, DynamicsError>

Defines the equations of motion for these dynamics, or a combination of provided dynamics. The time delta_t is in seconds PAST the context epoch. The state vector is the state which changes for every intermediate step of the integration. The state context is the state of what is being propagated, it should allow rebuilding a new state context from the provided state vector.

Provided Methods§

source

fn dual_eom( &self, _delta_t: f64, _osculating_state: &Self::StateType, _almanac: Arc<Almanac>, ) -> Result<(OVector<f64, <Self::StateType as State>::Size>, OMatrix<f64, <Self::StateType as State>::Size, <Self::StateType as State>::Size>), DynamicsError>

Defines the equations of motion for Dual numbers for these dynamics. All dynamics need to allow for automatic differentiation. However, if differentiation is not supported, then the dynamics should prevent initialization with a context which has an STM defined.

source

fn finally( &self, next_state: Self::StateType, _almanac: Arc<Almanac>, ) -> Result<Self::StateType, DynamicsError>

Optionally performs some final changes after each successful integration of the equations of motion. For example, this can be used to update the Guidance mode. NOTE: This function is also called just prior to very first integration step in order to update the initial state if needed.

Object Safety§

This trait is not object safe.

Implementors§