#[non_exhaustive]pub enum StageOverrideRule {
Rescaled,
PartsInPlace,
}Expand description
How a stage’s Overrides set its inertia. Both rules give the stage the overrides’ mass and
center; they differ in where the stage’s parts are taken to be, and so in the inertia.
With the parts’ mass m_p, center x_p and inertia I_p about it, a mass override m′ and
a center override c, an AddedMass at a station counted among the parts (one with no
station is too under Rescaled, and sits at c under PartsInPlace):
| Rescaled | Parts in place | |
|---|---|---|
| mass override alone | I_p m′/m_p | I_p |
| center override alone | I_p | I_p + m_p ((d·d) 1 − d dᵀ), d = x_p − c |
| both | I_p m′/m_p | I_p + m_p ((d·d) 1 − d dᵀ) |
An inertia override replaces the tensor under either rule. The two agree on a stage with no override and on an override that changes neither the mass nor the center.
Neither rule is measured on a flying rocket: a stage’s overrides say what it weighs and where
it balances, not where the mass the parts don’t account for sits. Rescaled puts it where the
parts’ mass is; PartsInPlace puts it at the stage’s center and leaves each part where the
design puts it. The decision record that added the second rule weighs the two
(ADR-340).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Rescaled
The stage’s parts, with its added mass, are one body the overrides rescale and move
(Overrides::apply): a mass override scales the inertia with the mass, and a center
override moves the body whole, its inertia about its center unchanged. The default, and
hpr-design’s rule for a part’s overrides too (ADR-061).
PartsInPlace
The parts stay where the design puts them (Overrides::apply_with_parts_in_place): the
stage’s inertia is its parts’ about the stage’s center, and the mass a mass override adds
or takes away sits at that center. This is how OpenRocket 24.12 weighs a single stage’s
overrides that cover its parts, measured on probe designs (validation/oracles/openrocket/);
on the lower of two stages OpenRocket’s sum is below the parts’ inertia about the stage’s
center. The .ork reader gives it to every stage with such an override, on the axis
(ADR-340) or parallel, whose pods OpenRocket leaves in place the same way
(the record that measured a parallel stage).
Implementations§
Source§impl StageOverrideRule
impl StageOverrideRule
Sourcepub fn is_rescaled(&self) -> bool
pub fn is_rescaled(&self) -> bool
Whether this is the default rule, Rescaled.
Sourcepub fn weigh(
self,
parts: MassProperties,
added_mass: Option<AddedMass>,
overrides: &Overrides,
fore_station_m: f64,
) -> Result<MassProperties, DesignError>
pub fn weigh( self, parts: MassProperties, added_mass: Option<AddedMass>, overrides: &Overrides, fore_station_m: f64, ) -> Result<MassProperties, DesignError>
A stage whose parts weigh parts, with added_mass added to them and then overrides
applied by this rule, stations measured from the stage’s forward end fore_station_m.
§Errors
As AddedMass::add_to and Overrides::apply.
Trait Implementations§
Source§impl Clone for StageOverrideRule
impl Clone for StageOverrideRule
Source§fn clone(&self) -> StageOverrideRule
fn clone(&self) -> StageOverrideRule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for StageOverrideRule
Source§impl Debug for StageOverrideRule
impl Debug for StageOverrideRule
Source§impl Default for StageOverrideRule
impl Default for StageOverrideRule
Source§fn default() -> StageOverrideRule
fn default() -> StageOverrideRule
Source§impl<'de> Deserialize<'de> for StageOverrideRule
impl<'de> Deserialize<'de> for StageOverrideRule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for StageOverrideRule
Source§impl JsonSchema for StageOverrideRule
impl JsonSchema for StageOverrideRule
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for StageOverrideRule
impl PartialEq for StageOverrideRule
Source§fn eq(&self, other: &StageOverrideRule) -> bool
fn eq(&self, other: &StageOverrideRule) -> bool
self and other values to be equal, and is used by ==.