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

Functions

 config ()
 _pressure_profiles (config, float duration_s, int n_points=101)
 _run_timeseries (config, float duration_s)
 _run_flight (config, data, float lox_kg, float fuel_kg)
 test_fuel_mass_is_capped_to_tank_and_left_alone_when_it_fits (config)
 test_apogee_increases_with_propellant_when_truncated (config)
 test_excess_propellant_does_not_increase_apogee (config)
 test_longer_burn_time_changes_impulse_and_apogee_with_enough_propellant (config)

Variables

str CONFIG = Path(__file__).resolve().parents[1] / "configs" / "default.yaml"

Detailed Description

Flight-sim propellant iteration -- regression tests against the shipped default config.

- Tank caps: a fuel tank too small for the requested load is capped by the flight router, a tank
  that fits the load is not, and an explicit design_requirements capacity wins over geometry.
- Apogee rises with propellant while the burn is truncated.
- Excess propellant above the full-burn requirement does not raise apogee.
- A longer burn with enough propellant raises impulse and apogee.

The previous version of this module read a config out of one developer's ~/Downloads folder and
asserted a property of that file's tank, so it skipped on every other machine and failed on his
once the file changed. Everything here is built from configs/default.yaml.

Function Documentation

◆ _pressure_profiles()

test_flight_propellant_iteration._pressure_profiles ( config,
float duration_s,
int n_points = 101 )
protected
Exponential blowdown from each tank's configured initial pressure to 70% of it.

Definition at line 40 of file test_flight_propellant_iteration.py.

Referenced by _run_timeseries().

◆ _run_flight()

test_flight_propellant_iteration._run_flight ( config,
data,
float lox_kg,
float fuel_kg )
protected

◆ _run_timeseries()

test_flight_propellant_iteration._run_timeseries ( config,
float duration_s )
protected

◆ config()

test_flight_propellant_iteration.config ( void )

Definition at line 28 of file test_flight_propellant_iteration.py.

◆ test_apogee_increases_with_propellant_when_truncated()

test_flight_propellant_iteration.test_apogee_increases_with_propellant_when_truncated ( config)

Definition at line 113 of file test_flight_propellant_iteration.py.

References _run_flight(), _run_timeseries(), and max.

◆ test_excess_propellant_does_not_increase_apogee()

test_flight_propellant_iteration.test_excess_propellant_does_not_increase_apogee ( config)

Definition at line 131 of file test_flight_propellant_iteration.py.

References _run_flight(), and _run_timeseries().

◆ test_fuel_mass_is_capped_to_tank_and_left_alone_when_it_fits()

test_flight_propellant_iteration.test_fuel_mass_is_capped_to_tank_and_left_alone_when_it_fits ( config)
The flight router caps a load the tank cannot hold, matches the shared resolver, does not
touch a load that fits, and honours an explicit design_requirements capacity over geometry.

Definition at line 77 of file test_flight_propellant_iteration.py.

◆ test_longer_burn_time_changes_impulse_and_apogee_with_enough_propellant()

test_flight_propellant_iteration.test_longer_burn_time_changes_impulse_and_apogee_with_enough_propellant ( config)

Definition at line 148 of file test_flight_propellant_iteration.py.

References _run_flight(), and _run_timeseries().

Variable Documentation

◆ CONFIG

str test_flight_propellant_iteration.CONFIG = Path(__file__).resolve().parents[1] / "configs" / "default.yaml"

Definition at line 24 of file test_flight_propellant_iteration.py.