Exemplo n.º 1
0
def pwr(rpm, MP, altitude, temp='std', alt_units='ft', temp_units='C'):
    """
    Returns horsepower for Lycoming IO-360-A series engines, given:
    rpm - engine speed in revolutions per minute
    MP - manifold pressure (" HG)
    altitude - pressure altitude
    temp - ambient temperature  (optional - std temperature is used if no
           temperature is input).
    alt_units - (optional) - units for altitude, ft, m, or km
                                 (default is ft)
    temp_units - (optional) - units for temperature, C, F, K or R
                              (default is deg C)

    The function replicates Lycoming curve 12700-A, and is valid at mixture
    for maximum power.

    Examples:

    Determine power at 2620 rpm, 28 inches HG manifold pressure, 0 ft, and
    -10 deg C:
    >>> pwr(2620, 28, 0, -10)
    197.71751932574702

    Determine power at 2500 rpm, 25" MP, 5000 ft and 0 deg F:
    >>> pwr(2500, 25, 5000, 0, temp_units = 'F')
    171.87810350172663

    Determine power at 2200 rpm, 20" MP, 2000 metres and -5 deg C
    >>> pwr(2200, 20, 2000, -5, alt_units = 'm')
    108.60284092217333

    Determine power at 2200 rpm, 20" MP, 2000 metres and standard
    temperature:
    >>> pwr(2200, 20, 2000, alt_units = 'm')
    107.2124765533882
    """
    # convert units
    altitude = unit_conversion.length_conv(altitude,
                                           from_units=alt_units,
                                           to_units='ft')
    if temp == 'std':
        temp = std_atm.alt2temp(altitude, temp_units=temp_units)
    temp = unit_conversion.temp_conv(temp, from_units=temp_units, to_units='K')

    # get standard temperature
    temp_std = std_atm.alt2temp(altitude, temp_units='K')

    # get power at standard temperature
    pwr_std = _pwr_std_temp(rpm, MP, altitude)

    # correct power for non-standard temperature
    pwr = pwr_std * np.sqrt(temp_std / temp)

    return pwr
Exemplo n.º 2
0
    def test_04(self):

        # check deg F at 25,000 m
        # change order of units specifications

        T = round(SA.alt2temp(25000, temp_units='F', alt_units='m'), 2)
        self.assertEqual(T, -60.7)
Exemplo n.º 3
0
	def __init__(self, h):
		# Cantera Solution object
		self.gas = ct.Solution('air.xml')

		# Discretised altitude steps
		self.h = h

		# Average molecular diameter of gas
		self.d = 4E-10

		self.steps = len(h)

		self.rho = np.zeros(self.steps)
		self.p = np.zeros(self.steps)
		self.T = np.zeros(self.steps)
		self.a = np.zeros(self.steps)
		self.k = np.zeros(self.steps)
		self.mu = np.zeros(self.steps)

		for index, alt in enumerate(self.h):
			self.rho[index] = atm.alt2density(alt, alt_units='m', density_units='kg/m**3')
			self.p[index] = atm.alt2press(alt, press_units='pa', alt_units='m')
			self.T[index] = atm.alt2temp(alt, alt_units='m', temp_units='K')
			self.a[index] = atm.temp2speed_of_sound(self.T[index], temp_units='K', speed_units='m/s')

		for index, alt in enumerate(self.h):
			self.gas.TP = self.T[index], self.p[index]
			self.k[index] = self.gas.cp / self.gas.cv
			self.mu[index] = self.gas.viscosity

		print 'ATMOSPHERIC MODEL COMPUTED (US76)'

		return None
Exemplo n.º 4
0
    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.assertLessEqual(RE(Value, Truth), 1e-5)
Exemplo n.º 5
0
    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.assertLessEqual(RE(Value, Truth), 1e-5)
Exemplo n.º 6
0
    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.assertLessEqual(RE(Value, Truth), 1e-5)
Exemplo n.º 7
0
    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.assertLessEqual(RE(Value, Truth), 1e-5)
Exemplo n.º 8
0
def pp(rpm, MP, altitude, temp='std', alt_units='ft', temp_units='C'):
    """
    Returns percent power for Lycoming IO-360-A series engines, given:
    rpm - engine speed in revolutions per minute
    MP - manifold pressure (" HG)
    altitude - pressure altitude
    temp - ambient temperature  (optional - std temperature is used if no
           temperature is input).
    alt_units - (optional) - units for altitude, ft, m, or km
                                 (default is ft)
    temp_units - (optional) - units for temperature, C, F, K or R
                              (default is deg C)

    The function replicates Lycoming curve 12700-A, and is valid at mixture
    for maximum power.

    Note: the output is rounded off to two decimal places.

    Examples:

    Determine power at 2620 rpm, 28 inches HG manifold pressure, 0 ft, and
    -10 deg C:
    >>> pp(2620, 28, 0, -10)
    '98.86%'

    Determine power at 2500 rpm, 25" MP, 5000 ft and 0 deg F:
    >>> pp(2500, 25, 5000, 0, temp_units = 'F')
    '85.94%'

    Determine power at 2200 rpm, 20" MP, 2000 metres and -5 deg C
    >>> pp(2200, 20, 2000, -5, alt_units = 'm')
    '54.30%'

    Determine power at 2200 rpm, 20" MP, 2000 metres and standard
    temperature:
    >>> pp(2200, 20, 2000, alt_units = 'm')
    '53.61%'

    """
    altitude = unit_conversion.length_conv(altitude,
                                           from_units=alt_units,
                                           to_units='ft')
    if temp == 'std':
        temp = std_atm.alt2temp(altitude, temp_units=temp_units)
    temp = unit_conversion.temp_conv(temp, from_units=temp_units, to_units='C')

    pp = pwr(rpm, MP, altitude, temp) / 2

    #   return pp
    return '%.2f' % (pp) + '%'
Exemplo n.º 9
0
def prop_eff(prop,
             bhp,
             rpm,
             tas,
             altitude,
             temp='std',
             power_units='hp',
             alt_units='ft',
             temp_units='C',
             speed_units='kt',
             dia_units='in'):
    """
    Returns propeller efficiency based on engine power provided to the propeller.
    """
    press_ratio = SA.alt2press_ratio(altitude, alt_units=alt_units)
    if temp == 'std':
        temp = SA.alt2temp(altitude,
                           temp_units=temp_units,
                           alt_units=alt_units)
    temp_ratio = U.temp_conv(temp, from_units=temp_units,
                             to_units='K') / 288.15
    density_ratio = press_ratio / temp_ratio
    density = density_ratio * SA.Rho0
    Cp = bhp2Cp(bhp,
                rpm,
                density,
                prop.dia,
                power_units=power_units,
                density_units='kg/m**3',
                dia_units=dia_units)
    J = advance_ratio(tas,
                      rpm,
                      prop.dia,
                      speed_units=speed_units,
                      dia_units=dia_units)
    blade_tip_mach = tip_mach(tas,
                              rpm,
                              temp,
                              prop.dia,
                              speed_units=speed_units,
                              temp_units=temp_units,
                              dia_units=dia_units)

    prop_eff = cp2eff(prop, Cp, J, blade_tip_mach)

    if N.isnan(prop_eff):
        raise ValueError('Out of range inputs')

    return prop_eff
Exemplo n.º 10
0
def blade_angle2bhp(prop,
                    blade_angle,
                    rpm,
                    tas,
                    altitude,
                    temp='std',
                    power_units='hp',
                    alt_units='ft',
                    temp_units='C',
                    speed_units='kt',
                    dia_units='in'):
    """
    Returns returns engine power, given blade angle, rpm and flight conditions.
    """
    press_ratio = SA.alt2press_ratio(altitude, alt_units=alt_units)
    if temp == 'std':
        temp = SA.alt2temp(altitude,
                           temp_units=temp_units,
                           alt_units=alt_units)
    temp_ratio = U.temp_conv(temp, from_units=temp_units,
                             to_units='K') / 288.15
    density_ratio = press_ratio / temp_ratio
    density = density_ratio * SA.Rho0
    #    Cp = bhp2Cp(bhp, rpm, density, prop.dia, power_units = power_units, density_units = 'kg/m**3', dia_units = dia_units)
    J = advance_ratio(tas,
                      rpm,
                      prop.dia,
                      speed_units=speed_units,
                      dia_units=dia_units)
    blade_tip_mach = tip_mach(tas,
                              rpm,
                              temp,
                              prop.dia,
                              speed_units=speed_units,
                              temp_units=temp_units,
                              dia_units=dia_units)

    Cp = blade_angle2cp(prop, blade_angle, J, blade_tip_mach)

    bhp = cp2bhp(Cp,
                 rpm,
                 density,
                 prop.dia,
                 power_units=power_units,
                 density_units='kg/m**3',
                 dia_units=dia_units)

    return bhp
Exemplo n.º 11
0
def pp2mp(percent_power,
          rpm,
          altitude,
          temp='std',
          alt_units='ft',
          temp_units='C'):
    """
    Returns manifold pressure in inches of mercury for a given percent
    power, rpm, altitude and temperature (temperature input is optional
    - standard temperature is used if no temperature is input).

    Note: the output is rounded off to two decimal places.

    Examples:

    Determine manifold pressure required for 62.5% power at 2550 rpm
    at 8000 ft and 10 deg C:
    >>> pp2mp(62.5, 2550, 8000, 10)
    '19.45'

    Determine manifold pressure required for 75% power at 2500 rpm at
    7500 ft at 10 deg F:
    >>> pp2mp(75, 2500, 7500, 10, temp_units = 'F')
    '22.25'


    Determine manifold pressure required for 55% power at 2400 rpm at
    9,500 ft at standard temperature:
    >>> pp2mp(55, 2400, 9500)
    '18.18'
    """
    if percent_power <= 0:
        raise ValueError('Power input must be positive.')

    # convert units
    altitude = unit_conversion.length_conv(altitude,
                                           from_units=alt_units,
                                           to_units='ft')
    if temp == 'std':
        temp = std_atm.alt2temp(altitude, temp_units=temp_units)
    temp = unit_conversion.temp_conv(temp, from_units=temp_units, to_units='C')

    pwr_seek = percent_power * 2

    mp = pwr2mp(pwr_seek, rpm, altitude, temp)

    return mp
Exemplo n.º 12
0
def blade_angle(prop,
                bhp,
                rpm,
                tas,
                altitude,
                temp='std',
                power_units='hp',
                alt_units='ft',
                temp_units='C',
                speed_units='kt',
                dia_units='in'):
    """
    Returns propeller blade angle.
    """
    press_ratio = SA.alt2press_ratio(altitude, alt_units=alt_units)
    if temp == 'std':
        temp = SA.alt2temp(altitude,
                           temp_units=temp_units,
                           alt_units=alt_units)
    temp_ratio = U.temp_conv(temp, from_units=temp_units,
                             to_units='K') / 288.15
    density_ratio = press_ratio / temp_ratio
    density = density_ratio * SA.Rho0
    Cp = bhp2Cp(bhp,
                rpm,
                density,
                prop.dia,
                power_units=power_units,
                density_units='kg/m**3',
                dia_units=dia_units)
    J = advance_ratio(tas,
                      rpm,
                      prop.dia,
                      speed_units=speed_units,
                      dia_units=dia_units)
    blade_tip_mach = tip_mach(tas,
                              rpm,
                              temp,
                              prop.dia,
                              speed_units=speed_units,
                              temp_units=temp_units,
                              dia_units=dia_units)

    blade_angle = cp2blade_angle(prop, Cp, J, blade_tip_mach)

    return blade_angle
Exemplo n.º 13
0
def pp2rpm(percent_power,
           mp,
           altitude,
           temp='std',
           alt_units='ft',
           temp_units='C'):
    """
    Returns rpm for a given percent power, manifold pressure in inches of
    mercury, altitude and temperature (temperature input is optional -
    standard temperature is used if no temperature is input).

    Examples:

    Determine rpm required for 125 hp at 20 inches HG manifold pressure at
    8000 ft and 10 deg C:
    >>> pp2rpm(62.5, 20, 8000, 10)
    2477

    Determine rpm required for 75% power at 22 inches HG manifold pressure
    at 6500 ft and 10 deg F:
    >>> pp2rpm(75, 22, 6500, 10, temp_units = 'F')
    2547

    Determine rpm required for 55% power at at 18 inches HG manifold
    pressure at 9,500 ft at standard temperature:
    >>> pp2rpm(55, 18, 9500)
    2423
    """
    if percent_power <= 0:
        raise ValueError('Power input must be positive.')

    # convert units
    altitude = unit_conversion.length_conv(altitude,
                                           from_units=alt_units,
                                           to_units='ft')
    if temp == 'std':
        temp = std_atm.alt2temp(altitude, temp_units=temp_units)
    temp = unit_conversion.temp_conv(temp, from_units=temp_units, to_units='C')

    pwr_seek = percent_power * 2

    rpm = pwr2rpm(pwr_seek, mp, altitude, temp)

    return rpm
Exemplo n.º 14
0
	def __init__(self, h, T_thermosphere):
		# Cantera Solution object
		self.gas = ct.Solution('air.xml')

		# Discretised altitude steps
		self.h = h

		# Average molecular diameter of gas
		self.d = 4E-10

		# Ratio of specific heats
		self.steps = len(h)

		self.rho = np.zeros(self.steps)
		self.p = np.zeros(self.steps)
		self.T = np.zeros(self.steps)
		self.a = np.zeros(self.steps)
		self.k = np.zeros(self.steps)
		self.mu = np.zeros(self.steps)

		# Call Jacchia77 model
		data = j77.j77sri(np.max(h), T_thermosphere)
		data_np = np.array(data)

		h_int = spint.griddata
		T_int = spint.griddata
		mw_int = spint.griddata
		n = spint.griddata

		for index, alt in enumerate(self.h):
			self.rho[index] = atm.alt2density(alt, alt_units='m', density_units='kg/m**3')
			self.p[index] = atm.alt2press(alt, press_units='pa', alt_units='m')
			self.T[index] = atm.alt2temp(alt, alt_units='m', temp_units='K')
			self.a[index] = atm.temp2speed_of_sound(self.T[index], temp_units='K', speed_units='m/s')

		for index, alt in enumerate(self.h):
			self.gas.TP = self.T[index], self.p[index]
			self.k[index] = self.gas.cp / self.gas.cv
			self.mu[index] = self.gas.viscosity
		return None
Exemplo n.º 15
0
    def test_03(self):

        # check deg R at 19 km

        T = round(SA.alt2temp(19, alt_units='km', temp_units='R'), 2)
        self.assertEqual(T, 389.97)
Exemplo n.º 16
0
    def test_08(self):

        # check at 80 km

        T = round(SA.alt2temp(80, alt_units='km'), 2)
        self.assertEqual(T, -76.5)
Exemplo n.º 17
0
    def test_07(self):

        # check at 60 km

        T = round(SA.alt2temp(60, alt_units='km'), 2)
        self.assertEqual(T, -27.7)
Exemplo n.º 18
0
    def test_06(self):

        # check at 50 km

        T = round(SA.alt2temp(50, alt_units='km'), 2)
        self.assertEqual(T, -2.5)
Exemplo n.º 19
0
    def test_05(self):

        # check at 40 km

        T = round(SA.alt2temp(40, alt_units='km'), 2)
        self.assertEqual(T, -22.1)
Exemplo n.º 20
0
def pwr2mp(pwr_seek,
           rpm,
           altitude,
           temp='std',
           alt_units='ft',
           temp_units='C'):
    """
    Returns manifold pressure in inches of mercury for a given power, rpm,
    altitude and temperature (temperature input is optional - standard
    temperature is used if no temperature is input).

    Note: the output is rounded off to two decimal places.

    Examples:

    Determine manifold pressure required for 125 hp at 2550 rpm at 8000 ft
    and 10 deg C:
    >>> pwr2mp(125, 2550, 8000, 10)
    '19.45'

    Determine manifold pressure required for 75% power at 2500 rpm at
    7500 ft at 10 deg F:
    >>> pwr2mp(.75 * 200, 2500, 7500, 10, temp_units = 'F')
    '22.25'


    Determine manifold pressure required for 55% power at 2400 rpm at
    9,500 ft at standard temperature:
    >>> pwr2mp(.55 * 200, 2400, 9500)
    '18.18'
    """
    if pwr_seek <= 0:
        raise ValueError('Power input must be positive.')

    low = 0  # initial lower guess
    high = 35  # initial upper guess

    # convert units
    altitude = unit_conversion.length_conv(altitude,
                                           from_units=alt_units,
                                           to_units='ft')
    if temp == 'std':
        temp = std_atm.alt2temp(altitude, temp_units=temp_units)
    temp = unit_conversion.temp_conv(temp, from_units=temp_units, to_units='C')

    # confirm initial low and high are OK:
    pwr_low = pwr(rpm, low, altitude, temp)
    if pwr_low > pwr_seek:
        raise ValueError('Initial low guess too high.')

    pwr_high = pwr(rpm, high, altitude, temp)
    if pwr_high < pwr_seek:
        raise ValueError('Initial high guess too low.')

    guess = (low + high) / 2.
    pwr_guess = pwr(rpm, guess, altitude, temp)

    # keep iterating until power is within 0.1% of desired value
    while np.fabs(pwr_guess - pwr_seek) / pwr_seek > 1e-3:
        if pwr_guess > pwr_seek:
            high = guess
        else:
            low = guess

        guess = (low + high) / 2.
        pwr_guess = pwr(rpm, guess, altitude, temp)


#   result = int(guess) + round(guess % 1, 2))
#   return guess
#   return result
    return '%.2f' % (guess)
Exemplo n.º 21
0
def pwr2rpm(pwr_seek,
            mp,
            altitude,
            temp='std',
            alt_units='ft',
            temp_units='C'):
    """
    Returns rpm for a given power, manifold pressure in inches of mercury,
    altitude and temperature (temperature input is optional - standard
    temperature is used if no temperature is input).

    Note: the output is rounded off to the nearest rpm.

    Examples:

    Determine rpm required for 125 hp at 20 inches HG manifold pressure at
    8000 ft and 10 deg C:
    >>> pwr2rpm(125, 20, 8000, 10)
    2477

    Determine rpm required for 75% power at 22 inches HG manifold pressure
    at 6500 ft and 10 deg F:
    >>> pwr2rpm(.75 * 200, 22, 6500, 10, temp_units = 'F')
    2547

    Determine rpm required for 55% power at at 18 inches HG manifold
    pressure at 9,500 ft at standard temperature:
    >>> pwr2rpm(.55 * 200, 18, 9500)
    2423
    """
    if pwr_seek <= 0:
        raise ValueError('Power input must be positive.')

    low = 1000  # initial lower guess
    high = 3500  # initial upper guess

    # convert units
    altitude = unit_conversion.length_conv(altitude,
                                           from_units=alt_units,
                                           to_units='ft')
    if temp == 'std':
        temp = std_atm.alt2temp(altitude, temp_units=temp_units)
    temp = unit_conversion.temp_conv(temp, from_units=temp_units, to_units='C')

    # confirm initial low and high are OK:
    pwr_low = pwr(low, mp, altitude, temp)
    # print("pwr_low=", pwr_low)
    if pwr_low > pwr_seek:
        raise ValueError('Initial low guess too high.')

    pwr_high = pwr(high, mp, altitude, temp)
    # print("pwr_high=", pwr_high)
    if pwr_high < pwr_seek:
        # print("pwr_high=", pwr_high)
        print("Function called was IO.pwr(%f, %f, %f, %f)" %
              (high, mp, altitude, temp))
        raise ValueError('Initial high guess too low.')

    guess = (low + high) / 2.
    pwr_guess = pwr(guess, mp, altitude, temp)

    # keep iterating until power is within 0.1% of desired value
    while np.fabs(pwr_guess - pwr_seek) / pwr_seek > 1e-4:
        if pwr_guess > pwr_seek:
            high = guess
        else:
            low = guess

        guess = (low + high) / 2.
        pwr_guess = pwr(guess, mp, altitude, temp)

    return int(round(guess, 0))
Exemplo n.º 22
0
    def test_02(self):

        # check deg K at 10 km

        T = round(SA.alt2temp(10, alt_units='km', temp_units='K'), 2)
        self.assertEqual(T, 223.15)
Exemplo n.º 23
0
    def test_01(self):

        # check at -1000 ft

        T = round(SA.alt2temp(-1000), 2)
        self.assertEqual(T, 16.98)
Exemplo n.º 24
0
def prop_data(prop,
              bhp,
              rpm,
              tas,
              altitude,
              temp='std',
              power_units='hp',
              alt_units='ft',
              temp_units='C',
              speed_units='kt',
              dia_units='in',
              thrust_units='lb'):
    """
    Returns advance ratio, power coefficient, thrust coefficient, blade tip
    mach number, propeller efficiency and thrust.

    Validated against Excel spreadsheet provided by Les Doud (Hartzell).
    """
    press_ratio = SA.alt2press_ratio(altitude, alt_units=alt_units)
    if temp == 'std':
        temp = SA.alt2temp(altitude,
                           temp_units=temp_units,
                           alt_units=alt_units)
    temp_ratio = U.temp_conv(temp, from_units=temp_units,
                             to_units='K') / 288.15
    density_ratio = press_ratio / temp_ratio
    density = density_ratio * SA.Rho0

    Cp = bhp2Cp(bhp,
                rpm,
                density,
                prop.dia,
                power_units=power_units,
                density_units='kg/m**3',
                dia_units=dia_units)
    J = advance_ratio(tas,
                      rpm,
                      prop.dia,
                      speed_units=speed_units,
                      dia_units=dia_units)
    blade_tip_mach = tip_mach(tas,
                              rpm,
                              temp,
                              prop.dia,
                              speed_units=speed_units,
                              temp_units=temp_units,
                              dia_units=dia_units)

    prop_eff = cp2eff(prop, Cp, J, blade_tip_mach)
    try:
        Ct = cp2ct(prop, Cp, J, blade_tip_mach)
    except BaseException:
        Ct = cp2ct_alt(prop,
                       Cp,
                       bhp,
                       rpm,
                       tas,
                       altitude,
                       temp=temp,
                       power_units=power_units,
                       alt_units=alt_units,
                       temp_units=temp_units,
                       speed_units=speed_units)

    if prop_eff > 0.1:
        thrust = eff2thrust(prop_eff,
                            bhp,
                            tas,
                            power_units=power_units,
                            speed_units=speed_units,
                            thrust_units=thrust_units)
    else:
        thrust = ct2thrust(Ct,
                           density,
                           rpm,
                           prop.dia,
                           thrust_units=thrust_units,
                           density_units='kg/m**3',
                           dia_units=dia_units)
    # data_block = 'J = ' + str(J) + '\nCp = ' + str(Cp) + '\n Tip mach = ' + str(blade_tip_mach) + '\n Ct = ' + str(Ct) + '\n Thrust = ' + str(thrust) + ' ' + thrust_units + '\n Prop efficiency = ' + str(prop_eff)

    print('           prop = ', prop.prop)
    print('              J = %.3f' % J)
    print('             Cp = %.5f' % Cp)
    print('       Tip Mach = %.3f' % blade_tip_mach)
    print('             Ct = %.3f' % Ct)
    print('         Thrust = %.2f' % thrust, thrust_units)
    print('Prop efficiency = %.4f' % prop_eff)
    print('      Thrust HP = %.2f' % bhp * prop_eff)

    return
Exemplo n.º 25
0
piece.append('2100'.center(cols))
piece.append('2200'.center(cols))
piece.append('2300'.center(cols))
piece.append('2400'.center(cols))
piece.append('2200'.center(cols))
piece.append('2300'.center(cols))
piece.append('2400'.center(cols))
piece.append('2500'.center(cols))
full_line = '|'.join(piece)
print('|' + full_line + '|')


for alt in range(0, 16000, 1000):
    piece = []
    piece.append(str(alt).rjust(col1))
    temp = SA.alt2temp(alt, temp_units='F')
    temp = int(temp)
    piece.append(str(temp).rjust(col2))
    press = SA.alt2press(alt)

    pwr = .55 * max_pwr
    for rpm in range(2100, 2500, 100):
        mp = float(io360a.pwr2mp(pwr, rpm, alt))
        if press - mp < diff:
            piece.append('FT'.center(col2))
        else:
            piece.append(str(round(mp, 1)).center(col2))

    pwr = .65 * max_pwr
    for rpm in range(2100, 2500, 100):
        mp = float(io360a.pwr2mp(pwr, rpm, alt))