pub struct ThrustCurve { /* private fields */ }Expand description
Validated, piecewise-linear thrust curve with exact piecewise-quadratic impulse.
Implementations§
Source§impl ThrustCurve
impl ThrustCurve
Sourcepub fn new(points: Vec<ThrustPoint>) -> Result<Self>
pub fn new(points: Vec<ThrustPoint>) -> Result<Self>
Construct from at least two strictly time-ordered samples, starting at zero. Total impulse must be positive. Endpoint thrust need not be zero; the integrator explicitly handles the discontinuities at ignition and burnout.
Sourcepub fn points(&self) -> &[ThrustPoint]
pub fn points(&self) -> &[ThrustPoint]
Read-only access to the validated samples.
Sourcepub fn duration_s(&self) -> f64
pub fn duration_s(&self) -> f64
Time of the last sample, in seconds after ignition.
Sourcepub fn total_impulse_ns(&self) -> f64
pub fn total_impulse_ns(&self) -> f64
Integral of thrust over the entire curve, in newton seconds.
Sourcepub fn thrust_at(&self, elapsed_s: f64) -> Result<f64>
pub fn thrust_at(&self, elapsed_s: f64) -> Result<f64>
Interpolated thrust. Returns zero outside the closed curve interval.
At the final sample this returns the left-limit force; Motor::sample
reports zero thrust at and after burnout instead.
Sourcepub fn impulse_at(&self, elapsed_s: f64) -> Result<f64>
pub fn impulse_at(&self, elapsed_s: f64) -> Result<f64>
Exact integrated impulse through this time, clamped to the curve interval.
Trait Implementations§
Source§impl Clone for ThrustCurve
impl Clone for ThrustCurve
Auto Trait Implementations§
impl Freeze for ThrustCurve
impl RefUnwindSafe for ThrustCurve
impl Send for ThrustCurve
impl Sync for ThrustCurve
impl Unpin for ThrustCurve
impl UnsafeUnpin for ThrustCurve
impl UnwindSafe for ThrustCurve
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.