Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,15 @@ sufficient_condition_meshed_without_voltage_phasor(std::vector<detail::BusNeighb
prepare_starting_nodes(neighbour_list, n_bus, starting_candidates);

// Try each starting candidate
return std::ranges::any_of(starting_candidates, [&](Idx const start_bus) {
bool const found_spanning_tree = std::ranges::any_of(starting_candidates, [&](Idx const start_bus) {
return find_spanning_tree_from_node(start_bus, n_bus, neighbour_list);
});

if (!found_spanning_tree) {
throw NotObservableError{"No full-spanning tree can be constructed from this meshed network. Unobservable.\n"};
}

return true;
}

} // namespace detail
Expand Down
4 changes: 1 addition & 3 deletions tests/cpp_unit_tests/test_observability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1565,10 +1565,8 @@ TEST_CASE("Test Observability - sufficient_condition_meshed_without_voltage_phas
// Expand bidirectional connections
complete_bidirectional_neighbourhood_info(neighbour_list);

bool const result = sufficient_condition_meshed_without_voltage_phasor(neighbour_list);

// Should fail due to insufficient measurements
CHECK(result == false);
CHECK_THROWS_AS(sufficient_condition_meshed_without_voltage_phasor(neighbour_list), NotObservableError);
}

SUBCASE("Single bus network - edge case") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
".+_residual": 5e-4
},
"raises": {
"raises": "SparseMatrixError",
"raises": "NotObservableError",
"reason": "One nodal measurement can not be made use of."
}
}
Loading