Skip to main content

Crate hpr_sim

Crate hpr_sim 

Source
Expand description

The 6-DOF flight engine: state, launch rail phase, integrators, events, recovery, separation and the recorder.

Guide: How a flight is simulated, Rigid-body flight, Time integration and Recovery: the models, their sources, how well they are validated and what they leave out.

  • flight: a Simulation of a rocket, its Environment and its Rail, flown from ignition through the pad, rail and free-flight phases to the ground.
  • dynamics: the rigid-body equations of motion with varying mass and jet damping.
  • rail: the rail’s geometry and friction, and where a design’s guides leave it.
  • recovery: recovery devices, their triggers and inflation, the descent under them, and separation into bodies that each fly to their own landing.
  • shifts: mass that moves along the airframe in flight, and what it does to the mass properties.
  • releases: mass released in flight, the rest flying on and the part falling on its own.
  • recorder: the Observer trait, flight Samples and the channel Recorder.
  • integrator: adaptive Dormand–Prince 5(4) with dense output, and fixed-step RK4, advancing to stop times and events.
  • events: event directions and Brent’s root finder.
  • metrics: what a flight comes to: its peaks, apogee, stability margins, optimum ejection delays and landings.
  • envelope: the operating envelope’s four flags: past the validated range, at high angle of attack, outside the core band and beyond the envelope.
  • flutter: a fin’s flutter speed and margin by NACA TN 4197’s criterion.
  • export: a recording as CSV or JSON, and the flight path and landings as GeoJSON or KML.

Status: the flight from the pad to the ground under parachutes, streamers or tumbling, a separation whose bodies each land, and staging: each motor lights at its own time, and a separation with the nose’s body still to burn lets that body fly on as a sustainer while the booster descends (flight). A cluster flies one motor in each of its tubes, a tube or a motor can be set never to light, and a .ork file’s staging settings and clusters fly too (milestone M1.9 of the roadmap, and M2.2e10 for a motor that never lights).

Re-exports§

pub use dynamics::Phase;
pub use envelope::EnvelopeFlag;
pub use environment::Environment;
pub use error::SimError;
pub use events::Direction;
pub use events::EVENT_TIME_RESOLUTION_S;
pub use events::RootError;
pub use events::find_root;
pub use export::TrackPoint;
pub use flight::EventKind;
pub use flight::FlightEvent;
pub use flight::FlightResult;
pub use flight::FlightSettings;
pub use flight::Simulation;
pub use flight::Termination;
pub use flight::UserEvent;
pub use flutter::FlutterMargin;
pub use flutter::FlutterPanel;
pub use integrator::Adaptive;
pub use integrator::Advance;
pub use integrator::DEFAULT_STEP_LIMIT;
pub use integrator::IntegrationError;
pub use integrator::Integrator;
pub use integrator::Method;
pub use integrator::OdeSystem;
pub use integrator::SettingsError;
pub use integrator::Stats;
pub use integrator::Step;
pub use issues::IssueWarning;
pub use issues::KnownIssue;
pub use metrics::FlightMetrics;
pub use metrics::FlightSummary;
pub use pieces::Ejection;
pub use pieces::Parting;
pub use rail::Guides;
pub use rail::Rail;
pub use recorder::Channel;
pub use recorder::FlightStep;
pub use recorder::Observer;
pub use recorder::Recorder;
pub use recorder::Sample;
pub use recovery::BodyEvent;
pub use recovery::BodyFlight;
pub use recovery::BodySample;
pub use recovery::CanopyType;
pub use recovery::Device;
pub use recovery::DeviceDrag;
pub use recovery::Inflation;
pub use recovery::Separation;
pub use recovery::StreamerModel;
pub use recovery::Trigger;
pub use recovery::terminal_speed_m_s;
pub use releases::MassRelease;
pub use releases::ReleasedFlight;
pub use shifts::MIN_SHIFT_DURATION_S;
pub use shifts::MassShift;
pub use state::STATE_LEN;
pub use state::State;

Modules§

dynamics
The equations of motion: a rigid body of varying mass referred to a point fixed in the body.
envelope
The flags a flight raises: the operating envelope’s four, where a flight goes past what hpr’s numbers have been checked for (ADR-143 §1, ADR-179; the validation plan’s Operating envelope), and two for a rocket that is unstable while a motor burns (#335; the guide’s Unstable under power), of which a flight raises at most one.
environment
The flight’s surroundings: the Earth model with the launch site, the atmosphere and the wind.
error
Errors from setting up or running a flight.
events
Event directions and their location: zero crossings of g(t, y) found on an integrator’s dense output and polished with Brent’s method.
export
Writing a flight out: a Recorder’s rows as CSV or JSON (or Parquet, with the parquet feature), and the center of mass’s path with the landings as GeoJSON or KML for a map.
flight
A flight from ignition to the ground: the pad, the rail and free flight, their events, and how the flight ends.
flutter
Fin flutter: the speed at which a fin’s bending and twisting couple and grow, from D. J. Martin’s criterion (the fin-flutter milestone; the guide’s Fin flutter page).
integrator
Initial-value integrators: the adaptive Dormand–Prince 5(4) pair with dense output, and the classical fixed-step fourth-order Runge–Kutta method.
issues
Warnings for known errors in hpr’s drag, each by its issue number: where a flight’s speed and its design’s shape meet the condition under which a number is known to read wrong (ADR-163 §4, ADR-180).
metrics
What a flight comes to: its peaks, its apogee, its stability margins, the ejection delay that would fire at apogee, and where each body landed (the flight-metrics milestone and its decision record; the guide’s Flight metrics page).
pieces
Ejected pieces: an airframe that comes apart at any joint, or lets a payload out, and the pieces that fly on to their own landings.
rail
The launch rail: its direction, length and friction, and where a design’s rail buttons or launch lugs leave it.
recorder
Watching a flight: the Observer trait, the Sample of derived quantities at an instant, and the Recorder, which keeps a chosen set of Channels at a fixed interval.
recovery
Recovery devices: what opens, when it opens, and the drag area it presents.
releases
Mass released in flight: ballast dropped or a payload let go on a trigger, with the rest of the rocket flying on in six degrees of freedom and the part falling to the ground on its own.
shifts
Mass that moves along the airframe in flight: a ballast weight or a payload slid fore or aft on a trigger, with the rocket’s mass properties and its equations of motion following it.
state
The flight state: the body origin’s position and velocity, the attitude and the body rates.