model_timeseries
Generate timeseries for eTraGo and pypsa-eur-sec
Call order * generate_model_data_eGon2035() / generate_model_data_eGon100RE()
generate_model_data()
generate_model_data_grid_district()
load_evs_trips()
data_preprocessing()
generate_load_time_series()
write_model_data_to_db()
Notes
# TODO REWORK Share of EV with access to private charging infrastructure (flex_share) for use cases work and home are not supported by simBEV v0.1.2 and are applied here (after simulation). Applying those fixed shares post-simulation introduces small errors compared to application during simBEV’s trip generation.
Values (cf. flex_share in scenario parameters
egon.data.datasets.scenario_parameters.parameters.mobility()) were
linearly extrapolated based upon
https://nationale-leitstelle.de/wp-content/pdf/broschuere-lis-2025-2030-final.pdf
(p.92):
eGon2035: home=0.8, work=1.0
eGon100RE: home=1.0, work=1.0
- data_preprocessing(scenario_data: DataFrame, ev_data_df: DataFrame) DataFrame[source]
Filter SimBEV data to match region requirements. Duplicates profiles if necessary. Pre-calculates necessary parameters for the load time series.
- Parameters:
scenario_data (pd.Dataframe) – EV per grid district
ev_data_df (pd.Dataframe) – Trip data
- Returns:
pd.Dataframe – Trip data
- generate_load_time_series(ev_data_df: DataFrame, run_config: DataFrame, scenario_data: DataFrame) DataFrame[source]
Calculate the load time series from the given trip data. A dumb charging strategy is assumed where each EV starts charging immediately after plugging it in. Simultaneously the flexible charging capacity is calculated.
- Parameters:
ev_data_df (pd.DataFrame) – Full trip data
run_config (pd.DataFrame) – simBEV metadata: run config
scenario_data (pd.Dataframe) – EV per grid district
- Returns:
pd.DataFrame – time series of the load and the flex potential
- generate_model_data_bunch(scenario_name: str, bunch: range) None[source]
Generates timeseries from simBEV trip data for a bunch of MV grid districts.
- Parameters:
scenario_name (str) – Scenario name
bunch (list) – Bunch of grid districts to generate data for, e.g. [1,2,..,100]. Note: bunch is NOT a list of grid districts but is used for slicing the ordered list (by bus_id) of grid districts! This is used for parallelization. See
egon.data.datasets.emobility.motorized_individual_travel.MotorizedIndividualTravel.generate_model_data_tasks()
- generate_model_data_eGon100RE_remaining()[source]
Generates timeseries for eGon100RE scenario for grid districts which has not been processed in the parallel tasks before.
- generate_model_data_eGon2035_remaining()[source]
Generates timeseries for eGon2035 scenario for grid districts which has not been processed in the parallel tasks before.
- generate_model_data_grid_district(scenario_name: str, evs_grid_district: DataFrame, bat_cap_dict: dict, run_config: DataFrame) tuple[source]
Generates timeseries from simBEV trip data for MV grid district
- Parameters:
scenario_name (str) – Scenario name
evs_grid_district (pd.DataFrame) – EV data for grid district
bat_cap_dict (dict) – Battery capacity per EV type
run_config (pd.DataFrame) – simBEV metadata: run config
- Returns:
pd.DataFrame – Model data for grid district
- generate_model_data_status2019_remaining()[source]
Generates timeseries for status2019 scenario for grid districts which has not been processed in the parallel tasks before.
- generate_model_data_status2023_remaining()[source]
Generates timeseries for status2023 scenario for grid districts which has not been processed in the parallel tasks before.
- generate_static_params(ev_data_df: DataFrame, load_time_series_df: DataFrame, evs_grid_district_df: DataFrame) dict[source]
Calculate static parameters from trip data.
cumulative initial SoC
cumulative battery capacity
simultaneous plugged in charging capacity
- Parameters:
ev_data_df (pd.DataFrame) – Fill trip data
- Returns:
dict – Static parameters
- load_evs_trips(scenario_name: str, evs_ids: list, charging_events_only: bool = False, flex_only_at_charging_events: bool = True) DataFrame[source]
Load trips for EVs
- Parameters:
scenario_name (str) – Scenario name
evs_ids (list of int) – IDs of EV to load the trips for
charging_events_only (bool) – Load only events where charging takes place
flex_only_at_charging_events (bool) – Flexibility only at charging events. If False, flexibility is provided by plugged-in EVs even if no charging takes place.
- Returns:
pd.DataFrame – Trip data
- write_model_data_to_db(static_params_dict: dict, load_time_series_df: DataFrame, bus_id: int, scenario_name: str, run_config: DataFrame, bat_cap: DataFrame) None[source]
Write all results for grid district to database
- Parameters:
static_params_dict (dict) – Static model params
load_time_series_df (pd.DataFrame) – Load time series for grid district
bus_id (int) – ID of grid district
scenario_name (str) – Scenario name
run_config (pd.DataFrame) – simBEV metadata: run config
bat_cap (pd.DataFrame) – Battery capacities per EV type
- Returns:
None