Skip to content

Merge links on nodes: create super nodes#1398

Open
mgovers wants to merge 18 commits into
mainfrom
feature/super-nodes
Open

Merge links on nodes: create super nodes#1398
mgovers wants to merge 18 commits into
mainfrom
feature/super-nodes

Conversation

@mgovers
Copy link
Copy Markdown
Member

@mgovers mgovers commented May 13, 2026

Part of #35

This actually creates the topological nodes from the regular nodes

mgovers added 8 commits April 29, 2026 14:23
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
@mgovers mgovers self-assigned this May 13, 2026
@mgovers mgovers added the feature New feature or request label May 13, 2026
Comment thread power_grid_model_c/power_grid_model/include/power_grid_model/supernodes.hpp Outdated
Comment thread power_grid_model_c/power_grid_model/include/power_grid_model/supernodes.hpp Outdated
Comment on lines +150 to +152
if (link_connected[0] == 0 || link_connected[1] == 0) {
return Idx2D{.group = disconnected, .pos = disconnected};
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking about this edge case:
If we have a link that's disconnected on one side, but it's not part of any other super node, and its connected side is then connected to a node to an active line, what will happen to that link? It clearly isn't part of a supernode so it will be excluded from the link solver algorithm, but it will also be excluded from the regular topology. What happens then? Is this expected? We still have to have output for it on the connected side.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should not be loaded. partially connected branches do contribute to the diagonal elements of the Ybus, but after this whole merging-links-on-nodes ordeal is finished, one of the key assumptions is that links have vanishing impedance and reactance relative to the rest of the grid, so they should get null output.

However, you're right in that that differs from the existing output, in which we assume fixed finite impedance.

@nitbharambe and/or @TonyXiang8787 can you confirm that this is indeed correct?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single-side connected links should not participate on calculations. For the output, if the node at the connected side is energized, the link should also have the output energized=1. Otherwise energized=0. All other quantities (power, current, etc) should be zero.

This is exactly the same behavior as current links.

REQUIRE(topo_node_mapping.n_user_nodes() == comp_topo.n_node);
CHECK(topo_node_mapping.mapping() == IdxVector{0, 0, 1});
}
SUBCASE("Disconnected link => not remapped") {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mentioned edge case in my previous comment is similar to this, however, can you add it here as well too? Just to make sure the mapping handles it well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that one is tested and handled correctly, right?

and later on in SUBCASE("Disconnected link => not included in user links") it is explicitly tested that they are disconnected in create_topological_nodes

Comment thread tests/cpp_unit_tests/test_supernodes.cpp
@nitbharambe
Copy link
Copy Markdown
Member

no new comments from me @mgovers

mgovers and others added 10 commits May 26, 2026 12:00
…upernodes.hpp


Signed-off-by: Martijn Govers <[email protected]>

Co-authored-by: Nitish Bharambe <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
…alculation_parameters.hpp


Signed-off-by: Martijn Govers <[email protected]>

Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Martijn Govers <[email protected]>
@sonarqubecloud
Copy link
Copy Markdown

@AnkurArohi
Copy link
Copy Markdown

AnkurArohi commented May 28, 2026

Hey @mgovers I would like to understand the concept of super node what is it mathematically are you simply merging the switches or links with low impedance or changing something in jacobian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants