pyBADA 0.1.2__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 CHANGED
@@ -1,19 +1,12 @@
1
- # -*- coding: utf-8 -*-
2
- """
3
- pyBADA
4
- Trajectory Computation Light (TCL) for BADAH/BADAE/BADA3/BADA4 aircraft performance module
5
- Developped @EUROCONTROL (EIH)
6
- 2024
7
- """
8
-
9
- import os
1
+ """Trajectory Computation Light (TCL) for BADAH/BADAE/BADA3/BADA4 aircraft
2
+ performance module."""
3
+
10
4
  import numpy as np
11
5
  from pyBADA.geodesic import Vincenty as vincenty
12
6
  from pyBADA.geodesic import RhumbLine as rhumb
13
7
  from pyBADA.geodesic import Turn as turn
14
8
 
15
9
  from dataclasses import dataclass
16
- import importlib.util
17
10
  import itertools
18
11
  import warnings
19
12
 
@@ -60,10 +53,9 @@ def constantSpeedLevel(
60
53
  magneticDeclinationGrid=None,
61
54
  **kwargs,
62
55
  ):
63
- """
64
- Calculates the time, fuel consumption, and other parameters for a level flight
65
- segment at a constant speed for a given aircraft in the BADA model. It supports step-climb,
66
- constant heading (true or magnetic), and turns.
56
+ """Calculates the time, fuel consumption, and other parameters for a level
57
+ flight segment at a constant speed for a given aircraft in the BADA model.
58
+ It supports step-climb, constant heading (true or magnetic), and turns.
67
59
 
68
60
  The function handles different BADA families (BADA3, BADA4, BADAH, BADAE), and computes various
69
61
  parameters such as altitude, speed, fuel consumption, power, heading, and mass based on aircraft
@@ -96,13 +88,12 @@ def constantSpeedLevel(
96
88
  :param magneticDeclinationGrid: Optional magnetic declination grid to correct headings. Default is None.
97
89
  :param kwargs: Additional optional parameters:
98
90
 
99
- - mass_const: Boolean. If True, keeps the aircraft mass constant during the segment. Default is False.
100
91
  - SOC_init: Initial battery state of charge for electric aircraft [%]. Default is 100 for BADAE.
101
92
  - speedBrakes: Dictionary defining whether speed brakes are deployed and their drag coefficient {deployed: False, value: 0.03}.
102
93
  - ROCD_min: Minimum rate of climb/descent threshold to identify service ceiling [ft/min]. Default varies by aircraft type.
103
94
  - config: Default aerodynamic configuration. Values: TO, IC, CR, AP, LD.
104
95
  - HpStep: Altitude step for step climb [ft]. Default is 2000 ft.
105
- - m_iter: Number of iterations for mass integration. Default is 1 for BADAE, 2 for others.
96
+ - calculationType: String indicating whether calculation is performed as INTEGRATED or POINT. Default is INTEGRATED.
106
97
  - step_length: The step length for each iteration in [NM] or [s], depending on the lengthType. Default is 100 NM for BADA3/4 and 10 NM for BADAH/BADAE.
107
98
 
108
99
  :returns: A pandas DataFrame containing the flight trajectory with columns such as:
@@ -180,7 +171,7 @@ def constantSpeedLevel(
180
171
  magneticHeading = trueHeading - magneticDeclination
181
172
  elif magneticHeading is not None and trueHeading is None:
182
173
  # fly MAGNETIC Heading
183
- if constantHeading == True:
174
+ if constantHeading is True:
184
175
  headingToFly = "MAGNETIC"
185
176
  trueHeading = magneticHeading + magneticDeclination
186
177
  else:
@@ -190,7 +181,12 @@ def constantSpeedLevel(
190
181
  raise Exception("Undefined Heading value combination")
191
182
 
192
183
  # calculation with constant mass (True) or integrated (False)
193
- mass_const = kwargs.get("mass_const", False)
184
+ calculationType = kwargs.get("calculationType", "INTEGRATED")
185
+
186
+ if calculationType == "INTEGRATED":
187
+ mass_const = False
188
+ if calculationType == "POINT":
189
+ mass_const = True
194
190
 
195
191
  # optional parameter to define initial Baterry State of Charge (SOC)
196
192
  if AC.BADAFamily.BADAE:
@@ -535,7 +531,6 @@ def constantSpeedLevel(
535
531
  and Lon_i is not None
536
532
  and (HDGMagnetic_i is not None or HDGTrue is not None)
537
533
  ):
538
-
539
534
  if headingToFly == "TRUE":
540
535
  if not turnFlight:
541
536
  if not constantHeading:
@@ -1166,6 +1161,7 @@ def constantSpeedLevel(
1166
1161
  }
1167
1162
 
1168
1163
  flightTrajectory = FT.createFlightTrajectoryDataframe(flightData)
1164
+
1169
1165
  return flightTrajectory
1170
1166
 
1171
1167
 
@@ -1188,9 +1184,10 @@ def constantSpeedROCD(
1188
1184
  magneticDeclinationGrid=None,
1189
1185
  **kwargs,
1190
1186
  ):
1191
- """
1192
- Computes the time, fuel consumption, and other parameters required for an aircraft to climb or descend
1193
- from a given initial altitude (Hp_init) to a final altitude (Hp_final) at a constant speed and rate of climb/descent (ROCD).
1187
+ """Computes the time, fuel consumption, and other parameters required for
1188
+ an aircraft to climb or descend from a given initial altitude (Hp_init) to
1189
+ a final altitude (Hp_final) at a constant speed and rate of climb/descent
1190
+ (ROCD).
1194
1191
 
1195
1192
  The function handles multiple BADA families (BADA3, BADA4, BADAH, BADAE), computing various parameters
1196
1193
  such as altitude, speed, fuel consumption, power, heading, and mass based on the aircraft's performance
@@ -1228,7 +1225,7 @@ def constantSpeedROCD(
1228
1225
  - speedBrakes: Dictionary specifying whether speed brakes are deployed and their drag coefficient {deployed: False, value: 0.03}.
1229
1226
  - ROCD_min: Minimum ROCD to identify the service ceiling [ft/min]. Default varies by aircraft type.
1230
1227
  - config: Default aerodynamic configuration. Values: TO, IC, CR, AP, LD. Default is None.
1231
- - mass_const: Boolean specifying whether to keep the mass constant during the segment. Default is False.
1228
+ - calculationType: String indicating whether calculation is performed as INTEGRATED or POINT. Default is INTEGRATED.
1232
1229
  - m_iter: Number of iterations for the mass integration loop. Default is 5.
1233
1230
 
1234
1231
  :returns: A pandas DataFrame containing the flight trajectory with columns such as:
@@ -1307,7 +1304,7 @@ def constantSpeedROCD(
1307
1304
  magneticHeading = trueHeading - magneticDeclination
1308
1305
  elif magneticHeading is not None and trueHeading is None:
1309
1306
  # fly MAGNETIC Heading
1310
- if constantHeading == True:
1307
+ if constantHeading is True:
1311
1308
  headingToFly = "MAGNETIC"
1312
1309
  trueHeading = magneticHeading + magneticDeclination
1313
1310
  else:
@@ -1317,7 +1314,12 @@ def constantSpeedROCD(
1317
1314
  raise Exception("Undefined Heading value combination")
1318
1315
 
1319
1316
  # calculation with constant mass (True) or integrated (False)
1320
- mass_const = kwargs.get("mass_const", False)
1317
+ calculationType = kwargs.get("calculationType", "INTEGRATED")
1318
+
1319
+ if calculationType == "INTEGRATED":
1320
+ mass_const = False
1321
+ if calculationType == "POINT":
1322
+ mass_const = True
1321
1323
 
1322
1324
  # optional parameter to define initial Baterry State of Charge (SOC)
1323
1325
  if AC.BADAFamily.BADAE:
@@ -1479,6 +1481,25 @@ def constantSpeedROCD(
1479
1481
  )
1480
1482
 
1481
1483
  # aircraft speed
1484
+ if calculationType == "POINT" and AC.BADAFamily.BADAH:
1485
+ [
1486
+ Pav_POINT,
1487
+ Peng_POINT,
1488
+ Preq_POINT,
1489
+ tas_POINT,
1490
+ ROCD_POINT,
1491
+ ESF_POINT,
1492
+ limitation_POINT,
1493
+ ] = AC.ARPM.ARPMProcedure(
1494
+ phase=phase,
1495
+ h=H_m,
1496
+ DeltaTemp=DeltaTemp,
1497
+ mass=mass[-1],
1498
+ rating="ARPM",
1499
+ )
1500
+ v = conv.ms2kt(tas_POINT)
1501
+ speedType = "TAS"
1502
+
1482
1503
  [M_i, CAS_i, TAS_i] = atm.convertSpeed(
1483
1504
  v=v, speedType=speedType, theta=theta, delta=delta, sigma=sigma
1484
1505
  )
@@ -2180,6 +2201,7 @@ def constantSpeedROCD(
2180
2201
  }
2181
2202
 
2182
2203
  flightTrajectory = FT.createFlightTrajectoryDataframe(flightData)
2204
+
2183
2205
  return flightTrajectory
2184
2206
 
2185
2207
 
@@ -2202,10 +2224,10 @@ def constantSpeedROCD_time(
2202
2224
  magneticDeclinationGrid=None,
2203
2225
  **kwargs,
2204
2226
  ):
2205
- """
2206
- Computes the time, fuel consumption, and performance parameters required for an aircraft to
2207
- perform a climb or descent based on a set amount of time, while maintaining a constant speed and constant
2208
- rate of climb/descent (ROCD).
2227
+ """Computes the time, fuel consumption, and performance parameters
2228
+ required for an aircraft to perform a climb or descent based on a set
2229
+ amount of time, while maintaining a constant speed and constant rate of
2230
+ climb/descent (ROCD).
2209
2231
 
2210
2232
  The function supports various BADA families (BADA3, BADA4, BADAH, BADAE), with different handling for mass changes,
2211
2233
  aerodynamic configurations, and energy consumption. It calculates parameters such as fuel consumption, power
@@ -2242,7 +2264,7 @@ def constantSpeedROCD_time(
2242
2264
  - speedBrakes: Dictionary specifying whether speed brakes are deployed and their drag coefficient {deployed: False, value: 0.03}.
2243
2265
  - ROCD_min: Minimum ROCD to identify the service ceiling [ft/min]. Default varies by aircraft type.
2244
2266
  - config: Default aerodynamic configuration. Values: TO, IC, CR, AP, LD. Default is None.
2245
- - mass_const: Boolean specifying whether to keep the mass constant during the segment. Default is False.
2267
+ - calculationType: String indicating whether calculation is performed as INTEGRATED or POINT. Default is INTEGRATED.
2246
2268
  - m_iter: Number of iterations for the mass integration loop. Default is 5.
2247
2269
 
2248
2270
  :returns: A pandas DataFrame containing the flight trajectory with columns such as:
@@ -2316,7 +2338,7 @@ def constantSpeedROCD_time(
2316
2338
  magneticHeading = trueHeading - magneticDeclination
2317
2339
  elif magneticHeading is not None and trueHeading is None:
2318
2340
  # fly MAGNETIC Heading
2319
- if constantHeading == True:
2341
+ if constantHeading is True:
2320
2342
  headingToFly = "MAGNETIC"
2321
2343
  trueHeading = magneticHeading + magneticDeclination
2322
2344
  else:
@@ -2326,7 +2348,12 @@ def constantSpeedROCD_time(
2326
2348
  raise Exception("Undefined Heading value combination")
2327
2349
 
2328
2350
  # calculation with constant mass (True) or integrated (False)
2329
- mass_const = kwargs.get("mass_const", False)
2351
+ calculationType = kwargs.get("calculationType", "INTEGRATED")
2352
+
2353
+ if calculationType == "INTEGRATED":
2354
+ mass_const = False
2355
+ if calculationType == "POINT":
2356
+ mass_const = True
2330
2357
 
2331
2358
  # optional parameter to define initial Baterry State of Charge (SOC)
2332
2359
  if AC.BADAFamily.BADAE:
@@ -2482,6 +2509,25 @@ def constantSpeedROCD_time(
2482
2509
  )
2483
2510
 
2484
2511
  # aircraft speed
2512
+ if calculationType == "POINT" and AC.BADAFamily.BADAH:
2513
+ [
2514
+ Pav_POINT,
2515
+ Peng_POINT,
2516
+ Preq_POINT,
2517
+ tas_POINT,
2518
+ ROCD_POINT,
2519
+ ESF_POINT,
2520
+ limitation_POINT,
2521
+ ] = AC.ARPM.ARPMProcedure(
2522
+ phase=phase,
2523
+ h=H_m,
2524
+ DeltaTemp=DeltaTemp,
2525
+ mass=mass[-1],
2526
+ rating="ARPM",
2527
+ )
2528
+ v = conv.ms2kt(tas_POINT)
2529
+ speedType = "TAS"
2530
+
2485
2531
  [M_i, CAS_i, TAS_i] = atm.convertSpeed(
2486
2532
  v=v, speedType=speedType, theta=theta, delta=delta, sigma=sigma
2487
2533
  )
@@ -3172,6 +3218,7 @@ def constantSpeedROCD_time(
3172
3218
  }
3173
3219
 
3174
3220
  flightTrajectory = FT.createFlightTrajectoryDataframe(flightData)
3221
+
3175
3222
  return flightTrajectory
3176
3223
 
3177
3224
 
@@ -3194,9 +3241,10 @@ def constantSpeedSlope(
3194
3241
  magneticDeclinationGrid=None,
3195
3242
  **kwargs,
3196
3243
  ):
3197
- """
3198
- Calculates time, fuel consumption, and other parameters required for an aircraft to perform a climb or descent
3199
- from an initial altitude (Hp_init) to a final altitude (Hp_final) while maintaining a constant speed and a constant slope.
3244
+ """Calculates time, fuel consumption, and other parameters required for an
3245
+ aircraft to perform a climb or descent from an initial altitude (Hp_init)
3246
+ to a final altitude (Hp_final) while maintaining a constant speed and a
3247
+ constant slope.
3200
3248
 
3201
3249
  It uses different models for BADA (Base of Aircraft Data) families (BADA3, BADA4, BADAH, BADAE) to compute key flight parameters
3202
3250
  such as energy consumption, rate of climb/descent (ROCD), fuel burn, mass changes, and power requirements. The function also supports
@@ -3233,7 +3281,7 @@ def constantSpeedSlope(
3233
3281
  - speedBrakes: A dictionary specifying whether speed brakes are deployed and the additional drag coefficient {deployed: False, value: 0.03}.
3234
3282
  - ROCD_min: Minimum rate of climb/descent used to determine service ceiling [ft/min]. Default varies based on aircraft type.
3235
3283
  - config: Default aerodynamic configuration (TO, IC, CR, AP, LD). Default is None.
3236
- - mass_const: Boolean indicating whether mass remains constant during the flight segment. Default is False.
3284
+ - calculationType: String indicating whether calculation is performed as INTEGRATED or POINT. Default is INTEGRATED.
3237
3285
  - m_iter: Number of iterations for the mass integration loop. Default is 5.
3238
3286
 
3239
3287
  :returns: A pandas DataFrame containing the flight trajectory with columns such as:
@@ -3307,7 +3355,7 @@ def constantSpeedSlope(
3307
3355
  magneticHeading = trueHeading - magneticDeclination
3308
3356
  elif magneticHeading is not None and trueHeading is None:
3309
3357
  # fly MAGNETIC Heading
3310
- if constantHeading == True:
3358
+ if constantHeading is True:
3311
3359
  headingToFly = "MAGNETIC"
3312
3360
  trueHeading = magneticHeading + magneticDeclination
3313
3361
  else:
@@ -3317,7 +3365,12 @@ def constantSpeedSlope(
3317
3365
  raise Exception("Undefined Heading value combination")
3318
3366
 
3319
3367
  # calculation with constant mass (True) or integrated (False)
3320
- mass_const = kwargs.get("mass_const", False)
3368
+ calculationType = kwargs.get("calculationType", "INTEGRATED")
3369
+
3370
+ if calculationType == "INTEGRATED":
3371
+ mass_const = False
3372
+ if calculationType == "POINT":
3373
+ mass_const = True
3321
3374
 
3322
3375
  # optional parameter to define initial Baterry State of Charge (SOC)
3323
3376
  if AC.BADAFamily.BADAE:
@@ -3473,6 +3526,25 @@ def constantSpeedSlope(
3473
3526
  )
3474
3527
 
3475
3528
  # aircraft speed
3529
+ if calculationType == "POINT" and AC.BADAFamily.BADAH:
3530
+ [
3531
+ Pav_POINT,
3532
+ Peng_POINT,
3533
+ Preq_POINT,
3534
+ tas_POINT,
3535
+ ROCD_POINT,
3536
+ ESF_POINT,
3537
+ limitation_POINT,
3538
+ ] = AC.ARPM.ARPMProcedure(
3539
+ phase=phase,
3540
+ h=H_m,
3541
+ DeltaTemp=DeltaTemp,
3542
+ mass=mass[-1],
3543
+ rating="ARPM",
3544
+ )
3545
+ v = conv.ms2kt(tas_POINT)
3546
+ speedType = "TAS"
3547
+
3476
3548
  [M_i, CAS_i, TAS_i] = atm.convertSpeed(
3477
3549
  v=v, speedType=speedType, theta=theta, delta=delta, sigma=sigma
3478
3550
  )
@@ -4178,6 +4250,7 @@ def constantSpeedSlope(
4178
4250
  }
4179
4251
 
4180
4252
  flightTrajectory = FT.createFlightTrajectoryDataframe(flightData)
4253
+
4181
4254
  return flightTrajectory
4182
4255
 
4183
4256
 
@@ -4200,8 +4273,9 @@ def constantSpeedSlope_time(
4200
4273
  magneticDeclinationGrid=None,
4201
4274
  **kwargs,
4202
4275
  ):
4203
- """
4204
- Computes the time, fuel, and trajectory parameters required by an aircraft to climb or descend at constant speed and slope over a given duration.
4276
+ """Computes the time, fuel, and trajectory parameters required by an
4277
+ aircraft to climb or descend at constant speed and slope over a given
4278
+ duration.
4205
4279
 
4206
4280
  This function models a trajectory with constant speed (either CAS, TAS, or Mach) and a specified slope (degrees). The aircraft's dynamics are modeled based on BADA family data (BADA3, BADA4, BADAH, BADAE), supporting various aircraft types including electric models. It also accounts for turns, heading changes, and wind effects.
4207
4281
 
@@ -4237,7 +4311,7 @@ def constantSpeedSlope_time(
4237
4311
  - config: Default aerodynamic configuration {TO, IC, CR, AP, LD}. If not provided, configuration is calculated automatically.
4238
4312
  - speedBrakes: Dictionary specifying if speed brakes are deployed and additional drag coefficient {deployed: False, value: 0.03}.
4239
4313
  - ROCD_min: Minimum Rate of Climb/Descent to determine service ceiling [ft/min]. Defaults depend on aircraft type and engine.
4240
- - mass_const: Boolean indicating whether mass remains constant during the flight. Default is False.
4314
+ - calculationType: String indicating whether calculation is performed as INTEGRATED or POINT. Default is INTEGRATED.
4241
4315
  - m_iter: Number of iterations for mass integration. Default is 5.
4242
4316
 
4243
4317
  :returns: A pandas DataFrame containing the flight trajectory with columns such as:
@@ -4311,7 +4385,7 @@ def constantSpeedSlope_time(
4311
4385
  magneticHeading = trueHeading - magneticDeclination
4312
4386
  elif magneticHeading is not None and trueHeading is None:
4313
4387
  # fly MAGNETIC Heading
4314
- if constantHeading == True:
4388
+ if constantHeading is True:
4315
4389
  headingToFly = "MAGNETIC"
4316
4390
  trueHeading = magneticHeading + magneticDeclination
4317
4391
  else:
@@ -4321,7 +4395,12 @@ def constantSpeedSlope_time(
4321
4395
  raise Exception("Undefined Heading value combination")
4322
4396
 
4323
4397
  # calculation with constant mass (True) or integrated (False)
4324
- mass_const = kwargs.get("mass_const", False)
4398
+ calculationType = kwargs.get("calculationType", "INTEGRATED")
4399
+
4400
+ if calculationType == "INTEGRATED":
4401
+ mass_const = False
4402
+ if calculationType == "POINT":
4403
+ mass_const = True
4325
4404
 
4326
4405
  # optional parameter to define initial Baterry State of Charge (SOC)
4327
4406
  if AC.BADAFamily.BADAE:
@@ -4473,6 +4552,25 @@ def constantSpeedSlope_time(
4473
4552
  )
4474
4553
 
4475
4554
  # aircraft speed
4555
+ if calculationType == "POINT" and AC.BADAFamily.BADAH:
4556
+ [
4557
+ Pav_POINT,
4558
+ Peng_POINT,
4559
+ Preq_POINT,
4560
+ tas_POINT,
4561
+ ROCD_POINT,
4562
+ ESF_POINT,
4563
+ limitation_POINT,
4564
+ ] = AC.ARPM.ARPMProcedure(
4565
+ phase=phase,
4566
+ h=H_m,
4567
+ DeltaTemp=DeltaTemp,
4568
+ mass=mass[-1],
4569
+ rating="ARPM",
4570
+ )
4571
+ v = conv.ms2kt(tas_POINT)
4572
+ speedType = "TAS"
4573
+
4476
4574
  [M_i, CAS_i, TAS_i] = atm.convertSpeed(
4477
4575
  v=v, speedType=speedType, theta=theta, delta=delta, sigma=sigma
4478
4576
  )
@@ -5175,6 +5273,7 @@ def constantSpeedSlope_time(
5175
5273
  }
5176
5274
 
5177
5275
  flightTrajectory = FT.createFlightTrajectoryDataframe(flightData)
5276
+
5178
5277
  return flightTrajectory
5179
5278
 
5180
5279
 
@@ -5198,9 +5297,10 @@ def constantSpeedRating(
5198
5297
  initRating=None,
5199
5298
  **kwargs,
5200
5299
  ):
5201
- """
5202
- Calculates time, fuel consumption, and other parameters required for an aircraft to perform a climb or descent
5203
- from an initial altitude (Hp_init) to a final altitude (Hp_final) while maintaining a constant speed and engine rating.
5300
+ """Calculates time, fuel consumption, and other parameters required for an
5301
+ aircraft to perform a climb or descent from an initial altitude (Hp_init)
5302
+ to a final altitude (Hp_final) while maintaining a constant speed and
5303
+ engine rating.
5204
5304
 
5205
5305
  It uses different models for BADA (Base of Aircraft Data) families (BADA3, BADA4, BADAH, BADAE) to compute key flight parameters
5206
5306
  such as fuel burn, rate of climb/descent (ROCD), thrust, drag, and energy requirements. The function also supports
@@ -5237,7 +5337,7 @@ def constantSpeedRating(
5237
5337
  - speedBrakes: A dictionary specifying whether speed brakes are deployed and the additional drag coefficient {deployed: False, value: 0.03}.
5238
5338
  - ROCD_min: Minimum rate of climb/descent used to determine service ceiling [ft/min]. Default varies based on aircraft type.
5239
5339
  - config: Default aerodynamic configuration (TO, IC, CR, AP, LD). Default is None.
5240
- - mass_const: Boolean indicating whether mass remains constant during the flight segment. Default is False.
5340
+ - calculationType: String indicating whether calculation is performed as INTEGRATED or POINT. Default is INTEGRATED.
5241
5341
  - m_iter: Number of iterations for the mass integration loop. Default is 5.
5242
5342
 
5243
5343
  :returns: A pandas DataFrame containing the flight trajectory with columns such as:
@@ -5311,7 +5411,7 @@ def constantSpeedRating(
5311
5411
  magneticHeading = trueHeading - magneticDeclination
5312
5412
  elif magneticHeading is not None and trueHeading is None:
5313
5413
  # fly MAGNETIC Heading
5314
- if constantHeading == True:
5414
+ if constantHeading is True:
5315
5415
  headingToFly = "MAGNETIC"
5316
5416
  trueHeading = magneticHeading + magneticDeclination
5317
5417
  else:
@@ -5321,7 +5421,12 @@ def constantSpeedRating(
5321
5421
  raise Exception("Undefined Heading value combination")
5322
5422
 
5323
5423
  # calculation with constant mass (True) or integrated (False)
5324
- mass_const = kwargs.get("mass_const", False)
5424
+ calculationType = kwargs.get("calculationType", "INTEGRATED")
5425
+
5426
+ if calculationType == "INTEGRATED":
5427
+ mass_const = False
5428
+ if calculationType == "POINT":
5429
+ mass_const = True
5325
5430
 
5326
5431
  # optional parameter to define initial Baterry State of Charge (SOC)
5327
5432
  if AC.BADAFamily.BADAE:
@@ -5504,6 +5609,25 @@ def constantSpeedRating(
5504
5609
  )
5505
5610
 
5506
5611
  # aircraft speed
5612
+ if calculationType == "POINT" and AC.BADAFamily.BADAH:
5613
+ [
5614
+ Pav_POINT,
5615
+ Peng_POINT,
5616
+ Preq_POINT,
5617
+ tas_POINT,
5618
+ ROCD_POINT,
5619
+ ESF_POINT,
5620
+ limitation_POINT,
5621
+ ] = AC.ARPM.ARPMProcedure(
5622
+ phase=phase,
5623
+ h=H_m,
5624
+ DeltaTemp=DeltaTemp,
5625
+ mass=mass[-1],
5626
+ rating=rating,
5627
+ )
5628
+ v = conv.ms2kt(tas_POINT)
5629
+ speedType = "TAS"
5630
+
5507
5631
  [M_i, CAS_i, TAS_i] = atm.convertSpeed(
5508
5632
  v=v, speedType=speedType, theta=theta, delta=delta, sigma=sigma
5509
5633
  )
@@ -5580,9 +5704,12 @@ def constantSpeedRating(
5580
5704
  M=M_i,
5581
5705
  DeltaTemp=DeltaTemp,
5582
5706
  ) # [N]
5583
- CT = AC.CT(Thrust=THR_i, delta=delta)
5584
5707
  FUEL_i = AC.ff(
5585
- CT=CT, delta=delta, theta=theta, M=M_i, DeltaTemp=DeltaTemp
5708
+ rating=rating,
5709
+ delta=delta,
5710
+ theta=theta,
5711
+ M=M_i,
5712
+ DeltaTemp=DeltaTemp,
5586
5713
  )
5587
5714
 
5588
5715
  # BADA3
@@ -5616,12 +5743,7 @@ def constantSpeedRating(
5616
5743
  DeltaTemp=DeltaTemp,
5617
5744
  )
5618
5745
  FUEL_i = AC.ff(
5619
- flightPhase=phase,
5620
- v=TAS_i,
5621
- h=H_m,
5622
- T=THR_i,
5623
- config=config_i,
5624
- adapted=True,
5746
+ flightPhase=phase, v=TAS_i, h=H_m, T=THR_i, config=config_i
5625
5747
  )
5626
5748
 
5627
5749
  if Hp_i != Hp_init: # exclude first point: initial m already known
@@ -5689,7 +5811,12 @@ def constantSpeedRating(
5689
5811
  CL = AC.CL(M=M_i, delta=delta, mass=mass_i, nz=nz)
5690
5812
  # compute drag coefficient
5691
5813
  CD = AC.CD(
5692
- M=M_i, CL=CL, HLid=HLid_i, LG=LG_i, speedBrakes=speedBrakes
5814
+ M=M_i,
5815
+ CL=CL,
5816
+ HLid=HLid_i,
5817
+ LG=LG_i,
5818
+ speedBrakes=speedBrakes,
5819
+ expedite=expedite,
5693
5820
  )
5694
5821
  # compute drag force
5695
5822
  Drag = AC.D(M=M_i, delta=delta, CD=CD)
@@ -6095,6 +6222,7 @@ def constantSpeedRating(
6095
6222
  }
6096
6223
 
6097
6224
  flightTrajectory = FT.createFlightTrajectoryDataframe(flightData)
6225
+
6098
6226
  return flightTrajectory
6099
6227
 
6100
6228
 
@@ -6119,9 +6247,9 @@ def constantSpeedRating_time(
6119
6247
  initRating=None,
6120
6248
  **kwargs,
6121
6249
  ):
6122
- """
6123
- Calculates the time, fuel consumption, and other flight parameters required for an aircraft to perform
6124
- a climb or descent at constant speed and engine rating for a specified duration.
6250
+ """Calculates the time, fuel consumption, and other flight parameters
6251
+ required for an aircraft to perform a climb or descent at constant speed
6252
+ and engine rating for a specified duration.
6125
6253
 
6126
6254
  It uses different models for BADA (Base of Aircraft Data) families (BADA3, BADA4, BADAH, BADAE) to compute key parameters
6127
6255
  such as rate of climb/descent (ROCD), thrust, drag, fuel burn, and power requirements. The function also supports complex
@@ -6160,7 +6288,7 @@ def constantSpeedRating_time(
6160
6288
  - speedBrakes: A dictionary specifying whether speed brakes are deployed and the additional drag coefficient {deployed: False, value: 0.03}.
6161
6289
  - ROCD_min: Minimum rate of climb/descent to determine service ceiling [ft/min]. Default varies by aircraft type.
6162
6290
  - config: Default aerodynamic configuration (TO, IC, CR, AP, LD). Default is None.
6163
- - mass_const: Boolean indicating whether mass remains constant during the flight segment. Default is False.
6291
+ - calculationType: String indicating whether calculation is performed as INTEGRATED or POINT. Default is INTEGRATED.
6164
6292
  - m_iter: Number of iterations for the mass integration loop. Default is 5.
6165
6293
 
6166
6294
  :returns: A pandas DataFrame containing the flight trajectory with columns such as:
@@ -6234,7 +6362,7 @@ def constantSpeedRating_time(
6234
6362
  magneticHeading = trueHeading - magneticDeclination
6235
6363
  elif magneticHeading is not None and trueHeading is None:
6236
6364
  # fly MAGNETIC Heading
6237
- if constantHeading == True:
6365
+ if constantHeading is True:
6238
6366
  headingToFly = "MAGNETIC"
6239
6367
  trueHeading = magneticHeading + magneticDeclination
6240
6368
  else:
@@ -6244,7 +6372,12 @@ def constantSpeedRating_time(
6244
6372
  raise Exception("Undefined Heading value combination")
6245
6373
 
6246
6374
  # calculation with constant mass (True) or integrated (False)
6247
- mass_const = kwargs.get("mass_const", False)
6375
+ calculationType = kwargs.get("calculationType", "INTEGRATED")
6376
+
6377
+ if calculationType == "INTEGRATED":
6378
+ mass_const = False
6379
+ if calculationType == "POINT":
6380
+ mass_const = True
6248
6381
 
6249
6382
  # optional parameter to define initial Baterry State of Charge (SOC)
6250
6383
  if AC.BADAFamily.BADAE:
@@ -6430,6 +6563,25 @@ def constantSpeedRating_time(
6430
6563
  )
6431
6564
 
6432
6565
  # aircraft speed
6566
+ if calculationType == "POINT" and AC.BADAFamily.BADAH:
6567
+ [
6568
+ Pav_POINT,
6569
+ Peng_POINT,
6570
+ Preq_POINT,
6571
+ tas_POINT,
6572
+ ROCD_POINT,
6573
+ ESF_POINT,
6574
+ limitation_POINT,
6575
+ ] = AC.ARPM.ARPMProcedure(
6576
+ phase=phase,
6577
+ h=H_m,
6578
+ DeltaTemp=DeltaTemp,
6579
+ mass=mass[-1],
6580
+ rating=rating,
6581
+ )
6582
+ v = conv.ms2kt(tas_POINT)
6583
+ speedType = "TAS"
6584
+
6433
6585
  [M_i, CAS_i, TAS_i] = atm.convertSpeed(
6434
6586
  v=v, speedType=speedType, theta=theta, delta=delta, sigma=sigma
6435
6587
  )
@@ -6508,9 +6660,12 @@ def constantSpeedRating_time(
6508
6660
  M=M_i,
6509
6661
  DeltaTemp=DeltaTemp,
6510
6662
  ) # [N]
6511
- CT = AC.CT(Thrust=THR_i, delta=delta)
6512
6663
  FUEL_i = AC.ff(
6513
- CT=CT, delta=delta, theta=theta, M=M_i, DeltaTemp=DeltaTemp
6664
+ rating=rating,
6665
+ delta=delta,
6666
+ theta=theta,
6667
+ M=M_i,
6668
+ DeltaTemp=DeltaTemp,
6514
6669
  )
6515
6670
 
6516
6671
  # BADA3
@@ -6544,12 +6699,7 @@ def constantSpeedRating_time(
6544
6699
  DeltaTemp=DeltaTemp,
6545
6700
  )
6546
6701
  FUEL_i = AC.ff(
6547
- flightPhase=phase,
6548
- v=TAS_i,
6549
- h=H_m,
6550
- T=THR_i,
6551
- config=config_i,
6552
- adapted=False,
6702
+ flightPhase=phase, v=TAS_i, h=H_m, T=THR_i, config=config_i
6553
6703
  ) # MCMB(climb) or IDLE(descent)
6554
6704
 
6555
6705
  # BADAH or BADAE
@@ -6603,7 +6753,12 @@ def constantSpeedRating_time(
6603
6753
  CL = AC.CL(M=M_i, delta=delta, mass=mass_i, nz=nz)
6604
6754
  # compute drag coefficient
6605
6755
  CD = AC.CD(
6606
- M=M_i, CL=CL, HLid=HLid_i, LG=LG_i, speedBrakes=speedBrakes
6756
+ M=M_i,
6757
+ CL=CL,
6758
+ HLid=HLid_i,
6759
+ LG=LG_i,
6760
+ speedBrakes=speedBrakes,
6761
+ expedite=expedite,
6607
6762
  )
6608
6763
  # compute drag force
6609
6764
  Drag = AC.D(M=M_i, delta=delta, CD=CD)
@@ -7008,6 +7163,7 @@ def constantSpeedRating_time(
7008
7163
  }
7009
7164
 
7010
7165
  flightTrajectory = FT.createFlightTrajectoryDataframe(flightData)
7166
+
7011
7167
  return flightTrajectory
7012
7168
 
7013
7169
 
@@ -7030,10 +7186,10 @@ def accDec(
7030
7186
  magneticDeclinationGrid=None,
7031
7187
  **kwargs,
7032
7188
  ):
7033
- """
7034
- Calculates the time, fuel consumption, and other key flight parameters required for an aircraft
7035
- to perform an acceleration or deceleration from an initial speed (v_init) to a final speed (v_final)
7036
- during the climb, cruise, or descent phases of flight.
7189
+ """Calculates the time, fuel consumption, and other key flight parameters
7190
+ required for an aircraft to perform an acceleration or deceleration from
7191
+ an initial speed (v_init) to a final speed (v_final) during the climb,
7192
+ cruise, or descent phases of flight.
7037
7193
 
7038
7194
  The flight parameters are calculated using different models for the BADA (Base of Aircraft Data) families (BADA3, BADA4, BADAH, BADAE).
7039
7195
  The function can also accommodate different control laws, vertical evolution phases, wind conditions, and complex flight dynamics like turns.
@@ -7082,7 +7238,7 @@ def accDec(
7082
7238
  - speed_step: Speed step size for the iterative calculation [-] for M, [kt] for TAS/CAS. Default is 0.01 Mach, 5 kt for TAS/CAS.
7083
7239
  - SOC_init: Initial battery state of charge for electric aircraft (BADAE) [%]. Default is 100.
7084
7240
  - config: Default aerodynamic configuration (TO, IC, CR, AP, LD). Default is None.
7085
- - mass_const: Boolean indicating whether mass remains constant during the flight segment. Default is False.
7241
+ - calculationType: String indicating whether calculation is performed as INTEGRATED or POINT. Default is INTEGRATED.
7086
7242
  - m_iter: Number of iterations for the mass integration loop. Default is 10 for BADA3/4/H, 5 for BADAE.
7087
7243
 
7088
7244
  :returns: A pandas DataFrame containing the flight trajectory with columns such as:
@@ -7156,7 +7312,7 @@ def accDec(
7156
7312
  magneticHeading = trueHeading - magneticDeclination
7157
7313
  elif magneticHeading is not None and trueHeading is None:
7158
7314
  # fly MAGNETIC Heading
7159
- if constantHeading == True:
7315
+ if constantHeading is True:
7160
7316
  headingToFly = "MAGNETIC"
7161
7317
  trueHeading = magneticHeading + magneticDeclination
7162
7318
  else:
@@ -7166,7 +7322,12 @@ def accDec(
7166
7322
  raise Exception("Undefined Heading value combination")
7167
7323
 
7168
7324
  # calculation with constant mass (True) or integrated (False)
7169
- mass_const = kwargs.get("mass_const", False)
7325
+ calculationType = kwargs.get("calculationType", "INTEGRATED")
7326
+
7327
+ if calculationType == "INTEGRATED":
7328
+ mass_const = False
7329
+ if calculationType == "POINT":
7330
+ mass_const = True
7170
7331
 
7171
7332
  # optional parameter to define initial Baterry State of Charge (SOC)
7172
7333
  if AC.BADAFamily.BADAE:
@@ -8283,6 +8444,7 @@ def accDec(
8283
8444
  }
8284
8445
 
8285
8446
  flightTrajectory = FT.createFlightTrajectoryDataframe(flightData)
8447
+
8286
8448
  return flightTrajectory
8287
8449
 
8288
8450
 
@@ -8306,10 +8468,10 @@ def accDec_time(
8306
8468
  magneticDeclinationGrid=None,
8307
8469
  **kwargs,
8308
8470
  ):
8309
- """
8310
- Calculates the time, fuel consumption, and other key flight parameters required for an aircraft
8311
- to perform an acceleration or deceleration from an initial speed (v_init) over a set period of time
8312
- during the climb, cruise, or descent phases of flight.
8471
+ """Calculates the time, fuel consumption, and other key flight parameters
8472
+ required for an aircraft to perform an acceleration or deceleration from
8473
+ an initial speed (v_init) over a set period of time during the climb,
8474
+ cruise, or descent phases of flight.
8313
8475
 
8314
8476
  The flight parameters are calculated using different models for the BADA (Base of Aircraft Data) families (BADA3, BADA4, BADAH, BADAE).
8315
8477
  The function can also accommodate different control laws, vertical evolution phases, wind conditions, and complex flight dynamics like turns.
@@ -8359,7 +8521,7 @@ def accDec_time(
8359
8521
  - step_length: Length of each time step in the calculation [s]. Default is 1 second.
8360
8522
  - SOC_init: Initial battery state of charge for electric aircraft (BADAE) [%]. Default is 100.
8361
8523
  - config: Default aerodynamic configuration (TO, IC, CR, AP, LD). Default is None.
8362
- - mass_const: Boolean indicating whether mass remains constant during the flight segment. Default is False.
8524
+ - calculationType: String indicating whether calculation is performed as INTEGRATED or POINT. Default is INTEGRATED.
8363
8525
  - m_iter: Number of iterations for the mass integration loop. Default is 10 for BADA3/4/H, 5 for BADAE.
8364
8526
 
8365
8527
  :returns: A pandas DataFrame containing the flight trajectory with columns such as:
@@ -8433,7 +8595,7 @@ def accDec_time(
8433
8595
  magneticHeading = trueHeading - magneticDeclination
8434
8596
  elif magneticHeading is not None and trueHeading is None:
8435
8597
  # fly MAGNETIC Heading
8436
- if constantHeading == True:
8598
+ if constantHeading is True:
8437
8599
  headingToFly = "MAGNETIC"
8438
8600
  trueHeading = magneticHeading + magneticDeclination
8439
8601
  else:
@@ -8443,7 +8605,12 @@ def accDec_time(
8443
8605
  raise Exception("Undefined Heading value combination")
8444
8606
 
8445
8607
  # calculation with constant mass (True) or integrated (False)
8446
- mass_const = kwargs.get("mass_const", False)
8608
+ calculationType = kwargs.get("calculationType", "INTEGRATED")
8609
+
8610
+ if calculationType == "INTEGRATED":
8611
+ mass_const = False
8612
+ if calculationType == "POINT":
8613
+ mass_const = True
8447
8614
 
8448
8615
  # optional parameter to define initial Baterry State of Charge (SOC)
8449
8616
  if AC.BADAFamily.BADAE:
@@ -8819,7 +8986,6 @@ def accDec_time(
8819
8986
  if P_i < Pmin:
8820
8987
  P_i = Pmin
8821
8988
  if ESFc is not None:
8822
-
8823
8989
  ROCD_i = (
8824
8990
  conv.m2ft(
8825
8991
  AC.ROCD(
@@ -9554,4 +9720,5 @@ def accDec_time(
9554
9720
  }
9555
9721
 
9556
9722
  flightTrajectory = FT.createFlightTrajectoryDataframe(flightData)
9723
+
9557
9724
  return flightTrajectory