doc-calculator 0.2__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.
- doc_calculator/__init__.py +2 -0
- doc_calculator/core/DOC_Calculator.py +424 -0
- doc_calculator/core/__init__.py +1 -0
- doc_calculator/core/utils/__init__.py +0 -0
- doc_calculator/core/utils/params.py +97 -0
- doc_calculator/core/utils/util_functions.py +11 -0
- doc_calculator/gemseo_discipline/DOC_Calculator.py +54 -0
- doc_calculator/gemseo_discipline/__init__.py +1 -0
- doc_calculator/gemseo_discipline/utils/__init__.py +0 -0
- doc_calculator/gemseo_discipline/utils/utils_functions.py +10 -0
- doc_calculator-0.2.dist-info/LICENSE +21 -0
- doc_calculator-0.2.dist-info/METADATA +6 -0
- doc_calculator-0.2.dist-info/RECORD +15 -0
- doc_calculator-0.2.dist-info/WHEEL +5 -0
- doc_calculator-0.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,424 @@
|
|
1
|
+
from .utils.params import Params
|
2
|
+
from .utils.util_functions import _assign_input
|
3
|
+
from typing import Dict, Tuple
|
4
|
+
import math
|
5
|
+
|
6
|
+
class DirectOperatingCost(object):
|
7
|
+
|
8
|
+
# Constants
|
9
|
+
MACH_NUMBER_FACTOR = 1.0 # 1.0 = Assumed subsonic cruise
|
10
|
+
FLIGHT_TIME_OFFSET = 0.25
|
11
|
+
|
12
|
+
def __init__(self, aircraft:dict, params:Params=Params()) -> None:
|
13
|
+
"""
|
14
|
+
### Description
|
15
|
+
This code enables to evaluate Direct and Total Operating Costs
|
16
|
+
for Short/Medium haul airliners and regional aircraft (jet and
|
17
|
+
propeller driven ).
|
18
|
+
|
19
|
+
### Input Dict Keys
|
20
|
+
List of variables composing the aircraft dict (case insensitive):
|
21
|
+
- adp (USD M) Aircraft Delivery Price
|
22
|
+
|
23
|
+
- mtow (Tonns) Max Take-off Weight
|
24
|
+
- pld (Tonns) Payload
|
25
|
+
- mew (Tonns) Manufacturer Empty Weight
|
26
|
+
- bengw (Tonns) Bare engine weight
|
27
|
+
- enpri (USD M) Engine Price
|
28
|
+
- en Thermal Engines number
|
29
|
+
- crewc Attendants number
|
30
|
+
- crewtech Number of Tech. crew members (pilots)
|
31
|
+
- bt (HR) Sector Block Time
|
32
|
+
- bf (KG) Sector Block Fuel
|
33
|
+
- sector (NM) Sector assumed for DOCs evaluation
|
34
|
+
|
35
|
+
- ieng Engine maintenance cost flag (1=Calculate, 2=Assigned in eoc parameter)
|
36
|
+
- eoc (USD/BHR) Engine overhaul cost (Necessary for ieng=2)
|
37
|
+
- shp (HP) Thermal Engine Shaft Horse Power (Necessary for ieng=1)
|
38
|
+
|
39
|
+
- afspare (fraction of adp) Airframe spares in [0.0 1.0]
|
40
|
+
- enspare (fraction of enpri) Spare engines and spares in [0.0 1.0]
|
41
|
+
- dyrs (YRS) Depreciation period
|
42
|
+
- rval Aircraft Residual value in [0.0 1.0]
|
43
|
+
- rinsh (fraction of adp) Insurance rate in [0.0 1.0]
|
44
|
+
- crtechr (USD/BHR) Tech. crew members (pilots) hourly tot.cost
|
45
|
+
- crcabhr (USD/BHR/Att ) Cab. crew member hourly cost
|
46
|
+
- labor_rate (USD/MHR) Maintenance Labour rate
|
47
|
+
- fuelpri (USD/US GAL) Fuel Price
|
48
|
+
- ioc_fact Coeff. for IOC evaluation in [0.0 Inf)
|
49
|
+
- util (BHR/Annum) Aircraft Annual Utilisation
|
50
|
+
- lifespan Lifespan of the aircraft (years)
|
51
|
+
- l_app (EPNdB) Certified noise level at the approach measure point
|
52
|
+
- l_lat (EPNdB) Certified noise level at the lateral measure point
|
53
|
+
- l_flyov (EPNdB) Certified noise level at the fly-over measure point
|
54
|
+
|
55
|
+
- cnox (USD) Unit rate for NOX (generally referred to nitrogen oxides) (Emission tariff that depends on the airport)
|
56
|
+
- nox_value (Kg) Emission value of NOX. Equivalent of nitrogen oxide exhausted by an aircraft,
|
57
|
+
in kilogram, in the "Landing and Take-Off Cycle, LTO
|
58
|
+
- cco (USD) Unit rate for CO (generally referred to nitrogen oxides) (Emission tariff that depends on the airport)
|
59
|
+
- co_value (Kg) Emission value of CO. Equivalent of carbon monoxide exhausted by an aircraft,
|
60
|
+
in kilogram, in the "Landing and Take-Off Cycle, LTO
|
61
|
+
- co2_value (kg) Mass of Emitted CO2, in kilograms
|
62
|
+
- prico2 (USD/kg) co2_value price for unit of emitted co2_value mass
|
63
|
+
|
64
|
+
- n_bat Number of batteries pack
|
65
|
+
- n_fc Number of fuel cells
|
66
|
+
- n_repbat Number of battery(ies) replacement during the aircraft lifespan
|
67
|
+
- batprice (USD) Battery(ies) price [USD]
|
68
|
+
- rvbat (USD) Battery(ies) residual value (at the end of its own life) [USD]
|
69
|
+
- lrbat (USD/MMH) Maintenance labor rate for battery(ies)
|
70
|
+
- tlbat (MMH) Maintenance man-hour for battery(ies) [hours]
|
71
|
+
- f_bat Maintenance frequency for battery(ies) - as the reciprocal of the number of flights before the next check
|
72
|
+
- n_repfc Number of fuel cell(s) replacement during the aircraft lifespan
|
73
|
+
- fcprice (USD) Fuel Cell price [USD]
|
74
|
+
- rvfc (USD) Fuel Cell(s) residual value (at the end of its own life) [USD]
|
75
|
+
- lrfc (USD/MMH) Maintenance labor rate for fuel cell(s)
|
76
|
+
- tlfc (MMH) Maintenance man-hour for fuel cell(s) [hours]
|
77
|
+
- f_fc Maintenance frequency for fuel cell(s) - as the reciprocal of the number of flights before the next check
|
78
|
+
- n_reppe Number of power electronics replacement during the aircraft lifespan
|
79
|
+
- peprice (USD) Power electronics price [USD]
|
80
|
+
- rvpe (USD) Power electronics residual value (at the end of its own life) [USD]
|
81
|
+
- lrpe (USD/MMH) Maintenance labor rate for power electronics
|
82
|
+
- tlpe (MMH) Maintenance man-hour for power electronics [hours]
|
83
|
+
- f_pe Maintenance frequency for power electronics - as the reciprocal of the number of flights before the next check
|
84
|
+
|
85
|
+
- n_em Number of electric machines
|
86
|
+
- emprice (USD) Price of a single electric machine
|
87
|
+
- lrem (USD/MMH) Maintenance labor rate for electric machine(s)
|
88
|
+
- speml (USD) Spare Parts Cost Line Maintenance electric machine
|
89
|
+
- spemb (USD) Spare Parts Cost Base Maintenance electric machine (If not known -> Assumption: spemb = 9.5*speml)
|
90
|
+
- tleml (MMH) Maintenance man-hour for line maintenance electric machine(s) [hours]
|
91
|
+
- tlemb (MMH) Maintenance man-hour for base maintenance electric machine(s) [hours]
|
92
|
+
- f_eml (times/YR) Maintenance frequency for electric machine(s) Line Maint.
|
93
|
+
- f_emb (times/BH) Maintenance frequency for electric machine(s) Base Maint.
|
94
|
+
|
95
|
+
- enerpri (USD/kWh) Electricity price
|
96
|
+
- ener_req (kWh) Electricity Requirement (from battery)
|
97
|
+
- h2_pri (USD/kg) H2 price
|
98
|
+
- h2_req (kg) H2 requirements
|
99
|
+
|
100
|
+
"""
|
101
|
+
self.aircraft = _assign_input(input=aircraft)
|
102
|
+
self._params = params
|
103
|
+
|
104
|
+
return None
|
105
|
+
|
106
|
+
def calculate_doc(self) -> Dict[str, float]:
|
107
|
+
|
108
|
+
bt = self.aircraft["bt"]
|
109
|
+
financial = self._calculate_financial_cost()
|
110
|
+
operating = self._calculate_cash_operating_cost()
|
111
|
+
|
112
|
+
doc_total = sum(financial.values()) + sum(operating.values())
|
113
|
+
|
114
|
+
return {
|
115
|
+
**financial,
|
116
|
+
**operating,
|
117
|
+
"DOC [USD/BHR]": doc_total,
|
118
|
+
"DOC [USD/flight]": bt * doc_total,
|
119
|
+
}
|
120
|
+
|
121
|
+
def calculate_ioc(self) -> Dict[str, float]:
|
122
|
+
|
123
|
+
ioc_factor = self.aircraft["ioc_fact"]
|
124
|
+
bt = self.aircraft["bt"]
|
125
|
+
operating_cost = self._calculate_cash_operating_cost()
|
126
|
+
ioc_bhr = ioc_factor * sum(operating_cost.values())
|
127
|
+
|
128
|
+
return {
|
129
|
+
"IOC [USD/BHR]": ioc_bhr,
|
130
|
+
"IOC [USD/flight]": bt * ioc_bhr,
|
131
|
+
}
|
132
|
+
|
133
|
+
def _calculate_cash_operating_cost(self) -> Dict[str, float]:
|
134
|
+
|
135
|
+
fuel = self._calculate_fuel_cost()
|
136
|
+
electric_energy = self._calculate_electric_energy_price()
|
137
|
+
h2 = self._calculate_h2_price()
|
138
|
+
cockpit_crew = self._calculate_cockpit_crew_cost()
|
139
|
+
cabin_crew = self._calculate_cabin_crew_cost()
|
140
|
+
landing_fees = self._calculate_landing_fees()
|
141
|
+
nav_charges = self._calculate_navigation_charges()
|
142
|
+
ground_charges = self._calculate_ground_handling_charges()
|
143
|
+
noise_charges = self._calculate_noise_charges()
|
144
|
+
airframe_maintenance = self._calculate_airframe_maintenance_cost()
|
145
|
+
thermal_engine_maintenance = self._calculate_thermal_engine_maintenance_cost()
|
146
|
+
nox_emission_charges = self._calculate_nox_emission_charges()
|
147
|
+
co_emission_charges = self._calculate_co_emission_charges()
|
148
|
+
co2_emission_charges = self._calculate_co2_emission_charges()
|
149
|
+
|
150
|
+
electric_machine_maint_line, electric_machine_maint_base = self._calculate_electric_machine_maintenance_cost()
|
151
|
+
battery_maint_line, battery_maint_base = self._calculate_battery_maintenance_cost()
|
152
|
+
fuelcell_maint_line, fuelcell_maint_base = self._calculate_fuel_cell_maintenance_cost()
|
153
|
+
power_elec_maint_line, power_elec_maint_base = self._calculate_power_electronic_maintenance_cost()
|
154
|
+
|
155
|
+
return {
|
156
|
+
"FUEL [USD/BHR]": fuel,
|
157
|
+
"ELECTRYCITY [USD/BHR]": electric_energy,
|
158
|
+
"H2 [USD/BHR]": h2,
|
159
|
+
"COCKPIT CREW [USD/BHR]": cockpit_crew,
|
160
|
+
"CABIN CREW [USD/BHR]": cabin_crew,
|
161
|
+
"LANDING FEES [USD/BHR]": landing_fees,
|
162
|
+
"NAVIGATION CHARGES [USD/BHR]": nav_charges,
|
163
|
+
"GROUND HANDLING [USD/BHR]": ground_charges,
|
164
|
+
"NOISE CHARGES [USD/BHR]": noise_charges,
|
165
|
+
"NOX EMISSION CHARGES [USD/BHR]": nox_emission_charges,
|
166
|
+
"CO EMISSION CHARGES [USD/BHR]": co_emission_charges,
|
167
|
+
"CO2 EMISSION CHARGES [USD/BHR]": co2_emission_charges,
|
168
|
+
"AIRFRANE MAINTENANCE [USD/BHR]": airframe_maintenance,
|
169
|
+
"THERM. ENG. MAINTENANCE [USD/BH]": thermal_engine_maintenance,
|
170
|
+
"ELECTRIC MACHINE LINE MAINT. [USD/BH]": electric_machine_maint_line,
|
171
|
+
"ELECTRIC MACHINE BASE MAINT. [USD/BH]": electric_machine_maint_base,
|
172
|
+
"BATTERY LINE MAINT. [USD/BH]": battery_maint_line,
|
173
|
+
"BATTERY BASE MAINT. [USD/BH]": battery_maint_base,
|
174
|
+
"FUEL CELL LINE MAINT. [USD/BH]": fuelcell_maint_line,
|
175
|
+
"FUEL CELL BASE MAINT. [USD/BH]": fuelcell_maint_base,
|
176
|
+
"POWER ELECTR. LINE MAINT. [USD/BH]": power_elec_maint_line,
|
177
|
+
"POWER ELECTR. BASE MAINT. [USD/BH]": power_elec_maint_base
|
178
|
+
}
|
179
|
+
|
180
|
+
def _calculate_financial_cost(self) -> Dict[str, float]:
|
181
|
+
return {
|
182
|
+
"INSURANCE [USD/BHR]": self._calculate_insurance_cost(),
|
183
|
+
"DEPRECIATION [USD/BHR]": self._calculate_depreciation(),
|
184
|
+
"INTEREST [USD/BHR]": self._calculate_interest()
|
185
|
+
}
|
186
|
+
|
187
|
+
def _calculate_co2_emission_charges(self) -> float:
|
188
|
+
co2_value = self.aircraft["co2_value"]
|
189
|
+
prico2 = self.aircraft["prico2"]
|
190
|
+
bt = self.aircraft["bt"]
|
191
|
+
|
192
|
+
return (1.0-self._params.AEC)*co2_value*prico2/bt
|
193
|
+
|
194
|
+
def _calculate_battery_maintenance_cost(self) -> Tuple[float, float]:
|
195
|
+
n_bat = self.aircraft["n_bat"]
|
196
|
+
n_repbat = self.aircraft["n_repbat"]
|
197
|
+
batprice = self.aircraft["batprice"]
|
198
|
+
rvbat = self.aircraft["rvbat"]
|
199
|
+
lrbat = self.aircraft["lrbat"]
|
200
|
+
tlbat = self.aircraft["tlbat"]
|
201
|
+
f_bat = self.aircraft["f_bat"]
|
202
|
+
lifespan = self.aircraft["lifespan"]
|
203
|
+
util = self.aircraft["util"]
|
204
|
+
|
205
|
+
battery_maint_line = n_bat*lrbat*tlbat*f_bat
|
206
|
+
battery_maint_base = n_bat*(n_repbat*(batprice-rvbat))/(lifespan*util) # replace
|
207
|
+
return battery_maint_line, battery_maint_base
|
208
|
+
|
209
|
+
def _calculate_fuel_cell_maintenance_cost(self) -> Tuple[float, float]:
|
210
|
+
n_fc = self.aircraft["n_fc"]
|
211
|
+
n_repfc = self.aircraft["n_repfc"]
|
212
|
+
fcprice = self.aircraft["fcprice"]
|
213
|
+
rvfc = self.aircraft["rvfc"]
|
214
|
+
lrfc = self.aircraft["lrfc"]
|
215
|
+
tlfc = self.aircraft["tlfc"]
|
216
|
+
f_fc = self.aircraft["f_fc"]
|
217
|
+
lifespan = self.aircraft["lifespan"]
|
218
|
+
util = self.aircraft["util"]
|
219
|
+
|
220
|
+
fuel_cell_maint_line = n_fc*lrfc*tlfc*f_fc
|
221
|
+
fuel_cell_maint_base = n_fc*(n_repfc*(fcprice-rvfc))/(lifespan*util) # replace
|
222
|
+
return fuel_cell_maint_line, fuel_cell_maint_base
|
223
|
+
|
224
|
+
def _calculate_power_electronic_maintenance_cost(self) -> Tuple[float, float]:
|
225
|
+
n_reppe = self.aircraft["n_reppe"]
|
226
|
+
peprice = self.aircraft["peprice"]
|
227
|
+
rvpe = self.aircraft["rvpe"]
|
228
|
+
lrpe = self.aircraft["lrpe"]
|
229
|
+
tlpe = self.aircraft["tlpe"]
|
230
|
+
f_pe = self.aircraft["f_pe"]
|
231
|
+
lifespan = self.aircraft["lifespan"]
|
232
|
+
util = self.aircraft["util"]
|
233
|
+
|
234
|
+
power_electronic_maint_line = lrpe*tlpe*f_pe
|
235
|
+
power_electronic_maint_base = (n_reppe*(peprice-rvpe))/(lifespan*util) # replace
|
236
|
+
return power_electronic_maint_line, power_electronic_maint_base
|
237
|
+
|
238
|
+
def _calculate_electric_machine_maintenance_cost(self) -> Tuple[float, float]:
|
239
|
+
n_em = self.aircraft["n_em"]
|
240
|
+
speml = self.aircraft["speml"] # spare parts cost line maintenance
|
241
|
+
spemb = self.aircraft["spemb"] # spare parts cost base maintenance
|
242
|
+
lrem = self.aircraft["lrem"]
|
243
|
+
tleml = self.aircraft["tleml"] # maintenance man hour line maint.
|
244
|
+
tlemb = self.aircraft["tlemb"] # maintenance man hour base maint.
|
245
|
+
f_eml = self.aircraft["f_eml"] # maintenance frequency line maint
|
246
|
+
f_emb = self.aircraft["f_emb"] # maintenance frequency base maint
|
247
|
+
lifespan = self.aircraft["lifespan"]
|
248
|
+
util = self.aircraft["util"]
|
249
|
+
|
250
|
+
electric_machine_maint_line = n_em*(speml + lrem*tleml)*lifespan*f_eml/util
|
251
|
+
electric_machine_maint_base = n_em*(spemb + lrem*tlemb)*f_emb*0.80
|
252
|
+
return electric_machine_maint_line, electric_machine_maint_base
|
253
|
+
|
254
|
+
def _calculate_airframe_maintenance_cost(self) -> float:
|
255
|
+
n_bat = self.aircraft["n_bat"]
|
256
|
+
n_em = self.aircraft["n_em"]
|
257
|
+
n_fc = self.aircraft["n_fc"]
|
258
|
+
batprice = self.aircraft["batprice"]
|
259
|
+
fcprice = self.aircraft["fcprice"]
|
260
|
+
emprice = self.aircraft["emprice"]
|
261
|
+
bt = self.aircraft["bt"]
|
262
|
+
adp = self.aircraft["adp"]
|
263
|
+
en = self.aircraft["en"]
|
264
|
+
enpri = self.aircraft["enpri"]
|
265
|
+
mew = self.aircraft["mew"]
|
266
|
+
bengw = self.aircraft["bengw"]
|
267
|
+
labor_rate = self.aircraft["labor_rate"]
|
268
|
+
|
269
|
+
FT = bt - self.FLIGHT_TIME_OFFSET
|
270
|
+
AFW = mew-(bengw*en)
|
271
|
+
|
272
|
+
C_A_FH = 3.08*(adp - en*enpri - n_bat*batprice/1.0e6 - n_em*emprice/1.0e6 - n_fc*fcprice/1.0e6)
|
273
|
+
C_A_FC = 6.24*(adp - en*enpri - n_bat*batprice/1.0e6 - n_em*emprice/1.0e6 - n_fc*fcprice/1.0e6)
|
274
|
+
K_A_FC = 0.05*AFW*2.2 + 6 - 630.0/(AFW*2.2 + 120.0)
|
275
|
+
K_A_FH = 0.59*K_A_FC
|
276
|
+
|
277
|
+
airframe_labor_cost = (K_A_FH*FT + K_A_FC)*labor_rate*math.sqrt(self.MACH_NUMBER_FACTOR)/bt
|
278
|
+
airframe_material_cost = (C_A_FH*FT + C_A_FC)/bt
|
279
|
+
|
280
|
+
return airframe_material_cost + airframe_labor_cost
|
281
|
+
|
282
|
+
def _calculate_thermal_engine_maintenance_cost(self) -> float:
|
283
|
+
ieng = self.aircraft["ieng"]
|
284
|
+
en = self.aircraft["en"]
|
285
|
+
|
286
|
+
if ieng == 1:
|
287
|
+
bt = self.aircraft["bt"]
|
288
|
+
labor_rate = self.aircraft["labor_rate"]
|
289
|
+
shp = self.aircraft["shp"]
|
290
|
+
enpri = self.aircraft["enpri"]
|
291
|
+
|
292
|
+
FT = bt - self.FLIGHT_TIME_OFFSET
|
293
|
+
K_ICE_FC = (0.3 + 0.03*shp/1000.0)*en
|
294
|
+
K_ICE_FH = (0.65 + 0.03*shp/1000.0)*en
|
295
|
+
C_ICE_FC = 2.0*en*enpri*10.0
|
296
|
+
C_ICE_FH = 2.5*en*enpri*10.0
|
297
|
+
|
298
|
+
thermal_engine_labor_cost = (K_ICE_FH*FT + K_ICE_FC)*labor_rate/bt
|
299
|
+
thermal_engine_material_cost = (C_ICE_FH*FT + C_ICE_FC)/bt
|
300
|
+
|
301
|
+
thermal_engine_maintenance_cost = thermal_engine_material_cost + thermal_engine_labor_cost
|
302
|
+
|
303
|
+
elif ieng == 2:
|
304
|
+
eoc = self.aircraft["eoc"]
|
305
|
+
|
306
|
+
thermal_engine_maintenance_cost = eoc*en
|
307
|
+
|
308
|
+
else:
|
309
|
+
raise ValueError(f"ieng Value {ieng} not valid")
|
310
|
+
|
311
|
+
return thermal_engine_maintenance_cost
|
312
|
+
|
313
|
+
def _calculate_nox_emission_charges(self) -> float:
|
314
|
+
cnox = self.aircraft["cnox"]
|
315
|
+
nox_value = self.aircraft["nox_value"]
|
316
|
+
bt = self.aircraft["bt"]
|
317
|
+
|
318
|
+
return (cnox*nox_value)/bt
|
319
|
+
|
320
|
+
def _calculate_co_emission_charges(self) -> float:
|
321
|
+
cco = self.aircraft["cco"]
|
322
|
+
co_value = self.aircraft["co_value"]
|
323
|
+
bt = self.aircraft["bt"]
|
324
|
+
|
325
|
+
return (cco*co_value)/bt
|
326
|
+
|
327
|
+
def _calculate_noise_charges(self) -> float:
|
328
|
+
ta = self._params.TA
|
329
|
+
td = self._params.TD
|
330
|
+
cnoise = self._params.CNOISE
|
331
|
+
|
332
|
+
l_app = self.aircraft["l_app"]
|
333
|
+
l_flyov = self.aircraft["l_flyov"]
|
334
|
+
l_lat = self.aircraft["l_lat"]
|
335
|
+
bt = self.aircraft["bt"]
|
336
|
+
|
337
|
+
DELTAA = (l_app-ta)/10.0
|
338
|
+
DELTAD = (((l_flyov+l_lat)/2.0)-td)/10.0
|
339
|
+
|
340
|
+
return (cnoise*(10.0**(DELTAA)+10.0**(DELTAD)))/bt
|
341
|
+
|
342
|
+
def _calculate_ground_handling_charges(self) -> float:
|
343
|
+
pld = self.aircraft["pld"]
|
344
|
+
bt = self.aircraft["bt"]
|
345
|
+
|
346
|
+
return (self._params.HTONN*pld)/bt
|
347
|
+
|
348
|
+
def _calculate_navigation_charges(self) -> float:
|
349
|
+
mtow = self.aircraft["mtow"]
|
350
|
+
bt = self.aircraft["bt"]
|
351
|
+
sector = self.aircraft["sector"]
|
352
|
+
|
353
|
+
return (self._params.ENR*sector*1.853/100.0)*math.sqrt(mtow/50.0)/bt
|
354
|
+
|
355
|
+
def _calculate_landing_fees(self) -> float:
|
356
|
+
mtow = self.aircraft["mtow"]
|
357
|
+
bt = self.aircraft["bt"]
|
358
|
+
|
359
|
+
return (self._params.LANDINGUR*mtow)/bt
|
360
|
+
|
361
|
+
def _calculate_cabin_crew_cost(self) -> float:
|
362
|
+
crcabhr = self.aircraft["crcabhr"]
|
363
|
+
crewc = self.aircraft["crewc"]
|
364
|
+
|
365
|
+
return crcabhr*crewc
|
366
|
+
|
367
|
+
def _calculate_cockpit_crew_cost(self) -> float:
|
368
|
+
crtechr = self.aircraft["crtechr"]
|
369
|
+
crewtech = self.aircraft["crewtech"]
|
370
|
+
|
371
|
+
return crtechr*crewtech
|
372
|
+
|
373
|
+
def _calculate_h2_price(self) -> None:
|
374
|
+
h2_pri = self.aircraft["h2_pri"]
|
375
|
+
h2_req = self.aircraft["h2_req"]
|
376
|
+
bt = self.aircraft["bt"]
|
377
|
+
|
378
|
+
return h2_pri*h2_req/bt
|
379
|
+
|
380
|
+
def _calculate_electric_energy_price(self) -> None:
|
381
|
+
enerpri = self.aircraft["enerpri"]
|
382
|
+
ener_req = self.aircraft["ener_req"]
|
383
|
+
bt = self.aircraft["bt"]
|
384
|
+
|
385
|
+
return ener_req*enerpri/bt
|
386
|
+
|
387
|
+
def _calculate_fuel_cost(self) -> float:
|
388
|
+
fuelpri = self.aircraft["fuelpri"]
|
389
|
+
bf = self.aircraft["bf"]
|
390
|
+
bt = self.aircraft["bt"]
|
391
|
+
|
392
|
+
return (0.328*fuelpri*bf)/bt
|
393
|
+
|
394
|
+
def _calculate_insurance_cost(self) -> float:
|
395
|
+
rinsh = self.aircraft["rinsh"]
|
396
|
+
adp = self.aircraft["adp"]*1.0e6
|
397
|
+
util = self.aircraft["util"]
|
398
|
+
|
399
|
+
return (rinsh*adp)/util
|
400
|
+
|
401
|
+
def _calculate_investment(self) -> float:
|
402
|
+
adp = self.aircraft["adp"]*1.0e6
|
403
|
+
afspare = self.aircraft["afspare"]
|
404
|
+
enpri = self.aircraft["enpri"]
|
405
|
+
en = self.aircraft["en"]
|
406
|
+
enspare = self.aircraft["enspare"]
|
407
|
+
|
408
|
+
return adp+(afspare*(adp-enpri*en))+(enspare*enpri*en)
|
409
|
+
|
410
|
+
def _calculate_interest(self) -> float:
|
411
|
+
util = self.aircraft["util"]
|
412
|
+
|
413
|
+
INVEST = self._calculate_investment()
|
414
|
+
|
415
|
+
return (self._params.INTEREST_RATE*INVEST)/util
|
416
|
+
|
417
|
+
def _calculate_depreciation(self) -> float:
|
418
|
+
rval = self.aircraft["rval"]
|
419
|
+
dyrs = self.aircraft["dyrs"]
|
420
|
+
util = self.aircraft["util"]
|
421
|
+
|
422
|
+
INVEST = self._calculate_investment()
|
423
|
+
|
424
|
+
return ((1-rval)*INVEST)/(dyrs*util)
|
@@ -0,0 +1 @@
|
|
1
|
+
from .DOC_Calculator import DirectOperatingCost
|
File without changes
|
@@ -0,0 +1,97 @@
|
|
1
|
+
from dataclasses import dataclass
|
2
|
+
|
3
|
+
@dataclass
|
4
|
+
class Params():
|
5
|
+
"""
|
6
|
+
### Description
|
7
|
+
The dataclass stores the main unit rates and constants necessary to conduct
|
8
|
+
a cost analysis
|
9
|
+
|
10
|
+
- AEC: Portion of free allocated certificate for CO2 emissions.
|
11
|
+
- ENR: Enroute navigation charges unit rate.
|
12
|
+
- INTEREST_RATE: annual interest rate
|
13
|
+
- LANDINGUR: Landing charge unit rate.
|
14
|
+
- HTONN: Coefficient of cost of handling per tonn of payload
|
15
|
+
- CNOISE: Unit noise rate (Noise tariff that depends on the airport) (USD)
|
16
|
+
- TA : Arrival airport threshold noise (EPNdB)
|
17
|
+
- TD: Departure airport threshold noise (EPNdB)
|
18
|
+
"""
|
19
|
+
|
20
|
+
AEC: float = 0.15
|
21
|
+
ENR: float = 68.5
|
22
|
+
INTEREST_RATE = 0.053
|
23
|
+
LANDINGUR: float = 10.0
|
24
|
+
HTONN: float = 45.0
|
25
|
+
CNOISE: float = 4.15
|
26
|
+
TA: float = 89.0
|
27
|
+
TD: float = 92.0
|
28
|
+
|
29
|
+
default_dict = {"ADP": 0.0,
|
30
|
+
"MTOW": 0.0,
|
31
|
+
"PLD": 0.,
|
32
|
+
"MEW": 0.0,
|
33
|
+
"BENGW": 0.0,
|
34
|
+
"ENPRI": 0.0,
|
35
|
+
"EN": 0.0,
|
36
|
+
"CREWTECH": 0.0,
|
37
|
+
"CREWC": 0.0,
|
38
|
+
"BT": 1.0,
|
39
|
+
"BF": 0.0,
|
40
|
+
"SECTOR": 0.0,
|
41
|
+
"IENG": 1.0,
|
42
|
+
"SHP": 0.0,
|
43
|
+
"AFSPARE": 0.0,
|
44
|
+
"ENSPARE": 0.0,
|
45
|
+
"DYRS": 1.0,
|
46
|
+
"RVAL": 0.0,
|
47
|
+
"RINSH": 0.0,
|
48
|
+
"CRTECHR": 0.0,
|
49
|
+
"CRCABHR": 0.0,
|
50
|
+
"LABOR_RATE": 0.0,
|
51
|
+
"FUELPRI": 0.0,
|
52
|
+
"IOC_FACT": 0.0,
|
53
|
+
"UTIL": 1.0,
|
54
|
+
"LIFESPAN": 1.0,
|
55
|
+
"L_APP": 0.0,
|
56
|
+
"L_LAT": 0.0,
|
57
|
+
"L_FLYOV": 0.0,
|
58
|
+
"CNOX": 0.0,
|
59
|
+
"NOX_VALUE":0.0,
|
60
|
+
"CCO": 0.0,
|
61
|
+
"CO_VALUE": 0.0,
|
62
|
+
"PRICO2": 0.0,
|
63
|
+
"CO2_VALUE": 0.0,
|
64
|
+
"ENERPRI": 0.0,
|
65
|
+
"ENER_REQ": 0.0,
|
66
|
+
"H2_PRI": 0.0,
|
67
|
+
"H2_REQ": 0.0,
|
68
|
+
"N_BAT": 0.0,
|
69
|
+
"N_FC": 0.0,
|
70
|
+
"N_REPBAT": 0.0,
|
71
|
+
"BATPRICE": 0.0,
|
72
|
+
"RVBAT": 0.0,
|
73
|
+
"LRBAT": 0.0,
|
74
|
+
"TLBAT": 0.0,
|
75
|
+
"F_BAT": 0.0,
|
76
|
+
"N_REPFC": 0.0,
|
77
|
+
"FCPRICE": 0.0,
|
78
|
+
"RVFC": 0.0,
|
79
|
+
"LRFC": 0.0,
|
80
|
+
"TLFC": 0.0,
|
81
|
+
"F_FC": 0.0,
|
82
|
+
"N_REPPE": 0.0,
|
83
|
+
"PEPRICE": 0.0,
|
84
|
+
"RVPE": 0.0,
|
85
|
+
"LRPE": 0.0,
|
86
|
+
"TLPE": 0.0,
|
87
|
+
"F_PE": 0.0,
|
88
|
+
"N_EM": 0.0,
|
89
|
+
"EMPRICE": 0.0,
|
90
|
+
"LREM": 0.0,
|
91
|
+
"SPEML": 0.0,
|
92
|
+
"SPEMB": 0.0,
|
93
|
+
"TLEML": 0.0,
|
94
|
+
"TLEMB": 0.0,
|
95
|
+
"F_EML": 0.0,
|
96
|
+
"F_EMB": 0.0
|
97
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
from .params import default_dict as dt
|
2
|
+
|
3
|
+
def _assign_input(input:dict) -> dict:
|
4
|
+
default_dict = {k.lower(): v for k, v in dt.items()}
|
5
|
+
input = {k.lower(): v for k, v in input.items()}
|
6
|
+
|
7
|
+
for key, value in default_dict.items():
|
8
|
+
if key in input:
|
9
|
+
default_dict[key] = input[key]
|
10
|
+
|
11
|
+
return default_dict
|
@@ -0,0 +1,54 @@
|
|
1
|
+
from gemseo.core.discipline.discipline import Discipline
|
2
|
+
from ..core import DirectOperatingCost
|
3
|
+
from ..core.utils.params import Params
|
4
|
+
from .utils.utils_functions import create_default_gemseo_grammar
|
5
|
+
import numpy as np
|
6
|
+
|
7
|
+
|
8
|
+
class GemseoDirectOperatingCost(Discipline):
|
9
|
+
|
10
|
+
def __init__(self, name="DOC_Calculator", **kwargs):
|
11
|
+
super().__init__(name)
|
12
|
+
|
13
|
+
# define input grammar
|
14
|
+
self.input_grammar.update_from_data(create_default_gemseo_grammar())
|
15
|
+
|
16
|
+
# define output grammar
|
17
|
+
self.output_grammar.update_from_names(["DOC", "IOC", "TOC"])
|
18
|
+
|
19
|
+
# define default data
|
20
|
+
self.default_input_data = create_default_gemseo_grammar()
|
21
|
+
|
22
|
+
# read kwargs params
|
23
|
+
if kwargs:
|
24
|
+
self._params = kwargs["params"]
|
25
|
+
else:
|
26
|
+
self._params = Params()
|
27
|
+
|
28
|
+
def _run(self, input_data):
|
29
|
+
|
30
|
+
# create DOC class aircraft dict
|
31
|
+
aircraft = {}
|
32
|
+
|
33
|
+
for key, value in input_data.items():
|
34
|
+
aircraft[key] = value[0]
|
35
|
+
|
36
|
+
# instance of the DOC class
|
37
|
+
doc_calc_object = DirectOperatingCost(aircraft, params=self._params)
|
38
|
+
|
39
|
+
# DOC [USD/flight]
|
40
|
+
direct_operating_cost = doc_calc_object.calculate_doc()
|
41
|
+
|
42
|
+
# IOC [USD/flight]
|
43
|
+
indirect_operating_cost = doc_calc_object.calculate_ioc()
|
44
|
+
|
45
|
+
direct_operating_cost_per_flight = direct_operating_cost["DOC [USD/flight]"]
|
46
|
+
indirect_operating_cost_per_flight = indirect_operating_cost["IOC [USD/flight]"]
|
47
|
+
total_operating_cost_per_flight = direct_operating_cost_per_flight + indirect_operating_cost_per_flight
|
48
|
+
|
49
|
+
# write output
|
50
|
+
return {
|
51
|
+
"DOC": np.array([direct_operating_cost_per_flight]),
|
52
|
+
"IOC": np.array([indirect_operating_cost_per_flight]),
|
53
|
+
"TOC": np.array([total_operating_cost_per_flight])
|
54
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
from .DOC_Calculator import GemseoDirectOperatingCost
|
File without changes
|
@@ -0,0 +1,10 @@
|
|
1
|
+
from doc_calculator.core.utils.params import default_dict
|
2
|
+
import numpy as np
|
3
|
+
|
4
|
+
def create_default_gemseo_grammar() -> dict:
|
5
|
+
default_grammar_dict = {}
|
6
|
+
|
7
|
+
for key, value in default_dict.items():
|
8
|
+
default_grammar_dict[key] = np.array([value])
|
9
|
+
|
10
|
+
return default_grammar_dict
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 Michele Tuccillo
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
doc_calculator/__init__.py,sha256=l24hn9jSD9FBynMc19l8v8OmxNLKQdKiawL8nbqe8hA,95
|
2
|
+
doc_calculator/core/DOC_Calculator.py,sha256=7SPq6GayIm5EP6xwiGnaJ2ReqfdF290yLqCZRg7xb7k,20068
|
3
|
+
doc_calculator/core/__init__.py,sha256=ZceJPuJOipP9v84b1sloJGHXppCEcPzElwHw7liG7yA,47
|
4
|
+
doc_calculator/core/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
+
doc_calculator/core/utils/params.py,sha256=FS99-wK_O4-8vXKozPfsk67F6tLVRg_ekAxKehvU5dU,2472
|
6
|
+
doc_calculator/core/utils/util_functions.py,sha256=jjPIs-shUAye2hgalqB1rancJ4FPtyRzl0XvXRB_7YI,345
|
7
|
+
doc_calculator/gemseo_discipline/DOC_Calculator.py,sha256=hgnZ7eOqNNh34NeehY6c5VEmjzdoVFlryxTi_dUl_XY,1909
|
8
|
+
doc_calculator/gemseo_discipline/__init__.py,sha256=lwTMrOr2oUeNTElP14atth9NdxyG6Qr1tUV2231YqBM,53
|
9
|
+
doc_calculator/gemseo_discipline/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
|
+
doc_calculator/gemseo_discipline/utils/utils_functions.py,sha256=kSaSP2FFllAjw7FI87KEb_IUfJ1uKVVVeREPVJufUKQ,295
|
11
|
+
doc_calculator-0.2.dist-info/LICENSE,sha256=0hLLMdm78mvfi_SZni23FLSVq0vYbvmRuLPUwy6Gc7I,1094
|
12
|
+
doc_calculator-0.2.dist-info/METADATA,sha256=x8Q2LEF1h0Ozi6DYcKh87GhVv3apkziOjOjYihDt6Jg,129
|
13
|
+
doc_calculator-0.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
14
|
+
doc_calculator-0.2.dist-info/top_level.txt,sha256=dTASglOF0CjM5b8VIFNUVVa3wXtrMNXgEwQ4l8wtrss,15
|
15
|
+
doc_calculator-0.2.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
doc_calculator
|