Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge two networks as DSO/TSO network? #2352

Open
samabu2011 opened this issue Jul 22, 2024 · 2 comments
Open

Merge two networks as DSO/TSO network? #2352

samabu2011 opened this issue Jul 22, 2024 · 2 comments

Comments

@samabu2011
Copy link

Hi

I was wondering if and how you can use the merge function to merge two networks such that one functions as a dso and one as TSO?

@vogt31337
Copy link
Contributor

@samabu2011 you can merge two networks. It should work, but you have to identify the merging points / busses. What exactly do you mean with one functions as dso and one as tso?

@samabu2011
Copy link
Author

samabu2011 commented Jul 26, 2024

Thanks for the answer! I would like to construct an example where I can use two of the IEEE cases from here: https://pandapower.readthedocs.io/en/v2.1.0/networks/power_system_test_cases.html#pandapower.networks.case24_ieee_rts and build a new network with them. Ideally one would represent a TSO and one would respresent DSO, such that I can do some further simulations. Currently for example I am trying to connect case14() as a TSO with case4gs() playing the role as a DSO.

How would you identify the merging points and busses?

Here is the code example I am using, but I am unsure if it is correct:

import pandapower as pp
import pandapower.networks as pn
import pandas as pd
import pandapower.plotting.plotly as pplot
from Solve_Networks import solve_networks
from parameters import OptParams

def fix_nan_values_in_boolean_columns(net):
for element, df in net.items():
if isinstance(df, pd.DataFrame):
for col in df.columns:
if pd.api.types.is_bool_dtype(df[col]):
df[col].fillna(False, inplace=True)

Load the IEEE 14-bus system as the TSO network

tso_net = pn.case14()

Load the IEEE 4-bus system as the DSO network

dso_net = pn.case4gs()

#pplot.simple_plotly(tso_net)

#pplot.simple_plotly(dso_net)

Add a bus in the TSO network to connect the DSO

tso_bus_new = pp.create_bus(tso_net, vn_kv=135, zone = 1.0, name="TSO Bus New")

Connect the new bus in the TSO network to an existing bus in the TSO network with a line

pp.create_line(tso_net, from_bus=1, to_bus=tso_bus_new, length_km=10, std_type="149-AL1/24-ST1A 110.0")

Add a transformer to connect the TSO bus and the DSO bus

pp.create_transformer(tso_net, hv_bus=tso_bus_new, lv_bus=dso_net.bus.index[0], std_type="25 MVA 110/20 kV")

#pplot.simple_plotly(tso_net)

Ensure there are no NaN values in boolean columns in all elements of the networks

fix_nan_values_in_boolean_columns(tso_net)
fix_nan_values_in_boolean_columns(dso_net)

Merge the networks

merged_net = pp.merge_nets(tso_net, dso_net, std_prio_on_net1=True, net2_reindex_log_level='INFO', return_net2_reindex_lookup=False)

Run power flow calculation

`import pandapower as pp
import pandapower.networks as pn
import pandas as pd
import pandapower.plotting.plotly as pplot
from Solve_Networks import solve_networks
from parameters import OptParams

def fix_nan_values_in_boolean_columns(net):
for element, df in net.items():
if isinstance(df, pd.DataFrame):
for col in df.columns:
if pd.api.types.is_bool_dtype(df[col]):
df[col].fillna(False, inplace=True)

Load the IEEE 14-bus system as the TSO network

tso_net = pn.case14()

Load the IEEE 4-bus system as the DSO network

dso_net = pn.case4gs()

#pplot.simple_plotly(tso_net)

#pplot.simple_plotly(dso_net)

Add a bus in the TSO network to connect the DSO

tso_bus_new = pp.create_bus(tso_net, vn_kv=135, zone = 1.0, name="TSO Bus New")

Connect the new bus in the TSO network to an existing bus in the TSO network with a line

pp.create_line(tso_net, from_bus=1, to_bus=tso_bus_new, length_km=10, std_type="149-AL1/24-ST1A 110.0")

Add a transformer to connect the TSO bus and the DSO bus

pp.create_transformer(tso_net, hv_bus=tso_bus_new, lv_bus=dso_net.bus.index[0], std_type="25 MVA 110/20 kV")

#pplot.simple_plotly(tso_net)

Ensure there are no NaN values in boolean columns in all elements of the networks

fix_nan_values_in_boolean_columns(tso_net)
fix_nan_values_in_boolean_columns(dso_net)

Merge the networks

merged_net = pp.merge_nets(tso_net, dso_net, std_prio_on_net1=True, net2_reindex_log_level='INFO', return_net2_reindex_lookup=False)

Run power flow calculation

pp.runpp(merged_net)`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants