|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Classes | |
| class | StandTripped |
Functions | |
| List[float] | _psia (List[float] values) |
| Any | _clean (Any value) |
| Dict[str, Any] | _setup_dict (Any setup) |
| tuple | _burn_once (Prepared prep, Optional[tuple] schedule, Progress say, Callable[[], bool] cancelled, float lo, float hi, Optional[Dict[str, Any]] accel=None, int pass_no=1, Optional[Callable[..., Any]] inline=None, Optional[Callable[[float, float, float], None]] live=None) |
| Dict[str, str] | dome_line_instruments (Any diagram, Any built) |
| Dict[str, Any] | run_prepared (Prepared prep, *, Optional[Progress] progress=None, Callable[[], bool] cancelled=lambda:False, Any runner=None, bool replay=True, Any config=None, bool diagnostics=False, Optional[Dict[str, Any]] sidecars=None, Optional[Callable[[float, float, float], None]] live=None) |
| Optional[float] | _trace_ullage_gas_kg (Prepared prep, Any trace) |
| Callable[[Any, Dict[str, float], float], Any] | _inline_factory (Prepared prep, Any config) |
| Dict[str, Any] | _inline_block (Optional[Dict[str, Any]] ascent, Optional[Dict[str, Any]] flown, Any flt) |
| Optional[float] | _schedule_gap (Dict[str, Any] inline, Dict[str, Any] rocketpy) |
| Dict[str, Any] | _failed (BaseException exc) |
| tuple | diagnostics_of (Prepared prep, Dict[str, Any] result, Any config, Any runner, Optional[Dict[str, Any]] opts=None) |
| bool | _review_pending (str key) |
| List[Dict[str, Any]] | grade_limits (Dict[str, Any] result, Any prep=None, Any config=None, Optional[Dict[str, Any]] opts=None, *, Optional[Dict[str, float]] meop_psi=None) |
| None | _key_events (Dict[str, Any] result, Prepared prep, Dict[str, Any] opts) |
| List[Dict[str, Any]] | model_record (Dict[str, Any] result, Optional[Prepared] prep=None) |
| Dict[str, float] | _loads (Dict[str, Any] result) |
| Optional[Dict[str, Any]] | _delivered (Dict[str, Any] rp, Dict[str, Any] result, float dt) |
| Dict[str, Any] | _flight_curve (Dict[str, Any] result, Optional[Dict[str, Any]] dv) |
| Any | _safe (Callable[..., Any] fn, *Any args) |
| Optional[float] | _ullage_gas_kg (Prepared prep, Dict[str, Any] result) |
| Optional[float] | _pressurant_kg (Dict[str, Any] result) |
| Dict[str, Any] | _pass_figures (Dict[str, Any] result, Optional[Dict[str, Any]] dv) |
| Dict[str, Any] | _flight_block (Prepared prep, Optional[Dict[str, Any]] flown, Optional[Dict[str, Any]] ground, Optional[Dict[str, Any]] last) |
| tuple | _impulse_to_depletion (Any trace, List[int] fire_idx, Any steps, str ox_tank, str fuel_tank, Dict[str, List[float]] ch) |
| Dict[str, float] | _dump_coefficients (Prepared prep) |
| Optional[int] | _card_outside (Prepared prep, Dict[str, Any] series, List[int] fire_idx) |
| Dict[str, Dict[str, Any]] | _instrument_series (Prepared prep, Any trace) |
| Dict[str, Any] | reduce_trace (Prepared prep, Any trace, Dict[str, float] initial) |
| Optional[Dict[str, Any]] | _network_of (Any trace) |
| Optional[Dict[str, Any]] | _trip_of (Any trace) |
| float | _line_exit_psia (Prepared prep, str side, float mdot, float p_tank, Optional[float] dp_feed) |
| Dict[str, Any] | cross_check (Prepared prep, Dict[str, Any] result, Any runner) |
| Dict[str, Any] | engine_check (Prepared prep, Dict[str, Any] result, int points=12) |
| Dict[str, Any] | _engine_check_from_replay (Prepared prep, Dict[str, Any] series, Dict[str, Any] rp) |
Variables | |
| float | G0 = 9.80665 |
| Progress = Callable[[str, float], None] | |
| tuple | DIAGNOSTIC_KEYS |
| tuple | FEED_KEYS |
| tuple | REVIEW_PENDING |
| tuple | REVIEW_NOTE |
| tuple | CHUG_DECISION |
| THERMAL_INSTRUMENTS = frozenset({"TC", "RTD"}) | |
Run a prepared Layer X burn and reduce it to what a person reads. The trace from :func:`feedtwin.session.burn.run_burn` is absolute SI, sampled at every step. This module turns it into four things: * **series**: every step in display units (psia, kg/s, N), one column per quantity, for the plots; * **summary**: the numbers a design review asks for (burn time, total impulse, the pressure ladder at T-0 and at its lowest, injector stiffness at its lowest, residuals); * **events**: when things happened (T-0 settle, ignition, lowest tank pressure, depletion); * **provenance**: everything needed to say what this run was: the drawing's hash, the config's hash, the setup, the plan, the engine calibration, and every parameter the drawing did not state. Integrals use the same rule the burn's mass bookkeeping uses: each step's value times that step. The library's conservation test checks that rule against tank inventory.
|
protected |
One twin pass. ``schedule`` is ``(t, A_throat)`` from the previous replay, applied to the chamber before every step; ``None`` is the as-built throat. ``accel`` is the flight's proper acceleration on the burn's clock (``flight.fly``), applied to every liquid column once the engine fires; ``None`` is the pad's one g throughout. ``inline`` (AUDIT D5-C) builds a :class:`flight.InlineAscent` from the trace and session at Fire; it is then advanced at every later sample on that sample's thrust and propellant flow, and its specific force is the acceleration the next step burns at, exactly as ``accel`` is applied (one step of lag). A held vehicle reads exactly one g0, so the lead-in and a vehicle still on the pad are the pad's burn. The ascent is returned as the trace's ``inline_ascent`` record (``None`` without it).
Definition at line 72 of file analysis.py.
References dome_line_instruments(), max, and min.
Referenced by run_prepared().
|
protected |
Firing steps at which the burn asked the engine card about a point outside what it was fitted to: an injector (flow, inlet pressure) or a chamber (O/F, flow) beyond its sample hull. ``None`` when there is no card.
Definition at line 1046 of file analysis.py.
Referenced by reduce_trace().
|
protected |
JSON-safe: NaN and inf become None, tuples become lists.
Definition at line 40 of file analysis.py.
References _clean().
Referenced by _clean(), and run_prepared().
|
protected |
The replay's answers on the twin's steps (``replay.delivered``), plus its impulse to depletion: the replay's impulse carried to depletion in the same proportion as the twin's, so a comparison graded on the replay is graded on a smooth number too.
Definition at line 891 of file analysis.py.
Referenced by run_prepared().
|
protected |
``K_exit / (2 rho A_exit^2)`` per side [Pa/(kg/s)^2]: the dump of the feed line's velocity head into the manifold, as EngineDesign prices it (its config density and exit bore). Zero for the twin's native engine, whose injector leg starts at the line exit with no manifold.
Definition at line 1025 of file analysis.py.
Referenced by reduce_trace().
|
protected |
As :func:`engine_check`, against EngineDesign's replay of this very burn: same instants, same line-exit pressures, the chamber eroded as far as EngineDesign says it had by then. With the replay's throat history applied to the twin, this is what the agreement loop closed.
Definition at line 1473 of file analysis.py.
References max.
Referenced by engine_check().
|
protected |
Definition at line 639 of file analysis.py.
Referenced by diagnostics_of(), and run_prepared().
|
protected |
Definition at line 982 of file analysis.py.
Referenced by run_prepared().
|
protected |
The burn as the flight flies it and as Forward and the Flight tab receive it: the Time-Series payload. It starts with a sample at Fire and ends on the last step, which the burn already cut to land on depletion (BurnPlan.end_on_depletion), so its impulse moves smoothly with the design and nothing past the burn's own end is flown.
Definition at line 907 of file analysis.py.
Referenced by run_prepared().
|
protected |
The impulse the load delivers if the burn ends exactly when the first tank empties [N·s], and when that is [s from Fire]: ``(impulse, t)``, or ``(None, None)`` for a burn too short. The burn stops on a step: the step in which a tank goes dry counts in full, so ``total_impulse_Ns`` moves by up to a step's worth (~330 N·s at 6.7 kN and 50 ms) as a design change slides the depletion across a step boundary. Any comparison between designs reads that as signal. This does not. It is the burn's own impulse per kilogram up to its last full step, times everything it could burn: what it burned up to that step, plus what is left at the O/F it was running, until the first tank empties.
Definition at line 996 of file analysis.py.
Referenced by reduce_trace().
|
protected |
``result.flight`` additions for the inline ascent: the acceleration the final pass burned at, the vehicle it flew, and how far it is from RocketPy's on the same burn.
Definition at line 567 of file analysis.py.
References _schedule_gap().
Referenced by run_prepared().
|
protected |
What :func:`_burn_once` calls at Fire to place the inline ascent's vehicle on the pad: the vehicle the RocketPy flight would fly (``flight.liftoff_mass`` books it the same way), with the loads, the bottle's gas and the ullage gas the trace holds at that instant. A weighed liftoff mass (``settings.liftoff_mass_kg``) wins.
Definition at line 543 of file analysis.py.
References _safe().
Referenced by run_prepared().
|
protected |
|
protected |
Give every event a stable ``key`` (DATA-CONTRACT 4) and add the ones the diagnostics and the limits know: the fuel lead and ignition (start), the graded chug minimum, burnout and a vessel trip (kind ``fail``; :func:`reduce_trace` writes it first). Warnings are ``warn:<n>``, numbered in time order.
Definition at line 797 of file analysis.py.
Referenced by run_prepared().
|
protected |
EngineDesign's pressure at the end of its feed line [psia]: the tank, less every feed loss except the exit dump into the manifold. Its ``P_injector`` is downstream of that dump (the still manifold), which is not where the twin's line ends, so comparing the two directly compares two different places.
Definition at line 1344 of file analysis.py.
Referenced by cross_check().
|
protected |
Definition at line 886 of file analysis.py.
Referenced by run_prepared().
|
protected |
``result["network"]`` (DATA-CONTRACT 2) from a trace recorded with ``Probes(network=True)``; ``None`` for a trace without one (a caller's own, or one recorded before the recorder).
Definition at line 1324 of file analysis.py.
Referenced by reduce_trace().
|
protected |
What a pass delivered, for the pad-against-flight comparison.
Definition at line 957 of file analysis.py.
References min.
Referenced by run_prepared().
|
protected |
The bottle's gas at the first firing step.
Definition at line 949 of file analysis.py.
Referenced by run_prepared().
|
protected |
Definition at line 36 of file analysis.py.
Referenced by _instrument_series(), and reduce_trace().
|
protected |
Definition at line 730 of file analysis.py.
Referenced by grade_limits().
|
protected |
Definition at line 917 of file analysis.py.
Referenced by _inline_factory(), and run_prepared().
|
protected |
See ``vs_rocketpy_basis`` in :func:`_inline_block`.
Definition at line 615 of file analysis.py.
Referenced by _inline_block().
|
protected |
Definition at line 64 of file analysis.py.
Referenced by reduce_trace().
|
protected |
The gas in both tanks' ullages at the trace's latest sample [kg]: as :func:`_ullage_gas_kg` prices it (the drawing's tank volumes, the twin's fill, pressure and gas temperature, CoolProp's density), read live from the trace instead of a finished result.
Definition at line 520 of file analysis.py.
References max.
|
protected |
``result["tripped"]`` (DATA-CONTRACT 4): lib/feedtwin's ``trip_record`` of the vessel trip that ended the burn, ``None`` when nothing tripped.
Definition at line 1334 of file analysis.py.
Referenced by reduce_trace().
|
protected |
The gas already in both tanks' ullages at Fire [kg]: the drawing's tank volumes, the twin's fill, pressure and gas temperature, CoolProp's density. It flies with the vehicle; the flight's own figure comes from the config's (smaller) tanks.
Definition at line 924 of file analysis.py.
References max.
| Dict[str, Any] engine.layerx.analysis.cross_check | ( | Prepared | prep, |
| Dict[str, Any] | result, | ||
| Any | runner ) |
Layer X against EngineDesign's own forward solve at the same tank pressures.
Taken at the first step after the ignition transient. The difference has
two sources, and the table says which is which:
* the feed lines: EngineDesign's ``feed_system`` (one K per side) against
the drawing's line-by-line network, visible as the injector-inlet
pressure;
* the engine away from its calibration point (none at T-0 when calibrated).
Definition at line 1364 of file analysis.py.
References _line_exit_psia().
Referenced by run_prepared().
| tuple engine.layerx.analysis.diagnostics_of | ( | Prepared | prep, |
| Dict[str, Any] | result, | ||
| Any | config, | ||
| Any | runner, | ||
| Optional[Dict[str, Any]] | opts = None ) |
Every DATA-CONTRACT 3 block for a settled burn: ``(diagnostics, wall_s per block)``.
Each block is its module's (``engine/layerx/diag``), called on the finished result; the
order lets a block read the ones before it (the shutdown reads the gas-ingestion onsets, the
water hammer the start's arrival). A block that raises is ``{available: false, error}``; none
can take the burn down. ``opts`` are :func:`engine.layerx.prepare.options` (the run's).
Definition at line 643 of file analysis.py.
References _failed().
Referenced by run_prepared().
| Dict[str, str] engine.layerx.analysis.dome_line_instruments | ( | Any | diagram, |
| Any | built ) |
The network node of each transducer on a dome line nothing on the drawing loads, and the dome signal it reads (``"<regulator tag>.dome"``). Layer X burns the vehicle alone: the GSE's loader is cut (engine.layerx.vehicle), the dome is the dial's, and the line from the dome port to the cut disconnect is no plumbing, so the solve leaves it at atmosphere. Walked from the ``dome`` handle through junctions and instruments, stopping at any valve, regulator, disconnect or vessel, as feed-twin walks it for a stand built with its GSE ignored (``Session._find_cut_dome_ports``). A regulator whose loader is drawn on the vehicle is left alone: the session already reads its line.
Definition at line 186 of file analysis.py.
Referenced by _burn_once().
| Dict[str, Any] engine.layerx.analysis.engine_check | ( | Prepared | prep, |
| Dict[str, Any] | result, | ||
| int | points = 12 ) |
The engine the twin burned, against EngineDesign at the same injector-inlet pressures. At ``points`` instants across the firing window, EngineDesign is solved at the line exit (its feed losses zeroed, its exit dump kept) at exactly the inlet pressures the twin's network delivered. Same boundary, same pressures, so any difference is the engine model and nothing else: the card's tabulation error, the T-0 fit's drift away from T-0, or the native engine's whole gap. The feed system is the twin's in both columns, and this does not test it.
Definition at line 1422 of file analysis.py.
References _engine_check_from_replay(), and max.
Referenced by run_prepared().
| List[Dict[str, Any]] engine.layerx.analysis.grade_limits | ( | Dict[str, Any] | result, |
| Any | prep = None, | ||
| Any | config = None, | ||
| Optional[Dict[str, Any]] | opts = None, | ||
| * | , | ||
| Optional[Dict[str, float]] | meop_psi = None ) |
``result["limits"]``: :func:`engine.layerx.diag.limits.grade` with the run's choices. * **Chug** (D7). On the ``config`` basis (the default) the graded ``chug_margin`` is today's: the delivered whole-burn minimum, start included, as before the diagnostics existed. The stability block's settled minimum is added beside it as ``chug_margin_settled`` and the other basis as ``chug_margin_other_basis``, both ``info``. On ``drawing`` the stability block is graded as ``diag.limits`` grades it (the settled minimum on the drawing basis). * **Review pending.** A limit from a new diagnostic (:data:`REVIEW_PENDING`) grades ``warn`` at worst; one that would have been ``bad`` says so (``capped_from``). * The design's tank cap grades ``warn`` (D11), as ``diag.limits`` already grades it.
Definition at line 734 of file analysis.py.
References _review_pending().
Referenced by run_prepared().
| List[Dict[str, Any]] engine.layerx.analysis.model_record | ( | Dict[str, Any] | result, |
| Optional[Prepared] | prep = None ) |
Every model block in the result, flattened for the run record (DATA-CONTRACT rules: each
block that rests on a model carries ``model: {name, source, assumptions, inputs}``):
``[{block, name, source, assumptions, inputs}]``, so Record lists every assumption, default
and source in one place. Also the opt-in card chamber's (D4-B) when it was on.
Definition at line 851 of file analysis.py.
Referenced by run_prepared().
| Dict[str, Any] engine.layerx.analysis.reduce_trace | ( | Prepared | prep, |
| Any | trace, | ||
| Dict[str, float] | initial ) |
Definition at line 1081 of file analysis.py.
References _card_outside(), _dump_coefficients(), _impulse_to_depletion(), _instrument_series(), _network_of(), _psia(), _setup_dict(), _trip_of(), max, min, and time.time().
Referenced by run_prepared().
| Dict[str, Any] engine.layerx.analysis.run_prepared | ( | Prepared | prep, |
| * | , | ||
| Optional[Progress] | progress = None, | ||
| Callable[[], bool] | cancelled = lambda: False, | ||
| Any | runner = None, | ||
| bool | replay = True, | ||
| Any | config = None, | ||
| bool | diagnostics = False, | ||
| Optional[Dict[str, Any]] | sidecars = None, | ||
| Optional[Callable[[float, float, float], None]] | live = None ) |
Burn ``prep`` and return the reduced result.
With ``replay`` (and an EngineDesign engine), the burn is closed against EngineDesign's
time-varying solve with the chamber eroding (:mod:`engine.layerx.replay`): twin pass,
replay, twin pass again with the replay's throat history, until that history stops moving.
``runner`` (EngineDesign's, through its own feed lines) is used for the Forward-mode
cross-check; without it that check is skipped.
With ``prep.settings.flight`` and the engine ``config``, the burn first settles on the pad (the
stand's answer), then flies: a 1-DOF ascent stepped inside each further pass, from the pad's
throat history until it stops moving, and RocketPy flies the settled burn once. The RocketPy
outer loop this replaced gave the same burn (LE4 He: impulse 0.006 %, apogee 0.01 m) in 5
passes and 247 s against 2 and 100 s. ``result["flight"]`` carries the flight and the
pad-against-flight comparison.
``diagnostics`` (DATA-CONTRACT 3): after the burn has settled, every diagnostic that reads it
(:func:`diagnostics_of`) into ``result["diagnostics"]``, the soak-back after the final replay,
and the stable event keys. They read the burn and change nothing in it; each one that fails
is ``{available: false, error}`` and the burn stands. The router asks for them on every run a
person starts; the tools that burn many candidates (sweep, set point, optimiser, reconcile)
leave them off and grade their candidates themselves. ``result["limits"]`` (the graded list,
:func:`grade_limits`) is written either way.
``live``, if given, is told each firing step of the first pass as it burns -- ``(t [s from
Fire], thrust [N], chamber pressure [psia])`` -- so a person watching sees the burn while the
passes run. It reads the step and changes nothing.
``sidecars``, a dict, receives the final replay's axial heat-flux grids as ``["axial"]``
(DATA-CONTRACT 4): too large for the run record, so the caller stores it beside it.
Every pass records the whole feed network (``result["network"]``, DATA-CONTRACT 2): recording
only, no number moves. A vessel over the trip pressure its drawing declares ends the burn on
that step (lib/feedtwin ``burn``): the result carries ``tripped``, a ``fail`` event keyed
``trip``, ``converged: False``, and totals that stop at the trip. That pass is replayed for its
delivered figures if it fired, and neither iterated nor flown. A trip in the settle, before
the burn recorded a step, raises :class:`StandTripped`.
Definition at line 229 of file analysis.py.
References _burn_once(), _clean(), _delivered(), _failed(), _flight_block(), _flight_curve(), _inline_block(), _inline_factory(), _key_events(), _loads(), _pass_figures(), _pressurant_kg(), _safe(), cross_check(), diagnostics_of(), engine_check(), grade_limits(), model_record(), and reduce_trace().
| tuple engine.layerx.analysis.CHUG_DECISION |
Definition at line 725 of file analysis.py.
| tuple engine.layerx.analysis.DIAGNOSTIC_KEYS |
Definition at line 631 of file analysis.py.
| tuple engine.layerx.analysis.FEED_KEYS |
Definition at line 635 of file analysis.py.
| float engine.layerx.analysis.G0 = 9.80665 |
Definition at line 31 of file analysis.py.
| engine.layerx.analysis.Progress = Callable[[str, float], None] |
Definition at line 33 of file analysis.py.
| tuple engine.layerx.analysis.REVIEW_NOTE |
Definition at line 722 of file analysis.py.
| tuple engine.layerx.analysis.REVIEW_PENDING |
Definition at line 720 of file analysis.py.
| engine.layerx.analysis.THERMAL_INSTRUMENTS = frozenset({"TC", "RTD"}) |
Definition at line 1064 of file analysis.py.