Trait nyx_space::dynamics::Dynamics [−][src]
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 HyperdualSize: DimName
[src]
The state of the associated hyperdual state, almost always StateType + U1
type StateType: State
[src]
Required methods
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>,
[src]
&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>,
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.
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,
[src]
&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,
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
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,
[src]
&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,
Computes both the state and the gradient of the dynamics. This function is pre-implemented.
fn finally(
&self,
next_state: Self::StateType
) -> Result<Self::StateType, NyxError>
[src]
&self,
next_state: Self::StateType
) -> Result<Self::StateType, NyxError>
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
impl<'a> Dynamics for OrbitalDynamics<'a>
[src]
type HyperdualSize = U7
type StateType = Orbit
fn eom(
&self,
delta_t_s: f64,
state: &VectorN<f64, U42>,
ctx: &Orbit
) -> Result<VectorN<f64, U42>, NyxError>
[src]
&self,
delta_t_s: f64,
state: &VectorN<f64, U42>,
ctx: &Orbit
) -> Result<VectorN<f64, U42>, NyxError>
fn dual_eom(
&self,
_delta_t_s: f64,
state: &VectorN<Hyperdual<f64, U7>, U6>,
ctx: &Orbit
) -> Result<(Vector6<f64>, Matrix6<f64>), NyxError>
[src]
&self,
_delta_t_s: f64,
state: &VectorN<Hyperdual<f64, U7>, U6>,
ctx: &Orbit
) -> Result<(Vector6<f64>, Matrix6<f64>), NyxError>
impl<'a> Dynamics for Spacecraft<'a>
[src]
type HyperdualSize = U7
type StateType = SpacecraftState
fn finally(
&self,
next_state: Self::StateType
) -> Result<Self::StateType, NyxError>
[src]
&self,
next_state: Self::StateType
) -> Result<Self::StateType, NyxError>
fn eom(
&self,
delta_t: f64,
state: &VectorN<f64, U43>,
ctx: &SpacecraftState
) -> Result<VectorN<f64, U43>, NyxError>
[src]
&self,
delta_t: f64,
state: &VectorN<f64, U43>,
ctx: &SpacecraftState
) -> Result<VectorN<f64, U43>, NyxError>
fn dual_eom(
&self,
delta_t_s: f64,
state_vec: &VectorN<Hyperdual<f64, Self::HyperdualSize>, U7>,
ctx: &Self::StateType
) -> Result<(VectorN<f64, U7>, MatrixN<f64, U7>), NyxError>
[src]
&self,
delta_t_s: f64,
state_vec: &VectorN<Hyperdual<f64, Self::HyperdualSize>, U7>,
ctx: &Self::StateType
) -> Result<(VectorN<f64, U7>, MatrixN<f64, U7>), NyxError>