Skip to content

Commit c06f367

Browse files
Merge pull request #1136 from PowerGridModel/feature/full-observability-check-meshed-network-without-voltage-phasor
Observability: full observability check meshed network without voltage phasor
2 parents e7675f7 + 67950e7 commit c06f367

File tree

7 files changed

+383
-51
lines changed

7 files changed

+383
-51
lines changed

power_grid_model_c/power_grid_model/include/power_grid_model/math_solver/iterative_linear_se_solver.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ template <symmetry_tag sym_type> class IterativeLinearSESolver {
9999
sub_timer = Timer{log, LogEvent::preprocess_measured_value};
100100
MeasuredValues<sym> const measured_values{y_bus.shared_topology(), input};
101101
auto const observability_result =
102-
observability_check(measured_values, y_bus.math_topology(), y_bus.y_bus_structure());
102+
observability::observability_check(measured_values, y_bus.math_topology(), y_bus.y_bus_structure());
103103

104104
// prepare matrix
105105
sub_timer = Timer{log, LogEvent::prepare_matrix_including_prefactorization};

power_grid_model_c/power_grid_model/include/power_grid_model/math_solver/newton_raphson_se_solver.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ template <symmetry_tag sym_type> class NewtonRaphsonSESolver {
167167
sub_timer = Timer{log, LogEvent::preprocess_measured_value};
168168
MeasuredValues<sym> const measured_values{y_bus.shared_topology(), input};
169169
auto const observability_result =
170-
observability_check(measured_values, y_bus.math_topology(), y_bus.y_bus_structure());
170+
observability::observability_check(measured_values, y_bus.math_topology(), y_bus.y_bus_structure());
171171

172172
// initialize voltage with initial angle
173173
sub_timer = Timer{log, LogEvent::initialize_voltages};

power_grid_model_c/power_grid_model/include/power_grid_model/math_solver/observability.hpp

Lines changed: 371 additions & 27 deletions
Large diffs are not rendered by default.

tests/cpp_unit_tests/test_observability.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ void check_whether_observable(bool is_observable, MathModelTopology const& topo,
2020
math_solver::MeasuredValues<symmetric_t> const measured_values{y_bus.shared_topology(), se_input};
2121

2222
if (is_observable) {
23-
CHECK_NOTHROW(
24-
math_solver::observability_check(measured_values, y_bus.math_topology(), y_bus.y_bus_structure()));
23+
CHECK_NOTHROW(math_solver::observability::observability_check(measured_values, y_bus.math_topology(),
24+
y_bus.y_bus_structure()));
2525
} else {
26-
CHECK_THROWS_AS(
27-
math_solver::observability_check(measured_values, y_bus.math_topology(), y_bus.y_bus_structure()),
28-
NotObservableError);
26+
CHECK_THROWS_AS(math_solver::observability::observability_check(measured_values, y_bus.math_topology(),
27+
y_bus.y_bus_structure()),
28+
NotObservableError);
2929
}
3030
}
3131

tests/data/state_estimation/ill-conditioned-system/leaf-without-power-sensor-meshed/params.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,5 @@
44
"atol": {
55
"default": 1e-8,
66
".+_residual": 5e-4
7-
},
8-
"xfail": {
9-
"raises": "SparseMatrixError",
10-
"reason": "Bug in Sparse LU solver found in #864"
117
}
128
}

tests/data/state_estimation/ill-conditioned-system/leaf-without-power-sensor-meshed/sym_output.json

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,15 @@
55
"attributes": {},
66
"data": {
77
"node": [
8-
{"id": 0, "energized": 1, "u_pu": 1, "u": 10, "u_angle": 0},
9-
{"id": 1, "energized": 1, "u_pu": 0.9, "u": 9, "u_angle": 0}
8+
{"id": 0, "u_pu": 1, "u": 10, "u_angle": 0},
9+
{"id": 1, "u_pu": 0.9, "u": 9, "u_angle": 0},
10+
{"id": 7, "u_pu": 0.95, "u": 9.5, "u_angle": 0}
1011
],
1112
"source": [
12-
{"id": 3, "energized": 1, "p": 10, "q": 0}
13+
{"id": 3, "p": 10, "q": 0}
1314
],
1415
"sym_load": [
15-
{"id": 4, "energized": 1, "p": 9, "q": 0}
16-
],
17-
"sym_power_sensor": [
18-
{"id": 5, "energized": 1, "p_residual": 0, "q_residual": 0}
19-
],
20-
"sym_voltage_sensor": [
21-
{"id": 6, "energized": 1, "u_residual": 0}
16+
{"id": 4, "p": 9, "q": 0}
2217
]
2318
}
2419
}

tests/data/state_estimation/meshed-network-observability/02-unobservable-with-branch-measurement/params.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,5 @@
88
"raises": {
99
"raises": "SparseMatrixError",
1010
"reason": "One nodal measurement can not be made use of."
11-
},
12-
"xpass": {
13-
"reason": "Full observability check for meshed grids is not yet implemented. See also https://github.com/PowerGridModel/power-grid-model/issues/864."
1411
}
1512
}

0 commit comments

Comments
 (0)