Bada4
pyBADA Generic BADA4 aircraft performance module Developed @EUROCONTROL (EIH) 2024
- class pyBADA.bada4.ARPM(AC)[source]
Bases:
BADA4
This class is a BADA4 aircraft subclass and implements the Airline Procedure Model (ARPM) following the BADA4 user manual.
- Parameters:
AC (bada4Aircraft.) – Aircraft object {BADA4}.
- climbSpeed(theta, delta, mass, h, hRWY=0.0, speedSchedule_default=None, procedure='BADA', config=None, NADP1_ALT=3000, NADP2_ALT=[1000, 3000], DeltaTemp=0.0)[source]
Computes the climb speed schedule (CAS) for the given altitude based on various procedures and aircraft parameters.
- Parameters:
theta (float) – Normalized air temperature [-].
delta (float) – Normalized air pressure [-].
mass (float) – Aircraft mass in kilograms [kg].
h (float) – Altitude in meters [m].
hRWY (float, optional) – Runway elevation AMSL in meters [m].
speedSchedule_default (list[float], optional) – Optional, a default speed schedule that overrides the BADA schedule. It should be in the form [Vcl1, Vcl2, Mcl].
procedure (str) – Climb procedure to be followed, e.g., ‘BADA’, ‘NADP1’, ‘NADP2’. Default is ‘BADA’.
config (str, optional) – Optional, current aircraft aerodynamic configuration (TO/IC/CR/AP/LD).
NADP1_ALT (float, optional) – Altitude in feet for NADP1 procedure. Default is 3000 feet.
NADP2_ALT (list[float], optional) – Altitude range in feet for NADP2 procedure. Default is [1000, 3000].
DeltaTemp (float, optional) – Deviation from ISA temperature in Kelvin [K].
- Returns:
A tuple containing the climb calibrated airspeed (CAS) in meters per second [m/s] and a status flag indicating whether the calculated CAS is constrained (‘C’), unconstrained (‘V’ or ‘v’), or not altered (‘’).
- Return type:
tuple[float, str]
This function computes the climb speed schedule for different phases of flight and aircraft types. It supports BADA, NADP1, and NADP2 procedures for both jet and turboprop/piston/electric aircraft.
The climb schedule uses specific speed profiles depending on altitude and aircraft model. For jet engines, the speed is constrained below 250 knots below 10,000 feet, and then it follows a defined speed schedule, either from BADA or NADP procedures.
Additionally, the function applies speed limits based on the aircraft’s flight envelope, adjusting the calculated climb speed if necessary.
For procedure=’BADA’, it uses the BADA climb speed schedule.
For procedure=’NADP1’, it implements the Noise Abatement Departure Procedure 1.
For procedure=’NADP2’, it implements the Noise Abatement Departure Procedure 2.
The function also ensures that the calculated CAS remains within the bounds of the aircraft’s minimum and maximum speeds.
- cruiseSpeed(theta, delta, mass, h, hRWY=0.0, speedSchedule_default=None, config=None, DeltaTemp=0.0)[source]
Computes the cruise speed schedule (CAS) for the given altitude based on various aircraft parameters.
- Parameters:
theta (float) – Normalized air temperature [-].
delta (float) – Normalized air pressure [-].
mass (float) – Aircraft mass in kilograms [kg].
h (float) – Altitude in meters [m].
hRWY (float, optional) – Runway elevation AMSL in meters [m].
speedSchedule_default (list[float], optional) – Optional, a default speed schedule that overrides the BADA schedule. It should be in the form [Vcr1, Vcr2, Mcr].
config (str, optional) – Optional, current aircraft aerodynamic configuration (TO/IC/CR/AP/LD).
DeltaTemp (float, optional) – Deviation from ISA temperature in Kelvin [K].
- Returns:
A tuple containing the cruise calibrated airspeed (CAS) in meters per second [m/s] and a status flag indicating whether the calculated CAS is constrained (‘C’), unconstrained (‘V’ or ‘v’), or not altered (‘’).
- Return type:
tuple[float, str]
This function computes the cruise speed schedule for different phases of flight and aircraft types. It uses either the default speed schedule or the BADA speed schedule based on the aircraft model and altitude.
The cruise speed schedule varies depending on the altitude and type of engine (JET, TURBOPROP, or PISTON).
The function also applies speed limits based on the aircraft’s flight envelope, ensuring the calculated cruise speed remains within the aircraft’s minimum and maximum allowable speeds.
The function ensures the calculated CAS remains within the aircraft’s operational speed limits, adjusting the speed if necessary.
- descentSpeed(theta, delta, mass, h, hRWY=0.0, speedSchedule_default=None, config=None, DeltaTemp=0.0)[source]
Computes the descent speed schedule (CAS) for the given altitude based on various aircraft parameters.
- Parameters:
theta (float) – Normalized air temperature [-].
delta (float) – Normalized air pressure [-].
mass (float) – Aircraft mass in kilograms [kg].
h (float) – Altitude in meters [m].
hRWY (float, optional) – Runway elevation AMSL in meters [m].
speedSchedule_default (list[float], optional) – Optional, a default speed schedule that overrides the BADA schedule. It should be in the form [Vdes1, Vdes2, Mdes].
config (str, optional) – Optional, current aircraft aerodynamic configuration (TO/IC/CR/AP/LD).
DeltaTemp (float, optional) – Deviation from ISA temperature in Kelvin [K].
- Returns:
A tuple containing the descent calibrated airspeed (CAS) in meters per second [m/s] and a status flag indicating whether the calculated CAS is constrained (‘C’), unconstrained (‘V’ or ‘v’), or not altered (‘’).
- Return type:
tuple[float, str]
This function computes the descent speed schedule for different phases of flight and aircraft types. It uses either the default speed schedule or the BADA speed schedule based on the aircraft model and altitude.
The descent speed schedule varies depending on the altitude and type of engine (JET, TURBOPROP, or PISTON).
The function ensures the calculated CAS remains within the aircraft’s operational speed limits, adjusting the speed if necessary.
- class pyBADA.bada4.BADA4(AC)[source]
-
This class implements the part of BADA4 performance model that will be used in other classes following the BADA4 manual.
- Parameters:
AC (bada4Aircraft.) – Aircraft object {BADA4}.
- CD(HLid, LG, CL, M, speedBrakes={'deployed': False, 'value': 0.03}, **kwargs)[source]
Computes the drag coefficient (CD) based on the Mach number (M), lift coefficient (CL), high lift devices (HLid), landing gear position (LG), and speed brakes status. The drag coefficient is calculated for both clean and non-clean configurations.
- Parameters:
M (float.) – Mach number [-].
CL (float.) – Lift coefficient [-].
HLid (float.) – High lift devices position [-].
LG (string.) – Landing gear position, [LGUP/LGDN] [-].
speedBrakes (dict.) – Dictionary indicating if speed brakes are deployed and their value. Default: {“deployed”: False, “value”: 0.03}.
- Returns:
Drag coefficient [-].
- Return type:
float.
- CDClean(CL, M)[source]
Computes the drag coefficient (CD) in a clean configuration based on the Mach number (M) and the lift coefficient (CL).
- Parameters:
M (float.) – Mach number [-].
CL (float.) – Lift coefficient [-].
- Returns:
Drag coefficient (CD) in clean configuration [-].
- Return type:
float
- CF(delta, theta, DeltaTemp, **kwargs)[source]
Computes the fuel flow coefficient (CF) for JET, TURBOPROP, and PISTON engines.
- Parameters:
delta (float) – Normalized pressure [-].
theta (float) – Normalized temperature [-].
DeltaTemp (float) – Temperature deviation from ISA [K].
kwargs – Optional parameters including ‘rating’, ‘deltaT’, ‘CT’, or ‘M’.
- Returns:
Fuel flow coefficient [-].
- Return type:
float
- CF_idle(delta, theta, M)[source]
Computes the fuel flow coefficient at idle throttle for JET and TURBOPROP engines.
- Parameters:
delta (float) – Normalized pressure [-].
theta (float) – Normalized temperature [-].
M (float) – Mach speed [-].
- Returns:
Idle fuel flow coefficient [-].
- Return type:
float
- CL(delta, mass, M, nz=1.0)[source]
Computes the aircraft’s lift coefficient based on the current Mach number (M), normalized air pressure (delta), aircraft mass, and load factor (nz).
- Parameters:
M (float) – Mach number [-].
delta (float) – Normalized air pressure [-].
mass (float) – Aircraft mass [kg].
nz (float) – Load factor [-]. Default is 1.0 (straight and level flight).
- Returns:
Lift coefficient (CL) [-].
- Return type:
float
- CLPoly(M)[source]
Computes the lift coefficient polynomial for the given Mach number (M).
This method uses a 5th-degree polynomial defined by the coefficients in the parsed aircraft data (self.AC.bf).
- Parameters:
M (float) – Mach number [-].
- Returns:
Lift coefficient (polynomial approximation) [-].
- Return type:
float
- CLmax(M, HLid, LG)[source]
Computes the maximum lift coefficient (CLmax) for the given Mach number (M), high-lift device (HLid) position, and landing gear (LG) configuration.
If the aircraft is in a clean configuration (HLid == 0 and LG == “LGUP”), the method interpolates or extrapolates the lift coefficient based on Mach number.
- Parameters:
M (float) – Mach number [-].
HLid (float) – High-lift device position [-].
LG (str) – Landing gear position [LGUP/LGDN] [-].
- Returns:
Maximum lift coefficient (CLmax) [-].
- Return type:
float
- CP(**kwargs)[source]
Computes the power coefficient (CP) for TURBOPROP and PISTON engines.
- Parameters:
rating (str.) – Throttle setting {MCMB, MCRZ, LIDL}.
deltaT (float.) – Direct throttle parameter [-].
delta (float.) – Normalized pressure [-].
theta (float.) – Normalized temperature [-].
sigma (float.) – Normalized density [-] (for piston engines).
M (float.) – Mach number [-].
- Returns:
Power coefficient (CP) [-].
- Return type:
float.
- Raises:
ValueError if an unknown rating is provided.
- CPmax(rating, delta, theta, M)[source]
Computes the maximum engine power coefficient (CPmax) for TURBOPROP engines.
- Parameters:
rating (str.) – Throttle setting {MCMB, MCRZ}.
delta (float.) – Normalized pressure [-].
theta (float.) – Normalized temperature [-].
M (float.) – Mach number [-].
- Returns:
Maximum engine power coefficient (CPmax) [-].
- Return type:
float.
- Raises:
ValueError: If the rating is unknown.
- CT(delta, **kwargs)[source]
Computes the thrust coefficient (CT) based on engine type, throttle setting, or engine rating. The thrust coefficient is calculated differently for JET, TURBOPROP, and PISTON engines based on normalized pressure, temperature, Mach number, and other inputs.
- Parameters:
delta (float) – Normalized pressure [-].
kwargs – Optional parameters: - ‘rating’: Engine rating {MCMB, MCRZ, MTKF, LIDL}. - ‘deltaT’: Direct throttle parameter [-]. - ‘Thrust’: Direct thrust value [N]. - ‘M’: Mach number [-]. - ‘theta’: Normalized temperature [-]. - ‘DeltaTemp’: Deviation from the standard ISA temperature [K].
- Returns:
Thrust coefficient (CT) [-].
- Return type:
float
- Raises:
ValueError: If an invalid rating is provided.
- CT_LIDL(**kwargs)[source]
Computes the thrust coefficient (CT) for the LIDL (idle) rating.
- Parameters:
delta (float.) – Normalized pressure [-].
theta (float.) – Normalized temperature [-].
M (float.) – Mach number [-].
CP (float.) – Power coefficient (for PISTON engines) [-].
- Returns:
Idle thrust coefficient (CT) [-].
- Return type:
float
- CT_nonLIDL(theta, delta, M, **kwargs)[source]
Computes the thrust coefficient (CT) for non-LIDL ratings {MCMB, MCRZ}.
- Parameters:
delta (float.) – Normalized pressure [-].
theta (float.) – Normalized temperature [-].
M (float.) – Mach number [-].
CP (float.) – Power coefficient (for PISTON engines) [-].
- Returns:
Thrust coefficient (CT) [-].
- Return type:
float
- D(delta, M, CD)[source]
Computes the thrust based on throttle settings, normalized air pressure (delta), and other flight parameters.
- Parameters:
rating (string.) – Throttle setting {MCMB, MCRZ, LIDL}.
deltaT (float.) – Direct throttle parameter [-].
delta (float.) – Normalized air pressure [-].
theta (float.) – Normalized temperature [-].
M (float.) – Mach number [-].
DeltaTemp (float.) – Temperature deviation with respect to ISA [K].
- Returns:
Thrust [N].
- Return type:
float.
- L(delta, M, CL)[source]
Computes the aerodynamic lift based on the Mach number (M), normalized air pressure (delta), and lift coefficient (CL).
- Parameters:
M (float.) – Mach number [-].
delta (float.) – Normalized air pressure [-].
CL (float.) – Lift coefficient [-].
- Returns:
Aerodynamic lift [N].
- Return type:
float.
- ROCD(T, D, v, mass, ESF, h, DeltaTemp)[source]
Computes the Rate of Climb or Descent (ROCD) of the aircraft based on the provided thrust, drag, true airspeed, mass, and Energy Share Factor (ESF).
- Parameters:
T (float.) – Thrust produced by the engines [N].
D (float.) – Drag acting on the aircraft [N].
v (float.) – True airspeed (TAS) of the aircraft [m/s].
mass (float.) – Current aircraft mass [kg].
ESF (float.) – Energy Share Factor, which controls the allocation of excess thrust between climb/descent and acceleration [-].
h (float.) – Altitude of the aircraft above sea level [m].
DeltaTemp (float.) – Temperature deviation from the International Standard Atmosphere (ISA) [K].
- Returns:
Rate of climb or descent (ROCD) in meters per second [m/s].
- Return type:
float.
- Thrust(delta, **kwargs)[source]
Computes the maximum thrust produced by the aircraft based on throttle settings, normalized air pressure (delta), and other flight parameters like Mach number and temperature deviation.
- Parameters:
rating (string (optional).) – Throttle setting {MCMB (Max Climb), MCRZ (Max Cruise), LIDL (Idle)}.
deltaT (float (optional).) – Direct throttle parameter for intermediate throttle levels [-].
delta (float.) – Normalized air pressure relative to sea-level pressure (ISA) [-].
theta (float (optional).) – Normalized temperature relative to sea-level temperature (ISA) [-].
M (float (optional).) – Mach number, the ratio of the aircraft’s speed to the speed of sound [-].
DeltaTemp (float (optional).) – Temperature deviation from the International Standard Atmosphere (ISA) [K].
- Returns:
Thrust force produced by the engine [N].
- Return type:
float.
- controlLawThrust(ROCD, D, v, mass, ESF, h, DeltaTemp)[source]
Computes the required thrust based on the TEM (Thrust-Equilibrium Method) control law. This calculation takes into account the aircraft’s rate of climb/descent (ROCD), drag (D), true airspeed (v), and energy share factor (ESF), along with altitude and temperature deviations.
- Parameters:
h (float.) – Altitude of the aircraft above sea level [m].
ROCD (float.) – Rate of climb or descent of the aircraft [m/s]. Positive value for climb, negative for descent.
D (float.) – Drag force acting on the aircraft [N].
v (float.) – True airspeed (TAS) of the aircraft [m/s].
mass (float.) – Current aircraft mass [kg].
ESF (float.) – Energy Share Factor, determining the fraction of excess thrust used for acceleration or climb/descent [-].
DeltaTemp (float.) – Temperature deviation from the International Standard Atmosphere (ISA) [K].
- Returns:
Thrust required to maintain the specified rate of climb or descent [N].
- Return type:
float.
- ff(delta, theta, DeltaTemp, **kwargs)[source]
Computes the fuel flow (FF) of the aircraft based on engine throttle settings, normalized air pressure (delta), normalized temperature (theta), and other relevant parameters.
- Parameters:
rating (string (optional).) – Throttle setting {MCMB (Max Climb), MCRZ (Max Cruise), LIDL (Idle), TAXI}. If ‘TAXI’ is selected, the taxi fuel allowance is used for ground operations.
deltaT (float (optional).) – Direct throttle parameter for intermediate throttle levels [-].
delta (float.) – Normalized air pressure relative to sea-level pressure (ISA) [-].
theta (float.) – Normalized temperature relative to sea-level temperature (ISA) [-].
M (float.) – Mach number, the ratio of the aircraft’s speed to the speed of sound [-].
DeltaTemp (float.) – Temperature deviation from the International Standard Atmosphere (ISA) [K].
- Returns:
Fuel flow rate in kilograms per second [kg s^-1].
- Return type:
float.
- propEfficiency(Wp, sigma, tas)[source]
Computes the propeller efficiency of a piston or turboprop engine using momentum theory. The calculation estimates the efficiency based on power, air density, and true airspeed.
- Parameters:
Wp (float.) – Total engine power output for all engines [W].
sigma (float.) – Normalized air density relative to sea-level density [-].
tas (float.) – True airspeed (TAS) of the aircraft [m/s].
- Returns:
Propeller efficiency as a dimensionless ratio [-].
- Return type:
float.
- class pyBADA.bada4.Bada4Aircraft(badaVersion, acName, filePath=None, allData=None)[source]
Bases:
BADA4
This class encapsulates the BADA4 performance model for an aircraft, extending the BADA4 base class.
- Parameters:
badaVersion (str) – The version of the BADA4 model being used.
acName (str) – The ICAO designation or name of the aircraft.
filePath (str, optional) – (Optional) Path to the BADA4 XML file. If not provided, a default path is used.
allData (pd.DataFrame, optional) – (Optional) Dataframe containing pre-loaded aircraft data, typically used to initialize the aircraft parameters without needing to parse XML files.
This class initializes the aircraft’s performance model using data from a dataframe or by reading from XML files in the BADA4 format.
- class pyBADA.bada4.FlightEnvelope(AC)[source]
Bases:
BADA4
This class is a BADA4 aircraft subclass and implements the flight envelope caclulations following the BADA4 manual.
- Parameters:
AC (bada4Aircraft.) – Aircraft object {BADA4}.
- VMax(h, HLid, LG, delta, theta, mass, nz=1.0)[source]
Computes the maximum speed (CAS)
- Parameters:
h (float.) – Altitude in meters [m].
HLid (float.) – High-lift devices position [-].
LG (str.) – Landing gear position, either “LGUP” (gear up) or “LGDN” (gear down) [-].
theta (float.) – Normalized temperature [-].
delta (float.) – Normalized pressure [-].
mass (float.) – Aircraft mass in kilograms [kg].
nz (float.) – Load factor [-], default is 1.0.
- Returns:
Maximum allowable calibrated airspeed (CAS) in meters per second [m/s].
- Return type:
float.
- VMin(config, theta, delta, mass)[source]
Computes the minimum speed (CAS) for the given aerodynamic configuration, accounting for stall speed and other configuration-based limitations.
- Parameters:
config (str.) – Aircraft configuration, options include “CR”, “IC”, “TO”, “AP”, “LD” [-].
delta (float.) – Normalized pressure [-].
theta (float.) – Normalized temperature [-].
mass (float.) – Aircraft mass in kilograms [kg].
- Returns:
Minimum calibrated airspeed (CAS) in meters per second [m/s].
- Return type:
float.
- VStall(mass, HLid, LG, nz=1.0, **kwargs)[source]
Calculates the stall speed (CAS) for the given aerodynamic configuration and load factor, taking into account altitude and temperature deviations from ISA.
- Parameters:
HLid (float.) – High-lift devices position [-].
LG (str.) – Landing gear position, either “LGUP” (gear up) or “LGDN” (gear down) [-].
delta (float.) – Normalized pressure [-].
theta (float.) – Normalized temperature [-].
mass (float.) – Aircraft mass in kilograms [kg].
nz (float.) – Load factor [-], default is 1.0.
h (float, optional.) – Altitude above mean sea level (AMSL) in meters [m].
DeltaTemp (float, optional.) – Temperature deviation from ISA in Kelvin [K].
- Returns:
Stall speed in calibrated airspeed (CAS) [m/s].
- Return type:
float.
- Vmax_thrustLimited(h, mass, DeltaTemp, rating, config)[source]
Computes the maximum speed (CAS) within the certified flight envelope while accounting for thrust limitations at a given altitude, temperature deviation, and configuration.
- Parameters:
h (float.) – Altitude in meters [m].
mass (float.) – Aircraft mass in kilograms [kg].
DeltaTemp (float.) – Deviation from ISA temperature in Kelvin [K].
rating (str.) – Engine rating, options include “MTKF”, “MCMB”, “MCRZ” [-].
config (str.) – Aircraft aerodynamic configuration, such as “TO”, “IC”, “CR” [-].
- Returns:
Maximum thrust-limited calibrated airspeed (CAS) in meters per second [m/s].
- Return type:
float.
- checkConfigurationContinuity(phase, previousConfig, currentConfig)[source]
Ensures the continuity of the aerodynamic configuration changes based on the phase of flight. It prevents sudden or improper configuration transitions, ensuring the aerodynamic configuration does not change in the wrong direction during Climb, Cruise, or Descent.
- Parameters:
phase (str) – Aircraft phase of flight (Climb, Cruise, Descent).
previousConfig (str) – Previous aerodynamic configuration.
currentConfig (str) – Current aerodynamic configuration.
- Returns:
The appropriate configuration for the current flight phase.
- Return type:
str
- getAeroConfig(config)[source]
Returns the aircraft aerodynamic configuration based on the provided configuration ID. This includes the high-lift device (HLID) position and landing gear (LG) position. If the configuration is not found, it returns None.
- Parameters:
config (str) – Aircraft configuration (TO/IC/CR/AP/LD).
- Returns:
Aerodynamic configuration as a combination of HLID and LG.
- Return type:
[float, str]
- getConfig(phase, h, mass, v, DeltaTemp=0.0, hRWY=0.0)[source]
Returns the aircraft’s aerodynamic configuration based on altitude, speed, and phase of flight.
- Parameters:
phase (str.) – Phase of flight [Climb, Cruise, Descent] [-].
h (float.) – Altitude above mean sea level (AMSL) [m].
mass (float.) – Aircraft mass [kg].
v (float.) – Calibrated airspeed (CAS) [m/s].
DeltaTemp (float.) – Deviation from ISA temperature [K], default is 0.0.
hRWY (float.) – Runway elevation above mean sea level (AMSL) [m], default is 0.0.
- Returns:
Aircraft aerodynamic configuration [TO/IC/CR/AP/LD] [-].
- Return type:
str.
- Raises:
TypeError if unable to determine the configuration.
- getSpeedSchedule(phase)[source]
Returns the speed schedule based on the phase of flight (Climb, Cruise, Descent). The schedule includes two CAS values (CAS1, CAS2) and a Mach number (M).
- Parameters:
phase (str) – Aircraft phase of flight (Climb, Cruise, Descent).
- Returns:
Speed schedule as a combination of CAS1, CAS2 (in m/s) and Mach number (M).
- Return type:
[float, float, float]
- maxAltitude(HLid, LG, M, DeltaTemp, mass, nz=1.0)[source]
Computes the maximum altitude taking into account buffet limitations. The altitude is calculated based on the aerodynamic configuration and the available buffet boundary conditions.
- Parameters:
HLid (float.) – High-lift devices position [-].
LG (str.) – Landing gear position, either “LGUP” (gear up) or “LGDN” (gear down) [-].
M (float.) – Mach airspeed [-].
mass (float.) – Aircraft mass [kg].
nz (float.) – Load factor [-], default is 1.0.
DeltaTemp (float.) – Temperature deviation from ISA [K].
- Returns:
Maximum altitude [m].
- Return type:
float.
- maxCAS(HLid, LG)[source]
Computes the maximum allowable Calibrated Airspeed (CASmax) based on the position of the high-lift devices (HLid) and landing gear (LG), following the kinematic limitations of the aircraft.
- Parameters:
HLid (float) – Position of high-lift devices (0 for clean configuration, >0 for extended).
LG (str) – Landing gear position, either “LGUP” (gear up) or “LGDN” (gear down).
- Returns:
The maximum allowable Calibrated Airspeed (CASmax) in meters per second [m/s].
- Return type:
float
- maxM(LG)[source]
Computes the maximum allowable Mach speed (Mmax) based on the kinematic limitations of the aircraft and the position of the landing gear (LG).
- Parameters:
LG (str) – Landing gear position, either “LGUP” (gear up) or “LGDN” (gear down).
- Returns:
The maximum allowable Mach number (Mmax) based on the aircraft’s limitations.
- Return type:
float
- maxMbuffet(HLid, LG, delta, mass, nz=1.0)[source]
Computes the maximum allowable Mach number (M) under buffet limitations, where the lift coefficient (CL) cannot exceed the maximum lift coefficient (CL_max) for the given Mach number and configuration.
- Parameters:
HLid (float.) – High-lift devices position [-].
LG (str.) – Landing gear position, either “LGUP” (gear up) or “LGDN” (gear down) [-].
delta (float.) – Normalized pressure [-].
mass (float.) – Aircraft mass in kilograms [kg].
nz (float.) – Load factor [-], default is 1.0.
- Returns:
Maximum allowable Mach number (M) limited by buffet conditions.
- Return type:
float.
- minMbuffet(HLid, LG, theta, delta, mass, nz=1.0)[source]
Computes the minimum Mach number (M) applying buffet limitations, where the lift coefficient (CL) must not exceed the maximum lift coefficient (CL_max) for the given Mach number and aerodynamic configuration.
- Parameters:
HLid (float.) – High-lift devices position [-].
LG (str.) – Landing gear position, either “LGUP” (gear up) or “LGDN” (gear down) [-].
delta (float.) – Normalized pressure [-].
theta (float.) – Normalized temperature [-].
mass (float.) – Aircraft mass in kilograms [kg].
nz (float.) – Load factor [-], default is 1.0.
- Returns:
Minimum Mach number (M) limited by buffet conditions.
- Return type:
float.
- class pyBADA.bada4.Optimization(AC)[source]
Bases:
BADA4
This class implements the BADA4 optimization following the BADA4 manual.
- Parameters:
AC (bada4Aircraft.) – Aircraft object {BADA4}.
- CCI(theta, delta, cI)[source]
Computes the cost index coefficient for given flight conditions.
- Parameters:
cI (float) – Cost index in kilograms per minute [kg min^-1].
delta (float) – Normalized pressure [-].
theta (float) – Normalized temperature [-].
- Returns:
Cost index coefficient [-].
- Return type:
float
- CW(mass, delta)[source]
Computes the weight coefficient at a given mass and pressure.
- Parameters:
mass (float) – Aircraft mass in kilograms [kg].
delta (float) – Normalized pressure [-].
- Returns:
Weight coefficient [-].
- Return type:
float
The weight coefficient is used to represent the aircraft’s weight relative to its maximum takeoff weight (MTOW) under given atmospheric conditions.
- LRC(theta, delta, mass, DeltaTemp, wS)[source]
Computes the Mach number representing Long Range Cruise (LRC) for the given flight conditions.
- Parameters:
theta (float) – Normalized air temperature [-].
delta (float) – Normalized air pressure [-].
mass (float) – Aircraft mass in kilograms [kg].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
wS (float) – Longitudinal wind speed in meters per second [m/s].
- Returns:
Long Range Cruise (LRC) Mach number [-].
- Return type:
float
The Long Range Cruise (LRC) is defined as the speed where fuel efficiency is 99% of the Maximum Range Cruise (MRC). This function calculates the LRC based on the MRC and iterates through possible Mach numbers to find the one that minimizes the difference between the specific range (SR) at LRC and 99% of the SR at MRC.
If no valid LRC is found, it returns NaN.
- MEC(theta, delta, mass, DeltaTemp, wS)[source]
Computes the Mach number representing Maximum Endurance Cruise (MEC) for given flight conditions.
- Parameters:
delta (float) – Normalized pressure [-].
theta (float) – Normalized temperature [-].
mass (float) – Aircraft mass in kilograms [kg].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
wS (float) – Longitudinal wind speed in meters per second [m/s].
- Returns:
Maximum Endurance Cruise (MEC) in Mach [-].
- Return type:
float
The Maximum Endurance Cruise (MEC) Mach is the Mach number that minimizes the fuel consumption rate, maximizing the endurance of the flight. This function iterates over a range of possible Mach numbers within the flight envelope and returns the Mach number with the lowest fuel coefficient (CF).
The calculation is subject to thrust limitations, and the function ensures that the resulting Mach does not exceed the maximum thrust available.
- MRC(theta, delta, mass, DeltaTemp, wS)[source]
Computes the Mach number representing Maximum Range Cruise (MRC) for the given flight conditions.
- Parameters:
theta (float) – Normalized air temperature [-].
delta (float) – Normalized air pressure [-].
mass (float) – Aircraft mass in kilograms [kg].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
wS (float) – Longitudinal wind speed in meters per second [m/s].
- Returns:
Maximum Range Cruise (MRC) Mach number [-].
- Return type:
float
This function calculates the Mach number that corresponds to the Maximum Range Cruise (MRC), which maximizes the specific range. The calculation assumes clean configuration during the cruise phase. It uses the econMach function with a cost index (cI) of zero to find the MRC.
If the calculated MRC is invalid, it returns NaN.
- SR(M, CF)[source]
Computes the specific range (SR) for given flight conditions.
- Parameters:
M (float) – Mach ground speed [-].
CF (float) – Fuel coefficient [-].
- Returns:
Specific range in nautical miles per kilogram [NM kg^-1].
- Return type:
float
Specific range is a measure of the distance that can be flown per unit of fuel mass. It is calculated as the ratio of Mach number to fuel flow coefficient.
- econMach(theta, delta, mass, DeltaTemp, cI, wS)[source]
Computes the economic Mach number for a given flight condition and cost index.
- Parameters:
delta (float) – Normalized pressure [-].
theta (float) – Normalized temperature [-].
mass (float) – Aircraft mass in kilograms [kg].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
cI (float) – Cost index in kilograms per minute [kg min^-1].
wS (float) – Longitudinal wind speed in meters per second [m/s].
- Returns:
Maximum Range Cruise (MRC) Mach number [-].
- Return type:
float
This function calculates the economic Mach number by balancing the fuel consumption and time costs, taking into account the aircraft’s flight conditions and the provided cost index (cI). It iterates through possible Mach numbers within the aircraft’s flight envelope (bounded by Mmin and Mmax), computing the drag, thrust, and fuel flow, then selects the Mach that maximizes the cost efficiency.
Mmin: Lower bound of Mach speed, limited by buffet constraints.
Mmax: Upper bound of Mach speed, limited by buffet constraints.
SR: Specific Range, used to calculate the most efficient cruise speed in terms of fuel consumption.
- getOPTParam(optParam, var_1, var_2=None)[source]
Returns the value of an optimization (OPT) parameter from a BADA4 OPT file for various flight conditions. The OPT file contains values for parameters like Long Range Cruise (LRC), Maximum Endurance Cruise (MEC), Maximum Range Cruise (MRC), ECON speed, or OPTALT altitude, and this function interpolates the appropriate value based on input variables.
Note
The array used in this function is expected to be sorted, as per the design of OPT files.
- Parameters:
optParam (str) – Name of the optimization parameter file {LRC, MEC, MRC, ECON, OPTALT}.
var_1 (float) – First optimizing factor, typically a flight condition like mass or altitude.
var_2 (float, optional) – (Optional) Second optimizing factor if the parameter depends on more than one factor.
- Returns:
Interpolated optimization parameter value or NaN if not found.
- Return type:
float
- optAltitude(M, mass, DeltaTemp)[source]
Computes the optimum altitude for a given flight condition and Mach number.
- Parameters:
M (float) – Mach number [-].
mass (float) – Aircraft mass in kilograms [kg].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
- Returns:
Optimum altitude in feet [ft].
- Return type:
float
The optimum altitude is the altitude where the aircraft achieves the maximum efficiency for a given Mach number and mass, subject to thrust and buffet limitations. The function iterates over a range of altitudes and returns the one with the best fuel efficiency.
The function also ensures that the optimum altitude is bounded by a minimum of 2000 feet.
- class pyBADA.bada4.PTD(AC)[source]
Bases:
BADA4
This class implements the PTD file creator for BADA4 aircraft following BADA4 manual.
- Parameters:
AC (bada4Aircraft.) – Aircraft object {BADA4}.
- PTD_climb(mass, altitudeList, DeltaTemp)[source]
Calculates the BADA4 PTD (Performance Table Data) for the CLIMB phase of flight.
- Parameters:
mass (float) – Aircraft mass in kilograms [kg].
altitudeList (list of int) – List of aircraft altitudes in feet [ft].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
- Returns:
List of PTD CLIMB data.
- Return type:
list
- PTD_cruise(mass, altitudeList, DeltaTemp)[source]
Calculates the BADA4 PTD (Performance Table Data) for the CRUISE phase of flight.
- Parameters:
mass (float) – Aircraft mass in kilograms [kg].
altitudeList (list of int) – List of aircraft altitudes in feet [ft].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
- Returns:
List of PTD CRUISE data.
- Return type:
list
- PTD_descent(mass, altitudeList, DeltaTemp)[source]
Calculates the BADA4 PTD (Performance Table Data) for the DESCENT phase of flight.
- Parameters:
mass (float) – Aircraft mass in kilograms [kg].
altitudeList (list of int) – List of aircraft altitudes in feet [ft].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
- Returns:
List of PTD DESCENT data.
- Return type:
list
- create(DeltaTemp, saveToPath)[source]
Creates the BADA4 Performance Table Data (PTD) file, calculating climb, cruise, and descent profiles for different mass levels and altitudes, and saves the output to the specified path.
- Parameters:
saveToPath (str) – Directory path where the PTD file should be stored.
DeltaTemp (float) – Deviation from the ISA (International Standard Atmosphere) temperature in Kelvin [K].
- Returns:
None
- Return type:
None
The function generates PTD files by computing the performance for three mass levels: - 120% of the Operating Empty Weight (OEW), - OEW plus 70% of the difference between Maximum Take-Off Weight (MTOW) and OEW, - and Maximum Take-Off Weight (MTOW).
For each mass level, climb, cruise, and descent performance is calculated at various altitudes (up to the maximum operating altitude or a limit of 51,000 feet). The data is then saved to a PTD file.
- save2PTD(saveToPath, CLList, CRList, DESList, DeltaTemp)[source]
Saves climb, cruise, and descent performance data into a PTD (Performance Table Data) file.
- Parameters:
saveToPath (str) – Directory path where the PTD file will be stored.
CLList (list) – List of climb performance data.
CRList (list) – List of cruise performance data.
DESList (list) – List of descent performance data.
DeltaTemp (float) – Deviation from ISA (International Standard Atmosphere) temperature in Kelvin [K].
- Returns:
None
- Return type:
None
- class pyBADA.bada4.PTF(AC)[source]
Bases:
BADA4
This class implements the PTF file creator for BADA4 aircraft following BADA4 manual.
- Parameters:
AC (bada4Aircraft.) – Aircraft object {BADA4}.
- PTF_climb(massList, altitudeList, DeltaTemp)[source]
Calculates the BADA4 PTF for the CLIMB phase of flight.
- Parameters:
massList (list) – List of aircraft mass levels in kilograms [kg].
altitudeList (list of int) – List of aircraft altitudes in feet [ft].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
- Returns:
List of PTF CLIMB data.
- Return type:
list
- PTF_cruise(massList, altitudeList, DeltaTemp)[source]
Calculates the BADA4 PTF for the CRUISE phase of flight.
- Parameters:
massList (list) – List of aircraft mass levels in kilograms [kg].
altitudeList (list of int) – List of aircraft altitudes in feet [ft].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
- Returns:
List of PTF CRUISE data.
- Return type:
list
- PTF_descent(massList, altitudeList, DeltaTemp)[source]
Calculates the BADA4 PTF for the DESCENT phase of flight.
- Parameters:
massList (list) – List of aircraft mass levels in kilograms [kg].
altitudeList (list of int) – List of aircraft altitudes in feet [ft].
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
- Returns:
List of PTF DESCENT data.
- Return type:
list
- create(DeltaTemp, saveToPath)[source]
Creates the BADA4 PTF and saves it to the specified directory.
- Parameters:
saveToPath (str) – Path to the directory where the PTF should be stored.
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
- Returns:
None
- Return type:
None
- save2PTF(saveToPath, CLList, CRList, DESList, DeltaTemp, massList, altitudeList)[source]
Saves the BADA4 performance data to a PTF format.
- Parameters:
saveToPath (str) – Path to the directory where the PTF should be stored.
CLList (list) – List of PTD data for CLIMB.
CRList (list) – List of PTD data for CRUISE.
DESList (list) – List of PTD data for DESCENT.
DeltaTemp (float) – Deviation from ISA temperature in Kelvin [K].
massList (list(float)) – List of aircraft mass levels [kg].
altitudeList – List of altitudes [ft].
- Returns:
None
- Return type:
None
This function formats and writes the climb, cruise, and descent data for different mass levels and altitudes into a .PTF file, adhering to the BADA4 performance file format.
- class pyBADA.bada4.Parser[source]
Bases:
object
This class implements the BADA4 parsing mechanism to parse xml and GPF(xml) BADA4 files.
- static combineXML_GPF(XMLDataFrame, GPFDataframe)[source]
Combines the parsed aircraft XML DataFrame with the parsed GPF DataFrame.
This function merges two DataFrames, one containing the parsed aircraft-specific data (from the XML file) and the other containing the parsed GPF data. This combination provides a unified set of aircraft performance data along with general performance factors.
- Parameters:
XMLDataFrame (pd.DataFrame) – A DataFrame containing the parsed aircraft XML data.
GPFDataframe (pd.DataFrame) – A DataFrame containing the parsed GPF data.
- Returns:
A combined DataFrame with both aircraft and GPF data.
- Return type:
pd.DataFrame
- static parseAll(badaVersion, filePath=None)[source]
Parses all BADA4 XML files and combines the data into a single DataFrame.
This function parses both the BADA4 aircraft XML files and the GPF (General Performance Factors) file. It combines the data from both sources and creates a unified DataFrame that contains all aircraft and performance-related data for the specified BADA version.
- Parameters:
badaVersion (str) – The version of BADA (e.g., “4.3”) to be parsed.
filePath (str, optional) – The path to the folder containing the BADA4 XML files and GPF file. If None, the default path from the configuration will be used.
- Raises:
IOError – If any of the necessary XML files cannot be found or parsed.
- Returns:
A DataFrame containing the combined data from all parsed aircraft and GPF files.
- Return type:
pd.DataFrame
- static parseGPF(filePath)[source]
Parses the BADA4 GPF XML file and extracts key performance factors.
This function processes the BADA4 GPF XML file to extract data related to various flight performance factors, such as minimum climb/descent speeds, maximum altitude limits for different phases of flight, and speed schedules for climb and descent.
- Parameters:
filePath (str) – The path to the directory containing the BADA4 GPF XML file.
- Raises:
IOError – If the GPF XML file cannot be found or parsed.
- Returns:
A pandas DataFrame containing the parsed GPF data.
- Return type:
pd.DataFrame
- static parseMappingFile(filePath, acName)[source]
Retrieves the file name for a given aircraft name from the parsed BADA4 mapping file.
This function uses the readMappingFile method to parse the BADA4 XML mapping file and returns the file name associated with the given aircraft name (acName).
- Parameters:
filePath (str) – The path to the directory containing the BADA4 mapping XML file.
acName (str) – The aircraft code name for which the corresponding file is being requested.
- Returns:
The file name corresponding to the aircraft code, or None if the aircraft code is not found.
- Return type:
str or None
- static parseXML(filePath, acName)[source]
Parses the BADA4 XML file for a specific aircraft model and extracts various parameters.
This function parses the BADA4 aircraft XML file for a given aircraft model (acName). It retrieves general information about the aircraft, engine type, aerodynamic configurations, performance parameters, and more.
- Parameters:
filePath (str) – The path to the folder containing the BADA4 XML file.
acName (str) – The aircraft code name for which the XML file is being parsed.
- Raises:
IOError – If the XML file cannot be found or parsed.
- Returns:
A pandas DataFrame containing the parsed data for the specified aircraft.
- Return type:
pd.DataFrame
- static readMappingFile(filePath)[source]
Parses the BADA4 mapping XML file and stores a dictionary of aircraft code names and their corresponding XML file paths.
This function processes the BADA4 aircraft model mapping XML file to create a dictionary that maps the aircraft code names to the XML file paths for their corresponding BADA models. The mapping file contains information about available models for the specified BADA version.
- Parameters:
filePath (str) – The path to the directory containing the BADA4 mapping XML file.
- Raises:
IOError – If the XML file cannot be found or parsed.
- Returns:
A dictionary with aircraft code names as keys and corresponding file names as values.
- Return type:
dict