Skip to content

Commit

Permalink
quick and dirty csv export of market results
Browse files Browse the repository at this point in the history
  • Loading branch information
ulfmueller committed Oct 17, 2023
1 parent 08f3f19 commit 6bcffe4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
12 changes: 8 additions & 4 deletions etrago/appl.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"q_allocation": "p_nom", # allocate reactive power via 'p_nom' or 'p'
},
"start_snapshot": 1,
"end_snapshot": 8760,
"end_snapshot": 168,
"solver": "gurobi", # glpk, cplex or gurobi
"solver_options": {
"BarConvTol": 1.0e-5,
Expand All @@ -80,7 +80,7 @@
"scn_decommissioning": None, # None or decommissioning scenario
# Export options:
"lpfile": False, # save pyomo's lp file: False or /path/to/lpfile.lp
"csv_export": "/home/ulf/Documents/PoWErD/AP2etrago_results/consecutive_100b_24h_2019", # save results as csv: False or /path/tofolder
"csv_export": "/home/ulf/Documents/PoWErD/AP2etrago_results/consecutive_test", # save results as csv: False or /path/tofolder
# Settings:
"extendable": {
"extendable_components": [
Expand All @@ -107,7 +107,7 @@
"network_clustering": {
"active": True, # choose if clustering is activated
"method": "kmedoids-dijkstra", # choose clustering method: kmeans or kmedoids-dijkstra
"n_clusters_AC": 51, # total number of resulting AC nodes (DE+foreign)
"n_clusters_AC": 30, # total number of resulting AC nodes (DE+foreign)
"cluster_foreign_AC": False, # take foreign AC buses into account, True or False
"method_gas": "kmedoids-dijkstra", # choose clustering method: kmeans or kmedoids-dijkstra
"n_clusters_gas": 14, # total number of resulting CH4 nodes (DE+foreign)
Expand Down Expand Up @@ -473,7 +473,9 @@ def run_etrago(args, json_path):
)
etrago.network.lines.loc[etrago.network.lines.r==0.0, 'r']=10


# delete following unconnected CH4 buses. why are they there?
etrago.network.buses.drop(etrago.network.buses[etrago.network.buses.index.isin(['37865', '37870'])].index, inplace=True)


# ehv network clustering
etrago.ehv_clustering()
Expand All @@ -493,6 +495,8 @@ def run_etrago(args, json_path):
etrago.network.storage_units.cyclic_state_of_charge = True
etrago.network.stores.e_cyclic = True

etrago.network.lines.loc[etrago.network.lines.r==0.0, 'r']=10

etrago.optimize()

# conduct lopf with full complex timeseries for dispatch disaggregation
Expand Down
10 changes: 7 additions & 3 deletions etrago/execute/market_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,18 @@ def build_market_model(self):
)
net.lines.drop(net.lines.loc[net.lines.carrier == 'AC'].index, inplace=True)
#net.buses.loc[net.buses.carrier == 'AC', 'carrier'] = "DC"

# delete following unconnected CH4 buses. why are they there?
#net.buses.drop(net.buses[net.buses.index.isin(['37865', '37870'])].index, inplace=True)

net.generators_t.p_max_pu = self.network.generators_t.p_max_pu

self.market_model = net


# quick and dirty csv export of market model results
path = self.args["csv_export"]
if not os.path.exists(path):
os.makedirs(path, exist_ok=True)
self.market_model.export_to_csv_folder(path + "/market")

# Todo: buses_by_country() geolocation_buses() apply on market_model does not work because no self.network?!


Expand Down

0 comments on commit 6bcffe4

Please sign in to comment.