Skip to content

feat(aero): Mach from stagnation pressure ratio (pitot-static)#416

Merged
nochallenge merged 1 commit into
masterfrom
feat/aero-mach-from-stagnation-pressure
Jun 8, 2026
Merged

feat(aero): Mach from stagnation pressure ratio (pitot-static)#416
nochallenge merged 1 commit into
masterfrom
feat/aero-mach-from-stagnation-pressure

Conversation

@nochallenge

Copy link
Copy Markdown
Owner

What

Adds report::mach_from_stagnation_pressure_ratio(p0_over_p, gamma) — the Mach number recovered from a measured total-to-static pressure ratio:

// M = sqrt(2*((p0/p)^((gamma-1)/gamma) - 1)/(gamma - 1))
pub fn mach_from_stagnation_pressure_ratio(p0_over_p: f64, gamma: f64) -> f64

Why

report.rs has the #403 temperature-ratio inverse but not the pressure-ratio one. mach_from_stagnation_pressure_ratio inverts isentropic_stagnation_pressure_ratio — the subsonic pitot-static (Rayleigh-pitot) airspeed reduction, the most common compressible airspeed measurement (Mach from a measured total-to-static pressure ratio). Mirrors the #403 sentinel style: returns the at-rest 0.0 (inverse of the ratio's 1.0 no-rise identity) for non-physical input (non-finite, p0/p < 1, or gamma <= 1).

Test

mach_from_stagnation_pressure_ratio_inverts_the_ratio:

  • (a) round-trip threading isentropic_stagnation_pressure_ratio (both directions);
  • (b) worked — at M=1, gamma=1.4 the critical ratio p0/p = 1.2^3.5 -> M=1;
  • (c) consistency with the temperature-ratio inverse (feat(astro): apsis radii from orbital elements #403) — for the same Mach, the pressure-ratio and temperature-ratio reductions return the same Mach;
  • (d) at restp0/p = 1 -> M = 0;
  • (e) guards0-sentinel for p0/p < 1, gamma <= 1, non-finite.

Free fn in report.rs (not re-exported), no lib.rs change. valenx-aero 213 lib tests (was 212); cargo clippy -p valenx-aero --all-targets -- -D warnings clean. Research-grade compressible-flow data-reduction primitive.

Add report::mach_from_stagnation_pressure_ratio(p0_over_p, gamma), the
Mach number recovered from a measured total-to-static pressure ratio:

  M = sqrt(2*((p0/p)^((gamma-1)/gamma) - 1)/(gamma - 1))

the inverse of isentropic_stagnation_pressure_ratio -- the SUBSONIC
pitot-static (Rayleigh-pitot) airspeed reduction, the most common
compressible airspeed measurement. Mirrors the #403 temperature-ratio
inverse's sentinel style: returns the at-rest 0.0 (the inverse of the
ratio's 1.0 no-rise identity) for non-physical input (non-finite,
p0/p < 1, or gamma <= 1).

Analytic test mach_from_stagnation_pressure_ratio_inverts_the_ratio:
(a) round-trip threading isentropic_stagnation_pressure_ratio (both
    directions);
(b) worked: at M=1, gamma=1.4 the critical ratio p0/p = 1.2^3.5 -> M=1;
(c) consistency with the temperature-ratio inverse (#403): for the same
    Mach, the pressure-ratio and temperature-ratio reductions agree;
(d) at rest: p0/p = 1 -> M = 0;
(e) 0-sentinel guard for p0/p < 1, gamma <= 1, non-finite.

Free fn in report.rs (not re-exported), no lib.rs change. valenx-aero 213
lib tests (was 212), cargo clippy --all-targets -D warnings clean.
@nochallenge nochallenge merged commit 209ca8b into master Jun 8, 2026
@nochallenge nochallenge deleted the feat/aero-mach-from-stagnation-pressure branch June 8, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant