Struct nyx_space::cosmic::eclipse::Spacecraft [−][src]
pub struct Spacecraft {
pub orbit: Orbit,
pub dry_mass_kg: f64,
pub fuel_mass_kg: f64,
pub srp_area_m2: f64,
pub drag_area_m2: f64,
pub cr: f64,
pub cd: f64,
pub thruster: Option<Thruster>,
pub mode: GuidanceMode,
pub stm: Option<OMatrix<f64, Const<9>, Const<9>>>,
}
Expand description
A spacecraft state
Fields
orbit: Orbit
Initial orbit the vehicle is in
dry_mass_kg: f64
Dry mass, i.e. mass without fuel, in kg
fuel_mass_kg: f64
Fuel mass (if fuel mass is negative, thrusting will fail, unless configured to break laws of physics)
srp_area_m2: f64
in m^2
drag_area_m2: f64
in m^2
cr: f64
coefficient of reflectivity, must be between 0.0 (translucent) and 2.0 (all radiation absorbed and twice the force is transmitted back).
cd: f64
coefficient of drag; (spheres are between 2.0 and 2.1, use 2.2 in Earth’s atmosphere).
thruster: Option<Thruster>
mode: GuidanceMode
Guidance mode determines whether the thruster should fire or not
stm: Option<OMatrix<f64, Const<9>, Const<9>>>
Optionally stores the state transition matrix from the start of the propagation until the current time (i.e. trajectory STM, not step-size STM)
Implementations
Initialize a spacecraft state from all of its parameters
Initialize a spacecraft state from the SRP default 1.8 for coefficient of reflectivity (fuel mass and drag parameters nullified!)
Initialize a spacecraft state from the SRP default 1.8 for coefficient of drag (fuel mass and SRP parameters nullified!)
pub fn from_thruster(
orbit: Orbit,
dry_mass_kg: f64,
fuel_mass_kg: f64,
thruster: Thruster,
init_mode: GuidanceMode
) -> Self
pub fn from_thruster(
orbit: Orbit,
dry_mass_kg: f64,
fuel_mass_kg: f64,
thruster: Thruster,
init_mode: GuidanceMode
) -> Self
Initialize a spacecraft state from only a thruster and mass. Use this when designing control laws whilke ignoring drag and SRP.
Returns a copy of the state with a new dry mass
Returns a copy of the state with a new fuel mass
Returns a copy of the state with a new SRP area and CR
Returns a copy of the state with a new SRP area
Returns a copy of the state with a new coefficient of reflectivity
Returns a copy of the state with a new drag area and CD
Returns a copy of the state with a new SRP area
Returns a copy of the state with a new coefficient of drag
Returns a copy of the state with a new orbit
Returns a copy of the state with the provided guidance mode
Returns the root sum square error between this spacecraft and the other, in kilometers for the position, kilometers per second in velocity, and kilograms in fuel
Sets the STM of this state of identity, which also enables computation of the STM for spacecraft navigation
Trait Implementations
From the state extract the state to be estimated
From the state extract the state to be estimated
Stop searching when the time has converged to less than 0.1 seconds
Finds the darkest part of an eclipse within 2% of penumbra (i.e. 98% in shadow)
Stop searching when the time has converged to less than 0.1 seconds
Finds the slightest penumbra within 2%(i.e. 98% in visibility)
Return the parameters in order
Return the requested parameter and its time derivative
fn set_value_and_deriv(
&mut self,
param: &StateParameter,
value: f64,
_: f64
) -> Result<(), NyxError>
fn set_value_and_deriv(
&mut self,
param: &StateParameter,
value: f64,
_: f64
) -> Result<(), NyxError>
Sets the requested parameter
Perform a measurement from the ground station to the receiver (rx).
The vector is organized as such: [X, Y, Z, Vx, Vy, Vz, Cr, Cd, Fuel mass, STM(9x9)]
Vector is expected to be organized as such: [X, Y, Z, Vx, Vy, Vz, Cr, Cd, Fuel mass, STM(9x9)]
diag(STM) = [X,Y,Z,Vx,Vy,Vz,Cr,Cd,Fuel] WARNING: Currently the STM assumes that the fuel mass is constant at ALL TIMES!
Return this state as a vector for the propagation/estimation By default, this is not implemented. This function must be implemented when filtering on this state. Read more
Initialize an empty state By default, this is not implemented. This function must be implemented when filtering on this state. Read more
By default, this is not implemented. This function must be implemented when filtering on this state.
Auto Trait Implementations
impl RefUnwindSafe for Spacecraft
impl Send for Spacecraft
impl Sync for Spacecraft
impl Unpin for Spacecraft
impl UnwindSafe for Spacecraft
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.