Skip to main content

Separation

Struct Separation 

Source
pub struct Separation {
    pub trigger: Trigger,
    pub after_stage: usize,
    pub drops_burning: bool,
}
Expand description

A separation: the stack comes apart at a stage boundary and every body descends under its own devices (docs/physics/recovery.md, and the decision record on separation, ADR-014).

Bodies are contiguous runs of stages. Stages 0..=after_stage keep the nose and are body 0; the stages aft of the split are body 1. Each body flies as a point mass from the separation, with the mass properties of its own stages and motors, so every body must carry at least one device: the descent phase has no airframe drag (the decision record on recovery, ADR-012), and a body with nothing open would fall as if in a vacuum.

A separation is an ideal one: no impulse, so each body leaves with the velocity its own center of mass already had. The aft body’s motors must have burned out by then, because a body’s mass is taken as constant through its descent, unless the separation may drop one burning (Separation::drops_burning). When the nose’s body still has a motor to burn, it is a sustainer: it flies on as a rigid body on its own stages’ aerodynamics, and only the aft body descends as a point mass (the decision record on staging, ADR-074).

Fields§

§trigger: Trigger

When the stack comes apart.

§after_stage: usize

The last stage that stays with the nose. Stages after it form the aft body.

§drops_burning: bool

Whether, when it is powered (Self::powered_at), it may drop a motor that still burns, as OpenRocket’s first burnout of a stage drops the stage’s other motors (the decision record on a stage’s first burnout, ADR-172). The dropped body’s descent is a point mass with no thrust, so it leaves out the impulse that motor had left (BodyFlight::impulse_left_n_s). Off by default: then the aft body’s motors must have burned out by the separation. A motor still to light is refused either way, and so is any in an unpowered separation’s aft body.

Implementations§

Source§

impl Separation

Source

pub const BODIES: usize = 2

How many bodies it makes: two.

Source

pub const fn new(trigger: Trigger, after_stage: usize) -> Separation

A separation at the boundary after after_stage, on trigger.

Source

pub const fn dropping_burning(self) -> Separation

The same separation, let drop a motor that still burns when it is powered (Self::drops_burning).

Source

pub const fn stages_of( &self, index: usize, stage_count: usize, ) -> Option<(usize, usize)>

The stages of body index: body 0 keeps the nose, body 1 is the rest. None when there is no such body, including when the boundary is at or past the last stage.

Source

pub fn powered_at(&self, assembly: &Assembly, time_s: f64) -> bool

Whether it is powered when it fires at time_s, as the flight decides for the first separation it flies: a motor of the nose’s body (stages 0..=after_stage) burns then, or lights later at a known time, counting one this separation lights. A powered separation’s nose body flies on as a rigid body on its own stages’ aerodynamics (the decision record on staging, ADR-074); an unpowered one’s descends as a point mass with only its devices’ drag, as every body does (the decision record on separation, ADR-014).

Source

pub fn body_of(separations: &[Separation], stage: usize) -> usize

The body stage stage rides once every one of separations (in the order they fire, as crate::Simulation::with_separations takes them) has fired: body k + 1 for the first separation k it is aft of, the part that separation drops; body 0, the nose’s, for a stage aft of none.

Source

pub fn stages_of_body( separations: &[Separation], body: usize, stage_count: usize, ) -> Option<(usize, usize)>

The stages of body body once every one of separations has fired, in a design of stage_count stages: body 0 keeps the nose, and body k + 1 is the stages separation k drops, from its boundary back to the one behind it (or the tail). None when there is no such body, including when a boundary is at or past the last stage, or the boundaries don’t move forward in the order given.

Trait Implementations§

Source§

impl Clone for Separation

Source§

fn clone(&self) -> Separation

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Separation

Source§

impl Debug for Separation

Source§

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

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

impl<'de> Deserialize<'de> for Separation

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Separation, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Separation

Source§

fn eq(&self, other: &Separation) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Separation

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Separation

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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
§

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
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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, 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.