Skip to content

CostSavings

Fleet electrification economic savings calculator.

The CostSavings class estimates annual operating cost savings resulting from the transition of diesel vehicles to electric vehicles (EVs), based on fleet operation data and energy price assumptions.

The analysis compares: - Diesel fuel costs under conventional operation - Electricity costs under full electrification

Savings are computed at the trip and vehicle level and aggregated to annual values using a specified number of active working days.

Workflow
  1. Load fleet operation data containing trip distances.
  2. Annualize traveled distance using active working days.
  3. Compute diesel cost baseline.
  4. Compute EV electricity costs (corrected for charging efficiency).
  5. Estimate economic savings.
  6. Export results and summary statistics.
Notes
  • Energy prices are assumed constant over the analysis period.
  • No maintenance, depreciation, or capital expenditure is included.
  • EV and diesel vehicles are assumed operationally equivalent.
  • Results represent potential operational savings only.

Attributes:

Name Type Description
input_file str

Path to CSV file containing fleet operation data.

active_working_days int

Number of operational days per year.

ev_consumption float

EV electricity consumption (kWh/km).

charging_efficiency float

Charging efficiency (0–1).

electricity_price float

Electricity price (currency/kWh).

diesel_consumption float

Diesel fuel consumption (L/km).

diesel_price float

Diesel fuel price (currency/L).

data DataFrame

Raw input fleet operation data.

results DataFrame

Computed economic savings per trip and vehicle.

Examples:

>>> calculator = CostSavings(
...     input_file="Mobility_fleet_operation.csv",
...     active_working_days=260,
...     ev_consumption=0.39,
...     charging_efficiency=0.9,
...     electricity_price=0.3,
...     diesel_consumption=0.1,
...     diesel_price=1.385,
... )
>>> calculator.compute_savings()
>>> calculator.save_results("economic_savings_results.csv")
>>> calculator.print_summary()

Functions

__init__(input_file, active_working_days=260, ev_consumption=0.39, charging_efficiency=0.9, electricity_price=0.3, diesel_consumption=0.1, diesel_price=1.385)

Initialize the economic savings calculator.

This constructor registers all required input parameters but does not perform any computation. Calculations are triggered by calling compute_savings().

Parameters:

Name Type Description Default
input_file str

Path to CSV file containing fleet operation data. The file must include at least: - vehicle_id - trip_id - total_distance_km

required
active_working_days int

Number of active operating days per year. Defaults to 260.

260
ev_consumption float

EV electricity consumption in kWh per km. Defaults to 0.39.

0.39
charging_efficiency float

Charging efficiency as a fraction (0–1). Defaults to 0.9.

0.9
electricity_price float

Electricity price in currency per kWh. Defaults to 0.3.

0.3
diesel_consumption float

Diesel fuel consumption in liters per km. Defaults to 0.1.

0.1
diesel_price float

Diesel fuel price in currency per liter. Defaults to 1.385.

1.385

compute_savings()

Compute annual economic savings from fleet electrification.

This method: - Loads fleet operation data from the input CSV file - Annualizes traveled distance using active working days - Computes diesel fuel costs - Computes EV electricity costs corrected for charging efficiency - Calculates net operating cost savings

Results are stored internally and made available via the results attribute.

print_summary()

Print summary statistics of economic savings.

The summary includes: - Average economic savings per vehicle - Total economic savings across the fleet

Raises:

Type Description
RuntimeError

If compute_savings() has not been called.

save_results(output_file)

Save computed economic savings to a CSV file.

Parameters:

Name Type Description Default
output_file str

Path to the output CSV file.

required

Raises:

Type Description
RuntimeError

If compute_savings() has not been called.