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

pub trait Dynamics where
    Self: Sized
{ type StateSize: DimName; type StateType: Copy; fn time(&self) -> f64;
fn state_vector(&self) -> VectorN<f64, Self::StateSize>
    where
        DefaultAllocator: Allocator<f64, Self::StateSize>
;
fn eom(
        &self,
        t: f64,
        state: &VectorN<f64, Self::StateSize>
    ) -> VectorN<f64, Self::StateSize>
    where
        DefaultAllocator: Allocator<f64, Self::StateSize>
;
fn set_state(
        &mut self,
        new_t: f64,
        new_state: &VectorN<f64, Self::StateSize>
    )
    where
        DefaultAllocator: Allocator<f64, Self::StateSize>
;
fn state(&self) -> Self::StateType; }

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

type StateSize: DimName

Defines the state size for these dynamics. It must be imported from nalgebra.

type StateType: Copy

Defines the type which will be published on the propagator channel

Loading content...

Required methods

fn time(&self) -> f64

Returns the time of the current state

fn state_vector(&self) -> VectorN<f64, Self::StateSize> where
    DefaultAllocator: Allocator<f64, Self::StateSize>, 

Returns the current state of the dynamics as a vector so it can be integrated.

fn eom(
    &self,
    t: f64,
    state: &VectorN<f64, Self::StateSize>
) -> VectorN<f64, Self::StateSize> where
    DefaultAllocator: Allocator<f64, Self::StateSize>, 

Defines the equations of motion for these dynamics, or a combination of provided dynamics.

fn set_state(&mut self, new_t: f64, new_state: &VectorN<f64, Self::StateSize>) where
    DefaultAllocator: Allocator<f64, Self::StateSize>, 

Updates the internal state of the dynamics.

fn state(&self) -> Self::StateType

Returns the state of the dynamics

Loading content...

Implementors

impl Dynamics for AngularMom[src]

type StateSize = U3

type StateType = Vector3<f64>

fn state_vector(&self) -> VectorN<f64, Self::StateSize>[src]

Returns the angular velocity ω of the system, not its momentum.

fn set_state(
    &mut self,
    new_t: f64,
    new_angular_velocity: &VectorN<f64, Self::StateSize>
)
[src]

Set the angular velocity ω of the system and the time.

fn eom(
    &self,
    _t: f64,
    omega: &VectorN<f64, Self::StateSize>
) -> VectorN<f64, Self::StateSize>
[src]

Computes the instantaneous equations of motion of the angular velocity of a tensor (i.e. the angular acceleration). [I]̲̇ω = -[̃ω][I]̲ω + ̲L

Source: Schaub & Junkins, 3th ed., eq. 4.32.

impl<'a> Dynamics for CelestialDynamics<'a>[src]

type StateSize = U6

type StateType = State

fn time(&self) -> f64[src]

Returns the relative time to the propagator. Use prop.dynamics.state.dt for absolute time

impl<'a> Dynamics for CelestialDynamicsStm<'a>[src]

type StateSize = U42

type StateType = (State, Matrix6<f64>)

fn time(&self) -> f64[src]

Returns the relative time to the propagator. Use prop.dynamics.state.dt for absolute time

fn state(&self) -> Self::StateType[src]

Returns the celestial state and the state transition matrix

impl<'a, D: DeltaVctrl> Dynamics for MissionArc<'a, D>[src]

type StateSize = U6

type StateType = State

fn time(&self) -> f64[src]

Returns the relative time

fn state(&self) -> Self::StateType[src]

State of the mission arc is always the celestial state

fn state_vector(&self) -> VectorN<f64, Self::StateSize>[src]

Mission arc state is a vector of six zeros followed by the fuel mass

impl<'a, T: ThrustControl> Dynamics for Spacecraft<'a, T>[src]

type StateSize = U7

type StateType = SpacecraftState

Loading content...