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

pub trait Dynamics where
    Self: Sized
{ type StateSize: DimName; fn time(&self) -> f64;
fn state(&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>
; }

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.

Loading content...

Required methods

fn time(&self) -> f64

Returns the time of the current state

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

Returns the current state of the dynamics 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.

Loading content...

Implementors

impl Dynamics for AngularMom[src]

type StateSize = U3

fn state(&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

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

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

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

Loading content...