Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make optional delete_dispensable_ac_buses
Browse files Browse the repository at this point in the history
CarlosEpia committed Oct 5, 2023
1 parent c63a459 commit b961b61
Showing 2 changed files with 22 additions and 6 deletions.
14 changes: 10 additions & 4 deletions etrago/appl.py
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@
"method": 2,
"crossover": 0,
"logFile": "solver_etrago.log",
"threads": 4,
"threads": 7,
},
"model_formulation": "kirchhoff", # angles or kirchhoff
"scn_name": "eGon2035", # scenario: eGon2035, eGon100RE or status2019
@@ -103,7 +103,8 @@
"generator_noise": 789456, # apply generator noise, False or seed number
"extra_functionality": {}, # Choose function name or {}
# Spatial Complexity:
"network_clustering_ehv": False, # clustering of HV buses to EHV buses
"delete_dispensable_ac_buses": False, # bool. Find and delete unnecesary buses
"network_clustering_ehv": True, # clustering of HV buses to EHV buses
"network_clustering": {
"active": True, # choose if clustering is activated
"method": "kmedoids-dijkstra", # choose clustering method: kmeans or kmedoids-dijkstra
@@ -125,7 +126,7 @@
"n_init": 10, # affects clustering algorithm, only change when neccesary
"max_iter": 100, # affects clustering algorithm, only change when neccesary
"tol": 1e-6, # affects clustering algorithm, only change when neccesary
"CPU_cores": 4, # number of cores used during clustering, "max" for all cores available.
"CPU_cores": 7, # number of cores used during clustering, "max" for all cores available.
},
"sector_coupled_clustering": {
"active": True, # choose if clustering is activated
@@ -156,7 +157,7 @@
"branch_capacity_factor": {"HV": 0.5, "eHV": 0.7}, # p.u. branch derating
"load_shedding": True, # meet the demand at value of loss load cost
"foreign_lines": {
"carrier": "AC", # 'DC' for modeling foreign lines as links
"carrier": "DC", # 'DC' for modeling foreign lines as links
"capacity": "osmTGmod", # 'osmTGmod', 'tyndp2020', 'ntc_acer' or 'thermal_acer'
},
"comments": None,
@@ -379,6 +380,11 @@ def run_etrago(args, json_path):
Limit overall energy production country-wise for each generator
by carrier. Set upper/lower limit in p.u.
delete_dispensable_ac_buses: bool
Choose if unnecessary buses should be identified and deleted from the
grid. This buses have no load or generation attached. Additionally,
they are just connected to two other buses.
Default: False.
network_clustering_ehv : bool
Choose if you want to cluster the full HV/EHV dataset down to only the
EHV buses. In that case, all HV buses are assigned to their closest EHV
14 changes: 12 additions & 2 deletions etrago/tools/utilities.py
Original file line number Diff line number Diff line change
@@ -127,8 +127,16 @@ def buses_grid_linked(network, voltage_level):
mask = (
network.buses.index.isin(network.lines.bus0)
| (network.buses.index.isin(network.lines.bus1))
| (network.buses.index.isin(network.links.loc[network.links.carrier=="DC", "bus0"]))
| (network.buses.index.isin(network.links.loc[network.links.carrier=="DC", "bus1"]))
| (
network.buses.index.isin(
network.links.loc[network.links.carrier == "DC", "bus0"]
)
)
| (
network.buses.index.isin(
network.links.loc[network.links.carrier == "DC", "bus1"]
)
)
) & (network.buses.v_nom.isin(voltage_level))

df = network.buses[mask]
@@ -1081,6 +1089,8 @@ def delete_dispensable_ac_buses(etrago):
None.
"""
if etrago.args["delete_dispensable_ac_buses"] == False:
return

def delete_buses(delete_buses, network):
drop_buses = delete_buses.index.to_list()

0 comments on commit b961b61

Please sign in to comment.