champpy.ChargingModel¶
The ChargingModel class is used to generate charging profiles based on driving profiles and user parameters.
Before using the charging model, synthetic mobility profiles must be generated using the MobModel class.
Basic workflow:
Initialize the model
ChargingModelwith synthetic mobility profilesMobProfilesConfigure charging parameters using
UserParamsChargingModelCall
generate_charging_profiles()to generate synthetic charging profilesAccess the generated
ChargingProfilesinstance
- class champpy.ChargingModel(mob_profiles)[source]¶
Model for generating charging profiles from mobility data and user parameters.
The model uses an algorithm that iterates over each time step and each vehicle to determine the charging status, energy consumption, energy stored, and missing energy based on the mobility data and user parameters. The resulting charging profiles are stored in a
ChargingProfilesobject.- Parameters:
mob_profiles (
MobProfiles) – Mobility profiles containing vehicle movement data and temporal information.
Examples
Generate charging profiles for synthetic mobility data:
from champpy import MobModel, ChargingModel, UserParamsChargingModel # Generate synthetic mobility profiles mob_model = MobModel(model_params) mob_profiles = mob_model.generate_mob_profiles(num_vehicles=100, days=7) # Create charging model charging_model = ChargingModel(mob_profiles) # Configure charging parameters charging_params = UserParamsChargingModel( energy_consumption_kwh_per_km=[0.2], battery_capacity_kwh=[60.0], charging_power_max_kw=[7.0], charging_locations=[1] # Charge at locations 1 ) # Generate charging profiles charging_profiles = charging_model.generate_charging_profiles(charging_params)
- generate_charging_profiles(user_params)[source]¶
Generate charging profiles from mobility data and charging parameters.
- Parameters:
user_params (
UserParamsChargingModel) – User-defined charging model parameters.- Returns:
Generated charging profiles including timeseries, electric vehicles, and clusters.
- Return type:
- class champpy.UserParamsChargingModel(*args, **kwargs)[source]¶
Data class to define user parameters for the charging profile generation.
This configuration class defines electric vehicle properties and charging behavior used by
ChargingModel.Examples
>>> params = UserParamsChargingModel( ... energy_consumption_kwh_per_km=[0.2], ... battery_capacity_kwh=[60.0], ... charging_power_max_kw=[11.0], ... charging_locations=[1, 2], ... temp_res=0.25, ... )
- distribute_energy_consumption: bool = True¶
If
True, distribute trip energy over all trip time steps.
- efficiency_charging: list[float]¶
Charging efficiency in the interval $(0, 1]$ per vehicle or as a scalar list.