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

Functions

Dict[str, Any] motor_header (Any config)
str _token (str text)
Tuple[List[float], List[float]] curve (Dict[str, Any] result)
Optional[str] _psia (Any value, int digits=1)
str _t0_words (Dict[str, Any] result, Dict[str, Any] derived, Dict[str, Any] settings)
float _trapz (List[float] t, List[float] f)
Tuple[float, float] _run_mean (List[float] t, List[float] f)
str to_eng (Dict[str, Any] result, *, str run_id="", Optional[str] name=None, Optional[float] diameter_mm=None, Optional[float] length_mm=None, Optional[float] dry_kg=None, str manufacturer="STAR", Optional[str] note=None)
str filename (Dict[str, Any] result, str run_id="")
Dict[str, Any] check (str text)

Variables

float EDGE_S = 0.001

Detailed Description

A Layer X burn as a RASP ``.eng`` thrust curve, for OpenRocket.

The curve is the run's hand-off (``result["timeseries"]``): the thrust the flight in this run flew,
from Fire to the moment the first tank ran dry. RASP's layout::

    ; comments
    NAME  DIAMETER_mm  LENGTH_mm  DELAYS  PROPELLANT_kg  TOTAL_kg  MANUFACTURER
    time_s  thrust_N
    ...

OpenRocket starts every curve from (0, 0) and needs it to end on zero thrust. The model's thrust
is on at Fire, so the first point sits ``EDGE_S`` after it and a zero point ``EDGE_S`` after the
last: the two ramps cost and add back half an edge of thrust each, and the file states its own
impulse against the run's.

Mass, as OpenRocket uses it: it removes the propellant mass in proportion to the impulse delivered.
``PROPELLANT_kg`` is what the burn consumed; ``TOTAL_kg`` adds the engine's dry mass
(``rocket.engine_mass``). Tanks, pressurant, bottle and unburned residual are not in it: in an
OpenRocket model of a liquid vehicle they are airframe components.

Function Documentation

◆ _psia()

Optional[str] engine.layerx.eng._psia ( Any value,
int digits = 1 )
protected

Definition at line 92 of file eng.py.

Referenced by _t0_words().

◆ _run_mean()

Tuple[float, float] engine.layerx.eng._run_mean ( List[float] t,
List[float] f )
protected
``(impulse [N s], mean thrust [N])`` as the run totals them (``delivered.summary``): each sample
after Fire carries the step that ends there, so the curve is step-held. The trapezoid of the same
samples is neither the run's figure nor the file's (LE4 (3): 23743.9 against the run's 23737.9 N-s).

Definition at line 116 of file eng.py.

Referenced by filename(), and to_eng().

◆ _t0_words()

str engine.layerx.eng._t0_words ( Dict[str, Any] result,
Dict[str, Any] derived,
Dict[str, Any] settings )
protected
The tanks and the bottle the burn started from, in psia (ADR 0007): the run's own T-0 when it
recorded one (a settle a relief or a regulator moved is said as it was), else what it asked for.

Definition at line 96 of file eng.py.

References _psia().

◆ _token()

str engine.layerx.eng._token ( str text)
protected
A RASP header field: no whitespace.

Definition at line 72 of file eng.py.

Referenced by to_eng().

◆ _trapz()

float engine.layerx.eng._trapz ( List[float] t,
List[float] f )
protected

Definition at line 112 of file eng.py.

Referenced by check(), and to_eng().

◆ check()

Dict[str, Any] engine.layerx.eng.check ( str text)
Parse ``text`` the way a RASP reader does: header fields, points, impulse. For tests.

Definition at line 195 of file eng.py.

References _trapz(), and split().

◆ curve()

Tuple[List[float], List[float]] engine.layerx.eng.curve ( Dict[str, Any] result)
(time from Fire [s], thrust [N]) of the run's hand-off curve.

Definition at line 77 of file eng.py.

Referenced by filename(), and to_eng().

◆ filename()

str engine.layerx.eng.filename ( Dict[str, Any] result,
str run_id = "" )

Definition at line 186 of file eng.py.

References _run_mean(), and curve().

◆ motor_header()

Dict[str, Any] engine.layerx.eng.motor_header ( Any config)
Diameter, length and dry mass of the engine for the ``.eng`` header, each with its basis.

Definition at line 33 of file eng.py.

◆ to_eng()

str engine.layerx.eng.to_eng ( Dict[str, Any] result,
* ,
str run_id = "",
Optional[str] name = None,
Optional[float] diameter_mm = None,
Optional[float] length_mm = None,
Optional[float] dry_kg = None,
str manufacturer = "STAR",
Optional[str] note = None )
The ``.eng`` text. Header values not given come from ``result["motor"]``.

Definition at line 124 of file eng.py.

References _run_mean(), _token(), _trapz(), and curve().

Variable Documentation

◆ EDGE_S

float engine.layerx.eng.EDGE_S = 0.001

Definition at line 30 of file eng.py.