pyBADA 0.1.3__py3-none-any.whl → 0.1.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyBADA/TCL.py +56 -49
- pyBADA/aircraft.py +39 -40
- pyBADA/atmosphere.py +79 -72
- pyBADA/bada3.py +272 -245
- pyBADA/bada4.py +460 -337
- pyBADA/badaH.py +338 -239
- pyBADA/configuration.py +31 -21
- pyBADA/constants.py +0 -1
- pyBADA/conversions.py +11 -23
- pyBADA/flightTrajectory.py +95 -63
- pyBADA/geodesic.py +119 -82
- pyBADA/magnetic.py +12 -7
- pyBADA/trajectoryPrediction.py +17 -13
- {pybada-0.1.3.dist-info → pybada-0.1.4.dist-info}/METADATA +14 -5
- {pybada-0.1.3.dist-info → pybada-0.1.4.dist-info}/RECORD +18 -18
- {pybada-0.1.3.dist-info → pybada-0.1.4.dist-info}/WHEEL +0 -0
- {pybada-0.1.3.dist-info → pybada-0.1.4.dist-info}/licenses/AUTHORS +0 -0
- {pybada-0.1.3.dist-info → pybada-0.1.4.dist-info}/licenses/LICENCE.txt +0 -0
pyBADA/bada3.py
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
"""
|
|
3
|
-
Generic BADA3 aircraft performance module
|
|
4
|
-
"""
|
|
1
|
+
"""Generic BADA3 aircraft performance module."""
|
|
5
2
|
|
|
6
3
|
from math import sqrt, isnan, asin, atan
|
|
7
4
|
import numpy as np
|
|
@@ -32,25 +29,27 @@ def checkArgument(argument, **kwargs):
|
|
|
32
29
|
raise TypeError("Missing " + argument + " argument")
|
|
33
30
|
|
|
34
31
|
|
|
35
|
-
class Parser
|
|
36
|
-
"""This class implements the BADA3 parsing mechanism to parse APF, OPF and
|
|
32
|
+
class Parser:
|
|
33
|
+
"""This class implements the BADA3 parsing mechanism to parse APF, OPF and
|
|
34
|
+
GPF BADA3 files."""
|
|
37
35
|
|
|
38
36
|
def __init__(self):
|
|
39
37
|
pass
|
|
40
38
|
|
|
41
39
|
@staticmethod
|
|
42
40
|
def parseXML(filePath, acName):
|
|
43
|
-
"""
|
|
44
|
-
Parses a BADA3 XML formatted file for aircraft performance data.
|
|
41
|
+
"""Parses a BADA3 XML formatted file for aircraft performance data.
|
|
45
42
|
|
|
46
43
|
:param filePath: Path to the XML file containing BADA data.
|
|
47
|
-
:param acName: Name of the aircraft for which data is being parsed
|
|
44
|
+
:param acName: Name of the aircraft for which data is being parsed
|
|
45
|
+
from the XML file.
|
|
48
46
|
:type filePath: str
|
|
49
47
|
:type acName: str
|
|
50
48
|
:raises IOError: If the file cannot be found or read.
|
|
51
|
-
:raises ValueError: If the BADA version is unsupported or if parsing
|
|
52
|
-
|
|
53
|
-
:returns: A pandas DataFrame containing the parsed aircraft
|
|
49
|
+
:raises ValueError: If the BADA version is unsupported or if parsing
|
|
50
|
+
fails.
|
|
51
|
+
:returns: A pandas DataFrame containing the parsed aircraft
|
|
52
|
+
performance data.
|
|
54
53
|
:rtype: pd.DataFrame
|
|
55
54
|
"""
|
|
56
55
|
|
|
@@ -59,7 +58,7 @@ class Parser(object):
|
|
|
59
58
|
try:
|
|
60
59
|
tree = ET.parse(filename)
|
|
61
60
|
root = tree.getroot()
|
|
62
|
-
except:
|
|
61
|
+
except Exception:
|
|
63
62
|
raise IOError(filename + " not found or in correct format")
|
|
64
63
|
|
|
65
64
|
modificationDateOPF = "UNKNOWN"
|
|
@@ -136,7 +135,6 @@ class Parser(object):
|
|
|
136
135
|
if (
|
|
137
136
|
LGDN is not None
|
|
138
137
|
): # Landing gear NOT allowed in clean configuration
|
|
139
|
-
|
|
140
138
|
d[HLid]["LGDN"] = []
|
|
141
139
|
for i in LGDN.find("DPM").find("CD").findall("d"):
|
|
142
140
|
d[HLid]["LGDN"].append(float(i.text))
|
|
@@ -290,7 +288,6 @@ class Parser(object):
|
|
|
290
288
|
"Ct": [Ct],
|
|
291
289
|
"CTdeslow": [CTdeslow],
|
|
292
290
|
"CTdeshigh": [CTdeshigh],
|
|
293
|
-
"CTdeshigh": [CTdeshigh],
|
|
294
291
|
"CTdesapp": [CTdesapp],
|
|
295
292
|
"CTdesld": [CTdesld],
|
|
296
293
|
"HpDes": [HpDes],
|
|
@@ -306,7 +303,6 @@ class Parser(object):
|
|
|
306
303
|
"Hmax": [Hmax],
|
|
307
304
|
"tempGrad": [tempGrad],
|
|
308
305
|
"massGrad": [massGrad],
|
|
309
|
-
"mass": [mass],
|
|
310
306
|
"MMO": [MMO],
|
|
311
307
|
"VMO": [VMO],
|
|
312
308
|
"MTOW": [MTOW],
|
|
@@ -316,14 +312,11 @@ class Parser(object):
|
|
|
316
312
|
"LDL": [LDL],
|
|
317
313
|
"span": [span],
|
|
318
314
|
"length": [length],
|
|
319
|
-
"span": [span],
|
|
320
|
-
"length": [length],
|
|
321
315
|
"aeroConfig": [aeroConfig],
|
|
322
316
|
"speedSchedule": [speedSchedule],
|
|
323
317
|
"V1": [V1],
|
|
324
318
|
"V2": [V2],
|
|
325
319
|
"M": [M],
|
|
326
|
-
"speedSchedule": [speedSchedule],
|
|
327
320
|
"xmlFiles": [xmlFiles],
|
|
328
321
|
}
|
|
329
322
|
df_single = pd.DataFrame(data)
|
|
@@ -332,17 +325,17 @@ class Parser(object):
|
|
|
332
325
|
|
|
333
326
|
@staticmethod
|
|
334
327
|
def findData(f):
|
|
335
|
-
"""
|
|
336
|
-
Searches for specific data lines in an open file stream.
|
|
328
|
+
"""Searches for specific data lines in an open file stream.
|
|
337
329
|
|
|
338
330
|
:param f: An open file object from which lines are read.
|
|
339
331
|
:type f: file object
|
|
340
|
-
:returns: A tuple containing the file object and a parsed line split
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
332
|
+
:returns: A tuple containing the file object and a parsed line split
|
|
333
|
+
into a list, or None if no relevant line is found.
|
|
334
|
+
:rtype: tuple(file object, list of str or None) This function reads
|
|
335
|
+
the file line by line until it finds a line that starts with "CD".
|
|
336
|
+
Once found, the line is stripped of extra spaces, split into a
|
|
337
|
+
list, and returned. If no such line is found, it returns None for
|
|
338
|
+
the line.
|
|
346
339
|
"""
|
|
347
340
|
|
|
348
341
|
line = f.readline()
|
|
@@ -358,15 +351,16 @@ class Parser(object):
|
|
|
358
351
|
|
|
359
352
|
@staticmethod
|
|
360
353
|
def parseOPF(filePath, acName):
|
|
361
|
-
"""
|
|
362
|
-
|
|
354
|
+
"""Parses a BADA3 OPF (Operational Performance File) ASCII formatted
|
|
355
|
+
file for aircraft performance data.
|
|
363
356
|
|
|
364
357
|
:param filePath: Path to the BADA3 OPF ASCII formatted file.
|
|
365
358
|
:param acName: ICAO aircraft designation (e.g., 'A320').
|
|
366
359
|
:type filePath: str
|
|
367
360
|
:type acName: str
|
|
368
361
|
:raises IOError: If the file cannot be opened or read.
|
|
369
|
-
:returns: A pandas DataFrame containing the parsed aircraft
|
|
362
|
+
:returns: A pandas DataFrame containing the parsed aircraft
|
|
363
|
+
performance data.
|
|
370
364
|
:rtype: pd.DataFrame
|
|
371
365
|
"""
|
|
372
366
|
|
|
@@ -542,7 +536,6 @@ class Parser(object):
|
|
|
542
536
|
"ICAO": [ICAO],
|
|
543
537
|
"WTC": [WTC],
|
|
544
538
|
"modificationDateOPF": [modificationDateOPF],
|
|
545
|
-
"modificationDateOPF": [modificationDateOPF],
|
|
546
539
|
"S": [S],
|
|
547
540
|
"MREF": [MREF],
|
|
548
541
|
"mass": [mass],
|
|
@@ -557,7 +550,6 @@ class Parser(object):
|
|
|
557
550
|
"Ct": [Ct],
|
|
558
551
|
"CTdeslow": [CTdeslow],
|
|
559
552
|
"CTdeshigh": [CTdeshigh],
|
|
560
|
-
"CTdeshigh": [CTdeshigh],
|
|
561
553
|
"CTdesapp": [CTdesapp],
|
|
562
554
|
"CTdesld": [CTdesld],
|
|
563
555
|
"HpDes": [HpDes],
|
|
@@ -567,7 +559,6 @@ class Parser(object):
|
|
|
567
559
|
"hmo": [hmo],
|
|
568
560
|
"Hmax": [Hmax],
|
|
569
561
|
"tempGrad": [tempGrad],
|
|
570
|
-
"mass": [mass],
|
|
571
562
|
"MMO": [MMO],
|
|
572
563
|
"VMO": [VMO],
|
|
573
564
|
"massGrad": [massGrad],
|
|
@@ -578,8 +569,6 @@ class Parser(object):
|
|
|
578
569
|
"LDL": [LDL],
|
|
579
570
|
"span": [span],
|
|
580
571
|
"length": [length],
|
|
581
|
-
"span": [span],
|
|
582
|
-
"length": [length],
|
|
583
572
|
}
|
|
584
573
|
df_single = pd.DataFrame(data)
|
|
585
574
|
|
|
@@ -587,15 +576,16 @@ class Parser(object):
|
|
|
587
576
|
|
|
588
577
|
@staticmethod
|
|
589
578
|
def parseAPF(filePath, acName):
|
|
590
|
-
"""
|
|
591
|
-
|
|
579
|
+
"""Parses a BADA3 APF ASCII formatted file for aircraft performance
|
|
580
|
+
data.
|
|
592
581
|
|
|
593
582
|
:param filePath: Path to the BADA3 APF ASCII formatted file.
|
|
594
583
|
:param acName: ICAO aircraft designation (e.g., 'A320').
|
|
595
584
|
:type filePath: str
|
|
596
585
|
:type acName: str
|
|
597
586
|
:raises IOError: If the file cannot be opened or read.
|
|
598
|
-
:returns: A pandas DataFrame containing the parsed aircraft
|
|
587
|
+
:returns: A pandas DataFrame containing the parsed aircraft
|
|
588
|
+
performance data.
|
|
599
589
|
:rtype: pd.DataFrame
|
|
600
590
|
"""
|
|
601
591
|
|
|
@@ -662,11 +652,12 @@ class Parser(object):
|
|
|
662
652
|
|
|
663
653
|
@staticmethod
|
|
664
654
|
def combineOPF_APF(OPFDataFrame, APFDataFrame):
|
|
665
|
-
"""
|
|
666
|
-
Combines data from OPF and APF DataFrames.
|
|
655
|
+
"""Combines data from OPF and APF DataFrames.
|
|
667
656
|
|
|
668
|
-
:param OPFDataFrame: DataFrame containing parsed data from the OPF
|
|
669
|
-
|
|
657
|
+
:param OPFDataFrame: DataFrame containing parsed data from the OPF
|
|
658
|
+
file.
|
|
659
|
+
:param APFDataFrame: DataFrame containing parsed data from the APF
|
|
660
|
+
file.
|
|
670
661
|
:type OPFDataFrame: pd.DataFrame
|
|
671
662
|
:type APFDataFrame: pd.DataFrame
|
|
672
663
|
:returns: A single DataFrame combining both OPF and APF data.
|
|
@@ -686,12 +677,13 @@ class Parser(object):
|
|
|
686
677
|
|
|
687
678
|
@staticmethod
|
|
688
679
|
def readSynonym(filePath):
|
|
689
|
-
"""
|
|
690
|
-
|
|
680
|
+
"""Reads a BADA3 SYNONYM.NEW ASCII file and returns a dictionary of
|
|
681
|
+
model-synonym pairs.
|
|
691
682
|
|
|
692
683
|
:param filePath: Path to the directory containing BADA3 files.
|
|
693
684
|
:type filePath: str
|
|
694
|
-
:returns: A dictionary where the keys are aircraft models and the
|
|
685
|
+
:returns: A dictionary where the keys are aircraft models and the
|
|
686
|
+
values are the corresponding file names.
|
|
695
687
|
:rtype: dict
|
|
696
688
|
"""
|
|
697
689
|
|
|
@@ -721,17 +713,18 @@ class Parser(object):
|
|
|
721
713
|
|
|
722
714
|
@staticmethod
|
|
723
715
|
def readSynonymXML(filePath):
|
|
724
|
-
"""
|
|
725
|
-
|
|
716
|
+
"""Reads a BADA3 SYNONYM.xml file and returns a dictionary of model-
|
|
717
|
+
synonym pairs.
|
|
726
718
|
|
|
727
719
|
:param filePath: Path to the directory containing BADA3 files.
|
|
728
720
|
:type filePath: str
|
|
729
|
-
:returns: A dictionary where the keys are aircraft models (codes) and
|
|
721
|
+
:returns: A dictionary where the keys are aircraft models (codes) and
|
|
722
|
+
the values are the corresponding file names.
|
|
730
723
|
:rtype: dict
|
|
731
|
-
:raises IOError: If the XML file is not found or cannot be read.
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
724
|
+
:raises IOError: If the XML file is not found or cannot be read. This
|
|
725
|
+
function parses the 'SYNONYM.xml' file to extract aircraft model
|
|
726
|
+
codes and their associated file names. If the XML file is not
|
|
727
|
+
found or is improperly formatted, an IOError is raised.
|
|
735
728
|
"""
|
|
736
729
|
|
|
737
730
|
filename = os.path.join(filePath, "SYNONYM.xml")
|
|
@@ -743,7 +736,7 @@ class Parser(object):
|
|
|
743
736
|
try:
|
|
744
737
|
tree = ET.parse(filename)
|
|
745
738
|
root = tree.getroot()
|
|
746
|
-
except:
|
|
739
|
+
except Exception:
|
|
747
740
|
raise IOError(filename + " not found or in correct format")
|
|
748
741
|
|
|
749
742
|
for child in root.iter("SYN"):
|
|
@@ -758,19 +751,21 @@ class Parser(object):
|
|
|
758
751
|
|
|
759
752
|
@staticmethod
|
|
760
753
|
def parseSynonym(filePath, acName):
|
|
761
|
-
"""
|
|
762
|
-
|
|
754
|
+
"""Parses either the ASCII or XML synonym file and returns the file
|
|
755
|
+
name corresponding to the aircraft.
|
|
763
756
|
|
|
764
757
|
:param filePath: Path to the directory containing BADA3 files.
|
|
765
|
-
:param acName: ICAO aircraft designation for which the file name is
|
|
758
|
+
:param acName: ICAO aircraft designation for which the file name is
|
|
759
|
+
needed.
|
|
766
760
|
:type filePath: str
|
|
767
761
|
:type acName: str
|
|
768
|
-
:returns: The file name corresponding to the aircraft, or None if not
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
762
|
+
:returns: The file name corresponding to the aircraft, or None if not
|
|
763
|
+
found.
|
|
764
|
+
:rtype: str or None This function first attempts to read the aircraft
|
|
765
|
+
synonym from the ASCII file ('SYNONYM.NEW'). If the synonym is not
|
|
766
|
+
found, it then tries to read the XML version ('SYNONYM.xml'). It
|
|
767
|
+
returns the associated file name or None if the aircraft synonym
|
|
768
|
+
is not found.
|
|
774
769
|
"""
|
|
775
770
|
|
|
776
771
|
synonym_fileName = Parser.readSynonym(filePath)
|
|
@@ -787,13 +782,13 @@ class Parser(object):
|
|
|
787
782
|
|
|
788
783
|
@staticmethod
|
|
789
784
|
def readGPF(filePath):
|
|
790
|
-
"""
|
|
791
|
-
Parses a BADA3 GPF ASCII formatted file.
|
|
785
|
+
"""Parses a BADA3 GPF ASCII formatted file.
|
|
792
786
|
|
|
793
787
|
:param filePath: Path to the directory containing BADA3 files.
|
|
794
788
|
:type filePath: str
|
|
795
789
|
:raises IOError: If the GPF file cannot be opened or read.
|
|
796
|
-
:returns: A list of dictionaries, each containing GPF parameters like
|
|
790
|
+
:returns: A list of dictionaries, each containing GPF parameters like
|
|
791
|
+
engine type, flight phase, and parameter values.
|
|
797
792
|
:rtype: list of dict
|
|
798
793
|
"""
|
|
799
794
|
|
|
@@ -825,18 +820,18 @@ class Parser(object):
|
|
|
825
820
|
|
|
826
821
|
@staticmethod
|
|
827
822
|
def readGPFXML(filePath):
|
|
828
|
-
"""
|
|
829
|
-
Parses a BADA3 GPF XML formatted file.
|
|
823
|
+
"""Parses a BADA3 GPF XML formatted file.
|
|
830
824
|
|
|
831
825
|
:param filePath: Path to the directory containing BADA3 files.
|
|
832
826
|
:type filePath: str
|
|
833
827
|
:raises IOError: If the XML file is not found or cannot be read.
|
|
834
|
-
:returns: A list of dictionaries, each containing GPF parameters such
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
828
|
+
:returns: A list of dictionaries, each containing GPF parameters such
|
|
829
|
+
as engine type, flight phase, and performance values.
|
|
830
|
+
:rtype: list of dict This function reads the 'GPF.xml' file and
|
|
831
|
+
extracts general performance parameters for the aircraft,
|
|
832
|
+
including maximum acceleration, bank angles, thrust coefficients,
|
|
833
|
+
speed limits, and more. It parses the XML structure and returns a
|
|
834
|
+
list of dictionaries representing these parameters.
|
|
840
835
|
"""
|
|
841
836
|
|
|
842
837
|
filename = os.path.join(filePath, "GPF.xml")
|
|
@@ -847,7 +842,7 @@ class Parser(object):
|
|
|
847
842
|
try:
|
|
848
843
|
tree = ET.parse(filename)
|
|
849
844
|
root = tree.getroot()
|
|
850
|
-
except:
|
|
845
|
+
except Exception:
|
|
851
846
|
raise IOError(filename + " not found or in correct format")
|
|
852
847
|
|
|
853
848
|
allEngines = ["JET", "TURBOPROP", "PISTON", "ELECTRIC"]
|
|
@@ -998,7 +993,6 @@ class Parser(object):
|
|
|
998
993
|
|
|
999
994
|
HmaxList = {}
|
|
1000
995
|
for phase in root.find("HmaxList").findall("HmaxPhase"):
|
|
1001
|
-
|
|
1002
996
|
HmaxList[phase.find("Phase").text] = float(
|
|
1003
997
|
phase.find("Hmax").text
|
|
1004
998
|
)
|
|
@@ -1049,7 +1043,6 @@ class Parser(object):
|
|
|
1049
1043
|
|
|
1050
1044
|
VdList = {}
|
|
1051
1045
|
for vdphase in root.find("VdList").findall("VdPhase"):
|
|
1052
|
-
|
|
1053
1046
|
Phase = vdphase.find("Phase")
|
|
1054
1047
|
name = Phase.find("name").text
|
|
1055
1048
|
index = int(Phase.find("index").text)
|
|
@@ -1231,7 +1224,6 @@ class Parser(object):
|
|
|
1231
1224
|
|
|
1232
1225
|
VList = {}
|
|
1233
1226
|
for vphase in root.find("VList").findall("VPhase"):
|
|
1234
|
-
|
|
1235
1227
|
Phase = vphase.find("Phase")
|
|
1236
1228
|
name = Phase.find("name").text
|
|
1237
1229
|
index = int(Phase.find("index").text)
|
|
@@ -1381,8 +1373,7 @@ class Parser(object):
|
|
|
1381
1373
|
|
|
1382
1374
|
@staticmethod
|
|
1383
1375
|
def parseGPF(filePath):
|
|
1384
|
-
"""
|
|
1385
|
-
Parses a BADA3 (GPF) from either ASCII or XML format.
|
|
1376
|
+
"""Parses a BADA3 (GPF) from either ASCII or XML format.
|
|
1386
1377
|
|
|
1387
1378
|
:param filePath: Path to the directory containing BADA3 files.
|
|
1388
1379
|
:type filePath: str
|
|
@@ -1404,20 +1395,24 @@ class Parser(object):
|
|
|
1404
1395
|
|
|
1405
1396
|
@staticmethod
|
|
1406
1397
|
def getGPFValue(GPFdata, name, engine="JET", phase="cr", flight="civ"):
|
|
1407
|
-
"""
|
|
1408
|
-
|
|
1398
|
+
"""Retrieves the value of a specified GPF parameter based on engine
|
|
1399
|
+
type, flight phase, and flight type.
|
|
1409
1400
|
|
|
1410
1401
|
:param GPFdata: List of dictionaries containing GPF parameters.
|
|
1411
1402
|
:param name: Name of the GPF parameter to retrieve.
|
|
1412
|
-
:param engine: Engine type to filter by (e.g., 'JET', 'TURBOPROP',
|
|
1413
|
-
|
|
1414
|
-
:param
|
|
1403
|
+
:param engine: Engine type to filter by (e.g., 'JET', 'TURBOPROP',
|
|
1404
|
+
'PISTON', 'ELECTRIC'). Default is 'JET'.
|
|
1405
|
+
:param phase: Flight phase to filter by (e.g., 'cr', 'cl', 'des').
|
|
1406
|
+
Default is 'cr'.
|
|
1407
|
+
:param flight: Flight type to filter by ('civ' or 'mil'). Default is
|
|
1408
|
+
'civ'.
|
|
1415
1409
|
:type GPFdata: list
|
|
1416
1410
|
:type name: str
|
|
1417
1411
|
:type engine: str
|
|
1418
1412
|
:type phase: str
|
|
1419
1413
|
:type flight: str
|
|
1420
|
-
:returns: The value of the specified GPF parameter or None if not
|
|
1414
|
+
:returns: The value of the specified GPF parameter or None if not
|
|
1415
|
+
found.
|
|
1421
1416
|
:rtype: float or None
|
|
1422
1417
|
"""
|
|
1423
1418
|
|
|
@@ -1467,19 +1462,21 @@ class Parser(object):
|
|
|
1467
1462
|
|
|
1468
1463
|
@staticmethod
|
|
1469
1464
|
def parseAll(badaVersion, filePath=None):
|
|
1470
|
-
"""
|
|
1471
|
-
|
|
1465
|
+
"""Parses all BADA3 formatted files and combines them into a final
|
|
1466
|
+
DataFrame.
|
|
1472
1467
|
|
|
1473
1468
|
:param badaVersion: BADA version being used.
|
|
1474
|
-
:param filePath: Path to the BADA3 formatted files. If not provided,
|
|
1469
|
+
:param filePath: Path to the BADA3 formatted files. If not provided,
|
|
1470
|
+
the default path is used.
|
|
1475
1471
|
:type badaVersion: str
|
|
1476
1472
|
:type filePath: str, optional
|
|
1477
1473
|
:returns: A pandas DataFrame containing all parsed BADA3 data.
|
|
1478
1474
|
:rtype: pd.DataFrame
|
|
1479
|
-
:raises IOError: If any of the required files cannot be opened or
|
|
1475
|
+
:raises IOError: If any of the required files cannot be opened or
|
|
1476
|
+
read.
|
|
1480
1477
|
"""
|
|
1481
1478
|
|
|
1482
|
-
if filePath
|
|
1479
|
+
if filePath is None:
|
|
1483
1480
|
filePath = configuration.getBadaVersionPath(
|
|
1484
1481
|
badaFamily="BADA3", badaVersion=badaVersion
|
|
1485
1482
|
)
|
|
@@ -1553,7 +1550,8 @@ class Parser(object):
|
|
|
1553
1550
|
|
|
1554
1551
|
|
|
1555
1552
|
class BADA3(Airplane, Bada):
|
|
1556
|
-
"""This class implements the part of BADA3 performance model that will be
|
|
1553
|
+
"""This class implements the part of BADA3 performance model that will be
|
|
1554
|
+
used in other classes following the BADA3 manual.
|
|
1557
1555
|
|
|
1558
1556
|
:param AC: Aircraft object {BADA3}.
|
|
1559
1557
|
:type AC: bada3Aircraft.
|
|
@@ -1564,13 +1562,13 @@ class BADA3(Airplane, Bada):
|
|
|
1564
1562
|
self.AC = AC
|
|
1565
1563
|
|
|
1566
1564
|
def CL(self, sigma, mass, tas, nz=1.0):
|
|
1567
|
-
"""
|
|
1568
|
-
Computes the lift coefficient for the aircraft.
|
|
1565
|
+
"""Computes the lift coefficient for the aircraft.
|
|
1569
1566
|
|
|
1570
1567
|
:param sigma: Normalized air density [-].
|
|
1571
1568
|
:param mass: Aircraft mass in kilograms [kg].
|
|
1572
1569
|
:param tas: True airspeed in meters per second [m/s].
|
|
1573
|
-
:param nz: Load factor [-], default is 1.0 (straight and level
|
|
1570
|
+
:param nz: Load factor [-], default is 1.0 (straight and level
|
|
1571
|
+
flight).
|
|
1574
1572
|
:type sigma: float
|
|
1575
1573
|
:type mass: float
|
|
1576
1574
|
:type tas: float
|
|
@@ -1594,13 +1592,16 @@ class BADA3(Airplane, Bada):
|
|
|
1594
1592
|
expedite=False,
|
|
1595
1593
|
speedBrakes={"deployed": False, "value": 0.03},
|
|
1596
1594
|
):
|
|
1597
|
-
"""
|
|
1598
|
-
|
|
1595
|
+
"""Computes the drag coefficient based on the lift coefficient and
|
|
1596
|
+
aircraft configuration.
|
|
1599
1597
|
|
|
1600
1598
|
:param CL: Lift coefficient [-].
|
|
1601
|
-
:param config: Aircraft aerodynamic configuration (e.g., 'CR', 'IC',
|
|
1602
|
-
|
|
1603
|
-
:param
|
|
1599
|
+
:param config: Aircraft aerodynamic configuration (e.g., 'CR', 'IC',
|
|
1600
|
+
'TO', 'AP', 'LD').
|
|
1601
|
+
:param expedite: Flag indicating if expedite descent is used (default
|
|
1602
|
+
is False).
|
|
1603
|
+
:param speedBrakes: Dictionary indicating if speed brakes are deployed
|
|
1604
|
+
and their effect.
|
|
1604
1605
|
:type CL: float
|
|
1605
1606
|
:type config: str
|
|
1606
1607
|
:type expedite: bool
|
|
@@ -1625,7 +1626,6 @@ class BADA3(Airplane, Bada):
|
|
|
1625
1626
|
and self.AC.CD2[HLid_LD][LG_LD] == 0.0
|
|
1626
1627
|
and self.AC.DeltaCD == 0.0
|
|
1627
1628
|
):
|
|
1628
|
-
|
|
1629
1629
|
CD = self.AC.CD0[HLid_CR][LG_CR] + self.AC.CD2[HLid_CR][
|
|
1630
1630
|
LG_CR
|
|
1631
1631
|
] * (CL * CL)
|
|
@@ -1691,8 +1691,7 @@ class BADA3(Airplane, Bada):
|
|
|
1691
1691
|
return CD
|
|
1692
1692
|
|
|
1693
1693
|
def D(self, sigma, tas, CD):
|
|
1694
|
-
"""
|
|
1695
|
-
Computes the aerodynamic drag force.
|
|
1694
|
+
"""Computes the aerodynamic drag force.
|
|
1696
1695
|
|
|
1697
1696
|
:param sigma: Normalized air density [-].
|
|
1698
1697
|
:param tas: True airspeed in meters per second [m/s].
|
|
@@ -1707,8 +1706,7 @@ class BADA3(Airplane, Bada):
|
|
|
1707
1706
|
return 0.5 * sigma * const.rho_0 * tas * tas * self.AC.S * CD
|
|
1708
1707
|
|
|
1709
1708
|
def L(self, sigma, tas, CL):
|
|
1710
|
-
"""
|
|
1711
|
-
Computes the aerodynamic lift force.
|
|
1709
|
+
"""Computes the aerodynamic lift force.
|
|
1712
1710
|
|
|
1713
1711
|
:param sigma: Normalized air density [-].
|
|
1714
1712
|
:param tas: True airspeed in meters per second [m/s].
|
|
@@ -1723,14 +1721,16 @@ class BADA3(Airplane, Bada):
|
|
|
1723
1721
|
return 0.5 * sigma * const.rho_0 * tas * tas * self.AC.S * CL
|
|
1724
1722
|
|
|
1725
1723
|
def Thrust(self, h, DeltaTemp, rating, v, config, **kwargs):
|
|
1726
|
-
"""
|
|
1727
|
-
|
|
1724
|
+
"""Computes the aircraft thrust based on engine rating and flight
|
|
1725
|
+
conditions.
|
|
1728
1726
|
|
|
1729
|
-
:param rating: Engine rating ('MCMB', 'MCRZ', 'MTKF', 'LIDL',
|
|
1727
|
+
:param rating: Engine rating ('MCMB', 'MCRZ', 'MTKF', 'LIDL',
|
|
1728
|
+
'ADAPTED').
|
|
1730
1729
|
:param h: Altitude in meters [m].
|
|
1731
1730
|
:param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
|
|
1732
1731
|
:param v: True airspeed (TAS) in meters per second [m/s].
|
|
1733
|
-
:param config: Aircraft aerodynamic configuration (e.g., 'CR', 'IC',
|
|
1732
|
+
:param config: Aircraft aerodynamic configuration (e.g., 'CR', 'IC',
|
|
1733
|
+
'TO', 'AP', 'LD').
|
|
1734
1734
|
:type rating: str
|
|
1735
1735
|
:type h: float
|
|
1736
1736
|
:type DeltaTemp: float
|
|
@@ -1779,8 +1779,8 @@ class BADA3(Airplane, Bada):
|
|
|
1779
1779
|
return T
|
|
1780
1780
|
|
|
1781
1781
|
def TAdapted(self, h, DeltaTemp, ROCD, mass, v, acc, Drag):
|
|
1782
|
-
"""
|
|
1783
|
-
|
|
1782
|
+
"""Computes adapted thrust for non-standard flight conditions (e.g.,
|
|
1783
|
+
climb, acceleration).
|
|
1784
1784
|
|
|
1785
1785
|
:param h: Altitude in meters [m].
|
|
1786
1786
|
:param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
|
|
@@ -1807,8 +1807,8 @@ class BADA3(Airplane, Bada):
|
|
|
1807
1807
|
return Tadapted
|
|
1808
1808
|
|
|
1809
1809
|
def TMax(self, h, DeltaTemp, rating, v):
|
|
1810
|
-
"""
|
|
1811
|
-
|
|
1810
|
+
"""Computes the maximum thrust based on engine type, altitude, and
|
|
1811
|
+
temperature deviation.
|
|
1812
1812
|
|
|
1813
1813
|
:param h: Altitude in meters [m].
|
|
1814
1814
|
:param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
|
|
@@ -1869,13 +1869,14 @@ class BADA3(Airplane, Bada):
|
|
|
1869
1869
|
)
|
|
1870
1870
|
|
|
1871
1871
|
def TDes(self, h, DeltaTemp, v, config):
|
|
1872
|
-
"""
|
|
1873
|
-
|
|
1872
|
+
"""Computes descent thrust based on altitude, temperature deviation,
|
|
1873
|
+
and configuration.
|
|
1874
1874
|
|
|
1875
1875
|
:param h: Altitude in meters [m].
|
|
1876
1876
|
:param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
|
|
1877
1877
|
:param v: True airspeed (TAS) in meters per second [m/s].
|
|
1878
|
-
:param config: Aircraft aerodynamic configuration (e.g., 'CR', 'IC',
|
|
1878
|
+
:param config: Aircraft aerodynamic configuration (e.g., 'CR', 'IC',
|
|
1879
|
+
'TO', 'AP', 'LD').
|
|
1879
1880
|
:type h: float
|
|
1880
1881
|
:type DeltaTemp: float
|
|
1881
1882
|
:type v: float
|
|
@@ -1912,7 +1913,6 @@ class BADA3(Airplane, Bada):
|
|
|
1912
1913
|
and self.AC.CD2[HLid_LD][LG_LD] != 0.0
|
|
1913
1914
|
and self.AC.DeltaCD != 0.0
|
|
1914
1915
|
):
|
|
1915
|
-
|
|
1916
1916
|
if HpDes_ < H_max_app:
|
|
1917
1917
|
HpDes_ = H_max_app
|
|
1918
1918
|
|
|
@@ -1942,8 +1942,7 @@ class BADA3(Airplane, Bada):
|
|
|
1942
1942
|
return Tdes
|
|
1943
1943
|
|
|
1944
1944
|
def ffnom(self, v, T):
|
|
1945
|
-
"""
|
|
1946
|
-
Computes the nominal fuel flow based on airspeed and thrust.
|
|
1945
|
+
"""Computes the nominal fuel flow based on airspeed and thrust.
|
|
1947
1946
|
|
|
1948
1947
|
:param v: True airspeed (TAS) in meters per second [m/s].
|
|
1949
1948
|
:param T: Thrust in Newtons [N].
|
|
@@ -1978,8 +1977,7 @@ class BADA3(Airplane, Bada):
|
|
|
1978
1977
|
return ffnom
|
|
1979
1978
|
|
|
1980
1979
|
def ffMin(self, h):
|
|
1981
|
-
"""
|
|
1982
|
-
Computes the minimum fuel flow based on altitude.
|
|
1980
|
+
"""Computes the minimum fuel flow based on altitude.
|
|
1983
1981
|
|
|
1984
1982
|
:param h: Altitude in meters [m].
|
|
1985
1983
|
:type h: float
|
|
@@ -1999,15 +1997,18 @@ class BADA3(Airplane, Bada):
|
|
|
1999
1997
|
return ffmin
|
|
2000
1998
|
|
|
2001
1999
|
def ff(self, h, v, T, config=None, flightPhase=None, adapted=False):
|
|
2002
|
-
"""
|
|
2003
|
-
|
|
2000
|
+
"""Computes the fuel flow based on flight phase and current flight
|
|
2001
|
+
conditions.
|
|
2004
2002
|
|
|
2005
2003
|
:param h: Altitude in meters [m].
|
|
2006
2004
|
:param v: True airspeed (TAS) in meters per second [m/s].
|
|
2007
2005
|
:param T: Thrust in Newtons [N].
|
|
2008
|
-
:param config: Aircraft aerodynamic configuration (e.g., 'CR', 'AP',
|
|
2009
|
-
|
|
2010
|
-
:param
|
|
2006
|
+
:param config: Aircraft aerodynamic configuration (e.g., 'CR', 'AP',
|
|
2007
|
+
'LD'). Optional.
|
|
2008
|
+
:param flightPhase: Flight phase (e.g., 'Climb', 'Cruise', 'Descent').
|
|
2009
|
+
Optional.
|
|
2010
|
+
:param adapted: If True, computes fuel flow for adapted thrust.
|
|
2011
|
+
Default is False.
|
|
2011
2012
|
:type h: float
|
|
2012
2013
|
:type v: float
|
|
2013
2014
|
:type T: float
|
|
@@ -2046,8 +2047,8 @@ class BADA3(Airplane, Bada):
|
|
|
2046
2047
|
return ff
|
|
2047
2048
|
|
|
2048
2049
|
def reducedPower(self, h, mass, DeltaTemp):
|
|
2049
|
-
"""
|
|
2050
|
-
|
|
2050
|
+
"""Computes the reduced climb power coefficient based on altitude,
|
|
2051
|
+
mass, and temperature deviation.
|
|
2051
2052
|
|
|
2052
2053
|
:param h: Altitude in meters [m].
|
|
2053
2054
|
:param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
|
|
@@ -2100,8 +2101,8 @@ class BADA3(Airplane, Bada):
|
|
|
2100
2101
|
return CPowRed
|
|
2101
2102
|
|
|
2102
2103
|
def ROCD(self, T, D, v, mass, ESF, h, DeltaTemp, reducedPower=False):
|
|
2103
|
-
"""
|
|
2104
|
-
|
|
2104
|
+
"""Computes the rate of climb or descent (ROCD) based on thrust, drag,
|
|
2105
|
+
airspeed, and other flight parameters.
|
|
2105
2106
|
|
|
2106
2107
|
:param T: Aircraft thrust in Newtons [N].
|
|
2107
2108
|
:param D: Aircraft drag in Newtons [N].
|
|
@@ -2110,7 +2111,8 @@ class BADA3(Airplane, Bada):
|
|
|
2110
2111
|
:param ESF: Energy share factor [-].
|
|
2111
2112
|
:param h: Altitude in meters [m].
|
|
2112
2113
|
:param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
|
|
2113
|
-
:param reducedPower: Whether to account for reduced power in the
|
|
2114
|
+
:param reducedPower: Whether to account for reduced power in the
|
|
2115
|
+
calculation. Default is False.
|
|
2114
2116
|
:type T: float
|
|
2115
2117
|
:type D: float
|
|
2116
2118
|
:type v: float
|
|
@@ -2143,8 +2145,8 @@ class BADA3(Airplane, Bada):
|
|
|
2143
2145
|
|
|
2144
2146
|
|
|
2145
2147
|
class FlightEnvelope(BADA3):
|
|
2146
|
-
"""This class is a BADA3 aircraft subclass and implements the flight
|
|
2147
|
-
following the BADA3 manual.
|
|
2148
|
+
"""This class is a BADA3 aircraft subclass and implements the flight
|
|
2149
|
+
envelope caclulations following the BADA3 manual.
|
|
2148
2150
|
|
|
2149
2151
|
:param AC: Aircraft object {BADA3}.
|
|
2150
2152
|
:type AC: bada3Aircraft.
|
|
@@ -2154,19 +2156,20 @@ class FlightEnvelope(BADA3):
|
|
|
2154
2156
|
super().__init__(AC)
|
|
2155
2157
|
|
|
2156
2158
|
def maxAltitude(self, mass, DeltaTemp):
|
|
2157
|
-
"""
|
|
2158
|
-
|
|
2159
|
+
"""Computes the maximum altitude for a given aircraft mass and
|
|
2160
|
+
deviation from ISA.
|
|
2159
2161
|
|
|
2160
2162
|
:param mass: Actual aircraft mass in kilograms [kg].
|
|
2161
|
-
:param DeltaTemp: Deviation from International Standard Atmosphere
|
|
2163
|
+
:param DeltaTemp: Deviation from International Standard Atmosphere
|
|
2164
|
+
(ISA) temperature in Kelvin [K].
|
|
2162
2165
|
:type mass: float
|
|
2163
2166
|
:type DeltaTemp: float
|
|
2164
2167
|
:returns: Maximum altitude in meters [m].
|
|
2165
|
-
:rtype: float
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2168
|
+
:rtype: float This function calculates the maximum possible altitude
|
|
2169
|
+
based on the aircraft's mass, ISA temperature deviation, and
|
|
2170
|
+
engine-specific parameters such as temperature and mass gradients.
|
|
2171
|
+
It considers the maximum operational altitude and adjusts for the
|
|
2172
|
+
given conditions.
|
|
2170
2173
|
"""
|
|
2171
2174
|
|
|
2172
2175
|
Gt = self.AC.tempGrad
|
|
@@ -2193,8 +2196,8 @@ class FlightEnvelope(BADA3):
|
|
|
2193
2196
|
return conv.ft2m(hMax)
|
|
2194
2197
|
|
|
2195
2198
|
def VStall(self, mass, config):
|
|
2196
|
-
"""
|
|
2197
|
-
|
|
2199
|
+
"""Computes the stall speed based on the aircraft configuration and
|
|
2200
|
+
mass.
|
|
2198
2201
|
|
|
2199
2202
|
:param config: Aircraft configuration (e.g., 'CR', 'TO', 'AP', 'LD').
|
|
2200
2203
|
:param mass: Aircraft mass in kilograms [kg].
|
|
@@ -2219,15 +2222,16 @@ class FlightEnvelope(BADA3):
|
|
|
2219
2222
|
def VMin(
|
|
2220
2223
|
self, h, mass, config, DeltaTemp, nz=1.2, envelopeType="OPERATIONAL"
|
|
2221
2224
|
):
|
|
2222
|
-
"""
|
|
2223
|
-
|
|
2225
|
+
"""Computes the minimum speed for a given configuration and
|
|
2226
|
+
conditions.
|
|
2224
2227
|
|
|
2225
2228
|
:param h: Altitude in meters [m].
|
|
2226
2229
|
:param mass: Aircraft mass in kilograms [kg].
|
|
2227
2230
|
:param config: Aircraft configuration (e.g., 'CR', 'TO', 'LD').
|
|
2228
2231
|
:param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
|
|
2229
2232
|
:param nz: Load factor, default is 1.2.
|
|
2230
|
-
:param envelopeType: Type of flight envelope ('OPERATIONAL' or
|
|
2233
|
+
:param envelopeType: Type of flight envelope ('OPERATIONAL' or
|
|
2234
|
+
'CERTIFIED').
|
|
2231
2235
|
:type h: float
|
|
2232
2236
|
:type mass: float
|
|
2233
2237
|
:type config: str
|
|
@@ -2249,6 +2253,7 @@ class FlightEnvelope(BADA3):
|
|
|
2249
2253
|
) * self.VStall(mass=mass, config=config)
|
|
2250
2254
|
elif envelopeType == "CERTIFIED":
|
|
2251
2255
|
VminStall = self.VStall(mass=mass, config=config)
|
|
2256
|
+
return VminStall
|
|
2252
2257
|
|
|
2253
2258
|
if self.AC.Clbo == 0.0 and self.AC.k == 0.0:
|
|
2254
2259
|
Vmin = VminStall
|
|
@@ -2288,8 +2293,8 @@ class FlightEnvelope(BADA3):
|
|
|
2288
2293
|
return Vmin
|
|
2289
2294
|
|
|
2290
2295
|
def Vmax_thrustLimited(self, h, mass, DeltaTemp, rating, config):
|
|
2291
|
-
"""
|
|
2292
|
-
|
|
2296
|
+
"""Computes the maximum CAS speed considering thrust limitations
|
|
2297
|
+
within the certified flight envelope.
|
|
2293
2298
|
|
|
2294
2299
|
:param h: Altitude in meters [m].
|
|
2295
2300
|
:param mass: Aircraft mass in kilograms [kg].
|
|
@@ -2351,8 +2356,7 @@ class FlightEnvelope(BADA3):
|
|
|
2351
2356
|
return max(maxCASList)
|
|
2352
2357
|
|
|
2353
2358
|
def Vx(self, h, mass, DeltaTemp, rating, config):
|
|
2354
|
-
"""
|
|
2355
|
-
Computes the best angle of climb (Vx) speed.
|
|
2359
|
+
"""Computes the best angle of climb (Vx) speed.
|
|
2356
2360
|
|
|
2357
2361
|
:param h: Altitude in meters [m].
|
|
2358
2362
|
:param mass: Aircraft mass in kilograms [kg].
|
|
@@ -2404,8 +2408,8 @@ class FlightEnvelope(BADA3):
|
|
|
2404
2408
|
return VxList[idx]
|
|
2405
2409
|
|
|
2406
2410
|
def VMax(self, h, DeltaTemp):
|
|
2407
|
-
"""
|
|
2408
|
-
|
|
2411
|
+
"""Computes the maximum speed based on altitude and temperature
|
|
2412
|
+
deviation.
|
|
2409
2413
|
|
|
2410
2414
|
:param h: Altitude in meters [m].
|
|
2411
2415
|
:param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
|
|
@@ -2432,8 +2436,7 @@ class FlightEnvelope(BADA3):
|
|
|
2432
2436
|
return VMax
|
|
2433
2437
|
|
|
2434
2438
|
def lowSpeedBuffetLimit(self, h, mass, DeltaTemp, nz=1.2):
|
|
2435
|
-
"""
|
|
2436
|
-
Computes the low-speed buffet limit using numerical methods.
|
|
2439
|
+
"""Computes the low-speed buffet limit using numerical methods.
|
|
2437
2440
|
|
|
2438
2441
|
:param h: Altitude in meters [m].
|
|
2439
2442
|
:param mass: Aircraft mass in kilograms [kg].
|
|
@@ -2466,15 +2469,16 @@ class FlightEnvelope(BADA3):
|
|
|
2466
2469
|
return min(Mb)
|
|
2467
2470
|
|
|
2468
2471
|
def getConfig(self, phase, h, mass, v, DeltaTemp, hRWY=0.0, nz=1.2):
|
|
2469
|
-
"""
|
|
2470
|
-
|
|
2472
|
+
"""Returns the aerodynamic configuration based on altitude, speed, and
|
|
2473
|
+
phase of flight.
|
|
2471
2474
|
|
|
2472
2475
|
:param phase: Phase of flight (e.g., 'Climb', 'Cruise', 'Descent').
|
|
2473
2476
|
:param h: Altitude in meters [m].
|
|
2474
2477
|
:param v: Calibrated airspeed in meters per second [m/s].
|
|
2475
2478
|
:param mass: Aircraft mass in kilograms [kg].
|
|
2476
2479
|
:param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
|
|
2477
|
-
:param hRWY: Runway elevation above mean sea level in meters [m],
|
|
2480
|
+
:param hRWY: Runway elevation above mean sea level in meters [m],
|
|
2481
|
+
default is 0.
|
|
2478
2482
|
:param nz: Load factor, default is 1.2.
|
|
2479
2483
|
:type phase: str
|
|
2480
2484
|
:type h: float
|
|
@@ -2483,7 +2487,8 @@ class FlightEnvelope(BADA3):
|
|
|
2483
2487
|
:type DeltaTemp: float
|
|
2484
2488
|
:type hRWY: float, optional
|
|
2485
2489
|
:type nz: float, optional
|
|
2486
|
-
:returns: Aerodynamic configuration (e.g., 'TO', 'IC', 'CR', 'AP',
|
|
2490
|
+
:returns: Aerodynamic configuration (e.g., 'TO', 'IC', 'CR', 'AP',
|
|
2491
|
+
'LD').
|
|
2487
2492
|
:rtype: str
|
|
2488
2493
|
"""
|
|
2489
2494
|
|
|
@@ -2567,12 +2572,13 @@ class FlightEnvelope(BADA3):
|
|
|
2567
2572
|
return config
|
|
2568
2573
|
|
|
2569
2574
|
def getAeroConfig(self, config):
|
|
2570
|
-
"""
|
|
2571
|
-
Returns the aerodynamic configuration ID for a given configuration.
|
|
2575
|
+
"""Returns the aerodynamic configuration ID for a given configuration.
|
|
2572
2576
|
|
|
2573
|
-
:param config: Aircraft configuration (e.g., 'CR', 'IC', 'TO', 'AP',
|
|
2577
|
+
:param config: Aircraft configuration (e.g., 'CR', 'IC', 'TO', 'AP',
|
|
2578
|
+
'LD').
|
|
2574
2579
|
:type config: str
|
|
2575
|
-
:returns: A list containing the HLid and LG for the given
|
|
2580
|
+
:returns: A list containing the HLid and LG for the given
|
|
2581
|
+
configuration.
|
|
2576
2582
|
:rtype: [int, str]
|
|
2577
2583
|
"""
|
|
2578
2584
|
|
|
@@ -2582,8 +2588,8 @@ class FlightEnvelope(BADA3):
|
|
|
2582
2588
|
return [HLid, LG]
|
|
2583
2589
|
|
|
2584
2590
|
def getHoldSpeed(self, h, theta, delta, sigma, DeltaTemp):
|
|
2585
|
-
"""
|
|
2586
|
-
|
|
2591
|
+
"""Computes the aircraft's holding speed (CAS) based on the current
|
|
2592
|
+
altitude.
|
|
2587
2593
|
|
|
2588
2594
|
:param h: Altitude in meters [m].
|
|
2589
2595
|
:param theta: Normalized temperature [-].
|
|
@@ -2595,7 +2601,8 @@ class FlightEnvelope(BADA3):
|
|
|
2595
2601
|
:type delta: float
|
|
2596
2602
|
:type sigma: float
|
|
2597
2603
|
:type DeltaTemp: float
|
|
2598
|
-
:returns: Holding calibrated airspeed (CAS) in meters per second
|
|
2604
|
+
:returns: Holding calibrated airspeed (CAS) in meters per second
|
|
2605
|
+
[m/s].
|
|
2599
2606
|
:rtype: float
|
|
2600
2607
|
"""
|
|
2601
2608
|
|
|
@@ -2620,14 +2627,14 @@ class FlightEnvelope(BADA3):
|
|
|
2620
2627
|
return conv.kt2ms(vHold)
|
|
2621
2628
|
|
|
2622
2629
|
def getGroundMovementSpeed(self, pos):
|
|
2623
|
-
"""
|
|
2624
|
-
|
|
2630
|
+
"""Returns the ground movement speed based on the aircraft's position
|
|
2631
|
+
on the ground.
|
|
2625
2632
|
|
|
2626
|
-
:param pos: Aircraft position on the airport ground (e.g.,
|
|
2633
|
+
:param pos: Aircraft position on the airport ground (e.g.,
|
|
2634
|
+
'backtrack', 'taxi', 'apron', 'gate').
|
|
2627
2635
|
:type pos: str
|
|
2628
2636
|
:returns: Ground movement speed in meters per second [m/s].
|
|
2629
2637
|
:rtype: float
|
|
2630
|
-
|
|
2631
2638
|
"""
|
|
2632
2639
|
|
|
2633
2640
|
if pos == "backtrack":
|
|
@@ -2650,12 +2657,14 @@ class FlightEnvelope(BADA3):
|
|
|
2650
2657
|
return conv.kt2ms(vGround)
|
|
2651
2658
|
|
|
2652
2659
|
def getBankAngle(self, phase, flightUnit, value):
|
|
2653
|
-
"""
|
|
2654
|
-
|
|
2660
|
+
"""Returns the nominal or maximum bank angle for the given flight
|
|
2661
|
+
phase and unit type.
|
|
2655
2662
|
|
|
2656
2663
|
:param phase: Phase of flight (e.g., 'to', 'ic', 'cl', 'cr', etc.).
|
|
2657
|
-
:param flightUnit: Flight unit (e.g., 'civ' for civilian, 'mil' for
|
|
2658
|
-
|
|
2664
|
+
:param flightUnit: Flight unit (e.g., 'civ' for civilian, 'mil' for
|
|
2665
|
+
military).
|
|
2666
|
+
:param value: Desired value, either 'nom' for nominal or 'max' for
|
|
2667
|
+
maximum bank angle.
|
|
2659
2668
|
:type phase: str
|
|
2660
2669
|
:type flightUnit: str
|
|
2661
2670
|
:type value: str
|
|
@@ -2676,14 +2685,19 @@ class FlightEnvelope(BADA3):
|
|
|
2676
2685
|
return maxBankAngle
|
|
2677
2686
|
|
|
2678
2687
|
def isAccOK(self, v1, v2, type="long", flightUnit="civ", deltaTime=1.0):
|
|
2679
|
-
"""
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
:param v1: Airspeed (or vertical speed for 'norm') at the previous
|
|
2683
|
-
|
|
2684
|
-
:param
|
|
2685
|
-
|
|
2686
|
-
:param
|
|
2688
|
+
"""Checks whether the acceleration between two time steps is within
|
|
2689
|
+
allowable limits.
|
|
2690
|
+
|
|
2691
|
+
:param v1: Airspeed (or vertical speed for 'norm') at the previous
|
|
2692
|
+
time step [m/s].
|
|
2693
|
+
:param v2: Airspeed (or vertical speed for 'norm') at the current time
|
|
2694
|
+
step [m/s].
|
|
2695
|
+
:param type: Type of acceleration to check ('long' for longitudinal,
|
|
2696
|
+
'norm' for normal).
|
|
2697
|
+
:param flightUnit: Flight unit type ('civ' for civilian, 'mil' for
|
|
2698
|
+
military).
|
|
2699
|
+
:param deltaTime: Time difference between the two time steps in
|
|
2700
|
+
seconds [s].
|
|
2687
2701
|
:type v1: float
|
|
2688
2702
|
:type v2: float
|
|
2689
2703
|
:type type: str
|
|
@@ -2723,12 +2737,12 @@ class FlightEnvelope(BADA3):
|
|
|
2723
2737
|
return OK
|
|
2724
2738
|
|
|
2725
2739
|
def getSpeedSchedule(self, phase):
|
|
2726
|
-
"""
|
|
2727
|
-
Returns the speed schedule for a given phase of flight.
|
|
2740
|
+
"""Returns the speed schedule for a given phase of flight.
|
|
2728
2741
|
|
|
2729
2742
|
:param phase: Flight phase ('Climb', 'Cruise', 'Descent').
|
|
2730
2743
|
:type phase: str
|
|
2731
|
-
:returns: A list containing CAS1, CAS2, and Mach number for the
|
|
2744
|
+
:returns: A list containing CAS1, CAS2, and Mach number for the
|
|
2745
|
+
specified phase [m/s, m/s, -].
|
|
2732
2746
|
:rtype: list[float, float, float]
|
|
2733
2747
|
"""
|
|
2734
2748
|
|
|
@@ -2748,8 +2762,8 @@ class FlightEnvelope(BADA3):
|
|
|
2748
2762
|
def checkConfigurationContinuity(
|
|
2749
2763
|
self, phase, previousConfig, currentConfig
|
|
2750
2764
|
):
|
|
2751
|
-
"""
|
|
2752
|
-
|
|
2765
|
+
"""Ensures the continuity of aerodynamic configuration changes based
|
|
2766
|
+
on the phase of flight.
|
|
2753
2767
|
|
|
2754
2768
|
:param phase: Current flight phase ('Climb', 'Cruise', 'Descent').
|
|
2755
2769
|
:param previousConfig: The previous aerodynamic configuration.
|
|
@@ -2758,11 +2772,10 @@ class FlightEnvelope(BADA3):
|
|
|
2758
2772
|
:type previousConfig: str
|
|
2759
2773
|
:type currentConfig: str
|
|
2760
2774
|
:returns: Updated aerodynamic configuration.
|
|
2761
|
-
:rtype: str
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
should not revert to a clean configuration after deploying flaps for approach or landing.
|
|
2775
|
+
:rtype: str This function ensures that the aerodynamic configuration
|
|
2776
|
+
transitions logically based on the phase of flight. For example,
|
|
2777
|
+
during descent, the configuration should not revert to a clean
|
|
2778
|
+
configuration after deploying flaps for approach or landing.
|
|
2766
2779
|
"""
|
|
2767
2780
|
|
|
2768
2781
|
newConfig = ""
|
|
@@ -2800,8 +2813,8 @@ class FlightEnvelope(BADA3):
|
|
|
2800
2813
|
|
|
2801
2814
|
|
|
2802
2815
|
class ARPM:
|
|
2803
|
-
"""This class is a BADA3 aircraft subclass and implements the Airline
|
|
2804
|
-
following the BADA3 user manual.
|
|
2816
|
+
"""This class is a BADA3 aircraft subclass and implements the Airline
|
|
2817
|
+
Procedure Model (ARPM) following the BADA3 user manual.
|
|
2805
2818
|
|
|
2806
2819
|
:param AC: Aircraft object {BADA3}.
|
|
2807
2820
|
:type AC: bada3Aircraft.
|
|
@@ -2826,8 +2839,8 @@ class ARPM:
|
|
|
2826
2839
|
NADP1_ALT=3000,
|
|
2827
2840
|
NADP2_ALT=[1000, 3000],
|
|
2828
2841
|
):
|
|
2829
|
-
"""
|
|
2830
|
-
|
|
2842
|
+
"""Computes the climb speed schedule (CAS) for the given altitude
|
|
2843
|
+
based on various procedures and aircraft parameters.
|
|
2831
2844
|
|
|
2832
2845
|
:param theta: Normalized air temperature [-].
|
|
2833
2846
|
:param delta: Normalized air pressure [-].
|
|
@@ -3205,8 +3218,8 @@ class ARPM:
|
|
|
3205
3218
|
applyLimits=True,
|
|
3206
3219
|
config=None,
|
|
3207
3220
|
):
|
|
3208
|
-
"""
|
|
3209
|
-
|
|
3221
|
+
"""Computes the cruise speed schedule (CAS) for a given altitude based
|
|
3222
|
+
on aircraft parameters and procedures.
|
|
3210
3223
|
|
|
3211
3224
|
:param h: Altitude in meters [m].
|
|
3212
3225
|
:param mass: Aircraft mass in kilograms [kg].
|
|
@@ -3325,8 +3338,8 @@ class ARPM:
|
|
|
3325
3338
|
applyLimits=True,
|
|
3326
3339
|
config=None,
|
|
3327
3340
|
):
|
|
3328
|
-
"""
|
|
3329
|
-
|
|
3341
|
+
"""Computes the descent speed schedule (CAS) for a given altitude
|
|
3342
|
+
based on aircraft parameters and procedures.
|
|
3330
3343
|
|
|
3331
3344
|
:param h: Altitude in meters [m].
|
|
3332
3345
|
:param mass: Aircraft mass in kilograms [kg].
|
|
@@ -3517,7 +3530,8 @@ class ARPM:
|
|
|
3517
3530
|
|
|
3518
3531
|
|
|
3519
3532
|
class PTD(BADA3):
|
|
3520
|
-
"""This class implements the PTD file creator for BADA3 aircraft following
|
|
3533
|
+
"""This class implements the PTD file creator for BADA3 aircraft following
|
|
3534
|
+
BADA3 manual.
|
|
3521
3535
|
|
|
3522
3536
|
:param AC: Aircraft object {BADA3}.
|
|
3523
3537
|
:type AC: bada3Aircraft.
|
|
@@ -3530,13 +3544,14 @@ class PTD(BADA3):
|
|
|
3530
3544
|
self.ARPM = ARPM(AC)
|
|
3531
3545
|
|
|
3532
3546
|
def create(self, DeltaTemp, saveToPath):
|
|
3533
|
-
"""
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3547
|
+
"""Creates a BADA3 PTD file based on specified temperature deviation
|
|
3548
|
+
from ISA and saves it to the provided directory path. It generates
|
|
3549
|
+
performance data for different aircraft mass levels (low, medium,
|
|
3550
|
+
high) in both climb and descent phases.
|
|
3537
3551
|
|
|
3538
3552
|
:param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
|
|
3539
|
-
:param saveToPath: Path to the directory where the PTD file will be
|
|
3553
|
+
:param saveToPath: Path to the directory where the PTD file will be
|
|
3554
|
+
stored.
|
|
3540
3555
|
:type DeltaTemp: float.
|
|
3541
3556
|
:type saveToPath: str.
|
|
3542
3557
|
:returns: None
|
|
@@ -3599,16 +3614,21 @@ class PTD(BADA3):
|
|
|
3599
3614
|
DESList_med,
|
|
3600
3615
|
DeltaTemp,
|
|
3601
3616
|
):
|
|
3602
|
-
"""
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
:param saveToPath: Path to the directory where the PTD file should be
|
|
3608
|
-
|
|
3609
|
-
:param
|
|
3610
|
-
|
|
3611
|
-
:param
|
|
3617
|
+
"""Saves BADA3 (PTD) to a file. It stores performance data for low,
|
|
3618
|
+
medium, and high aircraft masses during the climb phase, and medium
|
|
3619
|
+
aircraft mass during the descent phase. The file is saved in a
|
|
3620
|
+
predefined format.
|
|
3621
|
+
|
|
3622
|
+
:param saveToPath: Path to the directory where the PTD file should be
|
|
3623
|
+
saved.
|
|
3624
|
+
:param CLList_low: List containing PTD data for CLIMB at low aircraft
|
|
3625
|
+
mass.
|
|
3626
|
+
:param CLList_med: List containing PTD data for CLIMB at medium
|
|
3627
|
+
aircraft mass.
|
|
3628
|
+
:param CLList_high: List containing PTD data for CLIMB at high
|
|
3629
|
+
aircraft mass.
|
|
3630
|
+
:param DESList_med: List containing PTD data for DESCENT at medium
|
|
3631
|
+
aircraft mass.
|
|
3612
3632
|
:param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
|
|
3613
3633
|
:type saveToPath: str.
|
|
3614
3634
|
:type CLList_low: list.
|
|
@@ -3776,12 +3796,12 @@ class PTD(BADA3):
|
|
|
3776
3796
|
file.write("\nTDC stands for (Thrust - Drag) * Cred\n")
|
|
3777
3797
|
|
|
3778
3798
|
def PTD_climb(self, mass, altitudeList, DeltaTemp):
|
|
3779
|
-
"""
|
|
3780
|
-
Calculates the BADA3 PTD data in climb phase.
|
|
3799
|
+
"""Calculates the BADA3 PTD data in climb phase.
|
|
3781
3800
|
|
|
3782
3801
|
:param mass: Aircraft mass [kg]
|
|
3783
3802
|
:param altitudeList: List of altitude levels for calculation (in feet)
|
|
3784
|
-
:param DeltaTemp: Deviation from International Standard Atmosphere
|
|
3803
|
+
:param DeltaTemp: Deviation from International Standard Atmosphere
|
|
3804
|
+
(ISA) temperature [K]
|
|
3785
3805
|
:type mass: float
|
|
3786
3806
|
:type altitudeList: list of int
|
|
3787
3807
|
:type DeltaTemp: float
|
|
@@ -3915,11 +3935,11 @@ class PTD(BADA3):
|
|
|
3915
3935
|
return CLList
|
|
3916
3936
|
|
|
3917
3937
|
def PTD_descent(self, mass, altitudeList, DeltaTemp):
|
|
3918
|
-
"""
|
|
3919
|
-
Calculates the BADA3 PTD data in descent phase.
|
|
3938
|
+
"""Calculates the BADA3 PTD data in descent phase.
|
|
3920
3939
|
|
|
3921
|
-
This function generates a detailed list of descent performance metrics
|
|
3922
|
-
mass configurations based on BADA3
|
|
3940
|
+
This function generates a detailed list of descent performance metrics
|
|
3941
|
+
for different altitudes and mass configurations based on BADA3
|
|
3942
|
+
performance models.
|
|
3923
3943
|
|
|
3924
3944
|
:param mass: Aircraft mass [kg].
|
|
3925
3945
|
:param altitudeList: List of aircraft altitudes in feet [ft].
|
|
@@ -4103,7 +4123,8 @@ class PTD(BADA3):
|
|
|
4103
4123
|
|
|
4104
4124
|
|
|
4105
4125
|
class PTF(BADA3):
|
|
4106
|
-
"""This class implements the PTF file creator for BADA3 aircraft following
|
|
4126
|
+
"""This class implements the PTF file creator for BADA3 aircraft following
|
|
4127
|
+
BADA3 manual.
|
|
4107
4128
|
|
|
4108
4129
|
:param AC: Aircraft object {BADA3}.
|
|
4109
4130
|
:type AC: bada3Aircraft.
|
|
@@ -4116,13 +4137,14 @@ class PTF(BADA3):
|
|
|
4116
4137
|
self.ARPM = ARPM(AC)
|
|
4117
4138
|
|
|
4118
4139
|
def create(self, DeltaTemp, saveToPath):
|
|
4119
|
-
"""
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4140
|
+
"""Creates a BADA3 PTF file based on specified temperature deviation
|
|
4141
|
+
from ISA and saves it to the provided directory path. It generates
|
|
4142
|
+
performance data for different aircraft mass levels (low, medium,
|
|
4143
|
+
high) in both climb and descent phases.
|
|
4123
4144
|
|
|
4124
4145
|
:param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
|
|
4125
|
-
:param saveToPath: Path to the directory where the PTF file will be
|
|
4146
|
+
:param saveToPath: Path to the directory where the PTF file will be
|
|
4147
|
+
stored.
|
|
4126
4148
|
:type DeltaTemp: float.
|
|
4127
4149
|
:type saveToPath: str.
|
|
4128
4150
|
:returns: None
|
|
@@ -4184,8 +4206,7 @@ class PTF(BADA3):
|
|
|
4184
4206
|
massList,
|
|
4185
4207
|
DeltaTemp,
|
|
4186
4208
|
):
|
|
4187
|
-
"""
|
|
4188
|
-
Saves performance data to a PTF file.
|
|
4209
|
+
"""Saves performance data to a PTF file.
|
|
4189
4210
|
|
|
4190
4211
|
:param saveToPath: Directory path where the PTF file will be stored.
|
|
4191
4212
|
:param CRList: List of cruise phase data.
|
|
@@ -4346,9 +4367,11 @@ class PTF(BADA3):
|
|
|
4346
4367
|
def PTF_cruise(self, massList, altitudeList, DeltaTemp):
|
|
4347
4368
|
"""Calculates BADA3 PTF data for the cruise phase.
|
|
4348
4369
|
|
|
4349
|
-
:param massList: List of aircraft masses [kg] (low, nominal, and
|
|
4370
|
+
:param massList: List of aircraft masses [kg] (low, nominal, and
|
|
4371
|
+
high).
|
|
4350
4372
|
:param altitudeList: List of aircraft altitudes [ft].
|
|
4351
|
-
:param DeltaTemp: Deviation from the International Standard Atmosphere
|
|
4373
|
+
:param DeltaTemp: Deviation from the International Standard Atmosphere
|
|
4374
|
+
(ISA) temperature [K].
|
|
4352
4375
|
:type massList: list of float.
|
|
4353
4376
|
:type altitudeList: list of int.
|
|
4354
4377
|
:type DeltaTemp: float.
|
|
@@ -4425,7 +4448,8 @@ class PTF(BADA3):
|
|
|
4425
4448
|
|
|
4426
4449
|
:param massList: List of aircraft masses [kg] (low, nominal, high).
|
|
4427
4450
|
:param altitudeList: List of aircraft altitudes [ft].
|
|
4428
|
-
:param DeltaTemp: Deviation from the International Standard Atmosphere
|
|
4451
|
+
:param DeltaTemp: Deviation from the International Standard Atmosphere
|
|
4452
|
+
(ISA) temperature [K].
|
|
4429
4453
|
:type massList: list of float.
|
|
4430
4454
|
:type altitudeList: list of int.
|
|
4431
4455
|
:type DeltaTemp: float.
|
|
@@ -4550,7 +4574,8 @@ class PTF(BADA3):
|
|
|
4550
4574
|
|
|
4551
4575
|
:param massList: List of aircraft masses [kg] (low, nominal, high).
|
|
4552
4576
|
:param altitudeList: List of aircraft altitudes [ft].
|
|
4553
|
-
:param DeltaTemp: Deviation from the International Standard Atmosphere
|
|
4577
|
+
:param DeltaTemp: Deviation from the International Standard Atmosphere
|
|
4578
|
+
(ISA) temperature [K].
|
|
4554
4579
|
:type massList: list of float.
|
|
4555
4580
|
:type altitudeList: list of int.
|
|
4556
4581
|
:type DeltaTemp: float.
|
|
@@ -4679,20 +4704,22 @@ class PTF(BADA3):
|
|
|
4679
4704
|
|
|
4680
4705
|
|
|
4681
4706
|
class Bada3Aircraft(BADA3):
|
|
4682
|
-
"""
|
|
4683
|
-
|
|
4707
|
+
"""Implements the BADA3 performance model for an aircraft following the
|
|
4708
|
+
BADA3 manual.
|
|
4684
4709
|
|
|
4685
|
-
This class handles the loading of aircraft-specific data from either a
|
|
4686
|
-
dataset or a set of BADA3 performance model files (e.g., OPF
|
|
4687
|
-
It initializes various parameters such as mass, speed
|
|
4688
|
-
necessary for simulating the aircraft's
|
|
4710
|
+
This class handles the loading of aircraft-specific data from either a
|
|
4711
|
+
predefined dataset or a set of BADA3 performance model files (e.g., OPF
|
|
4712
|
+
and APF files). It initializes various parameters such as mass, speed
|
|
4713
|
+
schedules, and engine type necessary for simulating the aircraft's
|
|
4714
|
+
performance.
|
|
4689
4715
|
|
|
4690
4716
|
:param badaVersion: The BADA version being used.
|
|
4691
4717
|
:param acName: The ICAO aircraft designation (e.g., "A320").
|
|
4692
|
-
:param filePath: Optional path to the BADA3 formatted file. If not
|
|
4693
|
-
|
|
4694
|
-
:param allData: Optional DataFrame containing all aircraft data. If
|
|
4695
|
-
|
|
4718
|
+
:param filePath: Optional path to the BADA3 formatted file. If not
|
|
4719
|
+
provided, the default aircraft directory is used.
|
|
4720
|
+
:param allData: Optional DataFrame containing all aircraft data. If
|
|
4721
|
+
provided, the class will try to load the aircraft data from this
|
|
4722
|
+
DataFrame.
|
|
4696
4723
|
:type badaVersion: str.
|
|
4697
4724
|
:type acName: str.
|
|
4698
4725
|
:type filePath: str, optional.
|
|
@@ -4711,7 +4738,7 @@ class Bada3Aircraft(BADA3):
|
|
|
4711
4738
|
self.BADAFamily = BadaFamily(BADA3=True)
|
|
4712
4739
|
self.BADAVersion = badaVersion
|
|
4713
4740
|
|
|
4714
|
-
if filePath
|
|
4741
|
+
if filePath is None:
|
|
4715
4742
|
self.filePath = configuration.getBadaVersionPath(
|
|
4716
4743
|
badaFamily="BADA3", badaVersion=badaVersion
|
|
4717
4744
|
)
|
|
@@ -4820,7 +4847,7 @@ class Bada3Aircraft(BADA3):
|
|
|
4820
4847
|
self.filePath, acName
|
|
4821
4848
|
)
|
|
4822
4849
|
|
|
4823
|
-
if self.SearchedACName
|
|
4850
|
+
if self.SearchedACName is None:
|
|
4824
4851
|
# look for file name directly, which consists of added "_" at the end of file
|
|
4825
4852
|
fileName = acName
|
|
4826
4853
|
while len(fileName) < 6:
|