Skip to content
Snippets Groups Projects
Commit db1db5a6 authored by dph-jkr's avatar dph-jkr
Browse files

bug fix runme_GUI.py

parent 6d9ba85a
No related branches found
No related tags found
No related merge requests found
Subproject commit 6cd2e8d93928a381269448830f817c980b907be7 Subproject commit 32fc39c9e2b5ea3844cb13be5057f45bcf10714d
name,type,model,min_size,max_size,current_size name,type,model,min_size,max_size,current_size
pv_roof,PVGenerator,PV2,10.0,10.0,0.0
inv_pv,StaticInverter,INVPV,10.0,10.0,0.0 inv_pv,StaticInverter,INVPV,10.0,10.0,0.0
bat_keller,LiionBattery,BAT1,10.0,10.0,0.0 pv_roof,PVGenerator,PV2,10.0,10.0,0.0
elec_cns,ElectricalConsumption,,,, elec_cns,ElectricalConsumption,,,,
therm_cns,HeatConsumption,,,, therm_cns,HeatConsumption,,,,
dhw_dmd,HotWaterConsumption,,,, dhw_dmd,HotWaterConsumption,,,,
......
No preview for this file type
...@@ -15,44 +15,8 @@ def optimization(df_scenario_dict, simulation_scope, simulation_scope_name): ...@@ -15,44 +15,8 @@ def optimization(df_scenario_dict, simulation_scope, simulation_scope_name):
t_horizon = 240 # number of time steps to be simulated t_horizon = 240 # number of time steps to be simulated
t_step = 1 # length of a time step in hours t_step = 1 # length of a time step in hours
''' create Backup input_profile_dict, config file, etc.'''
# get prosumer_id from prosumer_name # get prosumer_id from prosumer_name
prosumer_id = df_scenario_dict['prosumer'].loc[df_scenario_dict['prosumer']['prosumer_name'] == simulation_scope_name, 'id'].iloc[0] prosumer_id = df_scenario_dict['prosumer'].loc[df_scenario_dict['prosumer']['prosumer_name'] == simulation_scope_name, 'id'].iloc[0]
prosumer_count = 1
input_profile_dict_backup = {'irradiance_1': ['irradiance', 'C:/Git/ineed-dc-framework/input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv'],
'temperature_1': ['air_temperature', 'C:/Git/ineed-dc-framework/input_files/data/temperature/temperature.csv'],
'demand_electric_1': ['elec_demand', 'generate', 3000],
'demand_heat_1': ['therm_demand', 'generate', 6000, 'temperature_1'],
'demand_hot_water_1': ['hot_water_demand', 'generate', 1500, 'temperature_1'],
'irradiance_2': ['irradiance', 'C:/Git/ineed-dc-framework/input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv'],
'temperature_2': ['air_temperature', 'C:/Git/ineed-dc-framework/input_files/data/temperature/temperature.csv'],
'demand_electric_2': ['elec_demand', 'generate', 3000],
'demand_heat_2': ['therm_demand', 'generate', 6000, 'temperature_2'],
'demand_hot_water_2': ['hot_water_demand', 'generate', 1500, 'temperature_2'],
'irradiance_3': ['irradiance', 'C:/Git/ineed-dc-framework/input_files/data/irradiance/Lindenberg2006BSRN_Irradiance_60sec.csv'],
'temperature_3': ['air_temperature', 'C:/Git/ineed-dc-framework/input_files/data/temperature/temperature.csv'],
'demand_electric_3': ['elec_demand', 'generate', 0],
'demand_heat_3': ['therm_demand', 'generate', 0, 'temperature_3'],
'demand_hot_water_3': ['hot_water_demand', 'generate', 0, 'temperature_3'],
'elec_price_1': ['elec_price', 'C:/Git/ineed-dc-framework/input_files/data/prices/day-ahead/hourly_price.csv']}
input_profiles_backup = Tooling.input_profile_processor.input_profile_processor.process_input_profiles(input_profile_dict_backup, t_start, t_horizon, t_step)
# 'config_path': path to global configurations like prices, injection prices, emission costs, etc.
# 'topology_path': path to directory that contains the matrices that define the prosumer topology
prosumer_dict_backup = {'SCN2_CAT1_PV11_3000_6000':{'config_path': 'C:/Git/ineed-dc-framework/input_files/models/prosumer_models/SCN2_CAT1_PV11/config.csv',
'topology_path': 'C:/Git/ineed-dc-framework/input_files/models/prosumer_models/SCN2_CAT1_PV11',
'profiles': {'pv_roof': ['irradiance_1', 'temperature_1'],
'elec_cns': 'demand_electric_1',
'therm_cns': 'demand_heat_1',
'dhw_dmd': 'demand_hot_water_1'}},
'SCN0_CAT1_3000_6000': {'config_path': 'C:/Git/ineed-dc-framework/input_files/models/prosumer_models/SCN0_CAT1/config.csv',
'topology_path': 'C:/Git/ineed-dc-framework/input_files/models/prosumer_models/SCN0_CAT1',
'profiles': {'elec_cns': 'demand_electric_2',
'therm_cns': 'demand_heat_2',
'dhw_dmd': 'demand_hot_water_2'}}}
''' create input profile dict ''' ''' create input profile dict '''
...@@ -153,8 +117,8 @@ def optimization(df_scenario_dict, simulation_scope, simulation_scope_name): ...@@ -153,8 +117,8 @@ def optimization(df_scenario_dict, simulation_scope, simulation_scope_name):
# reset the indices of both dataframes # reset the indices of both dataframes
prosumer_component_df = prosumer_component_df.reset_index(drop=True) prosumer_component_df = prosumer_component_df.reset_index(drop=True)
components_df = components_df.reset_index(drop=True) components_df = components_df.reset_index(drop=True)
# combine prosumer_component df and components df to one df # combine prosumer_component df and components df to one df
# components_df = prosumer_component_df.merge(components_df, left_on='prosumer_component_id', right_on='component_id')
components_df = prosumer_component_df.merge(components_df, left_on='component_id', right_on='id') components_df = prosumer_component_df.merge(components_df, left_on='component_id', right_on='id')
...@@ -165,13 +129,12 @@ def optimization(df_scenario_dict, simulation_scope, simulation_scope_name): ...@@ -165,13 +129,12 @@ def optimization(df_scenario_dict, simulation_scope, simulation_scope_name):
''' Create instance of prosumer class ''' ''' Create instance of prosumer class '''
#prosumer_main = main.Main(prosumer_dict_backup, input_profiles_backup, t_horizon, t_step)
prosumer_main = main.Main(prosumer_dict, input_profiles, t_horizon, t_step) prosumer_main = main.Main(prosumer_dict, input_profiles, t_horizon, t_step)
''' Get prosumer sizing strategy ''' ''' Get prosumer sizing strategy '''
# get sizing strategy from "prosumer" sheet df # get sizing strategy from "prosumer" sheet df
prosumer_sizing_strategy = df_scenario_dict['prosumer'].loc[df_scenario_dict['prosumer']['prosumer_name'] == simulation_scope_name, 'optimierungsziele'].iloc[0] prosumer_sizing_strategy = df_scenario_dict['prosumer'].loc[df_scenario_dict['prosumer']['prosumer_name'] == simulation_scope_name, 'sizing_strategies'].iloc[0]
# convert string from excel cell 'optimierungsziele' into list # convert string from excel cell 'optimierungsziele' into list
prosumer_sizing_strategy = prosumer_sizing_strategy.strip("[]").replace("'", '') prosumer_sizing_strategy = prosumer_sizing_strategy.strip("[]").replace("'", '')
...@@ -195,8 +158,7 @@ def optimization(df_scenario_dict, simulation_scope, simulation_scope_name): ...@@ -195,8 +158,7 @@ def optimization(df_scenario_dict, simulation_scope, simulation_scope_name):
''' Community ''' ''' Community '''
# simulation_scope: 1 for prosumer; 2 for community if simulation_scope == 'community':
if simulation_scope == 2:
community_assets_dict = {'ca_bat': {'config_path': 'input_files/models/district_models/example_CA/config.csv', community_assets_dict = {'ca_bat': {'config_path': 'input_files/models/district_models/example_CA/config.csv',
'topology_path': 'input_files/models/district_models/example_CA', 'topology_path': 'input_files/models/district_models/example_CA',
'profiles': {'elec_cns': 'demand_electric_3'}}} 'profiles': {'elec_cns': 'demand_electric_3'}}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment