Struct nyx_space::dynamics::spacecraft::BaseSpacecraftDynamics
source · pub struct BaseSpacecraftDynamics<'a, X: SpacecraftExt> {
pub orbital_dyn: OrbitalDynamics<'a>,
pub force_models: Vec<Arc<dyn ForceModel<X> + 'a>>,
pub guid_law: Option<Arc<dyn GuidanceLaw<X> + 'a>>,
pub decrement_mass: bool,
}
Expand description
A generic spacecraft dynamics with associated force models, guidance law, and flag specifying whether to decrement the fuel mass or not. Note: when developing new guidance laws, it is recommended to not enable fuel decrement until the guidance law seems to work without proper physics. Note: if the spacecraft runs out of fuel, the propagation segment will return an error.
Fields§
§orbital_dyn: OrbitalDynamics<'a>
§force_models: Vec<Arc<dyn ForceModel<X> + 'a>>
§guid_law: Option<Arc<dyn GuidanceLaw<X> + 'a>>
§decrement_mass: bool
Implementations§
source§impl<'a, X: SpacecraftExt> BaseSpacecraftDynamics<'a, X>
impl<'a, X: SpacecraftExt> BaseSpacecraftDynamics<'a, X>
sourcepub fn from_guidance_law(
orbital_dyn: OrbitalDynamics<'a>,
guid_law: Arc<dyn GuidanceLaw<X> + 'a>
) -> Self
pub fn from_guidance_law( orbital_dyn: OrbitalDynamics<'a>, guid_law: Arc<dyn GuidanceLaw<X> + 'a> ) -> Self
Initialize a Spacecraft with a set of orbital dynamics and a propulsion subsystem. By default, the mass of the vehicle will be decremented as propellant is consummed.
sourcepub fn from_guidance_law_no_decr(
orbital_dyn: OrbitalDynamics<'a>,
guid_law: Arc<dyn GuidanceLaw<X> + 'a>
) -> Self
pub fn from_guidance_law_no_decr( orbital_dyn: OrbitalDynamics<'a>, guid_law: Arc<dyn GuidanceLaw<X> + 'a> ) -> Self
Initialize a Spacecraft with a set of orbital dynamics and a propulsion subsystem. Will not decrement the fuel mass as propellant is consummed.
sourcepub fn new(orbital_dyn: OrbitalDynamics<'a>) -> Self
pub fn new(orbital_dyn: OrbitalDynamics<'a>) -> Self
Initialize a Spacecraft with a set of orbital dynamics and with SRP enabled.
sourcepub fn from_model(
orbital_dyn: OrbitalDynamics<'a>,
force_model: Arc<dyn ForceModel<X> + 'a>
) -> Self
pub fn from_model( orbital_dyn: OrbitalDynamics<'a>, force_model: Arc<dyn ForceModel<X> + 'a> ) -> Self
Initialize new spacecraft dynamics with the provided orbital mechanics and with the provided force model.
sourcepub fn from_models(
orbital_dyn: OrbitalDynamics<'a>,
force_models: Vec<Arc<dyn ForceModel<X> + 'a>>
) -> Self
pub fn from_models( orbital_dyn: OrbitalDynamics<'a>, force_models: Vec<Arc<dyn ForceModel<X> + 'a>> ) -> Self
Initialize new spacecraft dynamics with a vector of force models.
sourcepub fn add_model(&mut self, force_model: Arc<dyn ForceModel<X> + 'a>)
pub fn add_model(&mut self, force_model: Arc<dyn ForceModel<X> + 'a>)
Add a model to the currently defined spacecraft dynamics
sourcepub fn with_model(self, force_model: Arc<dyn ForceModel<X> + 'a>) -> Self
pub fn with_model(self, force_model: Arc<dyn ForceModel<X> + 'a>) -> Self
Clone these dynamics and add a model to the currently defined orbital dynamics
sourcepub fn guidance_achieved(
&self,
state: &BaseSpacecraft<X>
) -> Result<bool, NyxError>
pub fn guidance_achieved( &self, state: &BaseSpacecraft<X> ) -> Result<bool, NyxError>
A shortcut to spacecraft.guid_law if a guidance law is defined for these dynamics
sourcepub fn with_guidance_law(&self, guid_law: Arc<dyn GuidanceLaw<X> + 'a>) -> Self
pub fn with_guidance_law(&self, guid_law: Arc<dyn GuidanceLaw<X> + 'a>) -> Self
Clone these spacecraft dynamics and update the control to the one provided.
sourcepub fn with_guidance_law_no_decr(
&self,
guid_law: Arc<dyn GuidanceLaw<X> + 'a>
) -> Self
pub fn with_guidance_law_no_decr( &self, guid_law: Arc<dyn GuidanceLaw<X> + 'a> ) -> Self
Clone these spacecraft dynamics and update the control to the one provided.
sourcepub fn without_guidance_law(&self) -> Self
pub fn without_guidance_law(&self) -> Self
Clone these spacecraft dynamics and remove any control model
Trait Implementations§
source§impl<'a, X: Clone + SpacecraftExt> Clone for BaseSpacecraftDynamics<'a, X>
impl<'a, X: Clone + SpacecraftExt> Clone for BaseSpacecraftDynamics<'a, X>
source§fn clone(&self) -> BaseSpacecraftDynamics<'a, X>
fn clone(&self) -> BaseSpacecraftDynamics<'a, X>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'a, X: SpacecraftExt> Display for BaseSpacecraftDynamics<'a, X>
impl<'a, X: SpacecraftExt> Display for BaseSpacecraftDynamics<'a, X>
source§impl<'a, X: SpacecraftExt> Dynamics for BaseSpacecraftDynamics<'a, X>
impl<'a, X: SpacecraftExt> Dynamics for BaseSpacecraftDynamics<'a, X>
§type HyperdualSize = Const<9>
type HyperdualSize = Const<9>
type StateType = BaseSpacecraft<X>
source§fn finally(
&self,
next_state: Self::StateType
) -> Result<Self::StateType, NyxError>
fn finally( &self, next_state: Self::StateType ) -> Result<Self::StateType, NyxError>
source§fn eom(
&self,
delta_t: f64,
state: &OVector<f64, Const<90>>,
ctx: &Self::StateType
) -> Result<OVector<f64, Const<90>>, NyxError>
fn eom( &self, delta_t: f64, state: &OVector<f64, Const<90>>, ctx: &Self::StateType ) -> Result<OVector<f64, Const<90>>, NyxError>
source§fn dual_eom(
&self,
delta_t_s: f64,
ctx: &Self::StateType
) -> Result<(OVector<f64, Const<9>>, OMatrix<f64, Const<9>, Const<9>>), NyxError>
fn dual_eom( &self, delta_t_s: f64, ctx: &Self::StateType ) -> Result<(OVector<f64, Const<9>>, OMatrix<f64, Const<9>, Const<9>>), NyxError>
Auto Trait Implementations§
impl<'a, X> !RefUnwindSafe for BaseSpacecraftDynamics<'a, X>
impl<'a, X> Send for BaseSpacecraftDynamics<'a, X>
impl<'a, X> Sync for BaseSpacecraftDynamics<'a, X>
impl<'a, X> Unpin for BaseSpacecraftDynamics<'a, X>
impl<'a, X> !UnwindSafe for BaseSpacecraftDynamics<'a, X>
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Printing<T> for Twhere
T: Display,
impl<T> Printing<T> for Twhere T: Display,
§fn to_str(self) -> String
fn to_str(self) -> String
printing.rs
. §fn to_plainstr(self) -> String
fn to_plainstr(self) -> String
printing.rs
.§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.