CO2Savings¶
Fleet electrification CO₂ emissions and diesel fuel savings calculator.
The CO2Savings class estimates annual CO₂ emission reductions and
diesel fuel savings resulting from the replacement of diesel vehicles
with electric vehicles (EVs), based on fleet operation data.
The calculation is performed at the trip and vehicle level and assumes a full substitution of diesel operation by electric driving over a defined number of active working days per year.
Workflow
- Load fleet operation data containing trip distances.
- Annualize traveled distance using active working days.
- Compute diesel baseline emissions.
- Compute EV-related emissions from electricity consumption.
- Estimate CO₂ emission reductions and diesel fuel savings.
- Export results and summary statistics.
Notes
- Emission factors are assumed constant over time.
- EV electricity consumption is corrected for charging efficiency.
- No vehicle-specific efficiency differences are modeled.
- Results represent potential annual savings, not measured values.
- Upstream vehicle manufacturing emissions are not included.
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_co2_intensity |
float
|
Electricity CO₂ intensity (kgCO₂/kWh). |
diesel_consumption |
float
|
Diesel fuel consumption (L/km). |
diesel_co2_intensity |
float
|
Diesel CO₂ intensity (kgCO₂/L). |
data |
DataFrame
|
Raw input fleet data. |
results |
DataFrame
|
Computed emission reductions and fuel savings. |
Examples:
>>> calculator = CO2Savings(
... input_file="mobility_fleet_operation.csv",
... active_working_days=260,
... ev_consumption=0.39,
... charging_efficiency=0.9,
... electricity_co2_intensity=0.1,
... diesel_consumption=0.1,
... diesel_co2_intensity=2.7,
... )
>>> calculator.compute_savings()
>>> calculator.save_results("co2_savings_results.csv")
>>> calculator.print_summary()
Functions¶
__init__(input_file, active_working_days=260, ev_consumption=0.39, charging_efficiency=0.9, electricity_co2_intensity=0.1, diesel_consumption=0.1, diesel_co2_intensity=2.7)
¶
Initialize the CO₂ emissions and diesel savings calculator.
This constructor registers all 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_co2_intensity
|
float
|
CO₂ intensity of electricity in kgCO₂/kWh. Defaults to 0.1. |
0.1
|
diesel_consumption
|
float
|
Diesel fuel consumption in liters per km. Defaults to 0.1. |
0.1
|
diesel_co2_intensity
|
float
|
CO₂ intensity of diesel fuel in kgCO₂ per liter. Defaults to 2.7. |
2.7
|
compute_savings()
¶
Compute annual CO₂ emission reductions and diesel fuel savings.
This method: - Loads fleet operation data from the input CSV file - Annualizes traveled distance using active working days - Computes diesel baseline emissions - Computes EV-related emissions from electricity use - Calculates emission reductions and diesel savings
Results are stored internally and made available via the
results attribute.
print_summary()
¶
Print summary statistics of emission reductions and diesel savings.
The summary includes: - Average CO₂ emission reduction per vehicle - Total CO₂ emission reduction - Average diesel fuel savings per vehicle - Total diesel fuel savings
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If |
save_results(output_file)
¶
Save computed results to a CSV file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_file
|
str
|
Path to the output CSV file. |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If |