STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_layerx_flight Namespace Reference

Functions

 le4_arrays ()
 le4_payload ()
 le4_loads ()
 le4_config ()
float he_bottle (float copv_psia, float volume_L)
 built_flight (config, payload, loads, **kw)
 config ()
 he_derived (config)
 he_kw (he_derived)
 he_flown (config, he_kw)
 he_built (config, he_kw)
 test_the_helium_drawing_flies_and_its_budget_is_helium (he_derived, he_kw, he_flown)
 test_the_refill_and_the_ullage_are_priced_as_helium (config, he_built)
 test_without_the_species_the_helium_bottle_is_refused_as_before (config, he_kw)
 test_the_configs_own_gas_changes_nothing (config)
 test_liftoff_mass_books_the_vehicle_as_the_flight_does (config, he_kw, he_flown)
 test_coolprop_names ()
 _ungated (flight, t)
 test_the_coast_reads_drag_only (he_built)
 test_the_burn_reads_exactly_as_before (he_built)
 test_the_fly_trajectory_coast_is_drag_only (he_flown)
 test_a_vehicle_held_on_the_rail_reads_one_g (config)
 test_stability_has_the_contract_shape (he_flown)
 test_static_margin_is_cg_less_cp_over_the_diameter (he_flown)
 test_cp_is_barrowmans_by_hand (he_built, he_flown)
 test_max_q_is_half_rho_v_squared_at_its_time (config, he_flown)
 test_rail_exit_against_an_independent_ascent (config, he_flown)
 test_a_stability_block_that_cannot_be_made_says_why ()

Variables

float G0 = 9.80665
float PSI = 6894.757293168
str LE4 = Path(__file__).resolve().parents[1] / "configs" / "ethalox_6800N.yaml"
float SITE_PA = 94069.72225005485
list LE4_SCHEDULE

Detailed Description

Layer X flight: the drawing's pressurant flies, the coast carries no thrust, a held vehicle
reads one g, and the vehicle's stability comes back with the flight.

docs/layerx/AUDIT.md 5.1 (in-flight head row), 5.2 (He drawing cannot be flown), 9.3;
docs/layerx/DATA-CONTRACT.md 4 (``result.flight.stability``).

Every check is against something other than the code under test: CoolProp's densities, RocketPy's
own kinematics, the 1976 standard atmosphere, or the formula the flight used before the change.

Function Documentation

◆ _ungated()

test_layerx_flight._ungated ( flight,
t )
protected
``axial_acceleration`` as it was before the gate (flight.py at the start of 2026-10-02).

Definition at line 235 of file test_layerx_flight.py.

Referenced by test_the_burn_reads_exactly_as_before(), and test_the_coast_reads_drag_only().

◆ built_flight()

test_layerx_flight.built_flight ( config,
payload,
loads,
** kw )
What ``flight.fly`` builds, keeping RocketPy's Flight: ``(flight config, setup_flight result)``.

Definition at line 91 of file test_layerx_flight.py.

Referenced by he_built().

◆ config()

test_layerx_flight.config ( void )

Definition at line 114 of file test_layerx_flight.py.

References le4_config().

◆ he_bottle()

float test_layerx_flight.he_bottle ( float copv_psia,
float volume_L )
The He drawing's bottle at T-0, CoolProp at 293.15 K (room temperature, the audit's hand check).

Definition at line 84 of file test_layerx_flight.py.

Referenced by he_kw().

◆ he_built()

test_layerx_flight.he_built ( config,
he_kw )

Definition at line 144 of file test_layerx_flight.py.

References built_flight(), le4_loads(), and le4_payload().

◆ he_derived()

test_layerx_flight.he_derived ( config)
The hot-fire drawing as Layer X reads it: its pressurant species and its bottle.

Definition at line 119 of file test_layerx_flight.py.

◆ he_flown()

test_layerx_flight.he_flown ( config,
he_kw )

Definition at line 139 of file test_layerx_flight.py.

References le4_loads(), and le4_payload().

◆ he_kw()

test_layerx_flight.he_kw ( he_derived)

Definition at line 133 of file test_layerx_flight.py.

References he_bottle().

◆ le4_arrays()

test_layerx_flight.le4_arrays ( )
(t, thrust [N], mdot_O, mdot_F) of the saved LE4 curve.

Definition at line 60 of file test_layerx_flight.py.

Referenced by le4_loads(), le4_payload(), test_rail_exit_against_an_independent_ascent(), and test_the_burn_reads_exactly_as_before().

◆ le4_config()

test_layerx_flight.le4_config ( )

Definition at line 78 of file test_layerx_flight.py.

Referenced by config().

◆ le4_loads()

test_layerx_flight.le4_loads ( )
What the curve burns, plus a gram: the flight caps each load to its tank as it would.

Definition at line 72 of file test_layerx_flight.py.

References le4_arrays().

Referenced by he_built(), he_flown(), test_liftoff_mass_books_the_vehicle_as_the_flight_does(), test_the_configs_own_gas_changes_nothing(), and test_without_the_species_the_helium_bottle_is_refused_as_before().

◆ le4_payload()

◆ test_a_stability_block_that_cannot_be_made_says_why()

test_layerx_flight.test_a_stability_block_that_cannot_be_made_says_why ( )

Definition at line 400 of file test_layerx_flight.py.

◆ test_a_vehicle_held_on_the_rail_reads_one_g()

test_layerx_flight.test_a_vehicle_held_on_the_rail_reads_one_g ( config)
A curve whose thrust dips below the weight before the vehicle leaves the rail: RocketPy holds
it (u_dot_rail1 clamps the axial acceleration to zero), the rail carries the difference, and
the liquid columns feel g0 sin(90 deg) = g0, the pad's value, not T/m. Once thrust exceeds the
weight again it reads T/m as before.

Definition at line 280 of file test_layerx_flight.py.

◆ test_coolprop_names()

test_layerx_flight.test_coolprop_names ( )

Definition at line 226 of file test_layerx_flight.py.

◆ test_cp_is_barrowmans_by_hand()

test_layerx_flight.test_cp_is_barrowmans_by_hand ( he_built,
he_flown )
The CP the block reports, by hand from the flown layout (Barrowman 1967, Mach 0, slender
body): nose normal-force slope 2 at X_N = L - V/A_base from its tip, V integrated here from the
von Karman (Haack C = 0) shape rather than taken as 0.5 L; fins
CN = (1 + r/(s + r)) 4N (s/d)^2 / (1 + sqrt(1 + (2 l_m/(Cr + Ct))^2)), l_m the mid-chord line, at
X = m (Cr + 2Ct)/(3(Cr + Ct)) + (Cr + Ct - Cr Ct/(Cr + Ct))/6 aft of the root's leading edge
(sweep m = Cr - Ct, RocketPy's default: a square trailing edge). Positions from the tail. A fin
set placed by its trailing edge instead of its leading edge, or a nose CP off by 1 cm, fails.

Definition at line 335 of file test_layerx_flight.py.

◆ test_liftoff_mass_books_the_vehicle_as_the_flight_does()

test_layerx_flight.test_liftoff_mass_books_the_vehicle_as_the_flight_does ( config,
he_kw,
he_flown )
The mass the inline ascent starts from, without building RocketPy: the same booking as the
flight's own (RocketPy's total_mass(0)), helium bottle and all; a weighed vehicle wins.

Definition at line 214 of file test_layerx_flight.py.

References le4_loads().

◆ test_max_q_is_half_rho_v_squared_at_its_time()

test_layerx_flight.test_max_q_is_half_rho_v_squared_at_its_time ( config,
he_flown )
Hand check: q = 1/2 rho v^2 with rho from the 1976 standard atmosphere at the reported
altitude and the reported speed (no wind: the free stream is the vehicle's speed). Max-Q comes
at burnout on LE4 (fastest, still low).

Definition at line 368 of file test_layerx_flight.py.

◆ test_rail_exit_against_an_independent_ascent()

test_layerx_flight.test_rail_exit_against_an_independent_ascent ( config,
he_flown )
The 1-DOF ascent (not RocketPy) on the same curve, mass and drag reaches the rail's length
at the speed RocketPy reports at rail exit (no rail buttons declared: the full rail is flown).

Definition at line 385 of file test_layerx_flight.py.

References le4_arrays().

◆ test_stability_has_the_contract_shape()

test_layerx_flight.test_stability_has_the_contract_shape ( he_flown)

Definition at line 303 of file test_layerx_flight.py.

◆ test_static_margin_is_cg_less_cp_over_the_diameter()

test_layerx_flight.test_static_margin_is_cg_less_cp_over_the_diameter ( he_flown)
Positions from the tail: CG ahead of CP is stable, margin = (CG - CP) / D. As the LOX tank
(aft of the fuel) drains the CG moves forward and the margin grows (AUDIT 9.3 3: 7.7 -> 8.7
cal on the GN2 run).

Definition at line 322 of file test_layerx_flight.py.

References min.

◆ test_the_burn_reads_exactly_as_before()

test_layerx_flight.test_the_burn_reads_exactly_as_before ( he_built)
The gate must not touch the burn: every firing instant, both ends included, is the old
formula bit for bit (the burn uses these through Setup.body_acceleration).

Definition at line 261 of file test_layerx_flight.py.

References _ungated(), and le4_arrays().

◆ test_the_coast_reads_drag_only()

test_layerx_flight.test_the_coast_reads_drag_only ( he_built)
After burnout the motor gives nothing: the specific force is the drag over the mass, which
is RocketPy's own vertical acceleration plus gravity (no wind, vertical rail: the axis stays
vertical), and zero at apogee where the vehicle stops. Before the gate it read +0.40 g there.

Definition at line 247 of file test_layerx_flight.py.

References _ungated().

◆ test_the_configs_own_gas_changes_nothing()

test_layerx_flight.test_the_configs_own_gas_changes_nothing ( config)
Turned on with the gas the config already says, nothing moves: same config, same flight,
bit for bit (the GN2 drawing's flights are unchanged by this fix).

Definition at line 198 of file test_layerx_flight.py.

References le4_loads(), and le4_payload().

◆ test_the_fly_trajectory_coast_is_drag_only()

test_layerx_flight.test_the_fly_trajectory_coast_is_drag_only ( he_flown)

Definition at line 274 of file test_layerx_flight.py.

◆ test_the_helium_drawing_flies_and_its_budget_is_helium()

test_layerx_flight.test_the_helium_drawing_flies_and_its_budget_is_helium ( he_derived,
he_kw,
he_flown )
AUDIT 5.2: the He drawing's bottle (0.209 kg) was priced as the config's nitrogen, needed
0.52 kg and was refused. Flown as the drawing's gas it flies, and says which gas it flew.

Definition at line 151 of file test_layerx_flight.py.

◆ test_the_refill_and_the_ullage_are_priced_as_helium()

test_layerx_flight.test_the_refill_and_the_ullage_are_priced_as_helium ( config,
he_built )
The COPV's loss is the gas that fills the volume the liquid leaves, at tank pressure and the
ullage temperature: sum of rho_He(p, T) / rho_liquid x liquid burned (CoolProp), and nothing
else. Priced as nitrogen it would be ~7x larger.

Definition at line 163 of file test_layerx_flight.py.

◆ test_without_the_species_the_helium_bottle_is_refused_as_before()

test_layerx_flight.test_without_the_species_the_helium_bottle_is_refused_as_before ( config,
he_kw )
``pressurant_gas=None`` is the previous behaviour exactly: the config's nitrogen prices the
refill and the 0.209 kg helium bottle cannot hold it (AUDIT 9.3 7.1: 'needs 0.521 kg').

Definition at line 189 of file test_layerx_flight.py.

References le4_loads(), and le4_payload().

Variable Documentation

◆ G0

float test_layerx_flight.G0 = 9.80665

Definition at line 23 of file test_layerx_flight.py.

◆ LE4

str test_layerx_flight.LE4 = Path(__file__).resolve().parents[1] / "configs" / "ethalox_6800N.yaml"

Definition at line 25 of file test_layerx_flight.py.

◆ LE4_SCHEDULE

list test_layerx_flight.LE4_SCHEDULE
Initial value:
1= [
2 (0, 6.972301, 1.917587, 1.251566), (0.05, 6.972301, 1.917587, 1.251566), (0.1, 6.927351, 1.906825, 1.245252),
3 (0.15, 6.882402, 1.896063, 1.238938), (0.2, 6.837452, 1.885301, 1.232625), (0.25, 6.819932, 1.879127, 1.231964),
4 (0.3, 6.802411, 1.872952, 1.231303), (0.35, 6.795583, 1.869783, 1.231821), (0.4, 6.788755, 1.866614, 1.232339),
5 (0.45, 6.781927, 1.863445, 1.232857), (0.5, 6.780529, 1.861768, 1.233808), (0.55, 6.779131, 1.860091, 1.234759),
6 (0.6, 6.781210, 1.859660, 1.235894), (0.65, 6.783289, 1.859228, 1.237028), (0.7, 6.785368, 1.858797, 1.238163),
7 (0.75, 6.789630, 1.859217, 1.239412), (0.8, 6.793892, 1.859637, 1.240661), (0.85, 6.799634, 1.860632, 1.241996),
8 (0.9, 6.805376, 1.861626, 1.243331), (0.95, 6.811118, 1.862621, 1.244666), (1, 6.818007, 1.864031, 1.246074),
9 (1.05, 6.824896, 1.865441, 1.247483), (1.1, 6.832595, 1.867150, 1.248954), (1.15, 6.840294, 1.868859, 1.250426),
10 (1.2, 6.847994, 1.870568, 1.251898), (1.25, 6.856368, 1.872529, 1.253432), (1.3, 6.864742, 1.874491, 1.254967),
11 (1.35, 6.873116, 1.876453, 1.256501), (1.4, 6.881859, 1.878559, 1.258073), (1.45, 6.890601, 1.880665, 1.259645),
12 (1.5, 6.899553, 1.882863, 1.261237), (1.55, 6.908505, 1.885062, 1.262830), (1.6, 6.917457, 1.887261, 1.264422),
13 (1.65, 6.926531, 1.889520, 1.266029), (1.7, 6.935604, 1.891779, 1.267636), (1.75, 6.944710, 1.894070, 1.269244),
14 (1.8, 6.953816, 1.896362, 1.270853), (1.85, 6.962922, 1.898653, 1.272461), (1.9, 6.972011, 1.900959, 1.274067),
15 (1.95, 6.981100, 1.903265, 1.275673), (2, 6.990123, 1.905570, 1.277269), (2.05, 6.999145, 1.907875, 1.278865),
16 (2.1, 7.008168, 1.910180, 1.280461), (2.15, 7.017106, 1.912470, 1.282042), (2.2, 7.026043, 1.914761, 1.283622),
17 (2.25, 7.034854, 1.917036, 1.285188), (2.3, 7.043664, 1.919312, 1.286753), (2.35, 7.052475, 1.921587, 1.288318),
18 (2.4, 7.061127, 1.923831, 1.289859), (2.45, 7.069779, 1.926075, 1.291399), (2.5, 7.078431, 1.928319, 1.292940),
19 (2.55, 7.086927, 1.930535, 1.294459), (2.6, 7.095422, 1.932751, 1.295979), (2.65, 7.103661, 1.934933, 1.297475),
20 (2.7, 7.111901, 1.937115, 1.298971), (2.75, 7.120140, 1.939297, 1.300467), (2.8, 7.128213, 1.941444, 1.301938),
21 (2.85, 7.136287, 1.943592, 1.303409), (2.9, 7.144188, 1.945702, 1.304854), (2.95, 7.152089, 1.947812, 1.306299),
22 (3, 7.159990, 1.949923, 1.307744), (3.05, 7.167719, 1.951993, 1.309163), (3.1, 7.175447, 1.954062, 1.310582),
23 (3.15, 7.182995, 1.956094, 1.311974), (3.2, 7.190543, 1.958126, 1.313367), (3.25, 7.198090, 1.960158, 1.314760),
24 (3.3, 7.205426, 1.962141, 1.316122), (3.35, 7.212762, 1.964123, 1.317485), (3.4, 7.219837, 1.966055, 1.318798),
25 (3.45, 7.226912, 1.967988, 1.320111), (3.4663, 7.229216, 1.968617, 1.320539),
26]

Definition at line 32 of file test_layerx_flight.py.

◆ PSI

float test_layerx_flight.PSI = 6894.757293168

Definition at line 24 of file test_layerx_flight.py.

◆ SITE_PA

float test_layerx_flight.SITE_PA = 94069.72225005485

Definition at line 27 of file test_layerx_flight.py.