nyx_space::md::opti::targeter

Struct Targeter

Source
pub struct Targeter<'a, const V: usize, const O: usize> {
    pub prop: &'a Propagator<SpacecraftDynamics>,
    pub objectives: [Objective; O],
    pub objective_frame: Option<Frame>,
    pub variables: [Variable; V],
    pub correction_frame: Option<LocalFrame>,
    pub iterations: usize,
}
Expand description

An optimizer structure with V control variables and O objectives.

Fields§

§prop: &'a Propagator<SpacecraftDynamics>

The propagator setup (kind, stages, etc.)

§objectives: [Objective; O]

The list of objectives of this targeter

§objective_frame: Option<Frame>

An optional frame (and Cosm) to compute the objectives in. Needed if the propagation frame is separate from objectives frame (e.g. for B Plane targeting).

§variables: [Variable; V]

The kind of correction to apply to achieve the objectives

§correction_frame: Option<LocalFrame>

The frame in which the correction should be applied, must be either a local frame or inertial

§iterations: usize

Maximum number of iterations

Implementations§

Source§

impl<const V: usize, const O: usize> Targeter<'_, V, O>

Source

pub fn try_achieve_fd( &self, initial_state: Spacecraft, correction_epoch: Epoch, achievement_epoch: Epoch, almanac: Arc<Almanac>, ) -> Result<TargeterSolution<V, O>, TargetingError>

Differential correction using finite differencing

Source§

impl<const V: usize, const O: usize> Targeter<'_, V, O>

Source

pub fn try_achieve_dual( &self, initial_state: Spacecraft, correction_epoch: Epoch, achievement_epoch: Epoch, almanac: Arc<Almanac>, ) -> Result<TargeterSolution<V, O>, TargetingError>

Differential correction using hyperdual numbers for the objectives

Source§

impl<'a, const O: usize> Targeter<'a, 3, O>

Source

pub fn delta_v( prop: &'a Propagator<SpacecraftDynamics>, objectives: [Objective; O], ) -> Self

Create a new Targeter which will apply an impulsive delta-v correction.

Source

pub fn delta_r( prop: &'a Propagator<SpacecraftDynamics>, objectives: [Objective; O], ) -> Self

Create a new Targeter which will MOVE the position of the spacecraft at the correction epoch

Source

pub fn vnc( prop: &'a Propagator<SpacecraftDynamics>, objectives: [Objective; O], ) -> Self

Create a new Targeter which will apply an impulsive delta-v correction on all components of the VNC frame. By default, max step is 0.5 km/s.

Source§

impl<'a, const O: usize> Targeter<'a, 4, O>

Source

pub fn thrust_dir( prop: &'a Propagator<SpacecraftDynamics>, objectives: [Objective; O], ) -> Self

Create a new Targeter which will apply a continuous thrust for the whole duration of the segment

Source§

impl<'a, const O: usize> Targeter<'a, 7, O>

Source

pub fn thrust_dir_rate( prop: &'a Propagator<SpacecraftDynamics>, objectives: [Objective; O], ) -> Self

Create a new Targeter which will apply a continuous thrust for the whole duration of the segment

Source§

impl<'a, const O: usize> Targeter<'a, 10, O>

Source

pub fn thrust_profile( prop: &'a Propagator<SpacecraftDynamics>, objectives: [Objective; O], ) -> Self

Create a new Targeter which will apply a continuous thrust for the whole duration of the segment

Source§

impl<'a, const V: usize, const O: usize> Targeter<'a, V, O>

Source

pub fn new( prop: &'a Propagator<SpacecraftDynamics>, variables: [Variable; V], objectives: [Objective; O], ) -> Self

Create a new Targeter which will apply an impulsive delta-v correction.

Source

pub fn in_frame( prop: &'a Propagator<SpacecraftDynamics>, variables: [Variable; V], objectives: [Objective; O], objective_frame: Frame, ) -> Self

Create a new Targeter which will apply an impulsive delta-v correction.

Source

pub fn vnc_with_components( prop: &'a Propagator<SpacecraftDynamics>, variables: [Variable; V], objectives: [Objective; O], ) -> Self

Create a new Targeter which will apply an impulsive delta-v correction on the specified components of the VNC frame.

Source

pub fn try_achieve_from( &self, initial_state: Spacecraft, correction_epoch: Epoch, achievement_epoch: Epoch, almanac: Arc<Almanac>, ) -> Result<TargeterSolution<V, O>, TargetingError>

Runs the targeter using finite differencing (for now).

Source

pub fn apply( &self, solution: &TargeterSolution<V, O>, almanac: Arc<Almanac>, ) -> Result<Spacecraft, TargetingError>

Apply a correction and propagate to achievement epoch. Also checks that the objectives are indeed matched

Source

pub fn apply_with_traj( &self, solution: &TargeterSolution<V, O>, almanac: Arc<Almanac>, ) -> Result<(Spacecraft, Traj<Spacecraft>), TargetingError>

Apply a correction and propagate to achievement epoch, return the final state and trajectory. Also checks that the objectives are indeed matched.

Trait Implementations§

Source§

impl<'a, const V: usize, const O: usize> Clone for Targeter<'a, V, O>

Source§

fn clone(&self) -> Targeter<'a, V, O>

Returns a copy 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<const V: usize, const O: usize> Display for Targeter<'_, V, O>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, const V: usize, const O: usize> Freeze for Targeter<'a, V, O>

§

impl<'a, const V: usize, const O: usize> !RefUnwindSafe for Targeter<'a, V, O>

§

impl<'a, const V: usize, const O: usize> Send for Targeter<'a, V, O>

§

impl<'a, const V: usize, const O: usize> Sync for Targeter<'a, V, O>

§

impl<'a, const V: usize, const O: usize> Unpin for Targeter<'a, V, O>

§

impl<'a, const V: usize, const O: usize> !UnwindSafe for Targeter<'a, V, O>

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, dst: *mut u8)

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

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

§

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

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

fn is_in_subset(&self) -> bool

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

fn to_subset_unchecked(&self) -> SS

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

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§

default 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T