Trait nyx_space::dynamics::Dynamics[][src]

pub trait Dynamics: Clone + Sync + Send where
    DefaultAllocator: Allocator<f64, <Self::StateType as State>::Size>, 
{ type HyperdualSize: DimName; type StateType: State; fn eom(
        &self,
        delta_t: f64,
        state_vec: &VectorN<f64, <Self::StateType as State>::PropVecSize>,
        state_ctx: &Self::StateType
    ) -> Result<VectorN<f64, <Self::StateType as State>::PropVecSize>, NyxError>
    where
        DefaultAllocator: Allocator<f64, <Self::StateType as State>::PropVecSize>
;
fn dual_eom(
        &self,
        delta_t: f64,
        state_vec: &VectorN<Hyperdual<f64, Self::HyperdualSize>, <Self::StateType as State>::Size>,
        state_ctx: &Self::StateType
    ) -> Result<(VectorN<f64, <Self::StateType as State>::Size>, MatrixN<f64, <Self::StateType as State>::Size>), NyxError>
    where
        DefaultAllocator: Allocator<f64, Self::HyperdualSize> + Allocator<f64, <Self::StateType as State>::Size> + Allocator<f64, <Self::StateType as State>::Size, <Self::StateType as State>::Size> + Allocator<Hyperdual<f64, Self::HyperdualSize>, <Self::StateType as State>::Size>,
        Owned<f64, Self::HyperdualSize>: Copy
; fn eom_grad(
        &self,
        delta_t_s: f64,
        state_vec: &VectorN<f64, <Self::StateType as State>::Size>,
        state_ctx: &Self::StateType
    ) -> Result<(VectorN<f64, <Self::StateType as State>::Size>, MatrixN<f64, <Self::StateType as State>::Size>), NyxError>
    where
        DefaultAllocator: Allocator<f64, <Self::StateType as State>::Size> + Allocator<f64, <Self::StateType as State>::Size, <Self::StateType as State>::Size> + Allocator<f64, Self::HyperdualSize> + Allocator<Hyperdual<f64, Self::HyperdualSize>, <Self::StateType as State>::Size>,
        Owned<f64, Self::HyperdualSize>: Copy
, { ... }
fn finally(
        &self,
        next_state: Self::StateType
    ) -> Result<Self::StateType, NyxError> { ... } }
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.

Associated Types

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

Required methods

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.

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.

Provided methods

Computes both the state and the gradient of the dynamics. This function is pre-implemented.

Optionally performs some final changes after each successful integration of the equations of motion. For example, this can be used to update the GNC mode.

Implementors