e2nIEE / pandapower

Convenient Power System Modelling and Analysis based on PYPOWER and pandas
https://www.pandapower.org
Other
885 stars 485 forks source link

determine stubs returns wrong stub bus #348

Closed FlorianShepherd closed 5 years ago

FlorianShepherd commented 5 years ago

I have a simple grid, which looks like this:

        b0
        |
        trafo
        |
    b6--b1--b2
    |   |   |
    b5--b4--b3

The function topology.determine_stubs returns that b6 is a stub bus and the connected lines are on a stub. This seems to be a bug in find_graph_characteristics

@jkupka could you have a look at this? I'll add a test

FlorianShepherd commented 5 years ago

I have a simple grid, which looks like this:

        b0
        |
        trafo
        |
    b6--b1--b2
    |   |   |
    b5--b4--b3

The function topology.determine_stubs returns that b6 is a stub bus and the connected lines are on a stub. This seems to be a bug in find_graph_characteristics

@jkupka could you have a look at this? I'll add a test

Here is the test: https://github.com/FlorianShepherd/pandapower/commit/db18a2fcb8c50d92a4390e527921804c554dc45c

jkupka commented 5 years ago

I'm not able to reproduce the result you described with the network you're using for the test.

For me determine_stubs returns that all buses except b0 are stub buses, which is expected behaviour. There is only one connection from b0 to b1 so all buses after this connection are determined as stub buses. If i use b1 as root bus (determine_stubs(meshed_network, roots=[1]) b1-b6 are not determined as stubs anymore.

If no root buses are declared, determine_stubs will use the connection buses of external grids per default. One could question if this is the proper approach.

jkupka commented 5 years ago

I was able to reproduce the wrong behaviour and fixed it with #353. In some cases the order of the bus discovery during the graph search led to falsely determined stub buses.