Skip to content

Commit

Permalink
Merge branch 'features/#377-grid-separation' into merge/powermodels_i…
Browse files Browse the repository at this point in the history
…nterface_split_grid
  • Loading branch information
birgits committed May 9, 2023
2 parents 2b7c2ad + b7230c1 commit 413a47b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
10 changes: 5 additions & 5 deletions edisgo/flex_opt/reinforce_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,17 +838,17 @@ def enhanced_reinforce_grid(
standard line type. Should this not be sufficient to solve non-convergence
issues, all components in the LV grid are aggregated to the MV/LV station.
Default: False.
kwargs : dict
Keyword arguments can be all parameters of function
:func:`edisgo.flex_opt.reinforce_grid.reinforce_grid`, except
`catch_convergence_problems` which will always be set to True, `mode` which
is set to None, and `skip_mv_reinforcement` which will be ignored.
separate_lv_grids : bool
If True, all highly overloaded LV grids are separated in a first step.
separation_threshold : int or float
Overloading threshold for LV grid separation. If the overloading is higher than
the threshold times the total nominal apparent power of the MV/LV transformer(s)
the grid is separated.
kwargs : dict
Keyword arguments can be all parameters of function
:func:`edisgo.flex_opt.reinforce_grid.reinforce_grid`, except
`catch_convergence_problems` which will always be set to True, `mode` which
is set to None, and `skip_mv_reinforcement` which will be ignored.
Returns
-------
Expand Down
20 changes: 9 additions & 11 deletions edisgo/flex_opt/reinforce_measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,20 +868,18 @@ def add_standard_transformer(

transformer_changes = {"added": {}}

transformer_s = grid.transformers_df.iloc[0]
new_transformer_name = transformer_s.name.split("_")
new_transformer_df = grid.transformers_df.iloc[[0]]
new_transformer_name = new_transformer_df.index[0].split("_")
grid_id_ind = new_transformer_name.index(str(grid.id))
new_transformer_name[grid_id_ind] = lv_grid_id_new

transformer_s.s_nom = standard_transformer.S_nom
transformer_s.type_info = None
transformer_s.r_pu = standard_transformer.r_pu
transformer_s.x_pu = standard_transformer.x_pu
transformer_s.name = "_".join([str(_) for _ in new_transformer_name])
transformer_s.bus0 = bus_mv
transformer_s.bus1 = bus_lv

new_transformer_df = transformer_s.to_frame().T
new_transformer_df.s_nom = standard_transformer.S_nom
new_transformer_df.type_info = None
new_transformer_df.r_pu = standard_transformer.r_pu
new_transformer_df.x_pu = standard_transformer.x_pu
new_transformer_df.index = ["_".join([str(_) for _ in new_transformer_name])]
new_transformer_df.bus0 = bus_mv
new_transformer_df.bus1 = bus_lv

old_s_nom = grid.transformers_df.s_nom.sum()

Expand Down

0 comments on commit 413a47b

Please sign in to comment.