MACH
Excel Usage
=MACH(V, c)
V(float, required): Velocity of fluid [m/s]c(float, required): Speed of sound in fluid [m/s]
Returns (float): Mach number [-]
Examples
Example 1: Subsonic flow (Mach < 1)
Inputs:
| V | c |
|---|---|
| 33 | 330 |
Excel formula:
=MACH(33, 330)
Expected output:
0.1
Example 2: Sonic flow (Mach = 1)
Inputs:
| V | c |
|---|---|
| 340 | 340 |
Excel formula:
=MACH(340, 340)
Expected output:
1
Example 3: Supersonic flow (Mach > 1)
Inputs:
| V | c |
|---|---|
| 500 | 340 |
Excel formula:
=MACH(500, 340)
Expected output:
1.471
Example 4: Low velocity example
Inputs:
| V | c |
|---|---|
| 10 | 300 |
Excel formula:
=MACH(10, 300)
Expected output:
0.0333
Python Code
from fluids.core import Mach as fluids_Mach
def mach(V, c):
"""
Calculate the Mach number.
See: https://fluids.readthedocs.io/fluids.core.html#fluids.core.Mach
This example function is provided as-is without any representation of accuracy.
Args:
V (float): Velocity of fluid [m/s]
c (float): Speed of sound in fluid [m/s]
Returns:
float: Mach number [-]
"""
try:
V_val = float(V)
c_val = float(c)
if c_val <= 0:
return "Error: Speed of sound must be positive"
result = fluids_Mach(V_val, c_val)
return float(result)
except Exception as e:
return f"Error: {str(e)}"