Expand description
Thrust, and mass with the center of mass, against flight time, given from outside in place of the flight’s own: for sizing the difference between two codes, not a model (M2.3c11, the increment that added them; ADR-349).
The gap between HPR Sim’s apogee and another tool’s is split into parts by swapping one input
at a time for the other tool’s (ADR-226). A drag table swaps the drag
(crate::Simulation::with_drag_table); these swap the thrust (ThrustHistory) and the
mass and center of mass (MassHistory), each a list of samples at the other tool’s own
times.
Interpolation. Between two samples (t_i, y_i) and (t_{i+1}, y_{i+1}) a history is the
straight line
y(t) = y_i + (y_{i+1} − y_i) (t − t_i) / (t_{i+1} − t_i)and before the first sample or after the last it holds that sample’s value. So its rate is the slope of the piece it is on, finite everywhere, and its second derivative is zero inside a piece. The flight stops its integration steps at every sample where the slope changes, so no step and no difference stencil of the mass properties straddles a corner: inside a step the rates are the piece’s slopes exactly.
Thrust. The history’s value is the thrust as flown, N, along the rocket’s axis +z_B: it
takes the place of the sum of the motors’ thrusts with HPR Sim’s correction for the air’s
pressure, which is not applied to it again. It acts at the mean of the nozzle exits of the
motors lit by a known time, so a symmetric cluster’s thrust has no moment, as HPR Sim’s own
has none, and an asymmetric cluster’s moment is left out. HPR Sim’s motors still set when a
motor burns: its burnout event, the burning motors’ cross-section taken off the base drag,
and the mass flow behind jet damping and the nozzle’s terms of the equations of motion
(docs/physics/flight.md).
Mass. The history gives the whole rocket’s mass m(t) and its center of mass x(t), m
aft of the nose tip along the axis, the body origin O: in body axes the center of mass is
r = (r_x, r_y, −x), its lateral offsets HPR Sim’s own. The mass rate ṁ, the center of
mass’s rate r′ and its acceleration r″ are the history’s slopes and zero. The inertia
about the center of mass I_c stays HPR Sim’s, and the inertia about O is taken from it by
the parallel-axis theorem with the history’s mass and center:
I_O = I_c + m (|r|² E − r rᵀ)so the inertia’s difference from the other tool’s stays in the split’s remainder.
Time. A history’s time is the flight’s clock: 0 at launch.
What refuses a history. A sample list that is empty, lists of different lengths, times
that don’t rise, a value that isn’t finite, a negative thrust, a mass that isn’t positive, a first sample after
launch, or a thrust that doesn’t end at zero (the history would stop while the motor still
pushed); a thrust history on a flight with no motor lit by a known time; and either history
on a flight that splits, by a separation or an ejection, or moves or releases a part, since a
history is the whole stack’s mass and thrust and gives no part’s own. A history read from
JSON ({"times_s": [...], "thrust_n": [...]}, or mass_kg and cg_aft_of_nose_m beside the
times) passes the same checks as one built by its constructor.
Structs§
- Mass
History - A mass and center of mass against flight time, flown in place of the design’s (the
module says what stays HPR Sim’s). It serializes as its
times_s,mass_kgandcg_aft_of_nose_mand is checked again when read. - Thrust
History - A thrust against flight time, N, flown in place of the motors’ (the module says what
stays HPR Sim’s). It serializes as its
times_sandthrust_nand is checked again when read.