#[non_exhaustive]pub struct DragTable {
pub power_off: Table1D,
pub power_on: Option<Table1D>,
pub reference_diameter_m: Option<f64>,
}Expand description
Drag coefficient against Mach number, power-off and optionally power-on.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.power_off: Table1DC_D0(M) with no motor thrusting.
power_on: Option<Table1D>C_D0(M) while a motor thrusts; the power-off table applies when this is None.
reference_diameter_m: Option<f64>The reference diameter the coefficients are on, m. When it differs from the rocket’s,
crate::AeroModel::drag rescales by the ratio of the reference areas; None takes the
coefficients as on the rocket’s reference area.
Implementations§
Source§impl DragTable
impl DragTable
Sourcepub fn new(power_off: Table1D, power_on: Option<Table1D>) -> Self
pub fn new(power_off: Table1D, power_on: Option<Table1D>) -> Self
A table with a power-off curve and an optional power-on curve, on the rocket’s reference area.
Sourcepub fn with_reference_diameter_m(
self,
diameter_m: f64,
) -> Result<Self, AeroError>
pub fn with_reference_diameter_m( self, diameter_m: f64, ) -> Result<Self, AeroError>
This table with its coefficients on a reference diameter of diameter_m, checked here
as NormalForceTable::with_reference_diameter_m checks its own, so that a bad diameter
is named when the table is made rather than at a flight’s first lookup (#79). A table
built or read with the field set directly is still checked at its first lookup.
§Errors
AeroError::Domain unless diameter_m is finite and positive.
Sourcepub fn from_csv(
power_off: &str,
power_on: Option<&str>,
) -> Result<Self, AeroError>
pub fn from_csv( power_off: &str, power_on: Option<&str>, ) -> Result<Self, AeroError>
Reads a power-off curve and an optional power-on curve from two-column CSV text
(parse_mach_csv with no column name).
§Errors
As parse_mach_csv.