from openap import prop
from pprint import pprint
1 🪬 Aircraft and engines
The prop
package in openap
allows users to obtain aircraft and engine-related data quickly. We will demonstrate usage through the following example.
1.1 Supported aircraft type codes
First, we need to import the prop
package from the OpenAP library.
We can get a list of available aircraft openap.prop.available_aircraft()
function:
= prop.available_aircraft()
avaiable_aircraft
print(f"Supports {len(avaiable_aircraft)} aircraft types")
print(avaiable_aircraft)
Supports 36 aircraft types
['a19n', 'a20n', 'a21n', 'a318', 'a319', 'a320', 'a321', 'a332', 'a333', 'a343', 'a359', 'a388', 'b37m', 'b38m', 'b39m', 'b3xm', 'b734', 'b737', 'b738', 'b739', 'b744', 'b748', 'b752', 'b763', 'b772', 'b773', 'b77w', 'b788', 'b789', 'c550', 'e145', 'e170', 'e190', 'e195', 'e75l', 'glf6']
1.2 Aircraft data
We can get the parameters for one aircraft using openap.prop.aircraft()
function:
= prop.aircraft("A320")
aircraft pprint(aircraft)
{'aircraft': 'Airbus A320',
'ceiling': 12500,
'cruise': {'height': 11000, 'mach': 0.78},
'drag': {'cd0': 0.018, 'e': 0.799, 'gears': 0.017, 'k': 0.039},
'engine': {'default': 'CFM56-5B4',
'mount': 'wing',
'number': 2,
'options': {'A320-111': 'CFM56-5-A1',
'A320-211': 'CFM56-5-A1',
'A320-212': 'CFM56-5A3',
'A320-214': 'CFM56-5B4',
'A320-215': 'CFM56-5B5',
'A320-216': 'CFM56-5B6',
'A320-231': 'V2500-A1',
'A320-232': 'V2527-A5',
'A320-233': 'V2527E-A5'},
'type': 'turbofan'},
'flaps': {'Sf/S': 0.17,
'area': 21.1,
'bf/b': 0.78,
'cf/c': 0.176,
'lambda_f': 0.9,
'type': 'single-slotted'},
'fuel': {'engine': 'CFM56-5B4/P', 'fuel_coef': 2.65942225},
'fuselage': {'height': 4.14, 'length': 37.57, 'width': 3.95},
'limits': {'MFC': 24210,
'MLW': 66000,
'MMO': 0.82,
'MTOW': 78000,
'OEW': 42600,
'VMO': 350,
'ceiling': 12500},
'mfc': 24210,
'mlw': 66000,
'mmo': 0.82,
'mtow': 78000,
'oew': 42600,
'pax': {'high': 170, 'low': 140, 'max': 180},
'vmo': 350,
'wing': {'area': 124, 'mac': 4.1935, 'span': 35.8, 'sweep': 25, 't/c': None}}
1.3 Engine data
The engine data can be obtained with openap.prop.engine()
function:
= prop.engine("CFM56-5B4")
engine engine
{'uid': '2CM014',
'name': 'CFM56-5B4',
'manufacturer': 'CFM International',
'type': 'TF',
'bpr': 5.9,
'pr': 27.1,
'max_thrust': 117900,
'ei_hc_to': 0.1,
'ei_hc_co': 0.1,
'ei_hc_app': 0.13,
'ei_hc_idl': 3.87,
'ei_co_to': 0.5,
'ei_co_co': 0.5,
'ei_co_app': 2.33,
'ei_co_idl': 31.9,
'ei_nox_to': 28.7,
'ei_nox_co': 23.3,
'ei_nox_app': 10.0,
'ei_nox_idl': 4.3,
'ff_to': 1.166,
'ff_co': 0.961,
'ff_app': 0.326,
'ff_idl': 0.107,
'fuel_lto': 421.0,
'fuel_c3': 0.0468598,
'fuel_c2': 0.202282,
'fuel_c1': 0.871899,
'fuel_a': 0.587855,
'fuel_b': 0.417561,
'cruise_thrust': 22241.0,
'cruise_sfc': 0.0154,
'cruise_mach': 0.8,
'cruise_alt': 35000.0,
'fuel_ch': 5.2e-07}