pub fn mach_from_a_ac<F: Float>(a_ac: F, gamma: F, supersonic: bool) -> FExpand description
Mach number for a given critical area ratio.
This function uses a bisection algorythm to solve for the Mach number. If this
function must be called many times, it may be preferable to make a look up
table with mach_to_a_ac and interpolate those values.
ยงExamples
use comp_flow::mach_from_a_ac;
assert_eq!(mach_from_a_ac(1.6875000000000002_f64, 1.4, true), 2.0);
assert_eq!(mach_from_a_ac(5.821828750000001_f64, 1.4, false), 0.1);
assert_eq!(mach_from_a_ac(6.25, 1.4, false), 0.09307469911759117);
assert_eq!(mach_from_a_ac(1.0, 1.4, false), 1.0);
assert_eq!(mach_from_a_ac(1.0, 1.4, true), 1.0);