From 148c8f104b7d2b1cd5b9b503f3302c9dad35eb2e Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Fri, 11 Oct 2024 13:33:10 +0200 Subject: [PATCH 1/2] auto tap validation test for meshed grid with transformers Signed-off-by: Martijn Govers --- .../auto-tap-changer-meshed-any/input.json | 59 +++++++++++++++++++ .../input.json.license | 3 + .../auto-tap-changer-meshed-any/params.json | 6 ++ .../params.json.license | 3 + .../sym_output.json | 28 +++++++++ .../sym_output.json.license | 3 + .../input.json | 59 +++++++++++++++++++ .../input.json.license | 3 + .../params.json | 6 ++ .../params.json.license | 3 + .../sym_output.json | 28 +++++++++ .../sym_output.json.license | 3 + .../auto-tap-changer-meshed-max/input.json | 59 +++++++++++++++++++ .../input.json.license | 3 + .../auto-tap-changer-meshed-max/params.json | 6 ++ .../params.json.license | 3 + .../sym_output.json | 28 +++++++++ .../sym_output.json.license | 3 + .../auto-tap-changer-meshed-min/input.json | 59 +++++++++++++++++++ .../input.json.license | 3 + .../auto-tap-changer-meshed-min/params.json | 6 ++ .../params.json.license | 3 + .../sym_output.json | 28 +++++++++ .../sym_output.json.license | 3 + 24 files changed, 408 insertions(+) create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/input.json create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/input.json.license create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/params.json create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/params.json.license create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/sym_output.json create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/sym_output.json.license create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/input.json create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/input.json.license create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/params.json create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/params.json.license create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/sym_output.json create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/sym_output.json.license create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/input.json create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/input.json.license create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/params.json create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/params.json.license create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/sym_output.json create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/sym_output.json.license create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/input.json create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/input.json.license create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/params.json create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/params.json.license create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/sym_output.json create mode 100644 tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/sym_output.json.license diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/input.json b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/input.json new file mode 100644 index 000000000..1eadd98aa --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/input.json @@ -0,0 +1,59 @@ +{ + "version": "1.0", + "type": "input", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 0, "u_rated": 10000}, + {"id": 1, "u_rated": 10000}, + {"id": 2, "u_rated": 10000}, + {"id": 3, "u_rated": 10000}, + {"id": 4, "u_rated": 10000}, + {"id": 5, "u_rated": 10000}, + {"id": 6, "u_rated": 10000}, + {"id": 7, "u_rated": 400}, + {"id": 8, "u_rated": 400}, + {"id": 9, "u_rated": 400}, + {"id": 10, "u_rated": 400} + ], + "line": [ + {"id": 11, "from_node": 0, "to_node": 1, "from_status": 1, "to_status": 1, "r1": 0.005, "x1": 0.5, "c1": 0, "tan1": 0}, + {"id": 12, "from_node": 0, "to_node": 2, "from_status": 1, "to_status": 1, "r1": 0.1, "x1": 0.6, "c1": 0, "tan1": 0}, + {"id": 13, "from_node": 3, "to_node": 5, "from_status": 1, "to_status": 1, "r1": 0.005, "x1": 0.5, "c1": 0, "tan1": 0}, + {"id": 14, "from_node": 4, "to_node": 6, "from_status": 1, "to_status": 1, "r1": 0.003, "x1": 0.3, "c1": 0, "tan1": 0}, + {"id": 15, "from_node": 7, "to_node": 9, "from_status": 1, "to_status": 1, "r1": 0.005, "x1": 0.5, "c1": 0, "tan1": 0}, + {"id": 16, "from_node": 8, "to_node": 9, "from_status": 1, "to_status": 1, "r1": 0.005, "x1": 0.6, "c1": 0, "tan1": 0} + ], + "transformer": [ + {"id": 17, "from_node": 1, "to_node": 3, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 10000, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 100}, + {"id": 18, "from_node": 2, "to_node": 4, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 10000, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 100}, + {"id": 19, "from_node": 5, "to_node": 7, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 400, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 20}, + {"id": 20, "from_node": 6, "to_node": 8, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 400, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 20}, + {"id": 21, "from_node": 9, "to_node": 10, "from_status": 1, "to_status": 1, "u1": 400, "u2": 400, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 20} + ], + "source": [ + {"id": 22, "node": 0, "status": 1, "u_ref": 1} + ], + "sym_load": [ + {"id": 23, "node": 0, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 24, "node": 1, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 25, "node": 2, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 26, "node": 3, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 27, "node": 4, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 28, "node": 5, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 29, "node": 6, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 30, "node": 7, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 31, "node": 8, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 32, "node": 9, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 33, "node": 10, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000} + ], + "transformer_tap_regulator": [ + {"id": 34, "regulated_object": 17, "status": 1, "control_side": 1, "u_set": 10000, "u_band": 300}, + {"id": 35, "regulated_object": 18, "status": 1, "control_side": 1, "u_set": 10000, "u_band": 300}, + {"id": 36, "regulated_object": 19, "status": 1, "control_side": 1, "u_set": 400, "u_band": 60}, + {"id": 37, "regulated_object": 20, "status": 1, "control_side": 1, "u_set": 400, "u_band": 60}, + {"id": 38, "regulated_object": 21, "status": 1, "control_side": 1, "u_set": 400, "u_band": 60} + ] + } +} \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/input.json.license b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/input.json.license new file mode 100644 index 000000000..2fcbfaeb5 --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/input.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/params.json b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/params.json new file mode 100644 index 000000000..9b92db92d --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/params.json @@ -0,0 +1,6 @@ +{ + "calculation_method": "newton_raphson", + "tap_changing_strategy": "any_valid_tap", + "rtol": 1e-05, + "atol": 1e-05 +} \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/params.json.license b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/params.json.license new file mode 100644 index 000000000..2fcbfaeb5 --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/params.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/sym_output.json b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/sym_output.json new file mode 100644 index 000000000..621c51c81 --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/sym_output.json @@ -0,0 +1,28 @@ +{ + "version": "1.0", + "type": "sym_output", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 0, "energized": 1, "u_pu": 0.9999685775574514, "u": 9999.685775574513, "u_angle": -0.0001080162531878653, "p": 1006027.827552064, "q": 195120.3069521648}, + {"id": 1, "energized": 1, "u_pu": 0.9994333873631714, "u": 9994.333873631715, "u_angle": -0.002665398059250737, "p": -99999.99999999323, "q": -9999.999999921869}, + {"id": 2, "energized": 1, "u_pu": 0.9989235130236771, "u": 9989.235130236772, "u_angle": -0.002981643256713985, "p": -99999.99999997459, "q": -9999.999999939741}, + {"id": 3, "energized": 1, "u_pu": 0.994851508142734, "u": 9948.51508142734, "u_angle": -2.619640099240546, "p": -100000.0000000401, "q": -9999.999999995298}, + {"id": 4, "energized": 1, "u_pu": 0.9945461001910171, "u": 9945.461001910171, "u_angle": -2.620069171582145, "p": -100000.000000009, "q": -9999.999999940057}, + {"id": 5, "energized": 1, "u_pu": 0.9944290227324328, "u": 9944.290227324329, "u_angle": -2.621203754353982, "p": -99999.99999995019, "q": -9999.999999937614}, + {"id": 6, "energized": 1, "u_pu": 0.9943233999502603, "u": 9943.233999502603, "u_angle": -2.62095218690015, "p": -100000.0000000192, "q": -10000.00000005206}, + {"id": 7, "energized": 1, "u_pu": 0.9920807600913329, "u": 396.8323040365332, "u_angle": 1.044783740215204, "p": -99999.99999998928, "q": -9999.999999983958}, + {"id": 8, "energized": 1, "u_pu": 0.992180588914527, "u": 396.8722355658108, "u_angle": 1.044923623034546, "p": -100000.000000007, "q": -10000.00000000539}, + {"id": 9, "energized": 1, "u_pu": 0.8682948639612919, "u": 347.3179455845167, "u_angle": 0.6381168383951473, "p": -99999.99999999936, "q": -10000.00000000324}, + {"id": 10, "energized": 1, "u_pu": 0.9636190035727636, "u": 385.4476014291055, "u_angle": -1.979757523221217, "p": -100000.0000000106, "q": -9999.999999998947} + ], + "transformer_tap_regulator": [ + {"id": 34, "energized": 1, "tap_pos": 0}, + {"id": 35, "energized": 1, "tap_pos": 0}, + {"id": 36, "energized": 1, "tap_pos": 0}, + {"id": 37, "energized": 1, "tap_pos": 0}, + {"id": 38, "energized": 1, "tap_pos": -2} + ] + } +} \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/sym_output.json.license b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/sym_output.json.license new file mode 100644 index 000000000..2fcbfaeb5 --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/sym_output.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/input.json b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/input.json new file mode 100644 index 000000000..1eadd98aa --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/input.json @@ -0,0 +1,59 @@ +{ + "version": "1.0", + "type": "input", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 0, "u_rated": 10000}, + {"id": 1, "u_rated": 10000}, + {"id": 2, "u_rated": 10000}, + {"id": 3, "u_rated": 10000}, + {"id": 4, "u_rated": 10000}, + {"id": 5, "u_rated": 10000}, + {"id": 6, "u_rated": 10000}, + {"id": 7, "u_rated": 400}, + {"id": 8, "u_rated": 400}, + {"id": 9, "u_rated": 400}, + {"id": 10, "u_rated": 400} + ], + "line": [ + {"id": 11, "from_node": 0, "to_node": 1, "from_status": 1, "to_status": 1, "r1": 0.005, "x1": 0.5, "c1": 0, "tan1": 0}, + {"id": 12, "from_node": 0, "to_node": 2, "from_status": 1, "to_status": 1, "r1": 0.1, "x1": 0.6, "c1": 0, "tan1": 0}, + {"id": 13, "from_node": 3, "to_node": 5, "from_status": 1, "to_status": 1, "r1": 0.005, "x1": 0.5, "c1": 0, "tan1": 0}, + {"id": 14, "from_node": 4, "to_node": 6, "from_status": 1, "to_status": 1, "r1": 0.003, "x1": 0.3, "c1": 0, "tan1": 0}, + {"id": 15, "from_node": 7, "to_node": 9, "from_status": 1, "to_status": 1, "r1": 0.005, "x1": 0.5, "c1": 0, "tan1": 0}, + {"id": 16, "from_node": 8, "to_node": 9, "from_status": 1, "to_status": 1, "r1": 0.005, "x1": 0.6, "c1": 0, "tan1": 0} + ], + "transformer": [ + {"id": 17, "from_node": 1, "to_node": 3, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 10000, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 100}, + {"id": 18, "from_node": 2, "to_node": 4, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 10000, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 100}, + {"id": 19, "from_node": 5, "to_node": 7, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 400, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 20}, + {"id": 20, "from_node": 6, "to_node": 8, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 400, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 20}, + {"id": 21, "from_node": 9, "to_node": 10, "from_status": 1, "to_status": 1, "u1": 400, "u2": 400, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 20} + ], + "source": [ + {"id": 22, "node": 0, "status": 1, "u_ref": 1} + ], + "sym_load": [ + {"id": 23, "node": 0, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 24, "node": 1, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 25, "node": 2, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 26, "node": 3, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 27, "node": 4, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 28, "node": 5, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 29, "node": 6, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 30, "node": 7, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 31, "node": 8, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 32, "node": 9, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 33, "node": 10, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000} + ], + "transformer_tap_regulator": [ + {"id": 34, "regulated_object": 17, "status": 1, "control_side": 1, "u_set": 10000, "u_band": 300}, + {"id": 35, "regulated_object": 18, "status": 1, "control_side": 1, "u_set": 10000, "u_band": 300}, + {"id": 36, "regulated_object": 19, "status": 1, "control_side": 1, "u_set": 400, "u_band": 60}, + {"id": 37, "regulated_object": 20, "status": 1, "control_side": 1, "u_set": 400, "u_band": 60}, + {"id": 38, "regulated_object": 21, "status": 1, "control_side": 1, "u_set": 400, "u_band": 60} + ] + } +} \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/input.json.license b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/input.json.license new file mode 100644 index 000000000..2fcbfaeb5 --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/input.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/params.json b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/params.json new file mode 100644 index 000000000..614875394 --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/params.json @@ -0,0 +1,6 @@ +{ + "calculation_method": "newton_raphson", + "tap_changing_strategy": "fast_any_tap", + "rtol": 1e-05, + "atol": 1e-05 +} \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/params.json.license b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/params.json.license new file mode 100644 index 000000000..2fcbfaeb5 --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/params.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/sym_output.json b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/sym_output.json new file mode 100644 index 000000000..8654509b4 --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/sym_output.json @@ -0,0 +1,28 @@ +{ + "version": "1.0", + "type": "sym_output", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 0, "energized": 1, "u_pu": 0.9999685792035808, "u": 9999.685792035809, "u_angle": -0.000108015064043123, "p": 1006014.359531452, "q": 195105.1126860094}, + {"id": 1, "energized": 1, "u_pu": 0.9994334306729814, "u": 9994.334306729814, "u_angle": -0.002665360388354479, "p": -99999.99999998668, "q": -10000.00000006777}, + {"id": 2, "energized": 1, "u_pu": 0.9989235622047079, "u": 9989.235622047079, "u_angle": -0.002981612107417925, "p": -100000.0000000164, "q": -10000.00000001979}, + {"id": 3, "energized": 1, "u_pu": 0.9948516332849774, "u": 9948.516332849775, "u_angle": -2.619640153725786, "p": -100000.0000000246, "q": -9999.999999982891}, + {"id": 4, "energized": 1, "u_pu": 0.994546217468617, "u": 9945.46217468617, "u_angle": -2.620069217451806, "p": -100000.0000000696, "q": -9999.99999988202}, + {"id": 5, "energized": 1, "u_pu": 0.9944291896054542, "u": 9944.291896054543, "u_angle": -2.621203772068462, "p": -99999.99999996748, "q": -10000.00000002437}, + {"id": 6, "energized": 1, "u_pu": 0.9943235381522523, "u": 9943.235381522523, "u_angle": -2.620952214419493, "p": -99999.99999996387, "q": -9999.999999981774}, + {"id": 7, "energized": 1, "u_pu": 0.9920810084787994, "u": 396.8324033915198, "u_angle": 1.04478362979705, "p": -99999.99999999025, "q": -9999.999999985541}, + {"id": 8, "energized": 1, "u_pu": 0.9921807948861237, "u": 396.8723179544494, "u_angle": 1.044923518025388, "p": -99999.99999997883, "q": -9999.999999995283}, + {"id": 9, "energized": 1, "u_pu": 0.8683101472161173, "u": 347.3240588864469, "u_angle": 0.6381526062152355, "p": -100000.000000015, "q": -9999.999999996206}, + {"id": 10, "energized": 1, "u_pu": 1.02045250228686, "u": 408.1810009147442, "u_angle": -1.979734683670089, "p": -99999.99999996256, "q": -10000.00000000768} + ], + "transformer_tap_regulator": [ + {"id": 34, "energized": 1, "tap_pos": 0}, + {"id": 35, "energized": 1, "tap_pos": 0}, + {"id": 36, "energized": 1, "tap_pos": 0}, + {"id": 37, "energized": 1, "tap_pos": 0}, + {"id": 38, "energized": 1, "tap_pos": -3} + ] + } +} \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/sym_output.json.license b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/sym_output.json.license new file mode 100644 index 000000000..2fcbfaeb5 --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/sym_output.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/input.json b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/input.json new file mode 100644 index 000000000..1eadd98aa --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/input.json @@ -0,0 +1,59 @@ +{ + "version": "1.0", + "type": "input", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 0, "u_rated": 10000}, + {"id": 1, "u_rated": 10000}, + {"id": 2, "u_rated": 10000}, + {"id": 3, "u_rated": 10000}, + {"id": 4, "u_rated": 10000}, + {"id": 5, "u_rated": 10000}, + {"id": 6, "u_rated": 10000}, + {"id": 7, "u_rated": 400}, + {"id": 8, "u_rated": 400}, + {"id": 9, "u_rated": 400}, + {"id": 10, "u_rated": 400} + ], + "line": [ + {"id": 11, "from_node": 0, "to_node": 1, "from_status": 1, "to_status": 1, "r1": 0.005, "x1": 0.5, "c1": 0, "tan1": 0}, + {"id": 12, "from_node": 0, "to_node": 2, "from_status": 1, "to_status": 1, "r1": 0.1, "x1": 0.6, "c1": 0, "tan1": 0}, + {"id": 13, "from_node": 3, "to_node": 5, "from_status": 1, "to_status": 1, "r1": 0.005, "x1": 0.5, "c1": 0, "tan1": 0}, + {"id": 14, "from_node": 4, "to_node": 6, "from_status": 1, "to_status": 1, "r1": 0.003, "x1": 0.3, "c1": 0, "tan1": 0}, + {"id": 15, "from_node": 7, "to_node": 9, "from_status": 1, "to_status": 1, "r1": 0.005, "x1": 0.5, "c1": 0, "tan1": 0}, + {"id": 16, "from_node": 8, "to_node": 9, "from_status": 1, "to_status": 1, "r1": 0.005, "x1": 0.6, "c1": 0, "tan1": 0} + ], + "transformer": [ + {"id": 17, "from_node": 1, "to_node": 3, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 10000, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 100}, + {"id": 18, "from_node": 2, "to_node": 4, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 10000, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 100}, + {"id": 19, "from_node": 5, "to_node": 7, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 400, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 20}, + {"id": 20, "from_node": 6, "to_node": 8, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 400, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 20}, + {"id": 21, "from_node": 9, "to_node": 10, "from_status": 1, "to_status": 1, "u1": 400, "u2": 400, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 20} + ], + "source": [ + {"id": 22, "node": 0, "status": 1, "u_ref": 1} + ], + "sym_load": [ + {"id": 23, "node": 0, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 24, "node": 1, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 25, "node": 2, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 26, "node": 3, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 27, "node": 4, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 28, "node": 5, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 29, "node": 6, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 30, "node": 7, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 31, "node": 8, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 32, "node": 9, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 33, "node": 10, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000} + ], + "transformer_tap_regulator": [ + {"id": 34, "regulated_object": 17, "status": 1, "control_side": 1, "u_set": 10000, "u_band": 300}, + {"id": 35, "regulated_object": 18, "status": 1, "control_side": 1, "u_set": 10000, "u_band": 300}, + {"id": 36, "regulated_object": 19, "status": 1, "control_side": 1, "u_set": 400, "u_band": 60}, + {"id": 37, "regulated_object": 20, "status": 1, "control_side": 1, "u_set": 400, "u_band": 60}, + {"id": 38, "regulated_object": 21, "status": 1, "control_side": 1, "u_set": 400, "u_band": 60} + ] + } +} \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/input.json.license b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/input.json.license new file mode 100644 index 000000000..2fcbfaeb5 --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/input.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/params.json b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/params.json new file mode 100644 index 000000000..d22393c9e --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/params.json @@ -0,0 +1,6 @@ +{ + "calculation_method": "newton_raphson", + "tap_changing_strategy": "max_voltage_tap", + "rtol": 1e-05, + "atol": 1e-05 +} \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/params.json.license b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/params.json.license new file mode 100644 index 000000000..2fcbfaeb5 --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/params.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/sym_output.json b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/sym_output.json new file mode 100644 index 000000000..8b6b48eb5 --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/sym_output.json @@ -0,0 +1,28 @@ +{ + "version": "1.0", + "type": "sym_output", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 0, "energized": 1, "u_pu": 0.9999694219207165, "u": 9999.694219207166, "u_angle": -0.000108073777055777, "p": 1005760.974499936, "q": 186661.7100759184}, + {"id": 1, "energized": 1, "u_pu": 0.9994572959993493, "u": 9994.572959993493, "u_angle": -0.00266487711839271, "p": -99999.99999999008, "q": -9999.9999999917}, + {"id": 2, "energized": 1, "u_pu": 0.9989475687887489, "u": 9989.475687887489, "u_angle": -0.002984773120947201, "p": -99999.99999997644, "q": -10000.00000000708}, + {"id": 3, "energized": 1, "u_pu": 1.005018452903429, "u": 10050.18452903429, "u_angle": -2.619710441685425, "p": -100000.0000000126, "q": -10000.00000001087}, + {"id": 4, "energized": 1, "u_pu": 1.004705657034634, "u": 10047.05657034634, "u_angle": -2.620132571355066, "p": -100000.0000001293, "q": -10000.00000002875}, + {"id": 5, "energized": 1, "u_pu": 1.004623136812936, "u": 10046.23136812936, "u_angle": -2.621242309106458, "p": -100000.0000000131, "q": -10000.00000004449}, + {"id": 6, "energized": 1, "u_pu": 1.004496676021677, "u": 10044.96676021677, "u_angle": -2.620997700995084, "p": -99999.9999998436, "q": -9999.999999970283}, + {"id": 7, "energized": 1, "u_pu": 1.022848723893756, "u": 409.1394895575023, "u_angle": 1.044649462434896, "p": -99999.99999997977, "q": -9999.99999998119}, + {"id": 8, "energized": 1, "u_pu": 1.022918677382032, "u": 409.1674709528126, "u_angle": 1.044797037412629, "p": -100000.0000000123, "q": -9999.999999981121}, + {"id": 9, "energized": 1, "u_pu": 0.9111926311153715, "u": 364.4770524461486, "u_angle": 0.6704313952514609, "p": -99999.99999999734, "q": -10000.00000000421}, + {"id": 10, "energized": 1, "u_pu": 1.070953828958853, "u": 428.3815315835412, "u_angle": -1.947465700544465, "p": -100000.0000000154, "q": -9999.999999999627} + ], + "transformer_tap_regulator": [ + {"id": 34, "energized": 1, "tap_pos": -1}, + {"id": 35, "energized": 1, "tap_pos": -1}, + {"id": 36, "energized": 1, "tap_pos": -10}, + {"id": 37, "energized": 1, "tap_pos": -10}, + {"id": 38, "energized": 1, "tap_pos": -3} + ] + } +} \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/sym_output.json.license b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/sym_output.json.license new file mode 100644 index 000000000..2fcbfaeb5 --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/sym_output.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/input.json b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/input.json new file mode 100644 index 000000000..1eadd98aa --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/input.json @@ -0,0 +1,59 @@ +{ + "version": "1.0", + "type": "input", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 0, "u_rated": 10000}, + {"id": 1, "u_rated": 10000}, + {"id": 2, "u_rated": 10000}, + {"id": 3, "u_rated": 10000}, + {"id": 4, "u_rated": 10000}, + {"id": 5, "u_rated": 10000}, + {"id": 6, "u_rated": 10000}, + {"id": 7, "u_rated": 400}, + {"id": 8, "u_rated": 400}, + {"id": 9, "u_rated": 400}, + {"id": 10, "u_rated": 400} + ], + "line": [ + {"id": 11, "from_node": 0, "to_node": 1, "from_status": 1, "to_status": 1, "r1": 0.005, "x1": 0.5, "c1": 0, "tan1": 0}, + {"id": 12, "from_node": 0, "to_node": 2, "from_status": 1, "to_status": 1, "r1": 0.1, "x1": 0.6, "c1": 0, "tan1": 0}, + {"id": 13, "from_node": 3, "to_node": 5, "from_status": 1, "to_status": 1, "r1": 0.005, "x1": 0.5, "c1": 0, "tan1": 0}, + {"id": 14, "from_node": 4, "to_node": 6, "from_status": 1, "to_status": 1, "r1": 0.003, "x1": 0.3, "c1": 0, "tan1": 0}, + {"id": 15, "from_node": 7, "to_node": 9, "from_status": 1, "to_status": 1, "r1": 0.005, "x1": 0.5, "c1": 0, "tan1": 0}, + {"id": 16, "from_node": 8, "to_node": 9, "from_status": 1, "to_status": 1, "r1": 0.005, "x1": 0.6, "c1": 0, "tan1": 0} + ], + "transformer": [ + {"id": 17, "from_node": 1, "to_node": 3, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 10000, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 100}, + {"id": 18, "from_node": 2, "to_node": 4, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 10000, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 100}, + {"id": 19, "from_node": 5, "to_node": 7, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 400, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 20}, + {"id": 20, "from_node": 6, "to_node": 8, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 400, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 20}, + {"id": 21, "from_node": 9, "to_node": 10, "from_status": 1, "to_status": 1, "u1": 400, "u2": 400, "sn": 300000, "uk": 0.0005, "pk": 1000, "i0": 0, "p0": 0, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -10, "tap_max": 10, "tap_size": 20} + ], + "source": [ + {"id": 22, "node": 0, "status": 1, "u_ref": 1} + ], + "sym_load": [ + {"id": 23, "node": 0, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 24, "node": 1, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 25, "node": 2, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 26, "node": 3, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 27, "node": 4, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 28, "node": 5, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 29, "node": 6, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 30, "node": 7, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 31, "node": 8, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 32, "node": 9, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000}, + {"id": 33, "node": 10, "status": 1, "type": 0, "p_specified": 100000, "q_specified": 10000} + ], + "transformer_tap_regulator": [ + {"id": 34, "regulated_object": 17, "status": 1, "control_side": 1, "u_set": 10000, "u_band": 300}, + {"id": 35, "regulated_object": 18, "status": 1, "control_side": 1, "u_set": 10000, "u_band": 300}, + {"id": 36, "regulated_object": 19, "status": 1, "control_side": 1, "u_set": 400, "u_band": 60}, + {"id": 37, "regulated_object": 20, "status": 1, "control_side": 1, "u_set": 400, "u_band": 60}, + {"id": 38, "regulated_object": 21, "status": 1, "control_side": 1, "u_set": 400, "u_band": 60} + ] + } +} \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/input.json.license b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/input.json.license new file mode 100644 index 000000000..2fcbfaeb5 --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/input.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/params.json b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/params.json new file mode 100644 index 000000000..a8c656c79 --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/params.json @@ -0,0 +1,6 @@ +{ + "calculation_method": "newton_raphson", + "tap_changing_strategy": "min_voltage_tap", + "rtol": 1e-05, + "atol": 1e-05 +} \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/params.json.license b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/params.json.license new file mode 100644 index 000000000..2fcbfaeb5 --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/params.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/sym_output.json b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/sym_output.json new file mode 100644 index 000000000..343704e3f --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/sym_output.json @@ -0,0 +1,28 @@ +{ + "version": "1.0", + "type": "sym_output", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 0, "energized": 1, "u_pu": 0.9999679360438888, "u": 9999.679360438888, "u_angle": -0.0001079656398834563, "p": 1006161.82777068, "q": 201553.6841024437}, + {"id": 1, "energized": 1, "u_pu": 0.9994152027388719, "u": 9994.152027388718, "u_angle": -0.00266561095796142, "p": -99999.99999999082, "q": -9999.999999996553}, + {"id": 2, "energized": 1, "u_pu": 0.9989052534613381, "u": 9989.05253461338, "u_angle": -0.002979053775977858, "p": -100000.0000000112, "q": -10000.00000000802}, + {"id": 3, "energized": 1, "u_pu": 0.994832412589078, "u": 9948.32412589078, "u_angle": -2.619601118662505, "p": -100000.0000000345, "q": -10000.00000003094}, + {"id": 4, "energized": 1, "u_pu": 0.9945271757700364, "u": 9945.271757700364, "u_angle": -2.620033867603252, "p": -100000.0000000593, "q": -10000.00000002334}, + {"id": 5, "energized": 1, "u_pu": 0.9943923062896204, "u": 9943.923062896203, "u_angle": -2.621165038463237, "p": -99999.99999996685, "q": -10000.00000003038}, + {"id": 6, "energized": 1, "u_pu": 0.9942956557535854, "u": 9942.956557535854, "u_angle": -2.620916985455465, "p": -99999.99999992239, "q": -10000.00000000921}, + {"id": 7, "energized": 1, "u_pu": 0.9724983505265743, "u": 388.9993402106297, "u_angle": 1.044895783152112, "p": -100000.0000000117, "q": -9999.999999980046}, + {"id": 8, "energized": 1, "u_pu": 0.9726134057196308, "u": 389.0453622878524, "u_angle": 1.045020802969225, "p": -100000.0000000038, "q": -9999.99999999443}, + {"id": 9, "energized": 1, "u_pu": 0.8393629421175863, "u": 335.7451768470345, "u_angle": 0.6142604146690938, "p": -99999.999999982, "q": -9999.999999994514}, + {"id": 10, "energized": 1, "u_pu": 0.9314325780418993, "u": 372.5730312167597, "u_angle": -2.003605555004947, "p": -100000.0000000109, "q": -9999.999999998636} + ], + "transformer_tap_regulator": [ + {"id": 34, "energized": 1, "tap_pos": 0}, + {"id": 35, "energized": 1, "tap_pos": 0}, + {"id": 36, "energized": 1, "tap_pos": 10}, + {"id": 37, "energized": 1, "tap_pos": 10}, + {"id": 38, "energized": 1, "tap_pos": -2} + ] + } +} \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/sym_output.json.license b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/sym_output.json.license new file mode 100644 index 000000000..2fcbfaeb5 --- /dev/null +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/sym_output.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023 Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 \ No newline at end of file From a8a8dd00747bd132920ba51a6a54a3ad433fb618 Mon Sep 17 00:00:00 2001 From: Martijn Govers Date: Fri, 11 Oct 2024 14:59:27 +0200 Subject: [PATCH 2/2] only check u_pu and u Signed-off-by: Martijn Govers --- pyproject.toml | 35 ++++++++++--------- .../sym_output.json | 32 ++++++++--------- .../sym_output.json | 32 ++++++++--------- .../sym_output.json | 32 ++++++++--------- .../sym_output.json | 32 ++++++++--------- 5 files changed, 83 insertions(+), 80 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 44998395a..2d3725fb5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,9 @@ build-backend = "setuptools.build_meta" [project] name = "power-grid-model" -authors = [{ name = "Contributors to the Power Grid Model project", email = "powergridmodel@lfenergy.org" }] +authors = [ + { name = "Contributors to the Power Grid Model project", email = "powergridmodel@lfenergy.org" }, +] description = "Python/C++ library for distribution power system analysis" readme = "README.md" license = { text = "MPL-2.0" } @@ -32,22 +34,14 @@ classifiers = [ "Topic :: Scientific/Engineering :: Physics", ] requires-python = ">=3.10" -dependencies = [ - "numpy>=1.21.0", -] +dependencies = ["numpy>=1.21.0"] dynamic = ["version"] [project.optional-dependencies] -dev = [ - "msgpack", - "pre-commit", - "pylint", - "pytest", - "pytest-cov", -] +dev = ["msgpack", "pre-commit", "pylint", "pytest", "pytest-cov"] doc = [ - "sphinx", + "sphinx<8.1", # Upper bound pin on sphinx can be removed once https://github.com/mgaitan/sphinxcontrib-mermaid/issues/160 is resolved "breathe", "myst_nb", "sphinx_rtd_theme", @@ -71,14 +65,23 @@ where = ["src"] namespaces = false [tool.setuptools.dynamic] -version = {file = "PYPI_VERSION"} +version = { file = "PYPI_VERSION" } [tool.setuptools.package-data] "power_grid_model" = ["py.typed"] [tool.pytest.ini_options] testpaths = ["tests/unit"] -addopts = ["--cov=power_grid_model", "--cov-report", "term", "--cov-report", "html:python_cov_html", "--cov-report", "xml:python_coverage.xml", "--cov-fail-under=95"] +addopts = [ + "--cov=power_grid_model", + "--cov-report", + "term", + "--cov-report", + "html:python_cov_html", + "--cov-report", + "xml:python_coverage.xml", + "--cov-fail-under=95", +] xfail_strict = true [tool.black] @@ -116,14 +119,14 @@ skip = ["pp*", "*-musllinux_aarch64"] archs = ["x86_64", "aarch64"] # force auditwheel to use manylinux_2_24 to support Amazon Linux 2 when building in manylinux_2_28 repair-wheel-command = "auditwheel repair --plat ${AUDITWHEEL_PLAT//2_28/2_24} -w {dest_dir} {wheel}" -environment = { CC="gcc", CXX="g++" } +environment = { CC = "gcc", CXX = "g++" } manylinux-x86_64-image = "manylinux_2_28" manylinux-aarch64-image = "manylinux_2_28" musllinux-x86_64-image = "musllinux_1_2" [tool.cibuildwheel.macos] archs = ["x86_64", "arm64"] -environment = { CC="clang", CXX="clang++" } +environment = { CC = "clang", CXX = "clang++" } [tool.cibuildwheel.windows] archs = ["AMD64"] diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/sym_output.json b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/sym_output.json index 621c51c81..5f802ad0f 100644 --- a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/sym_output.json +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-any/sym_output.json @@ -5,24 +5,24 @@ "attributes": {}, "data": { "node": [ - {"id": 0, "energized": 1, "u_pu": 0.9999685775574514, "u": 9999.685775574513, "u_angle": -0.0001080162531878653, "p": 1006027.827552064, "q": 195120.3069521648}, - {"id": 1, "energized": 1, "u_pu": 0.9994333873631714, "u": 9994.333873631715, "u_angle": -0.002665398059250737, "p": -99999.99999999323, "q": -9999.999999921869}, - {"id": 2, "energized": 1, "u_pu": 0.9989235130236771, "u": 9989.235130236772, "u_angle": -0.002981643256713985, "p": -99999.99999997459, "q": -9999.999999939741}, - {"id": 3, "energized": 1, "u_pu": 0.994851508142734, "u": 9948.51508142734, "u_angle": -2.619640099240546, "p": -100000.0000000401, "q": -9999.999999995298}, - {"id": 4, "energized": 1, "u_pu": 0.9945461001910171, "u": 9945.461001910171, "u_angle": -2.620069171582145, "p": -100000.000000009, "q": -9999.999999940057}, - {"id": 5, "energized": 1, "u_pu": 0.9944290227324328, "u": 9944.290227324329, "u_angle": -2.621203754353982, "p": -99999.99999995019, "q": -9999.999999937614}, - {"id": 6, "energized": 1, "u_pu": 0.9943233999502603, "u": 9943.233999502603, "u_angle": -2.62095218690015, "p": -100000.0000000192, "q": -10000.00000005206}, - {"id": 7, "energized": 1, "u_pu": 0.9920807600913329, "u": 396.8323040365332, "u_angle": 1.044783740215204, "p": -99999.99999998928, "q": -9999.999999983958}, - {"id": 8, "energized": 1, "u_pu": 0.992180588914527, "u": 396.8722355658108, "u_angle": 1.044923623034546, "p": -100000.000000007, "q": -10000.00000000539}, - {"id": 9, "energized": 1, "u_pu": 0.8682948639612919, "u": 347.3179455845167, "u_angle": 0.6381168383951473, "p": -99999.99999999936, "q": -10000.00000000324}, - {"id": 10, "energized": 1, "u_pu": 0.9636190035727636, "u": 385.4476014291055, "u_angle": -1.979757523221217, "p": -100000.0000000106, "q": -9999.999999998947} + {"id": 0, "u_pu": 0.9999685775574514, "u": 9999.685775574513}, + {"id": 1, "u_pu": 0.9994333873631714, "u": 9994.333873631715}, + {"id": 2, "u_pu": 0.9989235130236771, "u": 9989.235130236772}, + {"id": 3, "u_pu": 0.994851508142734, "u": 9948.51508142734}, + {"id": 4, "u_pu": 0.9945461001910171, "u": 9945.461001910171}, + {"id": 5, "u_pu": 0.9944290227324328, "u": 9944.290227324329}, + {"id": 6, "u_pu": 0.9943233999502603, "u": 9943.233999502603}, + {"id": 7, "u_pu": 0.9920807600913329, "u": 396.8323040365332}, + {"id": 8, "u_pu": 0.992180588914527, "u": 396.8722355658108}, + {"id": 9, "u_pu": 0.8682948639612919, "u": 347.3179455845167}, + {"id": 10, "u_pu": 0.9636190035727636, "u": 385.4476014291055} ], "transformer_tap_regulator": [ - {"id": 34, "energized": 1, "tap_pos": 0}, - {"id": 35, "energized": 1, "tap_pos": 0}, - {"id": 36, "energized": 1, "tap_pos": 0}, - {"id": 37, "energized": 1, "tap_pos": 0}, - {"id": 38, "energized": 1, "tap_pos": -2} + {"id": 34, "tap_pos": 0}, + {"id": 35, "tap_pos": 0}, + {"id": 36, "tap_pos": 0}, + {"id": 37, "tap_pos": 0}, + {"id": 38, "tap_pos": -2} ] } } \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/sym_output.json b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/sym_output.json index 8654509b4..fa0299c8a 100644 --- a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/sym_output.json +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-fast-any/sym_output.json @@ -5,24 +5,24 @@ "attributes": {}, "data": { "node": [ - {"id": 0, "energized": 1, "u_pu": 0.9999685792035808, "u": 9999.685792035809, "u_angle": -0.000108015064043123, "p": 1006014.359531452, "q": 195105.1126860094}, - {"id": 1, "energized": 1, "u_pu": 0.9994334306729814, "u": 9994.334306729814, "u_angle": -0.002665360388354479, "p": -99999.99999998668, "q": -10000.00000006777}, - {"id": 2, "energized": 1, "u_pu": 0.9989235622047079, "u": 9989.235622047079, "u_angle": -0.002981612107417925, "p": -100000.0000000164, "q": -10000.00000001979}, - {"id": 3, "energized": 1, "u_pu": 0.9948516332849774, "u": 9948.516332849775, "u_angle": -2.619640153725786, "p": -100000.0000000246, "q": -9999.999999982891}, - {"id": 4, "energized": 1, "u_pu": 0.994546217468617, "u": 9945.46217468617, "u_angle": -2.620069217451806, "p": -100000.0000000696, "q": -9999.99999988202}, - {"id": 5, "energized": 1, "u_pu": 0.9944291896054542, "u": 9944.291896054543, "u_angle": -2.621203772068462, "p": -99999.99999996748, "q": -10000.00000002437}, - {"id": 6, "energized": 1, "u_pu": 0.9943235381522523, "u": 9943.235381522523, "u_angle": -2.620952214419493, "p": -99999.99999996387, "q": -9999.999999981774}, - {"id": 7, "energized": 1, "u_pu": 0.9920810084787994, "u": 396.8324033915198, "u_angle": 1.04478362979705, "p": -99999.99999999025, "q": -9999.999999985541}, - {"id": 8, "energized": 1, "u_pu": 0.9921807948861237, "u": 396.8723179544494, "u_angle": 1.044923518025388, "p": -99999.99999997883, "q": -9999.999999995283}, - {"id": 9, "energized": 1, "u_pu": 0.8683101472161173, "u": 347.3240588864469, "u_angle": 0.6381526062152355, "p": -100000.000000015, "q": -9999.999999996206}, - {"id": 10, "energized": 1, "u_pu": 1.02045250228686, "u": 408.1810009147442, "u_angle": -1.979734683670089, "p": -99999.99999996256, "q": -10000.00000000768} + {"id": 0, "u_pu": 0.9999685792035808, "u": 9999.685792035809}, + {"id": 1, "u_pu": 0.9994334306729814, "u": 9994.334306729814}, + {"id": 2, "u_pu": 0.9989235622047079, "u": 9989.235622047079}, + {"id": 3, "u_pu": 0.9948516332849774, "u": 9948.516332849775}, + {"id": 4, "u_pu": 0.994546217468617, "u": 9945.46217468617}, + {"id": 5, "u_pu": 0.9944291896054542, "u": 9944.291896054543}, + {"id": 6, "u_pu": 0.9943235381522523, "u": 9943.235381522523}, + {"id": 7, "u_pu": 0.9920810084787994, "u": 396.8324033915198}, + {"id": 8, "u_pu": 0.9921807948861237, "u": 396.8723179544494}, + {"id": 9, "u_pu": 0.8683101472161173, "u": 347.3240588864469}, + {"id": 10, "u_pu": 1.02045250228686, "u": 408.1810009147442} ], "transformer_tap_regulator": [ - {"id": 34, "energized": 1, "tap_pos": 0}, - {"id": 35, "energized": 1, "tap_pos": 0}, - {"id": 36, "energized": 1, "tap_pos": 0}, - {"id": 37, "energized": 1, "tap_pos": 0}, - {"id": 38, "energized": 1, "tap_pos": -3} + {"id": 34, "tap_pos": 0}, + {"id": 35, "tap_pos": 0}, + {"id": 36, "tap_pos": 0}, + {"id": 37, "tap_pos": 0}, + {"id": 38, "tap_pos": -3} ] } } \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/sym_output.json b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/sym_output.json index 8b6b48eb5..17c9afc0b 100644 --- a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/sym_output.json +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-max/sym_output.json @@ -5,24 +5,24 @@ "attributes": {}, "data": { "node": [ - {"id": 0, "energized": 1, "u_pu": 0.9999694219207165, "u": 9999.694219207166, "u_angle": -0.000108073777055777, "p": 1005760.974499936, "q": 186661.7100759184}, - {"id": 1, "energized": 1, "u_pu": 0.9994572959993493, "u": 9994.572959993493, "u_angle": -0.00266487711839271, "p": -99999.99999999008, "q": -9999.9999999917}, - {"id": 2, "energized": 1, "u_pu": 0.9989475687887489, "u": 9989.475687887489, "u_angle": -0.002984773120947201, "p": -99999.99999997644, "q": -10000.00000000708}, - {"id": 3, "energized": 1, "u_pu": 1.005018452903429, "u": 10050.18452903429, "u_angle": -2.619710441685425, "p": -100000.0000000126, "q": -10000.00000001087}, - {"id": 4, "energized": 1, "u_pu": 1.004705657034634, "u": 10047.05657034634, "u_angle": -2.620132571355066, "p": -100000.0000001293, "q": -10000.00000002875}, - {"id": 5, "energized": 1, "u_pu": 1.004623136812936, "u": 10046.23136812936, "u_angle": -2.621242309106458, "p": -100000.0000000131, "q": -10000.00000004449}, - {"id": 6, "energized": 1, "u_pu": 1.004496676021677, "u": 10044.96676021677, "u_angle": -2.620997700995084, "p": -99999.9999998436, "q": -9999.999999970283}, - {"id": 7, "energized": 1, "u_pu": 1.022848723893756, "u": 409.1394895575023, "u_angle": 1.044649462434896, "p": -99999.99999997977, "q": -9999.99999998119}, - {"id": 8, "energized": 1, "u_pu": 1.022918677382032, "u": 409.1674709528126, "u_angle": 1.044797037412629, "p": -100000.0000000123, "q": -9999.999999981121}, - {"id": 9, "energized": 1, "u_pu": 0.9111926311153715, "u": 364.4770524461486, "u_angle": 0.6704313952514609, "p": -99999.99999999734, "q": -10000.00000000421}, - {"id": 10, "energized": 1, "u_pu": 1.070953828958853, "u": 428.3815315835412, "u_angle": -1.947465700544465, "p": -100000.0000000154, "q": -9999.999999999627} + {"id": 0, "u_pu": 0.9999694219207165, "u": 9999.694219207166}, + {"id": 1, "u_pu": 0.9994572959993493, "u": 9994.572959993493}, + {"id": 2, "u_pu": 0.9989475687887489, "u": 9989.475687887489}, + {"id": 3, "u_pu": 1.005018452903429, "u": 10050.18452903429}, + {"id": 4, "u_pu": 1.004705657034634, "u": 10047.05657034634}, + {"id": 5, "u_pu": 1.004623136812936, "u": 10046.23136812936}, + {"id": 6, "u_pu": 1.004496676021677, "u": 10044.96676021677}, + {"id": 7, "u_pu": 1.022848723893756, "u": 409.1394895575023}, + {"id": 8, "u_pu": 1.022918677382032, "u": 409.1674709528126}, + {"id": 9, "u_pu": 0.9111926311153715, "u": 364.4770524461486}, + {"id": 10, "u_pu": 1.070953828958853, "u": 428.3815315835412} ], "transformer_tap_regulator": [ - {"id": 34, "energized": 1, "tap_pos": -1}, - {"id": 35, "energized": 1, "tap_pos": -1}, - {"id": 36, "energized": 1, "tap_pos": -10}, - {"id": 37, "energized": 1, "tap_pos": -10}, - {"id": 38, "energized": 1, "tap_pos": -3} + {"id": 34, "tap_pos": -1}, + {"id": 35, "tap_pos": -1}, + {"id": 36, "tap_pos": -10}, + {"id": 37, "tap_pos": -10}, + {"id": 38, "tap_pos": -3} ] } } \ No newline at end of file diff --git a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/sym_output.json b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/sym_output.json index 343704e3f..9ecaacaaa 100644 --- a/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/sym_output.json +++ b/tests/data/power_flow/automatic-tap-regulator/auto-tap-changer-meshed-min/sym_output.json @@ -5,24 +5,24 @@ "attributes": {}, "data": { "node": [ - {"id": 0, "energized": 1, "u_pu": 0.9999679360438888, "u": 9999.679360438888, "u_angle": -0.0001079656398834563, "p": 1006161.82777068, "q": 201553.6841024437}, - {"id": 1, "energized": 1, "u_pu": 0.9994152027388719, "u": 9994.152027388718, "u_angle": -0.00266561095796142, "p": -99999.99999999082, "q": -9999.999999996553}, - {"id": 2, "energized": 1, "u_pu": 0.9989052534613381, "u": 9989.05253461338, "u_angle": -0.002979053775977858, "p": -100000.0000000112, "q": -10000.00000000802}, - {"id": 3, "energized": 1, "u_pu": 0.994832412589078, "u": 9948.32412589078, "u_angle": -2.619601118662505, "p": -100000.0000000345, "q": -10000.00000003094}, - {"id": 4, "energized": 1, "u_pu": 0.9945271757700364, "u": 9945.271757700364, "u_angle": -2.620033867603252, "p": -100000.0000000593, "q": -10000.00000002334}, - {"id": 5, "energized": 1, "u_pu": 0.9943923062896204, "u": 9943.923062896203, "u_angle": -2.621165038463237, "p": -99999.99999996685, "q": -10000.00000003038}, - {"id": 6, "energized": 1, "u_pu": 0.9942956557535854, "u": 9942.956557535854, "u_angle": -2.620916985455465, "p": -99999.99999992239, "q": -10000.00000000921}, - {"id": 7, "energized": 1, "u_pu": 0.9724983505265743, "u": 388.9993402106297, "u_angle": 1.044895783152112, "p": -100000.0000000117, "q": -9999.999999980046}, - {"id": 8, "energized": 1, "u_pu": 0.9726134057196308, "u": 389.0453622878524, "u_angle": 1.045020802969225, "p": -100000.0000000038, "q": -9999.99999999443}, - {"id": 9, "energized": 1, "u_pu": 0.8393629421175863, "u": 335.7451768470345, "u_angle": 0.6142604146690938, "p": -99999.999999982, "q": -9999.999999994514}, - {"id": 10, "energized": 1, "u_pu": 0.9314325780418993, "u": 372.5730312167597, "u_angle": -2.003605555004947, "p": -100000.0000000109, "q": -9999.999999998636} + {"id": 0, "u_pu": 0.9999679360438888, "u": 9999.679360438888}, + {"id": 1, "u_pu": 0.9994152027388719, "u": 9994.152027388718}, + {"id": 2, "u_pu": 0.9989052534613381, "u": 9989.05253461338}, + {"id": 3, "u_pu": 0.994832412589078, "u": 9948.32412589078}, + {"id": 4, "u_pu": 0.9945271757700364, "u": 9945.271757700364}, + {"id": 5, "u_pu": 0.9943923062896204, "u": 9943.923062896203}, + {"id": 6, "u_pu": 0.9942956557535854, "u": 9942.956557535854}, + {"id": 7, "u_pu": 0.9724983505265743, "u": 388.9993402106297}, + {"id": 8, "u_pu": 0.9726134057196308, "u": 389.0453622878524}, + {"id": 9, "u_pu": 0.8393629421175863, "u": 335.7451768470345}, + {"id": 10, "u_pu": 0.9314325780418993, "u": 372.5730312167597} ], "transformer_tap_regulator": [ - {"id": 34, "energized": 1, "tap_pos": 0}, - {"id": 35, "energized": 1, "tap_pos": 0}, - {"id": 36, "energized": 1, "tap_pos": 10}, - {"id": 37, "energized": 1, "tap_pos": 10}, - {"id": 38, "energized": 1, "tap_pos": -2} + {"id": 34, "tap_pos": 0}, + {"id": 35, "tap_pos": 0}, + {"id": 36, "tap_pos": 10}, + {"id": 37, "tap_pos": 10}, + {"id": 38, "tap_pos": -2} ] } } \ No newline at end of file