def tip_mach(tas, rpm, temperature, dia, speed_units='kt', temp_units='C', dia_units='in'): """ Returns the mach number of the propeller blade tip, given the true airspeed (tas), revolutions per minute (rpm), temperature and propeller diameter. The speed units may be specified as "kt", "mph", "km/h" or "ft/s", but default to "kt" if not specified. The temperature units may be specified as "C", "F", "K" or "R", but default to deg C if not specified. The diameter units may be specified as "in", "ft", or "m", but default to inches if not specified. """ dia = U.length_conv(dia, from_units=dia_units, to_units='m') tas = U.speed_conv(tas, from_units=speed_units, to_units='m/s') speed_of_sound = SA.temp2speed_of_sound(temperature, temp_units=temp_units, speed_units='m/s') rotation_speed = dia * rpm * M.pi / 60 tip_speed = M.sqrt(tas**2 + rotation_speed**2) tip_mach = tip_speed / speed_of_sound return tip_mach
def test_04(self): # speed of sound at 10,000 m # Truth value from NASA RP 1046 Value = SA.temp2speed_of_sound(SA.alt2temp(10000, alt_units='m')) Truth = 582.11 self.assertTrue(RE(Value, Truth) <= 1e-5)
def test_02(self): # speed of sound in mph at 8,000 ft # Truth value from NASA RP 1046 Value = SA.temp2speed_of_sound(SA.alt2temp(8000), speed_units='mph') Truth = 739.98 self.assertTrue(RE(Value, Truth) <= 1e-5)
def test_01(self): # speed of sound at 5,000 ft # Truth value from NASA RP 1046 Value = SA.temp2speed_of_sound(SA.alt2temp(5000)) Truth = 650.01 self.assertTrue(RE(Value, Truth) <= 1e-5)
def test_01(self): # speed of sound at 5,000 ft # Truth value from NASA RP 1046 Value = SA.temp2speed_of_sound(SA.alt2temp(5000)) Truth = 650.01 self.failUnless(RE(Value, Truth) <= 1e-5)
def test_04(self): # speed of sound at 10,000 m # Truth value from NASA RP 1046 Value = SA.temp2speed_of_sound(SA.alt2temp(10000, alt_units="m")) Truth = 582.11 self.failUnless(RE(Value, Truth) <= 1e-5)
def test_02(self): # speed of sound in mph at 8,000 ft # Truth value from NASA RP 1046 Value = SA.temp2speed_of_sound(SA.alt2temp(8000), speed_units="mph") Truth = 739.98 self.failUnless(RE(Value, Truth) <= 1e-5)
def test_03(self): # speed of sound in km/h at 2,000 m, with temp in deg R # Truth value from NASA RP 1046 Value = SA.temp2speed_of_sound(SA.alt2temp(2000, alt_units='m', temp_units='R'), speed_units='km/h', temp_units='R') Truth = 1197.1 self.failUnless(RE(Value, Truth) <= 1e-5)
def tip_mach(tas, rpm, temperature, dia, speed_units="kt", temp_units="C", dia_units="in"): """ Returns the mach number of the propeller blade tip, given the true airspeed (tas), revolutions per minute (rpm), temperature and propeller diameter. The speed units may be specified as "kt", "mph", "km/h" or "ft/s", but default to "kt" if not specified. The temperature units may be specified as "C", "F", "K" or "R", but default to deg C if not specified. The diameter units may be specified as "in", "ft", or "m", but default to inches if not specified. """ dia = U.length_conv(dia, from_units=dia_units, to_units="m") tas = U.speed_conv(tas, from_units=speed_units, to_units="m/s") speed_of_sound = SA.temp2speed_of_sound(temperature, temp_units=temp_units, speed_units="m/s") rotation_speed = dia * rpm * M.pi / 60 tip_speed = M.sqrt(tas ** 2 + rotation_speed ** 2) tip_mach = tip_speed / speed_of_sound return tip_mach