Skip to main content

load_parameters

Reads an Excel workbook and returns a flat parameter dictionary plus lookup-table arrays.
str
required
Path to the Excel workbook. Must contain sheets named Parameters, Lookup_Crews, and Lookup_Speed.
Returns Dict[str, Any] — all scalar parameters from the Parameters sheet, plus:

calculate_annual_costs

Core computation. Derives all 40+ cost components from the parameter dictionary.
Dict[str, Any]
required
Parameter dictionary returned by load_parameters.
Returns an AnnualCosts dataclass with every field populated except the optional life cycle fields (time_series, cumulative_costs, Life_Cycle_Total_Cost, Revenue_CASM, Fare_per_Pax_NM).

run_simulation

Runs the ODE integration over the service life.
Dict[str, Any]
required
Parameter dictionary returned by load_parameters.
Returns a 3-tuple: State row index mapping:

calculate_metrics

High-level function that runs the full pipeline — annual costs, simulation, and revenue metrics — and returns a single enriched AnnualCosts object.
Dict[str, Any]
required
Parameter dictionary returned by load_parameters.
Returns AnnualCosts with all optional fields populated:

run_comparison

Processes multiple Excel files and assembles a comparison matrix.
List[str]
required
List of paths to Excel workbooks. Each file is processed independently — errors are caught and printed without stopping the run.
Returns a 2-tuple: DataFrame columns: Aircraft, Revenue_CASM, Fare_per_Pax_NM, Total_Annual_Costs, Life_Cycle_Total_Cost, Annual_Fixed_Costs, Annual_Variable_Costs, Aircraft_Purchase_Price, Variable_Cost_per_Hour, Aircraft_Speed, Pilots_per_Aircraft, PAX_Seats
Prints a formatted ASCII table to stdout, rows sorted by Revenue_CASM ascending.
pd.DataFrame
required
DataFrame returned by run_comparison.

create_comparison_charts

Saves three PNG files to output_dir.
pd.DataFrame
required
Summary DataFrame from run_comparison.
Dict[str, AnnualCosts]
required
Full results dict from run_comparison, used to access time series for the cumulative cost chart.
Path
required
Directory where PNGs are written. Must already exist.
Output files:

extract_aircraft_name

Parses a clean display name from an Excel filename.
str
required
File path or name, e.g. Joby_S4_Cost_Model_1500hrs.xlsx.
Returns str — strips _Cost_Model_<hours>hrs, replaces underscores with spaces. Example: "Joby S4".

AnnualCosts dataclass

All monetary values are in USD. All rate values are per flight hour unless noted.

Derived flight parameters

Acquisition

Annual fixed costs

Variable costs (per flight hour)

Totals

Optional life cycle fields

Populated by calculate_metrics() and run_simulation().

Constants