Skip to main content

PropSettings

Struct PropSettings 

Source
pub struct PropSettings {
    pub gravity_degree: u16,
    pub gravity_order: u16,
    pub abs_error: f64,
    pub rel_error: f64,
    pub use_spaceweather: bool,
    pub use_sun_gravity: bool,
    pub use_moon_gravity: bool,
    pub enable_interp: bool,
    pub precomputed: Option<Precomputed>,
}
Expand description

Propagation settings

These include

  • gravity_degree - maximum degree of spherical harmonic gravity model. Default is 4
  • gravity_order - maximum order of spherical harmonic gravity model. Default is same as gravity_degree. Must be ≤ gravity_degree.
  • abs_error - the maximum absolute error for the infinity norm of the state in Runge-Kutta integrator. Default is 1e-8
  • rel_error - the maximum relative error for the infinity norm of the state in Runge-Kutta integrator. Default is 1e-8
  • use_spaceweather - Do we use space weather when computing the atmospheric density. Default is true
  • use_sun_gravity - Do we include sun third-body gravitational perturbation. Default is true
  • use_moon_gravity - Do we include moon third-body gravitational perturbation. Default is true
  • enable_interp - Do we enable interpolation of the state between begin and end times. Default is true slight computation savings if set to false

Fields§

§gravity_degree: u16§gravity_order: u16§abs_error: f64§rel_error: f64§use_spaceweather: bool§use_sun_gravity: bool§use_moon_gravity: bool§enable_interp: bool§precomputed: Option<Precomputed>

Implementations§

Source§

impl PropSettings

Source

pub fn set_gravity(&mut self, degree: u16, order: u16) -> Result<()>

Set gravity degree and order, with validation

§Arguments
  • degree - Maximum degree of spherical harmonic gravity model
  • order - Maximum order (must be ≤ degree)
§Errors

Returns error if order > degree

Source

pub fn precompute_terms<T: TimeLike>( &mut self, begin: &T, end: &T, ) -> Result<()>

Precompute terms between begin and end instants

§Arguments
  • begin - Begin instant
  • end - End instant

Pre-computes inertial to earth-fixed rotation vector (used for Earth gravity calculation), sun, and moon positions between the begin and end instants. These are used in the force model when propagating orbits

Pre-computing these terms means the settings can be used for multiple propagations between the same begin and end instants without needing to recompute these terms each time. (significant speedup when propagating many orbits over the same time span)

§Errors

Returns error if precomputation fails

§Example
use satkit::orbitprop::PropSettings;
use satkit::Instant;

let begin = Instant::now();
let end = begin + satkit::Duration::from_hours(1.0);
let mut props = PropSettings::default();
props.precompute_terms(&begin, &end).unwrap();
Source

pub fn precompute_terms_with_step<T: TimeLike>( &mut self, begin: &T, end: &T, step_secs: f64, ) -> Result<()>

Trait Implementations§

Source§

impl Clone for PropSettings

Source§

fn clone(&self) -> PropSettings

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PropSettings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PropSettings

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Display for PropSettings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.