From ae6cc2ba4da1a7d90a2d3f7d8f8f26904850e861 Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Mon, 7 Sep 2026 17:55:22 +0200 Subject: [PATCH 01/14] bugfix Signed-off-by: Santiago Figueroa Manrique --- .../include/power_grid_model/main_core/output.hpp | 4 ++-- .../power_grid_model/main_core/topological_node_output.hpp | 4 ++-- .../include/power_grid_model/main_core/topology.hpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/output.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/output.hpp index e008e8b733..61b082a3c7 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/output.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/output.hpp @@ -60,9 +60,9 @@ constexpr bool measured_terminal_active(MeasuredTerminalType const terminal_type using enum MeasuredTerminalType; case branch_from: - return measured_component_active(state, obj_seq, BranchSide::from); + return measured_component_active(state, obj_seq, BranchSide::from); case branch_to: - return measured_component_active(state, obj_seq, BranchSide::to); + return measured_component_active(state, obj_seq, BranchSide::to); case source: return measured_component_active(state, obj_seq); case shunt: diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/topological_node_output.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/topological_node_output.hpp index 0a0946bbeb..bb3ba9c80b 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/topological_node_output.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/topological_node_output.hpp @@ -96,10 +96,10 @@ inline Idx get_node_sequence_idx(main_model_state_c auto const& state, Idx compo } } -template ComponentType> +template ComponentType> inline BranchIdx const& get_branch_sequence_idx(main_model_state_c auto const& state, Idx component_idx) { return state.comp_topo - ->branch_node_idx[get_component_sequence_offset(state.components) + component_idx]; + ->branch_node_idx[get_component_sequence_offset(state.components) + component_idx]; } template ComponentType> diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/topology.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/topology.hpp index f2dca1df70..0e06b19c72 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/topology.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/topology.hpp @@ -121,7 +121,7 @@ constexpr void register_topology_components(ComponentContainer const& components case branch_from: [[fallthrough]]; case branch_to: - return get_component_sequence_idx(components, measured_object); + return get_component_sequence_idx(components, measured_object); case source: return get_component_sequence_idx(components, measured_object); case shunt: @@ -162,7 +162,7 @@ constexpr void register_topology_components(ComponentContainer const& components case branch_from: [[fallthrough]]; case branch_to: - return get_component_sequence_idx(components, measured_object); + return get_component_sequence_idx(components, measured_object); case branch3_1: [[fallthrough]]; case branch3_2: @@ -187,7 +187,7 @@ constexpr void register_topology_components(ComponentContainer const& components components, comp_topo.regulated_object_idx, [&components](Regulator const& regulator) { switch (regulator.regulated_object_type()) { case ComponentType::branch: - return get_component_sequence_idx(components, regulator.regulated_object()); + return get_component_sequence_idx(components, regulator.regulated_object()); case ComponentType::branch3: return get_component_sequence_idx(components, regulator.regulated_object()); case ComponentType::generic_load_gen: From 51774b3145f48d7ed7c705a2bd57ffad84f22971 Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Mon, 7 Sep 2026 17:55:34 +0200 Subject: [PATCH 02/14] ammend tests Signed-off-by: Santiago Figueroa Manrique --- .../state_estimation/link/asym_output.json | 154 +++++++++--------- tests/data/state_estimation/link/params.json | 11 +- 2 files changed, 80 insertions(+), 85 deletions(-) diff --git a/tests/data/state_estimation/link/asym_output.json b/tests/data/state_estimation/link/asym_output.json index f1ef399339..045c32fd10 100644 --- a/tests/data/state_estimation/link/asym_output.json +++ b/tests/data/state_estimation/link/asym_output.json @@ -25,13 +25,13 @@ ], "p": [ 0.0, - -0.0012418410248675865, - 0.009268427792436354 + 0.0, + 0.0 ], "q": [ - -0.0, - -0.0021507525858327006, - -0.006119996943348736 + 0.0, + 0.0, + 0.0 ] }, { @@ -53,14 +53,14 @@ 2.0943951023931957 ], "p": [ - 393.3408030101657, - 393.3408030098129, - 393.3408030088496 + 393.3371191683295, + 393.3470529602459, + 393.3371187874935 ], "q": [ - 0.007654988835790601, - 0.007654989582357776, - 0.00765498827708678 + 0.01021243921305726, + 0.0002790465936601411, + 0.005245307208308481 ] }, { @@ -82,14 +82,14 @@ 2.094359031883535 ], "p": [ - 0.0010466757970555023, - 0.006889802345860008, - -0.004495174863230333 + 0.0, + 0.0, + 0.0 ], "q": [ - -0.0005375343256626614, - -0.0006991445095695525, - -0.0005247856136144402 + 0.0, + 0.0, + 0.0 ] } ], @@ -98,14 +98,14 @@ "id": 207, "energized": 1, "p": [ - 393.3408030101657, - 393.3408030098129, - 393.3408030088496 + 393.3371191683295, + 393.3470529602459, + 393.3371187874935 ], "q": [ - 0.007654988835790601, - 0.007654989582357776, - 0.00765498827708678 + 0.01021243921305726, + 0.0002790465936601411, + 0.005245307208308481 ], "i": [ 0.06812793613843621, @@ -113,9 +113,9 @@ 0.06812793613820825 ], "s": [ - 393.34080308465434, - 393.34080308430157, - 393.3408030833383 + 393.3371193009053, + 393.3470529603449, + 393.3371188224676 ], "pf": [ 0.9999999998106257, @@ -130,14 +130,14 @@ "energized": 1, "loading": 0.0018730514432576098, "p_from": [ - 393.3408030101657, - 393.3408030098129, - 393.3408030088496 + 393.3371191683295, + 393.3470529602459, + 393.3371187874935 ], "q_from": [ - 0.007654988835790601, - 0.007654989582357776, - 0.00765498827708678 + 0.01021243921305726, + 0.0002790465936799065, + 0.005245307208297888 ], "i_from": [ 0.06812793613843621, @@ -145,29 +145,29 @@ 0.06812793613820826 ], "s_from": [ - 393.34080308465434, - 393.34080308430157, - 393.3408030833383 + 393.3371193009053, + 393.3470529603449, + 393.3371188224676 ], "p_to": [ - -0.0014972687986235403, - -0.0014972693598851046, - -0.0014972685747695362 + 0.002186607966965775, + -0.007747498817610485, + 0.002186629698293617 ], "q_to": [ - -0.0005609905429188497, - -0.0005609913192535611, - -0.0005609908303419999 + -0.00311870663014513, + 0.00681540331756798, + 0.001848424881236158 ], "i_to": [ - 6.9234982935624505e-06, - 6.923501748849574e-06, - 6.923497822536436e-06 + 1.649294460184314e-05, + 4.468083862943827e-05, + 1.239810253679854e-05 ], "s_to": [ - 0.0015989134575004255, - 0.0015989142554648143, - 0.0015989133487216264 + 0.003808882440573532, + 0.01031859778797451, + 0.002863219163639511 ] } ], @@ -177,44 +177,44 @@ "energized": 1, "loading": 0.0, "p_from": [ - 0.0, - -0.0012418410248675865, - 0.009268427792436354 + 0.009933928395925965, + -0.007361169324206875, + 0.0 ], "q_from": [ - -0.0, - -0.0021507525858327006, - -0.006119996943348736 + -0.004967412098343771, + 0.007118116679360186, + 0.0 ], "i_from": [ - 0.0, - 1.0753986783132437e-05, - 4.8093290952436835e-05 + 4.809329095243683e-05, + 4.433982340335132e-05, + 0.0 ], "s_from": [ - 0.0, - 0.002483526890635619, - 0.011106669902819858 + 0.01110666990281769, + 0.01023984369415032, + 0.0 ], "p_to": [ - 0.0, - 0.001241841024867587, - -0.009268427792436354 + -0.009933928395925962, + 0.007361169324206877, + 0.0 ], "q_to": [ - -0.0, - 0.0021507525858327006, - 0.006119996943348735 + 0.004967412098343769, + -0.007118116679360187, + 0.0 ], "i_to": [ - 0.0, - 1.0753986783132437e-05, - 4.8093290952436835e-05 + 4.809329095243683e-05, + 4.433982340335132e-05, + 0.0 ], "s_to": [ - 0.0, - 0.0024835268906356193, - 0.011106669902819858 + 0.01110666990281769, + 0.01023984369415032, + 0.0 ] } ], @@ -239,14 +239,14 @@ "id": 466, "energized": 1, "p_residual": [ - 0.0014972687986235403, - 0.0014972693598851046, - 0.0014972685747695362 + -0.002186607966965775, + 0.007747498817610485, + -0.002186629698293617 ], "q_residual": [ - 0.0005609905429188497, - 0.0005609913192535611, - 0.0005609908303419999 + 0.00311870663014513, + -0.00681540331756798, + -0.001848424881236158 ] } ] diff --git a/tests/data/state_estimation/link/params.json b/tests/data/state_estimation/link/params.json index 11b506051b..1e2db01fd1 100644 --- a/tests/data/state_estimation/link/params.json +++ b/tests/data/state_estimation/link/params.json @@ -1,12 +1,7 @@ { - "calculation_method": ["iterative_linear", "newton_raphson"], - "rtol": 1e-3, + "calculation_method": "newton_raphson", + "rtol": 1e-5, "atol": { - "default": 1e-5, - ".+_residual": 0.15 - }, - "xfail": { - "raises": "SparseMatrixError", - "reason": "Bug in https://github.com/PowerGridModel/power-grid-model/issues/1567" + "default": 1e-5 } } From 51f9f42735a5985098187b0e694a65792ff444e9 Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Tue, 8 Sep 2026 09:25:32 +0200 Subject: [PATCH 03/14] validation cases #1567 macos benchmark against v1.13.146 Signed-off-by: Martijn Govers --- .../link-after-trafo-ilse/asym_output.json | 28 +++++++++++++++++ .../asym_output.json.license | 3 ++ .../link-after-trafo-ilse/input.json | 29 ++++++++++++++++++ .../link-after-trafo-ilse/input.json.license | 3 ++ .../link-after-trafo-ilse/params.json | 5 ++++ .../link-after-trafo-ilse/params.json.license | 3 ++ .../link-after-trafo-nrse/asym_output.json | 28 +++++++++++++++++ .../asym_output.json.license | 3 ++ .../link-after-trafo-nrse/input.json | 29 ++++++++++++++++++ .../link-after-trafo-nrse/input.json.license | 3 ++ .../link-after-trafo-nrse/params.json | 5 ++++ .../link-after-trafo-nrse/params.json.license | 3 ++ .../asym_output.json | 29 ++++++++++++++++++ .../asym_output.json.license | 3 ++ .../input.json | 30 +++++++++++++++++++ .../input.json.license | 3 ++ .../params.json | 5 ++++ .../params.json.license | 3 ++ .../asym_output.json | 29 ++++++++++++++++++ .../asym_output.json.license | 3 ++ .../input.json | 30 +++++++++++++++++++ .../input.json.license | 3 ++ .../params.json | 5 ++++ .../params.json.license | 3 ++ 24 files changed, 288 insertions(+) create mode 100644 tests/data/state_estimation/link-after-trafo-ilse/asym_output.json create mode 100644 tests/data/state_estimation/link-after-trafo-ilse/asym_output.json.license create mode 100644 tests/data/state_estimation/link-after-trafo-ilse/input.json create mode 100644 tests/data/state_estimation/link-after-trafo-ilse/input.json.license create mode 100644 tests/data/state_estimation/link-after-trafo-ilse/params.json create mode 100644 tests/data/state_estimation/link-after-trafo-ilse/params.json.license create mode 100644 tests/data/state_estimation/link-after-trafo-nrse/asym_output.json create mode 100644 tests/data/state_estimation/link-after-trafo-nrse/asym_output.json.license create mode 100644 tests/data/state_estimation/link-after-trafo-nrse/input.json create mode 100644 tests/data/state_estimation/link-after-trafo-nrse/input.json.license create mode 100644 tests/data/state_estimation/link-after-trafo-nrse/params.json create mode 100644 tests/data/state_estimation/link-after-trafo-nrse/params.json.license create mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/asym_output.json create mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/asym_output.json.license create mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/input.json create mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/input.json.license create mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/params.json create mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/params.json.license create mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/asym_output.json create mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/asym_output.json.license create mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/input.json create mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/input.json.license create mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/params.json create mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/params.json.license diff --git a/tests/data/state_estimation/link-after-trafo-ilse/asym_output.json b/tests/data/state_estimation/link-after-trafo-ilse/asym_output.json new file mode 100644 index 0000000000..9881f2085c --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-ilse/asym_output.json @@ -0,0 +1,28 @@ +{ + "version": "1.0", + "type": "asym_output", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 30, "energized": 1, "u_pu": [1.0000000100640514, 1.0000000100640514, 1.0000000100640516], "u": [230.9401100000434, 230.9401100000434, 230.94011000004346], "u_angle": [-3.6070509660964574e-05, -2.0944311729028566, 2.0943590318835348], "p": [0, 0, 0], "q": [0, 0, 0]}, + {"id": 90, "energized": 1, "u_pu": [1.0000101195612181, 1.0000101195612181, 1.0000101195612183], "u": [5773.5611172101908, 5773.5611172101908, 5773.5611172101926], "u_angle": [-6.0184701719327681e-36, -2.0943951023931957, 2.0943951023931957], "p": [393.34080301016564, 393.34080301100619, 393.34080300855356], "q": [0.0076549888357906022, 0.007654989577034586, 0.0076549887898328924]}, + {"id": 112, "energized": 1, "u_pu": [1.0000000100640514, 1.0000000100640514, 1.0000000100640516], "u": [230.9401100000434, 230.9401100000434, 230.94011000004346], "u_angle": [-3.6070509660945966e-05, -2.0944311729028566, 2.0943590318835348], "p": [0, 0, 0], "q": [0, 0, 0]} + ], + "source": [ + {"id": 207, "energized": 1, "p": [393.34080301016564, 393.34080301100619, 393.34080300855356], "q": [0.0076549888357906022, 0.007654989577034586, 0.0076549887898328924], "i": [0.068127936138436207, 0.068127936138581785, 0.068127936138157], "s": [393.34080308465428, 393.34080308549483, 393.3408030830422], "pf": [0.99999999981062571, 0.99999999981062571, 0.99999999981062571]} + ], + "transformer": [ + {"id": 208, "energized": 1, "loading": 0.0018730514432590336, "p_from": [393.34080301016564, 393.34080301100619, 393.34080300855356], "q_from": [0.0076549888357906022, 0.0076549895770311053, 0.0076549887898481796], "i_from": [0.068127936138436207, 0.068127936138581785, 0.068127936138156986], "s_from": [393.34080308465428, 393.34080308549483, 393.3408030830422], "p_to": [-0.0014972693907211341, -0.0014972701290541671, -0.0014972688708105152], "q_to": [-0.00056098995077853936, -0.00056099087513660157, -0.00056099031754126621], "i_to": [6.9234997948205443e-06, 6.9235041929913596e-06, 6.9234982438638783e-06], "s_to": [0.0015989138042011345, 0.0015989148199151862, 0.0015989134460230319]} + ], + "link": [ + {"id": 229, "energized": 1, "loading": 0, "p_from": [0.0049670537780399648, 0, 0], "q_from": [-1.7916416136502353e-07, 0, 0], "i_from": [2.1507973566264874e-05, 0, 0], "s_from": [0.004967053781271236, 0, 0], "p_to": [-0.0049670537780399648, 0, 0], "q_to": [1.791641613649311e-07, 0, 0], "i_to": [2.1507973566264874e-05, 0, 0], "s_to": [0.004967053781271236, 0, 0]} + ], + "asym_voltage_sensor": [ + {"id": 329, "energized": 1, "u_residual": [-4.3382038204813206e-11, -4.3382038204813206e-11, -4.3433317209783434e-11]} + ], + "asym_power_sensor": [ + {"id": 466, "energized": 1, "p_residual": [0.0014972693907211341, 0.0014972701290541671, 0.0014972688708105152], "q_residual": [0.00056098995077853936, 0.00056099087513660157, 0.00056099031754126621]} + ] + } +} \ No newline at end of file diff --git a/tests/data/state_estimation/link-after-trafo-ilse/asym_output.json.license b/tests/data/state_estimation/link-after-trafo-ilse/asym_output.json.license new file mode 100644 index 0000000000..7601059167 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-ilse/asym_output.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link-after-trafo-ilse/input.json b/tests/data/state_estimation/link-after-trafo-ilse/input.json new file mode 100644 index 0000000000..e1d79c5b5c --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-ilse/input.json @@ -0,0 +1,29 @@ +{ + "version": "1.0", + "type": "input", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 30, "u_rated": 400}, + {"id": 90, "u_rated": 10000}, + {"id": 112, "u_rated": 400} + ], + "source": [ + {"id": 207, "node": 90, "status": 1, "u_ref": 1, "u_ref_angle": 0} + ], + "transformer": [ + {"id": 208, "from_node": 90, "to_node": 112, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 400, "sn": 630000, "uk": 0.040000000000000001, "pk": 6800.2200000000003, "i0": 0.0018730158730158729, "p0": 1180, "winding_from": 1, "winding_to": 1, "clock": 0, "tap_side": 1, "tap_pos": 5, "tap_min": 1, "tap_max": 9, "tap_nom": 5, "tap_size": 10, "r_grounding_from": 0, "x_grounding_from": 0, "r_grounding_to": 0, "x_grounding_to": 0} + ], + "link": [ + {"id": 229, "from_node": 30, "to_node": 112, "from_status": 1, "to_status": 1} + ], + "asym_voltage_sensor": [ + {"id": 329, "measured_object": 30, "u_sigma": 2.3094000000000001, "u_measured": [230.94011, 230.94011, 230.94011]} + + ], + "asym_power_sensor": [ + {"id": 466, "measured_object": 208, "measured_terminal_type": 1, "p_measured": [0, 0, 0], "q_measured": [0, 0, 0], "p_sigma": [1000, 1000, 1000], "q_sigma": [1000, 1000, 1000]} + ] + } +} \ No newline at end of file diff --git a/tests/data/state_estimation/link-after-trafo-ilse/input.json.license b/tests/data/state_estimation/link-after-trafo-ilse/input.json.license new file mode 100644 index 0000000000..7601059167 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-ilse/input.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link-after-trafo-ilse/params.json b/tests/data/state_estimation/link-after-trafo-ilse/params.json new file mode 100644 index 0000000000..f545fe4a55 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-ilse/params.json @@ -0,0 +1,5 @@ +{ + "calculation_method": "iterative_linear", + "rtol": 1e-8, + "atol": 1e-5 +} diff --git a/tests/data/state_estimation/link-after-trafo-ilse/params.json.license b/tests/data/state_estimation/link-after-trafo-ilse/params.json.license new file mode 100644 index 0000000000..7601059167 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-ilse/params.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link-after-trafo-nrse/asym_output.json b/tests/data/state_estimation/link-after-trafo-nrse/asym_output.json new file mode 100644 index 0000000000..6f93d2215e --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-nrse/asym_output.json @@ -0,0 +1,28 @@ +{ + "version": "1.0", + "type": "asym_output", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 30, "energized": 1, "u_pu": [1.0000000100638562, 1.0000000100638426, 1.0000000100638553], "u": [230.94010999999833, 230.9401099999952, 230.94010999999813], "u_angle": [-3.6069702532602313e-05, -2.0944311720957329, 2.0943590326906585], "p": [0, 0, 0], "q": [0, 0, 0]}, + {"id": 90, "energized": 1, "u_pu": [1.0000101198407529, 1.0000101185294223, 1.0000101189297388], "u": [5773.5611188240864, 5773.5611112531151, 5773.5611135643439], "u_angle": [0, -2.0943951000605492, 2.0943951026485279], "p": [393.33711916832954, 393.34705296024589, 393.33711878749347], "q": [0.010212439213057258, 0.00027904659366014109, 0.005245307208308481]}, + {"id": 112, "energized": 1, "u_pu": [1.000000010063856, 1.0000000100638429, 1.0000000100638553], "u": [230.94010999999827, 230.94010999999526, 230.94010999999813], "u_angle": [-3.6069702532602313e-05, -2.0944311720957329, 2.0943590326906585], "p": [0, 0, 0], "q": [0, 0, 0]} + ], + "source": [ + {"id": 207, "energized": 1, "p": [393.33711916832954, 393.34705296024589, 393.33711878749347], "q": [0.010212439213057258, 0.00027904659366014109, 0.005245307208308481], "i": [0.068127298075787435, 0.068129018708000033, 0.068127298054984742], "s": [393.33711930090527, 393.34705296034485, 393.33711882246757], "pf": [0.99999999966294628, 0.99999999999974842, 0.99999999991108368]} + ], + "transformer": [ + {"id": 208, "energized": 1, "loading": 0.0018730496683868534, "p_from": [393.33711916832954, 393.34705296024589, 393.33711878749347], "q_from": [0.010212439213057258, 0.00027904659367990648, 0.0052453072082978879], "i_from": [0.068127298075787435, 0.068129018708000019, 0.068127298054984742], "s_from": [393.33711930090527, 393.34705296034485, 393.33711882246757], "p_to": [0.0021866079669657754, -0.0077474988176104848, 0.0021866296982936168], "q_to": [-0.0031187066301451298, 0.00681540331756798, 0.001848424881236158], "i_to": [1.6492944601843143e-05, 4.4680838629438272e-05, 1.2398102536798541e-05], "s_to": [0.0038088824405735325, 0.010318597787974511, 0.0028632191636395105]} + ], + "link": [ + {"id": 229, "energized": 1, "loading": 0, "p_from": [0.0099339283959259655, -0.0073611693242068748, 0], "q_from": [-0.0049674120983437707, 0.007118116679360186, 0], "i_from": [4.8093290952436835e-05, 4.4339823403351318e-05, 0], "s_from": [0.011106669902817688, 0.010239843694150316, 0], "p_to": [-0.009933928395925962, 0.0073611693242068774, 0], "q_to": [0.0049674120983437689, -0.0071181166793601869, 0], "i_to": [4.8093290952436835e-05, 4.4339823403351318e-05, 0], "s_to": [0.011106669902817686, 0.010239843694150317, 0]} + ], + "asym_voltage_sensor": [ + {"id": 329, "energized": 1, "u_residual": [1.6922071640175364e-12, 4.8202264672014671e-12, 1.89732318389845e-12]} + ], + "asym_power_sensor": [ + {"id": 466, "energized": 1, "p_residual": [-0.0021866079669657754, 0.0077474988176104848, -0.0021866296982936168], "q_residual": [0.0031187066301451298, -0.00681540331756798, -0.001848424881236158]} + ] + } +} \ No newline at end of file diff --git a/tests/data/state_estimation/link-after-trafo-nrse/asym_output.json.license b/tests/data/state_estimation/link-after-trafo-nrse/asym_output.json.license new file mode 100644 index 0000000000..7601059167 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-nrse/asym_output.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link-after-trafo-nrse/input.json b/tests/data/state_estimation/link-after-trafo-nrse/input.json new file mode 100644 index 0000000000..e1d79c5b5c --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-nrse/input.json @@ -0,0 +1,29 @@ +{ + "version": "1.0", + "type": "input", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 30, "u_rated": 400}, + {"id": 90, "u_rated": 10000}, + {"id": 112, "u_rated": 400} + ], + "source": [ + {"id": 207, "node": 90, "status": 1, "u_ref": 1, "u_ref_angle": 0} + ], + "transformer": [ + {"id": 208, "from_node": 90, "to_node": 112, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 400, "sn": 630000, "uk": 0.040000000000000001, "pk": 6800.2200000000003, "i0": 0.0018730158730158729, "p0": 1180, "winding_from": 1, "winding_to": 1, "clock": 0, "tap_side": 1, "tap_pos": 5, "tap_min": 1, "tap_max": 9, "tap_nom": 5, "tap_size": 10, "r_grounding_from": 0, "x_grounding_from": 0, "r_grounding_to": 0, "x_grounding_to": 0} + ], + "link": [ + {"id": 229, "from_node": 30, "to_node": 112, "from_status": 1, "to_status": 1} + ], + "asym_voltage_sensor": [ + {"id": 329, "measured_object": 30, "u_sigma": 2.3094000000000001, "u_measured": [230.94011, 230.94011, 230.94011]} + + ], + "asym_power_sensor": [ + {"id": 466, "measured_object": 208, "measured_terminal_type": 1, "p_measured": [0, 0, 0], "q_measured": [0, 0, 0], "p_sigma": [1000, 1000, 1000], "q_sigma": [1000, 1000, 1000]} + ] + } +} \ No newline at end of file diff --git a/tests/data/state_estimation/link-after-trafo-nrse/input.json.license b/tests/data/state_estimation/link-after-trafo-nrse/input.json.license new file mode 100644 index 0000000000..7601059167 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-nrse/input.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link-after-trafo-nrse/params.json b/tests/data/state_estimation/link-after-trafo-nrse/params.json new file mode 100644 index 0000000000..f8f6b6074d --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-nrse/params.json @@ -0,0 +1,5 @@ +{ + "calculation_method": "newton_raphson", + "rtol": 1e-8, + "atol": 1e-5 +} diff --git a/tests/data/state_estimation/link-after-trafo-nrse/params.json.license b/tests/data/state_estimation/link-after-trafo-nrse/params.json.license new file mode 100644 index 0000000000..7601059167 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-nrse/params.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/asym_output.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/asym_output.json new file mode 100644 index 0000000000..707b30faf6 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/asym_output.json @@ -0,0 +1,29 @@ +{ + "version": "1.0", + "type": "asym_output", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 30, "energized": 1, "u_pu": [1.0000000100640514, 1.0000000100640514, 1.0000000100640516], "u": [230.9401100000434, 230.9401100000434, 230.94011000004346], "u_angle": [-3.6070509660964574e-05, -2.0944311729028566, 2.0943590318835348], "p": [0, 0, 0], "q": [0, 0, 0]}, + {"id": 90, "energized": 1, "u_pu": [1.0000101195612181, 1.0000101195612181, 1.0000101195612183], "u": [5773.5611172101908, 5773.5611172101908, 5773.5611172101926], "u_angle": [-6.0184701719327681e-36, -2.0943951023931957, 2.0943951023931957], "p": [393.34080301016564, 393.34080301100619, 393.34080300855356], "q": [0.0076549888357906022, 0.007654989577034586, 0.0076549887898328924]}, + {"id": 112, "energized": 1, "u_pu": [1.0000000100640514, 1.0000000100640514, 1.0000000100640516], "u": [230.9401100000434, 230.9401100000434, 230.94011000004346], "u_angle": [-3.6070509660945966e-05, -2.0944311729028566, 2.0943590318835348], "p": [0, 0, 0], "q": [0, 0, 0]} + ], + "source": [ + {"id": 207, "energized": 1, "p": [393.34080301016564, 393.34080301100619, 393.34080300855356], "q": [0.0076549888357906022, 0.007654989577034586, 0.0076549887898328924], "i": [0.068127936138436207, 0.068127936138581785, 0.068127936138157], "s": [393.34080308465428, 393.34080308549483, 393.3408030830422], "pf": [0.99999999981062571, 0.99999999981062571, 0.99999999981062571]} + ], + "transformer": [ + {"id": 208, "energized": 1, "loading": 0.0018730514432590336, "p_from": [393.34080301016564, 393.34080301100619, 393.34080300855356], "q_from": [0.0076549888357906022, 0.0076549895770311053, 0.0076549887898481796], "i_from": [0.068127936138436207, 0.068127936138581785, 0.068127936138156986], "s_from": [393.34080308465428, 393.34080308549483, 393.3408030830422], "p_to": [-0.0014972693907211341, -0.0014972701290541671, -0.0014972688708105152], "q_to": [-0.00056098995077853936, -0.00056099087513660157, -0.00056099031754126621], "i_to": [6.9234997948205443e-06, 6.9235041929913596e-06, 6.9234982438638783e-06], "s_to": [0.0015989138042011345, 0.0015989148199151862, 0.0015989134460230319]} + ], + "link": [ + {"id": 229, "energized": 1, "loading": 0, "p_from": [0.0049670537780399648, 0, 0], "q_from": [-1.7916416136502353e-07, 0, 0], "i_from": [2.1507973566264874e-05, 0, 0], "s_from": [0.004967053781271236, 0, 0], "p_to": [-0.0049670537780399648, 0, 0], "q_to": [1.791641613649311e-07, 0, 0], "i_to": [2.1507973566264874e-05, 0, 0], "s_to": [0.004967053781271236, 0, 0]} + ], + "asym_voltage_sensor": [ + {"id": 329, "energized": 1, "u_residual": [-4.3382038204813206e-11, -4.3382038204813206e-11, -4.3433317209783434e-11]} + ], + "asym_power_sensor": [ + {"id": 466, "energized": 1, "p_residual": [0.0014972693907211341, 0.0014972701290541671, 0.0014972688708105152], "q_residual": [0.00056098995077853936, 0.00056099087513660157, 0.00056099031754126621]}, + {"id": 467, "energized": 1, "p_residual": [0.0088874314629008768, 0.0029550478868447631, -0.0019573526661112819], "q_residual": [0.0005371742209937544, -0.0021174704508418124, -0.0032002725709247104]} + ] + } +} \ No newline at end of file diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/asym_output.json.license b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/asym_output.json.license new file mode 100644 index 0000000000..7601059167 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/asym_output.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/input.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/input.json new file mode 100644 index 0000000000..bf48d252b0 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/input.json @@ -0,0 +1,30 @@ +{ + "version": "1.0", + "type": "input", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 30, "u_rated": 400}, + {"id": 90, "u_rated": 10000}, + {"id": 112, "u_rated": 400} + ], + "source": [ + {"id": 207, "node": 90, "status": 1, "u_ref": 1, "u_ref_angle": 0} + ], + "transformer": [ + {"id": 208, "from_node": 90, "to_node": 112, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 400, "sn": 630000, "uk": 0.040000000000000001, "pk": 6800.2200000000003, "i0": 0.0018730158730158729, "p0": 1180, "winding_from": 1, "winding_to": 1, "clock": 0, "tap_side": 1, "tap_pos": 5, "tap_min": 1, "tap_max": 9, "tap_nom": 5, "tap_size": 10, "r_grounding_from": 0, "x_grounding_from": 0, "r_grounding_to": 0, "x_grounding_to": 0} + ], + "link": [ + {"id": 229, "from_node": 30, "to_node": 112, "from_status": 1, "to_status": 1} + ], + "asym_voltage_sensor": [ + {"id": 329, "measured_object": 30, "u_sigma": 2.3094000000000001, "u_measured": [230.94011, 230.94011, 230.94011]} + + ], + "asym_power_sensor": [ + {"id": 466, "measured_object": 208, "measured_terminal_type": 1, "p_measured": [0, 0, 0], "q_measured": [0, 0, 0], "p_sigma": [1000, 1000, 1000], "q_sigma": [1000, 1000, 1000]}, + {"id": 467, "measured_object": 112, "measured_terminal_type": 9, "p_measured": [0, 0, 0], "q_measured": [0, 0, 0], "p_sigma": [1000, 1000, 1000], "q_sigma": [1000, 1000, 1000]} + ] + } +} \ No newline at end of file diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/input.json.license b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/input.json.license new file mode 100644 index 0000000000..7601059167 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/input.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/params.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/params.json new file mode 100644 index 0000000000..f545fe4a55 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/params.json @@ -0,0 +1,5 @@ +{ + "calculation_method": "iterative_linear", + "rtol": 1e-8, + "atol": 1e-5 +} diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/params.json.license b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/params.json.license new file mode 100644 index 0000000000..7601059167 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/params.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/asym_output.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/asym_output.json new file mode 100644 index 0000000000..b9b3f332bd --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/asym_output.json @@ -0,0 +1,29 @@ +{ + "version": "1.0", + "type": "asym_output", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 30, "energized": 1, "u_pu": [1.0000000100638562, 1.0000000100638426, 1.0000000100638553], "u": [230.94010999999833, 230.9401099999952, 230.94010999999813], "u_angle": [-3.6069702532602313e-05, -2.0944311720957329, 2.0943590326906585], "p": [0, 0, 0], "q": [0, 0, 0]}, + {"id": 90, "energized": 1, "u_pu": [1.0000101198407529, 1.0000101185294223, 1.0000101189297388], "u": [5773.5611188240864, 5773.5611112531151, 5773.5611135643439], "u_angle": [0, -2.0943951000605492, 2.0943951026485279], "p": [393.33711916832954, 393.34705296024589, 393.33711878749347], "q": [0.010212439213057258, 0.00027904659366014109, 0.005245307208308481]}, + {"id": 112, "energized": 1, "u_pu": [1.000000010063856, 1.0000000100638429, 1.0000000100638553], "u": [230.94010999999827, 230.94010999999526, 230.94010999999813], "u_angle": [-3.6069702532602313e-05, -2.0944311720957329, 2.0943590326906585], "p": [0, 0, 0], "q": [0, 0, 0]} + ], + "source": [ + {"id": 207, "energized": 1, "p": [393.33711916832954, 393.34705296024589, 393.33711878749347], "q": [0.010212439213057258, 0.00027904659366014109, 0.005245307208308481], "i": [0.068127298075787435, 0.068129018708000033, 0.068127298054984742], "s": [393.33711930090527, 393.34705296034485, 393.33711882246757], "pf": [0.99999999966294628, 0.99999999999974842, 0.99999999991108368]} + ], + "transformer": [ + {"id": 208, "energized": 1, "loading": 0.0018730496683868534, "p_from": [393.33711916832954, 393.34705296024589, 393.33711878749347], "q_from": [0.010212439213057258, 0.00027904659367990648, 0.0052453072082978879], "i_from": [0.068127298075787435, 0.068129018708000019, 0.068127298054984742], "s_from": [393.33711930090527, 393.34705296034485, 393.33711882246757], "p_to": [0.0021866079669657754, -0.0077474988176104848, 0.0021866296982936168], "q_to": [-0.0031187066301451298, 0.00681540331756798, 0.001848424881236158], "i_to": [1.6492944601843143e-05, 4.4680838629438272e-05, 1.2398102536798541e-05], "s_to": [0.0038088824405735325, 0.010318597787974511, 0.0028632191636395105]} + ], + "link": [ + {"id": 229, "energized": 1, "loading": 0, "p_from": [0.0099339283959259655, -0.0073611693242068748, 0], "q_from": [-0.0049674120983437707, 0.007118116679360186, 0], "i_from": [4.8093290952436835e-05, 4.4339823403351318e-05, 0], "s_from": [0.011106669902817688, 0.010239843694150316, 0], "p_to": [-0.009933928395925962, 0.0073611693242068774, 0], "q_to": [0.0049674120983437689, -0.0071181166793601869, 0], "i_to": [4.8093290952436835e-05, 4.4339823403351318e-05, 0], "s_to": [0.011106669902817686, 0.010239843694150317, 0]} + ], + "asym_voltage_sensor": [ + {"id": 329, "energized": 1, "u_residual": [1.6922071640175364e-12, 4.8202264672014671e-12, 1.89732318389845e-12]} + ], + "asym_power_sensor": [ + {"id": 466, "energized": 1, "p_residual": [-0.0021866079669657754, 0.0077474988176104848, -0.0021866296982936168], "q_residual": [0.0031187066301451298, -0.00681540331756798, -0.001848424881236158]}, + {"id": 467, "energized": 1, "p_residual": [0.0043162699002956351, -0.0026789957446007465, -0.0037121694261432999], "q_residual": [-0.0030165997023741528, 0.0014469418675200853, -0.0079959879743259094]} + ] + } +} \ No newline at end of file diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/asym_output.json.license b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/asym_output.json.license new file mode 100644 index 0000000000..7601059167 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/asym_output.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/input.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/input.json new file mode 100644 index 0000000000..bf48d252b0 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/input.json @@ -0,0 +1,30 @@ +{ + "version": "1.0", + "type": "input", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 30, "u_rated": 400}, + {"id": 90, "u_rated": 10000}, + {"id": 112, "u_rated": 400} + ], + "source": [ + {"id": 207, "node": 90, "status": 1, "u_ref": 1, "u_ref_angle": 0} + ], + "transformer": [ + {"id": 208, "from_node": 90, "to_node": 112, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 400, "sn": 630000, "uk": 0.040000000000000001, "pk": 6800.2200000000003, "i0": 0.0018730158730158729, "p0": 1180, "winding_from": 1, "winding_to": 1, "clock": 0, "tap_side": 1, "tap_pos": 5, "tap_min": 1, "tap_max": 9, "tap_nom": 5, "tap_size": 10, "r_grounding_from": 0, "x_grounding_from": 0, "r_grounding_to": 0, "x_grounding_to": 0} + ], + "link": [ + {"id": 229, "from_node": 30, "to_node": 112, "from_status": 1, "to_status": 1} + ], + "asym_voltage_sensor": [ + {"id": 329, "measured_object": 30, "u_sigma": 2.3094000000000001, "u_measured": [230.94011, 230.94011, 230.94011]} + + ], + "asym_power_sensor": [ + {"id": 466, "measured_object": 208, "measured_terminal_type": 1, "p_measured": [0, 0, 0], "q_measured": [0, 0, 0], "p_sigma": [1000, 1000, 1000], "q_sigma": [1000, 1000, 1000]}, + {"id": 467, "measured_object": 112, "measured_terminal_type": 9, "p_measured": [0, 0, 0], "q_measured": [0, 0, 0], "p_sigma": [1000, 1000, 1000], "q_sigma": [1000, 1000, 1000]} + ] + } +} \ No newline at end of file diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/input.json.license b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/input.json.license new file mode 100644 index 0000000000..7601059167 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/input.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/params.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/params.json new file mode 100644 index 0000000000..f8f6b6074d --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/params.json @@ -0,0 +1,5 @@ +{ + "calculation_method": "newton_raphson", + "rtol": 1e-8, + "atol": 1e-5 +} diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/params.json.license b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/params.json.license new file mode 100644 index 0000000000..7601059167 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/params.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 From b4a7afe0ce60e808ea286117d8adaf65b2ad4013 Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Tue, 8 Sep 2026 10:20:08 +0200 Subject: [PATCH 04/14] fit tolerances to theoretical results (ideal links) + filter out platform + architecture dependent Signed-off-by: Martijn Govers --- .../link-after-trafo-ilse/asym_output.json | 28 ----------------- .../link-after-trafo-ilse/input.json | 29 ------------------ .../link-after-trafo-ilse/params.json | 5 ---- .../link-after-trafo-nrse/asym_output.json | 28 ----------------- .../link-after-trafo-nrse/params.json | 5 ---- .../asym_output.json | 29 ------------------ .../asym_output.json.license | 3 -- .../input.json.license | 3 -- .../params.json | 5 ---- .../params.json.license | 3 -- .../asym_output.json | 29 ------------------ .../asym_output.json.license | 3 -- .../input.json | 30 ------------------- .../input.json.license | 3 -- .../params.json | 5 ---- .../params.json.license | 3 -- .../asym_output.json | 29 ++++++++++++++++++ .../asym_output.json.license | 0 .../input.json | 3 +- .../input.json.license | 0 .../params.json | 20 +++++++++++++ .../params.json.license | 0 .../link-after-trafo/asym_output.json | 28 +++++++++++++++++ .../asym_output.json.license | 0 .../input.json | 3 +- .../input.json.license | 0 .../link-after-trafo/params.json | 20 +++++++++++++ .../params.json.license | 0 28 files changed, 99 insertions(+), 215 deletions(-) delete mode 100644 tests/data/state_estimation/link-after-trafo-ilse/asym_output.json delete mode 100644 tests/data/state_estimation/link-after-trafo-ilse/input.json delete mode 100644 tests/data/state_estimation/link-after-trafo-ilse/params.json delete mode 100644 tests/data/state_estimation/link-after-trafo-nrse/asym_output.json delete mode 100644 tests/data/state_estimation/link-after-trafo-nrse/params.json delete mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/asym_output.json delete mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/asym_output.json.license delete mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/input.json.license delete mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/params.json delete mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/params.json.license delete mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/asym_output.json delete mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/asym_output.json.license delete mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/input.json delete mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/input.json.license delete mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/params.json delete mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/params.json.license create mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/asym_output.json rename tests/data/state_estimation/{link-after-trafo-ilse => link-after-trafo-with-node-injection-sensor}/asym_output.json.license (100%) rename tests/data/state_estimation/{link-after-trafo-with-node-injection-sensor-ilse => link-after-trafo-with-node-injection-sensor}/input.json (91%) rename tests/data/state_estimation/{link-after-trafo-ilse => link-after-trafo-with-node-injection-sensor}/input.json.license (100%) create mode 100644 tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json rename tests/data/state_estimation/{link-after-trafo-ilse => link-after-trafo-with-node-injection-sensor}/params.json.license (100%) create mode 100644 tests/data/state_estimation/link-after-trafo/asym_output.json rename tests/data/state_estimation/{link-after-trafo-nrse => link-after-trafo}/asym_output.json.license (100%) rename tests/data/state_estimation/{link-after-trafo-nrse => link-after-trafo}/input.json (90%) rename tests/data/state_estimation/{link-after-trafo-nrse => link-after-trafo}/input.json.license (100%) create mode 100644 tests/data/state_estimation/link-after-trafo/params.json rename tests/data/state_estimation/{link-after-trafo-nrse => link-after-trafo}/params.json.license (100%) diff --git a/tests/data/state_estimation/link-after-trafo-ilse/asym_output.json b/tests/data/state_estimation/link-after-trafo-ilse/asym_output.json deleted file mode 100644 index 9881f2085c..0000000000 --- a/tests/data/state_estimation/link-after-trafo-ilse/asym_output.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "version": "1.0", - "type": "asym_output", - "is_batch": false, - "attributes": {}, - "data": { - "node": [ - {"id": 30, "energized": 1, "u_pu": [1.0000000100640514, 1.0000000100640514, 1.0000000100640516], "u": [230.9401100000434, 230.9401100000434, 230.94011000004346], "u_angle": [-3.6070509660964574e-05, -2.0944311729028566, 2.0943590318835348], "p": [0, 0, 0], "q": [0, 0, 0]}, - {"id": 90, "energized": 1, "u_pu": [1.0000101195612181, 1.0000101195612181, 1.0000101195612183], "u": [5773.5611172101908, 5773.5611172101908, 5773.5611172101926], "u_angle": [-6.0184701719327681e-36, -2.0943951023931957, 2.0943951023931957], "p": [393.34080301016564, 393.34080301100619, 393.34080300855356], "q": [0.0076549888357906022, 0.007654989577034586, 0.0076549887898328924]}, - {"id": 112, "energized": 1, "u_pu": [1.0000000100640514, 1.0000000100640514, 1.0000000100640516], "u": [230.9401100000434, 230.9401100000434, 230.94011000004346], "u_angle": [-3.6070509660945966e-05, -2.0944311729028566, 2.0943590318835348], "p": [0, 0, 0], "q": [0, 0, 0]} - ], - "source": [ - {"id": 207, "energized": 1, "p": [393.34080301016564, 393.34080301100619, 393.34080300855356], "q": [0.0076549888357906022, 0.007654989577034586, 0.0076549887898328924], "i": [0.068127936138436207, 0.068127936138581785, 0.068127936138157], "s": [393.34080308465428, 393.34080308549483, 393.3408030830422], "pf": [0.99999999981062571, 0.99999999981062571, 0.99999999981062571]} - ], - "transformer": [ - {"id": 208, "energized": 1, "loading": 0.0018730514432590336, "p_from": [393.34080301016564, 393.34080301100619, 393.34080300855356], "q_from": [0.0076549888357906022, 0.0076549895770311053, 0.0076549887898481796], "i_from": [0.068127936138436207, 0.068127936138581785, 0.068127936138156986], "s_from": [393.34080308465428, 393.34080308549483, 393.3408030830422], "p_to": [-0.0014972693907211341, -0.0014972701290541671, -0.0014972688708105152], "q_to": [-0.00056098995077853936, -0.00056099087513660157, -0.00056099031754126621], "i_to": [6.9234997948205443e-06, 6.9235041929913596e-06, 6.9234982438638783e-06], "s_to": [0.0015989138042011345, 0.0015989148199151862, 0.0015989134460230319]} - ], - "link": [ - {"id": 229, "energized": 1, "loading": 0, "p_from": [0.0049670537780399648, 0, 0], "q_from": [-1.7916416136502353e-07, 0, 0], "i_from": [2.1507973566264874e-05, 0, 0], "s_from": [0.004967053781271236, 0, 0], "p_to": [-0.0049670537780399648, 0, 0], "q_to": [1.791641613649311e-07, 0, 0], "i_to": [2.1507973566264874e-05, 0, 0], "s_to": [0.004967053781271236, 0, 0]} - ], - "asym_voltage_sensor": [ - {"id": 329, "energized": 1, "u_residual": [-4.3382038204813206e-11, -4.3382038204813206e-11, -4.3433317209783434e-11]} - ], - "asym_power_sensor": [ - {"id": 466, "energized": 1, "p_residual": [0.0014972693907211341, 0.0014972701290541671, 0.0014972688708105152], "q_residual": [0.00056098995077853936, 0.00056099087513660157, 0.00056099031754126621]} - ] - } -} \ No newline at end of file diff --git a/tests/data/state_estimation/link-after-trafo-ilse/input.json b/tests/data/state_estimation/link-after-trafo-ilse/input.json deleted file mode 100644 index e1d79c5b5c..0000000000 --- a/tests/data/state_estimation/link-after-trafo-ilse/input.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "version": "1.0", - "type": "input", - "is_batch": false, - "attributes": {}, - "data": { - "node": [ - {"id": 30, "u_rated": 400}, - {"id": 90, "u_rated": 10000}, - {"id": 112, "u_rated": 400} - ], - "source": [ - {"id": 207, "node": 90, "status": 1, "u_ref": 1, "u_ref_angle": 0} - ], - "transformer": [ - {"id": 208, "from_node": 90, "to_node": 112, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 400, "sn": 630000, "uk": 0.040000000000000001, "pk": 6800.2200000000003, "i0": 0.0018730158730158729, "p0": 1180, "winding_from": 1, "winding_to": 1, "clock": 0, "tap_side": 1, "tap_pos": 5, "tap_min": 1, "tap_max": 9, "tap_nom": 5, "tap_size": 10, "r_grounding_from": 0, "x_grounding_from": 0, "r_grounding_to": 0, "x_grounding_to": 0} - ], - "link": [ - {"id": 229, "from_node": 30, "to_node": 112, "from_status": 1, "to_status": 1} - ], - "asym_voltage_sensor": [ - {"id": 329, "measured_object": 30, "u_sigma": 2.3094000000000001, "u_measured": [230.94011, 230.94011, 230.94011]} - - ], - "asym_power_sensor": [ - {"id": 466, "measured_object": 208, "measured_terminal_type": 1, "p_measured": [0, 0, 0], "q_measured": [0, 0, 0], "p_sigma": [1000, 1000, 1000], "q_sigma": [1000, 1000, 1000]} - ] - } -} \ No newline at end of file diff --git a/tests/data/state_estimation/link-after-trafo-ilse/params.json b/tests/data/state_estimation/link-after-trafo-ilse/params.json deleted file mode 100644 index f545fe4a55..0000000000 --- a/tests/data/state_estimation/link-after-trafo-ilse/params.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "calculation_method": "iterative_linear", - "rtol": 1e-8, - "atol": 1e-5 -} diff --git a/tests/data/state_estimation/link-after-trafo-nrse/asym_output.json b/tests/data/state_estimation/link-after-trafo-nrse/asym_output.json deleted file mode 100644 index 6f93d2215e..0000000000 --- a/tests/data/state_estimation/link-after-trafo-nrse/asym_output.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "version": "1.0", - "type": "asym_output", - "is_batch": false, - "attributes": {}, - "data": { - "node": [ - {"id": 30, "energized": 1, "u_pu": [1.0000000100638562, 1.0000000100638426, 1.0000000100638553], "u": [230.94010999999833, 230.9401099999952, 230.94010999999813], "u_angle": [-3.6069702532602313e-05, -2.0944311720957329, 2.0943590326906585], "p": [0, 0, 0], "q": [0, 0, 0]}, - {"id": 90, "energized": 1, "u_pu": [1.0000101198407529, 1.0000101185294223, 1.0000101189297388], "u": [5773.5611188240864, 5773.5611112531151, 5773.5611135643439], "u_angle": [0, -2.0943951000605492, 2.0943951026485279], "p": [393.33711916832954, 393.34705296024589, 393.33711878749347], "q": [0.010212439213057258, 0.00027904659366014109, 0.005245307208308481]}, - {"id": 112, "energized": 1, "u_pu": [1.000000010063856, 1.0000000100638429, 1.0000000100638553], "u": [230.94010999999827, 230.94010999999526, 230.94010999999813], "u_angle": [-3.6069702532602313e-05, -2.0944311720957329, 2.0943590326906585], "p": [0, 0, 0], "q": [0, 0, 0]} - ], - "source": [ - {"id": 207, "energized": 1, "p": [393.33711916832954, 393.34705296024589, 393.33711878749347], "q": [0.010212439213057258, 0.00027904659366014109, 0.005245307208308481], "i": [0.068127298075787435, 0.068129018708000033, 0.068127298054984742], "s": [393.33711930090527, 393.34705296034485, 393.33711882246757], "pf": [0.99999999966294628, 0.99999999999974842, 0.99999999991108368]} - ], - "transformer": [ - {"id": 208, "energized": 1, "loading": 0.0018730496683868534, "p_from": [393.33711916832954, 393.34705296024589, 393.33711878749347], "q_from": [0.010212439213057258, 0.00027904659367990648, 0.0052453072082978879], "i_from": [0.068127298075787435, 0.068129018708000019, 0.068127298054984742], "s_from": [393.33711930090527, 393.34705296034485, 393.33711882246757], "p_to": [0.0021866079669657754, -0.0077474988176104848, 0.0021866296982936168], "q_to": [-0.0031187066301451298, 0.00681540331756798, 0.001848424881236158], "i_to": [1.6492944601843143e-05, 4.4680838629438272e-05, 1.2398102536798541e-05], "s_to": [0.0038088824405735325, 0.010318597787974511, 0.0028632191636395105]} - ], - "link": [ - {"id": 229, "energized": 1, "loading": 0, "p_from": [0.0099339283959259655, -0.0073611693242068748, 0], "q_from": [-0.0049674120983437707, 0.007118116679360186, 0], "i_from": [4.8093290952436835e-05, 4.4339823403351318e-05, 0], "s_from": [0.011106669902817688, 0.010239843694150316, 0], "p_to": [-0.009933928395925962, 0.0073611693242068774, 0], "q_to": [0.0049674120983437689, -0.0071181166793601869, 0], "i_to": [4.8093290952436835e-05, 4.4339823403351318e-05, 0], "s_to": [0.011106669902817686, 0.010239843694150317, 0]} - ], - "asym_voltage_sensor": [ - {"id": 329, "energized": 1, "u_residual": [1.6922071640175364e-12, 4.8202264672014671e-12, 1.89732318389845e-12]} - ], - "asym_power_sensor": [ - {"id": 466, "energized": 1, "p_residual": [-0.0021866079669657754, 0.0077474988176104848, -0.0021866296982936168], "q_residual": [0.0031187066301451298, -0.00681540331756798, -0.001848424881236158]} - ] - } -} \ No newline at end of file diff --git a/tests/data/state_estimation/link-after-trafo-nrse/params.json b/tests/data/state_estimation/link-after-trafo-nrse/params.json deleted file mode 100644 index f8f6b6074d..0000000000 --- a/tests/data/state_estimation/link-after-trafo-nrse/params.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "calculation_method": "newton_raphson", - "rtol": 1e-8, - "atol": 1e-5 -} diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/asym_output.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/asym_output.json deleted file mode 100644 index 707b30faf6..0000000000 --- a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/asym_output.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "version": "1.0", - "type": "asym_output", - "is_batch": false, - "attributes": {}, - "data": { - "node": [ - {"id": 30, "energized": 1, "u_pu": [1.0000000100640514, 1.0000000100640514, 1.0000000100640516], "u": [230.9401100000434, 230.9401100000434, 230.94011000004346], "u_angle": [-3.6070509660964574e-05, -2.0944311729028566, 2.0943590318835348], "p": [0, 0, 0], "q": [0, 0, 0]}, - {"id": 90, "energized": 1, "u_pu": [1.0000101195612181, 1.0000101195612181, 1.0000101195612183], "u": [5773.5611172101908, 5773.5611172101908, 5773.5611172101926], "u_angle": [-6.0184701719327681e-36, -2.0943951023931957, 2.0943951023931957], "p": [393.34080301016564, 393.34080301100619, 393.34080300855356], "q": [0.0076549888357906022, 0.007654989577034586, 0.0076549887898328924]}, - {"id": 112, "energized": 1, "u_pu": [1.0000000100640514, 1.0000000100640514, 1.0000000100640516], "u": [230.9401100000434, 230.9401100000434, 230.94011000004346], "u_angle": [-3.6070509660945966e-05, -2.0944311729028566, 2.0943590318835348], "p": [0, 0, 0], "q": [0, 0, 0]} - ], - "source": [ - {"id": 207, "energized": 1, "p": [393.34080301016564, 393.34080301100619, 393.34080300855356], "q": [0.0076549888357906022, 0.007654989577034586, 0.0076549887898328924], "i": [0.068127936138436207, 0.068127936138581785, 0.068127936138157], "s": [393.34080308465428, 393.34080308549483, 393.3408030830422], "pf": [0.99999999981062571, 0.99999999981062571, 0.99999999981062571]} - ], - "transformer": [ - {"id": 208, "energized": 1, "loading": 0.0018730514432590336, "p_from": [393.34080301016564, 393.34080301100619, 393.34080300855356], "q_from": [0.0076549888357906022, 0.0076549895770311053, 0.0076549887898481796], "i_from": [0.068127936138436207, 0.068127936138581785, 0.068127936138156986], "s_from": [393.34080308465428, 393.34080308549483, 393.3408030830422], "p_to": [-0.0014972693907211341, -0.0014972701290541671, -0.0014972688708105152], "q_to": [-0.00056098995077853936, -0.00056099087513660157, -0.00056099031754126621], "i_to": [6.9234997948205443e-06, 6.9235041929913596e-06, 6.9234982438638783e-06], "s_to": [0.0015989138042011345, 0.0015989148199151862, 0.0015989134460230319]} - ], - "link": [ - {"id": 229, "energized": 1, "loading": 0, "p_from": [0.0049670537780399648, 0, 0], "q_from": [-1.7916416136502353e-07, 0, 0], "i_from": [2.1507973566264874e-05, 0, 0], "s_from": [0.004967053781271236, 0, 0], "p_to": [-0.0049670537780399648, 0, 0], "q_to": [1.791641613649311e-07, 0, 0], "i_to": [2.1507973566264874e-05, 0, 0], "s_to": [0.004967053781271236, 0, 0]} - ], - "asym_voltage_sensor": [ - {"id": 329, "energized": 1, "u_residual": [-4.3382038204813206e-11, -4.3382038204813206e-11, -4.3433317209783434e-11]} - ], - "asym_power_sensor": [ - {"id": 466, "energized": 1, "p_residual": [0.0014972693907211341, 0.0014972701290541671, 0.0014972688708105152], "q_residual": [0.00056098995077853936, 0.00056099087513660157, 0.00056099031754126621]}, - {"id": 467, "energized": 1, "p_residual": [0.0088874314629008768, 0.0029550478868447631, -0.0019573526661112819], "q_residual": [0.0005371742209937544, -0.0021174704508418124, -0.0032002725709247104]} - ] - } -} \ No newline at end of file diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/asym_output.json.license b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/asym_output.json.license deleted file mode 100644 index 7601059167..0000000000 --- a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/asym_output.json.license +++ /dev/null @@ -1,3 +0,0 @@ -SPDX-FileCopyrightText: Contributors to the Power Grid Model project - -SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/input.json.license b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/input.json.license deleted file mode 100644 index 7601059167..0000000000 --- a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/input.json.license +++ /dev/null @@ -1,3 +0,0 @@ -SPDX-FileCopyrightText: Contributors to the Power Grid Model project - -SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/params.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/params.json deleted file mode 100644 index f545fe4a55..0000000000 --- a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/params.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "calculation_method": "iterative_linear", - "rtol": 1e-8, - "atol": 1e-5 -} diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/params.json.license b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/params.json.license deleted file mode 100644 index 7601059167..0000000000 --- a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/params.json.license +++ /dev/null @@ -1,3 +0,0 @@ -SPDX-FileCopyrightText: Contributors to the Power Grid Model project - -SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/asym_output.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/asym_output.json deleted file mode 100644 index b9b3f332bd..0000000000 --- a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/asym_output.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "version": "1.0", - "type": "asym_output", - "is_batch": false, - "attributes": {}, - "data": { - "node": [ - {"id": 30, "energized": 1, "u_pu": [1.0000000100638562, 1.0000000100638426, 1.0000000100638553], "u": [230.94010999999833, 230.9401099999952, 230.94010999999813], "u_angle": [-3.6069702532602313e-05, -2.0944311720957329, 2.0943590326906585], "p": [0, 0, 0], "q": [0, 0, 0]}, - {"id": 90, "energized": 1, "u_pu": [1.0000101198407529, 1.0000101185294223, 1.0000101189297388], "u": [5773.5611188240864, 5773.5611112531151, 5773.5611135643439], "u_angle": [0, -2.0943951000605492, 2.0943951026485279], "p": [393.33711916832954, 393.34705296024589, 393.33711878749347], "q": [0.010212439213057258, 0.00027904659366014109, 0.005245307208308481]}, - {"id": 112, "energized": 1, "u_pu": [1.000000010063856, 1.0000000100638429, 1.0000000100638553], "u": [230.94010999999827, 230.94010999999526, 230.94010999999813], "u_angle": [-3.6069702532602313e-05, -2.0944311720957329, 2.0943590326906585], "p": [0, 0, 0], "q": [0, 0, 0]} - ], - "source": [ - {"id": 207, "energized": 1, "p": [393.33711916832954, 393.34705296024589, 393.33711878749347], "q": [0.010212439213057258, 0.00027904659366014109, 0.005245307208308481], "i": [0.068127298075787435, 0.068129018708000033, 0.068127298054984742], "s": [393.33711930090527, 393.34705296034485, 393.33711882246757], "pf": [0.99999999966294628, 0.99999999999974842, 0.99999999991108368]} - ], - "transformer": [ - {"id": 208, "energized": 1, "loading": 0.0018730496683868534, "p_from": [393.33711916832954, 393.34705296024589, 393.33711878749347], "q_from": [0.010212439213057258, 0.00027904659367990648, 0.0052453072082978879], "i_from": [0.068127298075787435, 0.068129018708000019, 0.068127298054984742], "s_from": [393.33711930090527, 393.34705296034485, 393.33711882246757], "p_to": [0.0021866079669657754, -0.0077474988176104848, 0.0021866296982936168], "q_to": [-0.0031187066301451298, 0.00681540331756798, 0.001848424881236158], "i_to": [1.6492944601843143e-05, 4.4680838629438272e-05, 1.2398102536798541e-05], "s_to": [0.0038088824405735325, 0.010318597787974511, 0.0028632191636395105]} - ], - "link": [ - {"id": 229, "energized": 1, "loading": 0, "p_from": [0.0099339283959259655, -0.0073611693242068748, 0], "q_from": [-0.0049674120983437707, 0.007118116679360186, 0], "i_from": [4.8093290952436835e-05, 4.4339823403351318e-05, 0], "s_from": [0.011106669902817688, 0.010239843694150316, 0], "p_to": [-0.009933928395925962, 0.0073611693242068774, 0], "q_to": [0.0049674120983437689, -0.0071181166793601869, 0], "i_to": [4.8093290952436835e-05, 4.4339823403351318e-05, 0], "s_to": [0.011106669902817686, 0.010239843694150317, 0]} - ], - "asym_voltage_sensor": [ - {"id": 329, "energized": 1, "u_residual": [1.6922071640175364e-12, 4.8202264672014671e-12, 1.89732318389845e-12]} - ], - "asym_power_sensor": [ - {"id": 466, "energized": 1, "p_residual": [-0.0021866079669657754, 0.0077474988176104848, -0.0021866296982936168], "q_residual": [0.0031187066301451298, -0.00681540331756798, -0.001848424881236158]}, - {"id": 467, "energized": 1, "p_residual": [0.0043162699002956351, -0.0026789957446007465, -0.0037121694261432999], "q_residual": [-0.0030165997023741528, 0.0014469418675200853, -0.0079959879743259094]} - ] - } -} \ No newline at end of file diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/asym_output.json.license b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/asym_output.json.license deleted file mode 100644 index 7601059167..0000000000 --- a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/asym_output.json.license +++ /dev/null @@ -1,3 +0,0 @@ -SPDX-FileCopyrightText: Contributors to the Power Grid Model project - -SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/input.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/input.json deleted file mode 100644 index bf48d252b0..0000000000 --- a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/input.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "version": "1.0", - "type": "input", - "is_batch": false, - "attributes": {}, - "data": { - "node": [ - {"id": 30, "u_rated": 400}, - {"id": 90, "u_rated": 10000}, - {"id": 112, "u_rated": 400} - ], - "source": [ - {"id": 207, "node": 90, "status": 1, "u_ref": 1, "u_ref_angle": 0} - ], - "transformer": [ - {"id": 208, "from_node": 90, "to_node": 112, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 400, "sn": 630000, "uk": 0.040000000000000001, "pk": 6800.2200000000003, "i0": 0.0018730158730158729, "p0": 1180, "winding_from": 1, "winding_to": 1, "clock": 0, "tap_side": 1, "tap_pos": 5, "tap_min": 1, "tap_max": 9, "tap_nom": 5, "tap_size": 10, "r_grounding_from": 0, "x_grounding_from": 0, "r_grounding_to": 0, "x_grounding_to": 0} - ], - "link": [ - {"id": 229, "from_node": 30, "to_node": 112, "from_status": 1, "to_status": 1} - ], - "asym_voltage_sensor": [ - {"id": 329, "measured_object": 30, "u_sigma": 2.3094000000000001, "u_measured": [230.94011, 230.94011, 230.94011]} - - ], - "asym_power_sensor": [ - {"id": 466, "measured_object": 208, "measured_terminal_type": 1, "p_measured": [0, 0, 0], "q_measured": [0, 0, 0], "p_sigma": [1000, 1000, 1000], "q_sigma": [1000, 1000, 1000]}, - {"id": 467, "measured_object": 112, "measured_terminal_type": 9, "p_measured": [0, 0, 0], "q_measured": [0, 0, 0], "p_sigma": [1000, 1000, 1000], "q_sigma": [1000, 1000, 1000]} - ] - } -} \ No newline at end of file diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/input.json.license b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/input.json.license deleted file mode 100644 index 7601059167..0000000000 --- a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/input.json.license +++ /dev/null @@ -1,3 +0,0 @@ -SPDX-FileCopyrightText: Contributors to the Power Grid Model project - -SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/params.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/params.json deleted file mode 100644 index f8f6b6074d..0000000000 --- a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/params.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "calculation_method": "newton_raphson", - "rtol": 1e-8, - "atol": 1e-5 -} diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/params.json.license b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/params.json.license deleted file mode 100644 index 7601059167..0000000000 --- a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-nrse/params.json.license +++ /dev/null @@ -1,3 +0,0 @@ -SPDX-FileCopyrightText: Contributors to the Power Grid Model project - -SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/asym_output.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/asym_output.json new file mode 100644 index 0000000000..4c059c4976 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/asym_output.json @@ -0,0 +1,29 @@ +{ + "version": "1.0", + "type": "asym_output", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 30, "energized": 1, "u_pu": [1.000000010064068, 1.000000010064068, 1.000000010064068], "u": [230.94011000004724, 230.94011000004724, 230.94011000004724], "p": [0, 0, 0], "q": [0, 0, 0]}, + {"id": 90, "energized": 1, "u_pu": [1.0000101193813746, 1.0000101193813751, 1.0000101193813746], "u": [5773.5611161718643, 5773.5611161718671, 5773.5611161718643], "p": [393.33930563990441, 393.33930564063223, 393.33930563908439], "q": [0.00709388887433921, 0.0070938906288457171, 0.0070938892082683235]}, + {"id": 112, "energized": 1, "u_pu": [1.000000010064068, 1.000000010064068, 1.000000010064068], "u": [230.94011000004724, 230.94011000004724, 230.94011000004724], "p": [0, 0, 0], "q": [0, 0, 0]} + ], + "source": [ + {"id": 207, "energized": 1, "p": [393.33930563990441, 393.33930564063223, 393.33930563908439], "q": [0.00709388887433921, 0.0070938906288457171, 0.0070938892082683235], "i": [0.068127676799353901, 0.068127676799479939, 0.068127676799211861], "s": [393.33930570387372, 393.33930570460149, 393.3393057030537], "pf": [0.99999999983736865, 0.99999999983736876, 0.99999999983736865]} + ], + "transformer": [ + {"id": 208, "energized": 1, "loading": 0.0018730443128754427, "p_from": [393.33930563990441, 393.33930564063223, 393.33930563908439], "q_from": [0.00709388887433921, 0.0070938906288644295, 0.0070938892082577018], "i_from": [0.068127676799353901, 0.068127676799479939, 0.068127676799211875], "s_from": [393.33930570387372, 393.33930570460149, 393.3393057030537], "p_to": [-2.9599540235974926e-10, -1.065247035871966e-09, -2.960409795477462e-10], "q_to": [1.7763675350654815e-09, -6.8662416846613241e-11, 5.1280073347288324e-10], "i_to": [7.797950250597033e-12, 4.6222270443732789e-12, 2.5639502485114186e-12], "s_to": [1.8008594886477745e-09, 1.0674576220727582e-09, 5.9211895242587547e-10]} + ], + "link": [ + {"id": 229, "energized": 1, "loading": 0, "p_from": [0, 0, 0], "q_from": [0, 0, 0], "i_from": [0, 0, 0], "s_from": [0, 0, 0], "p_to": [0, 0, 0], "q_to": [0, 0, 0], "i_to": [0, 0, 0], "s_to": [0, 0, 0]} + ], + "asym_voltage_sensor": [ + {"id": 329, "energized": 1, "u_residual": [0, 0, 0]} + ], + "asym_power_sensor": [ + {"id": 466, "energized": 1, "p_residual": [0, 0, 0], "q_residual": [0, 0, 0]}, + {"id": 467, "energized": 1, "p_residual": [0, 0, 0], "q_residual": [0, 0, 0]} + ] + } +} \ No newline at end of file diff --git a/tests/data/state_estimation/link-after-trafo-ilse/asym_output.json.license b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/asym_output.json.license similarity index 100% rename from tests/data/state_estimation/link-after-trafo-ilse/asym_output.json.license rename to tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/asym_output.json.license diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/input.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/input.json similarity index 91% rename from tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/input.json rename to tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/input.json index bf48d252b0..0dee80cbd5 100644 --- a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor-ilse/input.json +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/input.json @@ -19,8 +19,7 @@ {"id": 229, "from_node": 30, "to_node": 112, "from_status": 1, "to_status": 1} ], "asym_voltage_sensor": [ - {"id": 329, "measured_object": 30, "u_sigma": 2.3094000000000001, "u_measured": [230.94011, 230.94011, 230.94011]} - + {"id": 329, "measured_object": 30, "u_sigma": 2.3094, "u_measured": [230.94011, 230.94011, 230.94011]} ], "asym_power_sensor": [ {"id": 466, "measured_object": 208, "measured_terminal_type": 1, "p_measured": [0, 0, 0], "q_measured": [0, 0, 0], "p_sigma": [1000, 1000, 1000], "q_sigma": [1000, 1000, 1000]}, diff --git a/tests/data/state_estimation/link-after-trafo-ilse/input.json.license b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/input.json.license similarity index 100% rename from tests/data/state_estimation/link-after-trafo-ilse/input.json.license rename to tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/input.json.license diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json new file mode 100644 index 0000000000..d7ef8187a1 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json @@ -0,0 +1,20 @@ +{ + "calculation_method": ["iterative_linear", "newton_raphson"], + "rtol": 1e-8, + "atol": { + "default": 1e-5, + "p": 1e-2, + "q": 2e-2, + "s": 2e-2, + "p_from": 1e-2, + "q_from": 1e-2, + "i_from": 1e-4, + "s_from": 2e-2, + "p_to": 1e-2, + "q_to": 1e-2, + "i_to": 1e-4, + "s_to": 2e-2, + "p_residual": 1e-2, + "q_residual": 1e-2 + } +} diff --git a/tests/data/state_estimation/link-after-trafo-ilse/params.json.license b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json.license similarity index 100% rename from tests/data/state_estimation/link-after-trafo-ilse/params.json.license rename to tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json.license diff --git a/tests/data/state_estimation/link-after-trafo/asym_output.json b/tests/data/state_estimation/link-after-trafo/asym_output.json new file mode 100644 index 0000000000..03bde4755c --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo/asym_output.json @@ -0,0 +1,28 @@ +{ + "version": "1.0", + "type": "asym_output", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 30, "energized": 1, "u_pu": [1.000000010064068, 1.000000010064068, 1.000000010064068], "u": [230.94011000004724, 230.94011000004724, 230.94011000004724], "p": [0, 0, 0], "q": [0, 0, 0]}, + {"id": 90, "energized": 1, "u_pu": [1.0000101193813746, 1.0000101193813751, 1.0000101193813746], "u": [5773.5611161718643, 5773.5611161718671, 5773.5611161718643], "p": [393.33930563990441, 393.33930564063223, 393.33930563908439], "q": [0.00709388887433921, 0.0070938906288457171, 0.0070938892082683235]}, + {"id": 112, "energized": 1, "u_pu": [1.000000010064068, 1.000000010064068, 1.000000010064068], "u": [230.94011000004724, 230.94011000004724, 230.94011000004724], "p": [0, 0, 0], "q": [0, 0, 0]} + ], + "source": [ + {"id": 207, "energized": 1, "p": [393.33930563990441, 393.33930564063223, 393.33930563908439], "q": [0.00709388887433921, 0.0070938906288457171, 0.0070938892082683235], "i": [0.068127676799353901, 0.068127676799479939, 0.068127676799211861], "s": [393.33930570387372, 393.33930570460149, 393.3393057030537], "pf": [0.99999999983736865, 0.99999999983736876, 0.99999999983736865]} + ], + "transformer": [ + {"id": 208, "energized": 1, "loading": 0.0018730443128754427, "p_from": [393.33930563990441, 393.33930564063223, 393.33930563908439], "q_from": [0.00709388887433921, 0.0070938906288644295, 0.0070938892082577018], "i_from": [0.068127676799353901, 0.068127676799479939, 0.068127676799211875], "s_from": [393.33930570387372, 393.33930570460149, 393.3393057030537], "p_to": [-2.9599540235974926e-10, -1.065247035871966e-09, -2.960409795477462e-10], "q_to": [1.7763675350654815e-09, -6.8662416846613241e-11, 5.1280073347288324e-10], "i_to": [7.797950250597033e-12, 4.6222270443732789e-12, 2.5639502485114186e-12], "s_to": [1.8008594886477745e-09, 1.0674576220727582e-09, 5.9211895242587547e-10]} + ], + "link": [ + {"id": 229, "energized": 1, "loading": 0, "p_from": [0, 0, 0], "q_from": [0, 0, 0], "i_from": [0, 0, 0], "s_from": [0, 0, 0], "p_to": [0, 0, 0], "q_to": [0, 0, 0], "i_to": [0, 0, 0], "s_to": [0, 0, 0]} + ], + "asym_voltage_sensor": [ + {"id": 329, "energized": 1, "u_residual": [0, 0, 0]} + ], + "asym_power_sensor": [ + {"id": 466, "energized": 1, "p_residual": [0, 0, 0], "q_residual": [0, 0, 0]} + ] + } +} \ No newline at end of file diff --git a/tests/data/state_estimation/link-after-trafo-nrse/asym_output.json.license b/tests/data/state_estimation/link-after-trafo/asym_output.json.license similarity index 100% rename from tests/data/state_estimation/link-after-trafo-nrse/asym_output.json.license rename to tests/data/state_estimation/link-after-trafo/asym_output.json.license diff --git a/tests/data/state_estimation/link-after-trafo-nrse/input.json b/tests/data/state_estimation/link-after-trafo/input.json similarity index 90% rename from tests/data/state_estimation/link-after-trafo-nrse/input.json rename to tests/data/state_estimation/link-after-trafo/input.json index e1d79c5b5c..62588da098 100644 --- a/tests/data/state_estimation/link-after-trafo-nrse/input.json +++ b/tests/data/state_estimation/link-after-trafo/input.json @@ -19,8 +19,7 @@ {"id": 229, "from_node": 30, "to_node": 112, "from_status": 1, "to_status": 1} ], "asym_voltage_sensor": [ - {"id": 329, "measured_object": 30, "u_sigma": 2.3094000000000001, "u_measured": [230.94011, 230.94011, 230.94011]} - + {"id": 329, "measured_object": 30, "u_sigma": 2.3094, "u_measured": [230.94011, 230.94011, 230.94011]} ], "asym_power_sensor": [ {"id": 466, "measured_object": 208, "measured_terminal_type": 1, "p_measured": [0, 0, 0], "q_measured": [0, 0, 0], "p_sigma": [1000, 1000, 1000], "q_sigma": [1000, 1000, 1000]} diff --git a/tests/data/state_estimation/link-after-trafo-nrse/input.json.license b/tests/data/state_estimation/link-after-trafo/input.json.license similarity index 100% rename from tests/data/state_estimation/link-after-trafo-nrse/input.json.license rename to tests/data/state_estimation/link-after-trafo/input.json.license diff --git a/tests/data/state_estimation/link-after-trafo/params.json b/tests/data/state_estimation/link-after-trafo/params.json new file mode 100644 index 0000000000..7c5300b055 --- /dev/null +++ b/tests/data/state_estimation/link-after-trafo/params.json @@ -0,0 +1,20 @@ +{ + "calculation_method": ["iterative_linear", "newton_raphson"], + "rtol": 1e-8, + "atol": { + "default": 1e-5, + "p": 1e-2, + "q": 1e-2, + "s": 1e-2, + "p_from": 1e-2, + "q_from": 1e-2, + "i_from": 1e-4, + "s_from": 2e-2, + "p_to": 1e-2, + "q_to": 1e-2, + "i_to": 1e-4, + "s_to": 2e-2, + "p_residual": 1e-2, + "q_residual": 1e-2 + } +} diff --git a/tests/data/state_estimation/link-after-trafo-nrse/params.json.license b/tests/data/state_estimation/link-after-trafo/params.json.license similarity index 100% rename from tests/data/state_estimation/link-after-trafo-nrse/params.json.license rename to tests/data/state_estimation/link-after-trafo/params.json.license From 81802494054416700e9385ea6095f5f49e4255a7 Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Tue, 8 Sep 2026 10:08:42 +0200 Subject: [PATCH 05/14] revert irrelevant "fix" Signed-off-by: Santiago Figueroa Manrique --- .../power_grid_model/main_core/topological_node_output.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/topological_node_output.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/topological_node_output.hpp index bb3ba9c80b..0a0946bbeb 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/topological_node_output.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/topological_node_output.hpp @@ -96,10 +96,10 @@ inline Idx get_node_sequence_idx(main_model_state_c auto const& state, Idx compo } } -template ComponentType> +template ComponentType> inline BranchIdx const& get_branch_sequence_idx(main_model_state_c auto const& state, Idx component_idx) { return state.comp_topo - ->branch_node_idx[get_component_sequence_offset(state.components) + component_idx]; + ->branch_node_idx[get_component_sequence_offset(state.components) + component_idx]; } template ComponentType> From cecf2698dbb6ac8360cbae3510d81f8ae80ba579 Mon Sep 17 00:00:00 2001 From: Santiago Figueroa Manrique Date: Tue, 8 Sep 2026 10:27:41 +0200 Subject: [PATCH 06/14] fix related test Signed-off-by: Santiago Figueroa Manrique --- tests/cpp_unit_tests/main_core/test_main_core_output.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cpp_unit_tests/main_core/test_main_core_output.cpp b/tests/cpp_unit_tests/main_core/test_main_core_output.cpp index ba01d9a173..e2311edd59 100644 --- a/tests/cpp_unit_tests/main_core/test_main_core_output.cpp +++ b/tests/cpp_unit_tests/main_core/test_main_core_output.cpp @@ -43,7 +43,7 @@ namespace power_grid_model::main_core { namespace { using PowerSensorOutputComponents = - Container, + Container, GenericBranch, ThreeWindingTransformer, Source, Shunt, SymGenerator, SymLoad, SymPowerSensor>; using PowerSensorOutputState = MainModelState; From b69817e477a21e91a727d192197d9c4437607f93 Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Tue, 8 Sep 2026 10:30:54 +0200 Subject: [PATCH 07/14] difference between local macos and remote macos Signed-off-by: Martijn Govers --- .../link-after-trafo-with-node-injection-sensor/params.json | 2 +- tests/data/state_estimation/link-after-trafo/params.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json index d7ef8187a1..ff99a5d6f5 100644 --- a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json @@ -6,7 +6,7 @@ "p": 1e-2, "q": 2e-2, "s": 2e-2, - "p_from": 1e-2, + "p_from": 2e-2, "q_from": 1e-2, "i_from": 1e-4, "s_from": 2e-2, diff --git a/tests/data/state_estimation/link-after-trafo/params.json b/tests/data/state_estimation/link-after-trafo/params.json index 7c5300b055..fe2351eacb 100644 --- a/tests/data/state_estimation/link-after-trafo/params.json +++ b/tests/data/state_estimation/link-after-trafo/params.json @@ -6,7 +6,7 @@ "p": 1e-2, "q": 1e-2, "s": 1e-2, - "p_from": 1e-2, + "p_from": 2e-2, "q_from": 1e-2, "i_from": 1e-4, "s_from": 2e-2, From 12124dc77606e3fb3cb72e6be904a649d6301f51 Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Tue, 8 Sep 2026 10:41:47 +0200 Subject: [PATCH 08/14] fix Signed-off-by: Martijn Govers --- .../link-after-trafo-with-node-injection-sensor/params.json | 2 +- tests/data/state_estimation/link-after-trafo/params.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json index ff99a5d6f5..9b3cb6b7cc 100644 --- a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json @@ -10,7 +10,7 @@ "q_from": 1e-2, "i_from": 1e-4, "s_from": 2e-2, - "p_to": 1e-2, + "p_to": 2e-2, "q_to": 1e-2, "i_to": 1e-4, "s_to": 2e-2, diff --git a/tests/data/state_estimation/link-after-trafo/params.json b/tests/data/state_estimation/link-after-trafo/params.json index fe2351eacb..ddd0cfc0ef 100644 --- a/tests/data/state_estimation/link-after-trafo/params.json +++ b/tests/data/state_estimation/link-after-trafo/params.json @@ -10,7 +10,7 @@ "q_from": 1e-2, "i_from": 1e-4, "s_from": 2e-2, - "p_to": 1e-2, + "p_to": 2e-2, "q_to": 1e-2, "i_to": 1e-4, "s_to": 2e-2, From e63d33ddc3f430a9c4c2fb9c14f5898ea1c2a7cc Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Tue, 8 Sep 2026 10:55:40 +0200 Subject: [PATCH 09/14] also do p Signed-off-by: Martijn Govers --- .../link-after-trafo-with-node-injection-sensor/params.json | 2 +- tests/data/state_estimation/link-after-trafo/params.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json index 9b3cb6b7cc..7d585932aa 100644 --- a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json @@ -3,7 +3,7 @@ "rtol": 1e-8, "atol": { "default": 1e-5, - "p": 1e-2, + "p": 2e-2, "q": 2e-2, "s": 2e-2, "p_from": 2e-2, diff --git a/tests/data/state_estimation/link-after-trafo/params.json b/tests/data/state_estimation/link-after-trafo/params.json index ddd0cfc0ef..dd0ca793ba 100644 --- a/tests/data/state_estimation/link-after-trafo/params.json +++ b/tests/data/state_estimation/link-after-trafo/params.json @@ -3,7 +3,7 @@ "rtol": 1e-8, "atol": { "default": 1e-5, - "p": 1e-2, + "p": 2e-2, "q": 1e-2, "s": 1e-2, "p_from": 2e-2, From 3b4387a63e107d3a687c0d96ef16d151130627e1 Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Tue, 8 Sep 2026 11:24:47 +0200 Subject: [PATCH 10/14] fix musllinux Signed-off-by: Martijn Govers --- .../params.json | 4 ++-- tests/data/state_estimation/link-after-trafo/params.json | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json index 7d585932aa..70e826fad8 100644 --- a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json @@ -7,11 +7,11 @@ "q": 2e-2, "s": 2e-2, "p_from": 2e-2, - "q_from": 1e-2, + "q_from": 2e-2, "i_from": 1e-4, "s_from": 2e-2, "p_to": 2e-2, - "q_to": 1e-2, + "q_to": 2e-2, "i_to": 1e-4, "s_to": 2e-2, "p_residual": 1e-2, diff --git a/tests/data/state_estimation/link-after-trafo/params.json b/tests/data/state_estimation/link-after-trafo/params.json index dd0ca793ba..70e826fad8 100644 --- a/tests/data/state_estimation/link-after-trafo/params.json +++ b/tests/data/state_estimation/link-after-trafo/params.json @@ -4,14 +4,14 @@ "atol": { "default": 1e-5, "p": 2e-2, - "q": 1e-2, - "s": 1e-2, + "q": 2e-2, + "s": 2e-2, "p_from": 2e-2, - "q_from": 1e-2, + "q_from": 2e-2, "i_from": 1e-4, "s_from": 2e-2, "p_to": 2e-2, - "q_to": 1e-2, + "q_to": 2e-2, "i_to": 1e-4, "s_to": 2e-2, "p_residual": 1e-2, From 63b78507e0b17066fabc0da0b728426642d4c697 Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Tue, 8 Sep 2026 11:35:21 +0200 Subject: [PATCH 11/14] q_residual musllinux Signed-off-by: Martijn Govers --- .../link-after-trafo-with-node-injection-sensor/params.json | 2 +- tests/data/state_estimation/link-after-trafo/params.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json index 70e826fad8..1daf7c3915 100644 --- a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json @@ -15,6 +15,6 @@ "i_to": 1e-4, "s_to": 2e-2, "p_residual": 1e-2, - "q_residual": 1e-2 + "q_residual": 2e-2 } } diff --git a/tests/data/state_estimation/link-after-trafo/params.json b/tests/data/state_estimation/link-after-trafo/params.json index 70e826fad8..1daf7c3915 100644 --- a/tests/data/state_estimation/link-after-trafo/params.json +++ b/tests/data/state_estimation/link-after-trafo/params.json @@ -15,6 +15,6 @@ "i_to": 1e-4, "s_to": 2e-2, "p_residual": 1e-2, - "q_residual": 1e-2 + "q_residual": 2e-2 } } From 84b5f420b5aa557fa2508e6f911ec914bf777785 Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Tue, 8 Sep 2026 11:26:49 +0200 Subject: [PATCH 12/14] remove old test case from #1571 Signed-off-by: Martijn Govers --- .../state_estimation/link/asym_output.json | 254 ------------------ .../link/asym_output.json.license | 3 - tests/data/state_estimation/link/input.json | 29 -- .../state_estimation/link/input.json.license | 3 - tests/data/state_estimation/link/params.json | 12 - .../state_estimation/link/params.json.license | 3 - 6 files changed, 304 deletions(-) delete mode 100644 tests/data/state_estimation/link/asym_output.json delete mode 100644 tests/data/state_estimation/link/asym_output.json.license delete mode 100644 tests/data/state_estimation/link/input.json delete mode 100644 tests/data/state_estimation/link/input.json.license delete mode 100644 tests/data/state_estimation/link/params.json delete mode 100644 tests/data/state_estimation/link/params.json.license diff --git a/tests/data/state_estimation/link/asym_output.json b/tests/data/state_estimation/link/asym_output.json deleted file mode 100644 index f1ef399339..0000000000 --- a/tests/data/state_estimation/link/asym_output.json +++ /dev/null @@ -1,254 +0,0 @@ -{ - "version": "1.0", - "type": "asym_output", - "is_batch": false, - "attributes": {}, - "data": { - "node": [ - { - "id": 30, - "energized": 1, - "u_pu": [ - 1.0000000100640516, - 1.0000000100640518, - 1.0000000100640518 - ], - "u": [ - 230.94011000004346, - 230.94011000004352, - 230.94011000004352 - ], - "u_angle": [ - -3.607050966088345e-05, - -2.0944311729028566, - 2.094359031883535 - ], - "p": [ - 0.0, - -0.0012418410248675865, - 0.009268427792436354 - ], - "q": [ - -0.0, - -0.0021507525858327006, - -0.006119996943348736 - ] - }, - { - "id": 90, - "energized": 1, - "u_pu": [ - 1.0000101195612183, - 1.0000101195612185, - 1.0000101195612183 - ], - "u": [ - 5773.561117210193, - 5773.5611172101935, - 5773.561117210193 - ], - "u_angle": [ - -6.776195005914213e-21, - -2.0943951023931957, - 2.0943951023931957 - ], - "p": [ - 393.3408030101657, - 393.3408030098129, - 393.3408030088496 - ], - "q": [ - 0.007654988835790601, - 0.007654989582357776, - 0.00765498827708678 - ] - }, - { - "id": 112, - "energized": 1, - "u_pu": [ - 1.0000000100640516, - 1.000000010064052, - 1.0000000100640516 - ], - "u": [ - 230.94011000004346, - 230.94011000004355, - 230.94011000004346 - ], - "u_angle": [ - -3.6070509660883455e-05, - -2.0944311729028566, - 2.094359031883535 - ], - "p": [ - 0.0010466757970555023, - 0.006889802345860008, - -0.004495174863230333 - ], - "q": [ - -0.0005375343256626614, - -0.0006991445095695525, - -0.0005247856136144402 - ] - } - ], - "source": [ - { - "id": 207, - "energized": 1, - "p": [ - 393.3408030101657, - 393.3408030098129, - 393.3408030088496 - ], - "q": [ - 0.007654988835790601, - 0.007654989582357776, - 0.00765498827708678 - ], - "i": [ - 0.06812793613843621, - 0.06812793613837509, - 0.06812793613820825 - ], - "s": [ - 393.34080308465434, - 393.34080308430157, - 393.3408030833383 - ], - "pf": [ - 0.9999999998106257, - 0.9999999998106256, - 0.9999999998106256 - ] - } - ], - "transformer": [ - { - "id": 208, - "energized": 1, - "loading": 0.0018730514432576098, - "p_from": [ - 393.3408030101657, - 393.3408030098129, - 393.3408030088496 - ], - "q_from": [ - 0.007654988835790601, - 0.007654989582357776, - 0.00765498827708678 - ], - "i_from": [ - 0.06812793613843621, - 0.06812793613837509, - 0.06812793613820826 - ], - "s_from": [ - 393.34080308465434, - 393.34080308430157, - 393.3408030833383 - ], - "p_to": [ - -0.0014972687986235403, - -0.0014972693598851046, - -0.0014972685747695362 - ], - "q_to": [ - -0.0005609905429188497, - -0.0005609913192535611, - -0.0005609908303419999 - ], - "i_to": [ - 6.9234982935624505e-06, - 6.923501748849574e-06, - 6.923497822536436e-06 - ], - "s_to": [ - 0.0015989134575004255, - 0.0015989142554648143, - 0.0015989133487216264 - ] - } - ], - "link": [ - { - "id": 229, - "energized": 1, - "loading": 0.0, - "p_from": [ - 0.0, - -0.0012418410248675865, - 0.009268427792436354 - ], - "q_from": [ - -0.0, - -0.0021507525858327006, - -0.006119996943348736 - ], - "i_from": [ - 0.0, - 1.0753986783132437e-05, - 4.8093290952436835e-05 - ], - "s_from": [ - 0.0, - 0.002483526890635619, - 0.011106669902819858 - ], - "p_to": [ - 0.0, - 0.001241841024867587, - -0.009268427792436354 - ], - "q_to": [ - -0.0, - 0.0021507525858327006, - 0.006119996943348735 - ], - "i_to": [ - 0.0, - 1.0753986783132437e-05, - 4.8093290952436835e-05 - ], - "s_to": [ - 0.0, - 0.0024835268906356193, - 0.011106669902819858 - ] - } - ], - "asym_voltage_sensor": [ - { - "id": 329, - "energized": 1, - "u_residual": [ - -4.3433317209783434e-11, - -4.348459621475366e-11, - -4.348459621475366e-11 - ], - "u_angle_residual": [ - null, - null, - null - ] - } - ], - "asym_power_sensor": [ - { - "id": 466, - "energized": 1, - "p_residual": [ - 0.0014972687986235403, - 0.0014972693598851046, - 0.0014972685747695362 - ], - "q_residual": [ - 0.0005609905429188497, - 0.0005609913192535611, - 0.0005609908303419999 - ] - } - ] - } -} diff --git a/tests/data/state_estimation/link/asym_output.json.license b/tests/data/state_estimation/link/asym_output.json.license deleted file mode 100644 index 7601059167..0000000000 --- a/tests/data/state_estimation/link/asym_output.json.license +++ /dev/null @@ -1,3 +0,0 @@ -SPDX-FileCopyrightText: Contributors to the Power Grid Model project - -SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link/input.json b/tests/data/state_estimation/link/input.json deleted file mode 100644 index e1d79c5b5c..0000000000 --- a/tests/data/state_estimation/link/input.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "version": "1.0", - "type": "input", - "is_batch": false, - "attributes": {}, - "data": { - "node": [ - {"id": 30, "u_rated": 400}, - {"id": 90, "u_rated": 10000}, - {"id": 112, "u_rated": 400} - ], - "source": [ - {"id": 207, "node": 90, "status": 1, "u_ref": 1, "u_ref_angle": 0} - ], - "transformer": [ - {"id": 208, "from_node": 90, "to_node": 112, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 400, "sn": 630000, "uk": 0.040000000000000001, "pk": 6800.2200000000003, "i0": 0.0018730158730158729, "p0": 1180, "winding_from": 1, "winding_to": 1, "clock": 0, "tap_side": 1, "tap_pos": 5, "tap_min": 1, "tap_max": 9, "tap_nom": 5, "tap_size": 10, "r_grounding_from": 0, "x_grounding_from": 0, "r_grounding_to": 0, "x_grounding_to": 0} - ], - "link": [ - {"id": 229, "from_node": 30, "to_node": 112, "from_status": 1, "to_status": 1} - ], - "asym_voltage_sensor": [ - {"id": 329, "measured_object": 30, "u_sigma": 2.3094000000000001, "u_measured": [230.94011, 230.94011, 230.94011]} - - ], - "asym_power_sensor": [ - {"id": 466, "measured_object": 208, "measured_terminal_type": 1, "p_measured": [0, 0, 0], "q_measured": [0, 0, 0], "p_sigma": [1000, 1000, 1000], "q_sigma": [1000, 1000, 1000]} - ] - } -} \ No newline at end of file diff --git a/tests/data/state_estimation/link/input.json.license b/tests/data/state_estimation/link/input.json.license deleted file mode 100644 index 7601059167..0000000000 --- a/tests/data/state_estimation/link/input.json.license +++ /dev/null @@ -1,3 +0,0 @@ -SPDX-FileCopyrightText: Contributors to the Power Grid Model project - -SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/state_estimation/link/params.json b/tests/data/state_estimation/link/params.json deleted file mode 100644 index 11b506051b..0000000000 --- a/tests/data/state_estimation/link/params.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "calculation_method": ["iterative_linear", "newton_raphson"], - "rtol": 1e-3, - "atol": { - "default": 1e-5, - ".+_residual": 0.15 - }, - "xfail": { - "raises": "SparseMatrixError", - "reason": "Bug in https://github.com/PowerGridModel/power-grid-model/issues/1567" - } -} diff --git a/tests/data/state_estimation/link/params.json.license b/tests/data/state_estimation/link/params.json.license deleted file mode 100644 index 7601059167..0000000000 --- a/tests/data/state_estimation/link/params.json.license +++ /dev/null @@ -1,3 +0,0 @@ -SPDX-FileCopyrightText: Contributors to the Power Grid Model project - -SPDX-License-Identifier: MPL-2.0 From f9cbce39c14a71a8c80cba09442406a15c2db906 Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Tue, 8 Sep 2026 11:32:41 +0200 Subject: [PATCH 13/14] mark xfail Signed-off-by: Martijn Govers --- .../link-after-trafo-with-node-injection-sensor/params.json | 4 ++++ tests/data/state_estimation/link-after-trafo/params.json | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json index 1daf7c3915..d666f1a7bb 100644 --- a/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json +++ b/tests/data/state_estimation/link-after-trafo-with-node-injection-sensor/params.json @@ -16,5 +16,9 @@ "s_to": 2e-2, "p_residual": 1e-2, "q_residual": 2e-2 + }, + "xfail": { + "raises": "SparseMatrixError", + "reason": "Bug in https://github.com/PowerGridModel/power-grid-model/issues/1567" } } diff --git a/tests/data/state_estimation/link-after-trafo/params.json b/tests/data/state_estimation/link-after-trafo/params.json index 1daf7c3915..d666f1a7bb 100644 --- a/tests/data/state_estimation/link-after-trafo/params.json +++ b/tests/data/state_estimation/link-after-trafo/params.json @@ -16,5 +16,9 @@ "s_to": 2e-2, "p_residual": 1e-2, "q_residual": 2e-2 + }, + "xfail": { + "raises": "SparseMatrixError", + "reason": "Bug in https://github.com/PowerGridModel/power-grid-model/issues/1567" } } From 92634bdfecdd1a8f18710f7bcb0fc5658952718f Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Tue, 8 Sep 2026 17:33:19 +0200 Subject: [PATCH 14/14] add TODOs for cleanup v2 Signed-off-by: Martijn Govers --- .../power_grid_model/main_core/output.hpp | 6 ++- .../power_grid_model/main_core/topology.hpp | 51 ++++++++++--------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/output.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/output.hpp index 61b082a3c7..92e811eb63 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/output.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/output.hpp @@ -60,9 +60,11 @@ constexpr bool measured_terminal_active(MeasuredTerminalType const terminal_type using enum MeasuredTerminalType; case branch_from: - return measured_component_active(state, obj_seq, BranchSide::from); + return measured_component_active(state, obj_seq, + BranchSide::from); // TODO(mgovers): cleanup v2: change back to Branch case branch_to: - return measured_component_active(state, obj_seq, BranchSide::to); + return measured_component_active(state, obj_seq, + BranchSide::to); // TODO(mgovers): cleanup v2: change back to Branch case source: return measured_component_active(state, obj_seq); case shunt: diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/topology.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/topology.hpp index 0e06b19c72..1e9b7bd58e 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/topology.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/main_core/topology.hpp @@ -121,7 +121,8 @@ constexpr void register_topology_components(ComponentContainer const& components case branch_from: [[fallthrough]]; case branch_to: - return get_component_sequence_idx(components, measured_object); + return get_component_sequence_idx( + components, measured_object); // TODO(mgovers): cleanup v2: change back to Branch case source: return get_component_sequence_idx(components, measured_object); case shunt: @@ -152,28 +153,29 @@ constexpr void register_topology_components(ComponentContainer const& components template Component, class ComponentContainer> requires common::component_container_c constexpr void register_topology_components(ComponentContainer const& components, ComponentTopology& comp_topo) { - apply_registration(components, comp_topo.current_sensor_object_idx, - [&components](GenericCurrentSensor const& current_sensor) { - using enum MeasuredTerminalType; - - auto const measured_object = current_sensor.measured_object(); - - switch (current_sensor.get_terminal_type()) { - case branch_from: - [[fallthrough]]; - case branch_to: - return get_component_sequence_idx(components, measured_object); - case branch3_1: - [[fallthrough]]; - case branch3_2: - [[fallthrough]]; - case branch3_3: - return get_component_sequence_idx(components, measured_object); - default: - throw MissingCaseForEnumError("Current sensor idx to seq transformation", - current_sensor.get_terminal_type()); - } - }); + apply_registration( + components, comp_topo.current_sensor_object_idx, [&components](GenericCurrentSensor const& current_sensor) { + using enum MeasuredTerminalType; + + auto const measured_object = current_sensor.measured_object(); + + switch (current_sensor.get_terminal_type()) { + case branch_from: + [[fallthrough]]; + case branch_to: + return get_component_sequence_idx( + components, measured_object); // TODO(mgovers): cleanup v2: change back to Branch + case branch3_1: + [[fallthrough]]; + case branch3_2: + [[fallthrough]]; + case branch3_3: + return get_component_sequence_idx(components, measured_object); + default: + throw MissingCaseForEnumError("Current sensor idx to seq transformation", + current_sensor.get_terminal_type()); + } + }); apply_registration( components, comp_topo.current_sensor_terminal_type, @@ -187,7 +189,8 @@ constexpr void register_topology_components(ComponentContainer const& components components, comp_topo.regulated_object_idx, [&components](Regulator const& regulator) { switch (regulator.regulated_object_type()) { case ComponentType::branch: - return get_component_sequence_idx(components, regulator.regulated_object()); + return get_component_sequence_idx( + components, regulator.regulated_object()); // TODO(mgovers): cleanup v2: change back to Branch case ComponentType::branch3: return get_component_sequence_idx(components, regulator.regulated_object()); case ComponentType::generic_load_gen: