Skip to content

Commit

Permalink
Correct import of load time series
Browse files Browse the repository at this point in the history
  • Loading branch information
KathiEsterl committed Nov 1, 2024
1 parent ab2dbf2 commit 5fc87e1
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions etrago/tools/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -3416,7 +3416,7 @@ def add_line_with_costs_and_snommax(bus0, bus1, voltage, overhead=False):
name='AN_'+load_id,
carrier='AC',
bus=new_bus,
p_set=time_series_load['AC load'],
p_set=time_series_load['AC load'].values[:len(self.network.snapshots)],
scn_name=self.args['scn_name']
)
load_id = str(int(load_id)+1)
Expand All @@ -3426,7 +3426,7 @@ def add_line_with_costs_and_snommax(bus0, bus1, voltage, overhead=False):
name='LS_'+load_id,
carrier='AC',
bus=new_bus,
p_set=time_series_load['EV load'],
p_set=time_series_load['EV load'].values[:len(self.network.snapshots)],
scn_name=self.args['scn_name']
)
load_id = str(int(load_id)+1)
Expand Down Expand Up @@ -3672,7 +3672,7 @@ def add_line_with_costs_and_snommax(bus0, bus1, voltage, overhead=False):
name=load_id,
carrier='heat',
bus=heat_bus2,
p_set=time_series_load['heat load'],
p_set=time_series_load['heat load'].values[:len(self.network.snapshots)],
scn_name=self.args['scn_name']
)
load_id = str(int(load_id)+1)
Expand All @@ -3681,18 +3681,18 @@ def add_line_with_costs_and_snommax(bus0, bus1, voltage, overhead=False):
# AC
self.network.add("Load",
name=load_id,
carrier='heat',
carrier='AC',
bus=new_bus,
p_set=time_series_load['BGA_AC'],
p_set=time_series_load['BGA_AC'].values[:len(self.network.snapshots)],
scn_name=self.args['scn_name']
)
load_id = str(int(load_id)+1)
# heat
self.network.add("Load",
name=load_id,
carrier='heat',
bus=new_bus,
p_set=time_series_load['BGA_W'],
bus=heat_bus2,
p_set=time_series_load['BGA_W'].values[:len(self.network.snapshots)],
scn_name=self.args['scn_name']
)
load_id = str(int(load_id)+1)
Expand Down Expand Up @@ -3735,14 +3735,14 @@ def add_line_with_costs_and_snommax(bus0, bus1, voltage, overhead=False):
self.network.generators_t['p_min_pu'].loc[:, pv] = (time_series_set['PV1'] + time_series_set['PV2']).values[:len(self.network.snapshots)]
self.network.generators_t['p_max_pu'].loc[:, pv] = (time_series_set['PV1'] + time_series_set['PV2']).values[:len(self.network.snapshots)]

bsp = self.network.storage_units[self.network.storage_units.carrier=='BSp'].index[0]
self.network.storage_units_t['p_min_pu'].loc[:, bsp] = (time_series_set['BSp']).values[:len(self.network.snapshots)]
self.network.storage_units_t['p_max_pu'].loc[:, bsp] = (time_series_set['BSp']).values[:len(self.network.snapshots)]

bga = self.network.generators[self.network.generators.carrier=='Biogas'].index[0]
self.network.generators_t['p_min_pu'].loc[:, bga] = (time_series_set['BGA1'] + time_series_set['BGA2']).values[:len(self.network.snapshots)]
self.network.generators_t['p_max_pu'].loc[:, bga] = (time_series_set['BGA1'] + time_series_set['BGA2']).values[:len(self.network.snapshots)]

spk = self.network.generators[self.network.generators.carrier=='SpK'].index[0]
self.network.generators_t['p_min_pu'].loc[:, spk] = (time_series_set['SpK']).values[:len(self.network.snapshots)]
self.network.generators_t['p_max_pu'].loc[:, spk] = (time_series_set['SpK']).values[:len(self.network.snapshots)]

ac = self.network.links[self.network.links.scn_name!='status2019'][self.network.links.carrier=='KWK_AC'].index[0]
self.network.links_t['p_min_pu'].loc[:, ac] = (time_series_set['CHP1_AC']+time_series_set['CHP2_AC']+time_series_set['CHP3_AC']).values[:len(self.network.snapshots)]
self.network.links_t['p_max_pu'].loc[:, ac] = (time_series_set['CHP1_AC']+time_series_set['CHP2_AC']+time_series_set['CHP3_AC']).values[:len(self.network.snapshots)]
Expand All @@ -3751,6 +3751,10 @@ def add_line_with_costs_and_snommax(bus0, bus1, voltage, overhead=False):
self.network.links_t['p_min_pu'].loc[:, heat] = (time_series_set['CHP1_heat']+time_series_set['CHP2_heat']+time_series_set['CHP3_heat']).values[:len(self.network.snapshots)]
self.network.links_t['p_max_pu'].loc[:, heat] = (time_series_set['CHP1_heat']+time_series_set['CHP2_heat']+time_series_set['CHP3_heat']).values[:len(self.network.snapshots)]

spk = self.network.generators[self.network.generators.carrier=='SpK'].index[0]
self.network.generators_t['p_min_pu'].loc[:, spk] = (time_series_set['SpK']).values[:len(self.network.snapshots)]
self.network.generators_t['p_max_pu'].loc[:, spk] = (time_series_set['SpK']).values[:len(self.network.snapshots)]

wsp1 = self.network.links[self.network.links.carrier=='heat_WSp'].index[0]
self.network.links_t['p_min_pu'].loc[:, wsp1] = (time_series_set['W_laden']).values[:len(self.network.snapshots)]
self.network.links_t['p_max_pu'].loc[:, wsp1] = (time_series_set['W_laden']).values[:len(self.network.snapshots)]
Expand All @@ -3759,15 +3763,11 @@ def add_line_with_costs_and_snommax(bus0, bus1, voltage, overhead=False):
self.network.links_t['p_min_pu'].loc[:, wsp2] = (time_series_set['W_entladen']).values[:len(self.network.snapshots)]
self.network.links_t['p_max_pu'].loc[:, wsp2] = (time_series_set['W_entladen']).values[:len(self.network.snapshots)]

ta = self.network.links[self.network.links.carrier=='heat_TA'].index[0]
'''ta = self.network.links[self.network.links.carrier=='heat_TA'].index[0]
self.network.links_t['p_min_pu'].loc[:, ta] = (time_series_set['TA']).values[:len(self.network.snapshots)]
self.network.links_t['p_max_pu'].loc[:, ta] = (time_series_set['TA']).values[:len(self.network.snapshots)]
self.network.links_t['p_max_pu'].loc[:, ta] = (time_series_set['TA']).values[:len(self.network.snapshots)]'''

gsp = self.network.stores[self.network.stores.carrier=='Biogas'].index[0]
'''gsp = self.network.stores[self.network.stores.carrier=='Biogas'].index[0]
self.network.stores_t['e_min_pu'].loc[:, gsp] = (time_series_set['GSp1']+time_series_set['GSp2']).values[:len(self.network.snapshots)]
self.network.stores_t['e_max_pu'].loc[:, gsp] = (time_series_set['GSp1']+time_series_set['GSp2']).values[:len(self.network.snapshots)]

bsp = self.network.storage_units[self.network.storage_units.carrier=='BSp'].index[0]
self.network.storage_units_t['p_min_pu'].loc[:, bsp] = (time_series_set['BSp']).values[:len(self.network.snapshots)]
self.network.storage_units_t['p_max_pu'].loc[:, bsp] = (time_series_set['BSp']).values[:len(self.network.snapshots)]
self.network.stores_t['e_max_pu'].loc[:, gsp] = (time_series_set['GSp1']+time_series_set['GSp2']).values[:len(self.network.snapshots)]'''

0 comments on commit 5fc87e1

Please sign in to comment.