diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/grouped_index_vector.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/grouped_index_vector.hpp index e60f7c631..e50e67134 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/grouped_index_vector.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/grouped_index_vector.hpp @@ -260,7 +260,7 @@ class DenseGroupedIdxVector { : DenseGroupedIdxVector{std::move(dense_group_elements), num_groups} {} private: - Idx num_groups_; + Idx num_groups_{}; IdxVector dense_vector_; }; diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/math_solver/block_matrix.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/math_solver/block_matrix.hpp index 8101384db..44ad89168 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/math_solver/block_matrix.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/math_solver/block_matrix.hpp @@ -15,14 +15,9 @@ namespace power_grid_model::math_solver { template struct block_trait { - static constexpr int n_row = sym ? n_sub_block : n_sub_block * 3; - static constexpr int n_col = [] { - if constexpr (is_tensor) { - return sym ? n_sub_block : n_sub_block * 3; - } else { - return 1; - } - }(); + static constexpr int sub_block_size = sym ? 1 : 3; + static constexpr int n_row = n_sub_block * sub_block_size; + static constexpr int n_col = is_tensor ? n_sub_block * sub_block_size : 1; using ArrayType = Eigen::Array; }; @@ -30,7 +25,8 @@ template struct bloc template class Block : public block_trait::ArrayType { public: - using ArrayType = typename block_trait::ArrayType; + using block_traits = block_trait; + using ArrayType = typename block_traits::ArrayType; using ArrayType::operator(); // default zero @@ -42,24 +38,52 @@ class Block : public block_trait::ArrayType { return *this; } - template static auto get_asym_row_idx() { return Eigen::seqN(Eigen::fix, Eigen::fix<3>); } - template static auto get_asym_col_idx() { + template static auto get_sequence() { + static_assert(start >= 0); + static_assert(size >= 0); + static_assert(start + size <= n_total); + return Eigen::seqN(Eigen::fix, Eigen::fix); + } + template static auto get_block_sequence() { + constexpr auto size = block_size * block_traits::sub_block_size; + constexpr auto start = block_start * size; + return Block::get_sequence(); + } + template static auto get_block_row_idx() { + return Block::get_block_sequence(); + } + template static auto get_block_col_idx() { if constexpr (is_tensor) { - return Eigen::seqN(Eigen::fix, Eigen::fix<3>); + return Block::get_block_sequence(); } else { - return Eigen::seqN(Eigen::fix<0>, Eigen::fix<1>); + return Block::get_sequence(); } } + template static auto get_row_idx() { return Block::get_block_row_idx(); } + template static auto get_col_idx() { return Block::get_block_col_idx(); } template using GetterType = - std::conditional_t()(get_asym_row_idx(), get_asym_col_idx()))>; + std::conditional_t()(get_row_idx(), get_col_idx()))>; template GetterType get_val() { if constexpr (sym) { return (*this)(r, c); } else { - return (*this)(get_asym_row_idx(), get_asym_col_idx()); + return (*this)(get_row_idx(), get_col_idx()); + } + } + + template + using BlockGetterType = std::conditional_t, + decltype(std::declval()(get_block_row_idx(), + get_block_col_idx()))>; + + template BlockGetterType get_block_val() { + if constexpr (r_size == 1 && c_size == 1) { + return get_val(); + } else { + return (*this)(get_block_row_idx(), get_block_col_idx()); } } diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/math_solver/newton_raphson_se_solver.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/math_solver/newton_raphson_se_solver.hpp index 51d70eb2b..6867402dc 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/math_solver/newton_raphson_se_solver.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/math_solver/newton_raphson_se_solver.hpp @@ -51,6 +51,8 @@ template using NRSERhs = NRSEUnknown; template class NRSEGainBlock : public Block { public: template using GetterType = typename Block::template GetterType; + template + using BlockGetterType = typename Block::template BlockGetterType; // eigen expression using Block::Block; @@ -61,6 +63,7 @@ template class NRSEGainBlock : public Block { GetterType<1, 0> g_Q_theta() { return this->template get_val<1, 0>(); } GetterType<1, 1> g_Q_v() { return this->template get_val<1, 1>(); } + // (Q^T)(X, Y) GetterType<0, 2> qt_P_theta() { return this->template get_val<0, 2>(); } GetterType<0, 3> qt_P_v() { return this->template get_val<0, 3>(); } GetterType<1, 2> qt_Q_theta() { return this->template get_val<1, 2>(); } @@ -75,6 +78,11 @@ template class NRSEGainBlock : public Block { GetterType<2, 3> r_P_v() { return this->template get_val<2, 3>(); } GetterType<3, 2> r_Q_theta() { return this->template get_val<3, 2>(); } GetterType<3, 3> r_Q_v() { return this->template get_val<3, 3>(); } + + BlockGetterType<0, 0, 2, 2> g() { return this->template get_block_val<0, 0, 2, 2>(); } + BlockGetterType<0, 1, 2, 2> qt() { return this->template get_block_val<0, 1, 2, 2>(); } + BlockGetterType<1, 0, 2, 2> q() { return this->template get_block_val<1, 0, 2, 2>(); } + BlockGetterType<1, 1, 2, 2> r() { return this->template get_block_val<1, 1, 2, 2>(); } }; // solver @@ -159,8 +167,8 @@ template class NewtonRaphsonSESolver { sub_timer = Timer(calculation_info, 2224, "Prepare LHS rhs"); prepare_matrix_and_rhs(y_bus, measured_values, output.u); // solve with prefactorization - sub_timer = Timer(calculation_info, 2225, "Solve sparse linear equation (pre-factorized)"); - sparse_solver_.solve_with_prefactorized_matrix(data_gain_, perm_, delta_x_rhs_, delta_x_rhs_); + sub_timer = Timer(calculation_info, 2225, "Solve sparse linear equation"); + sparse_solver_.prefactorize_and_solve(data_gain_, perm_, delta_x_rhs_, delta_x_rhs_); sub_timer = Timer(calculation_info, 2226, "Iterate unknown"); max_dev = iterate_unknown(output.u, measured_values); }; @@ -245,20 +253,9 @@ template class NewtonRaphsonSESolver { for (Idx data_idx_lu = row_indptr[row]; data_idx_lu != row_indptr[row + 1]; ++data_idx_lu) { // get data idx of y bus, - // skip for a fill-in Idx const data_idx = y_bus.map_lu_y_bus()[data_idx_lu]; - if (data_idx == -1) { - continue; - } - Idx const col = col_indices[data_idx_lu]; - u_state.uj = current_u[col]; - u_state.abs_uj_inv = diagonal_inverse(x_[col].v()); - u_state.uj_uj_conj = vector_outer_product(u_state.uj, conj(u_state.uj)); - u_state.ui_uj_conj = vector_outer_product(u_state.ui, conj(u_state.uj)); - u_state.uj_ui_conj = vector_outer_product(u_state.uj, conj(u_state.ui)); - // get a reference and reset block to zero NRSEGainBlock& block = data_gain_[data_idx_lu]; if (row == col) { @@ -269,6 +266,17 @@ template class NewtonRaphsonSESolver { block.clear(); } + // skip anything else for a fill-in + if (data_idx == -1) { + continue; + } + + u_state.uj = current_u[col]; + u_state.abs_uj_inv = diagonal_inverse(x_[col].v()); + u_state.uj_uj_conj = vector_outer_product(u_state.uj, conj(u_state.uj)); + u_state.ui_uj_conj = vector_outer_product(u_state.ui, conj(u_state.uj)); + u_state.uj_ui_conj = vector_outer_product(u_state.uj, conj(u_state.ui)); + // fill block with branch, shunt measurement for (Idx element_idx = y_bus.y_bus_entry_indptr()[data_idx]; element_idx != y_bus.y_bus_entry_indptr()[data_idx + 1]; ++element_idx) { @@ -323,9 +331,6 @@ template class NewtonRaphsonSESolver { fill_qt(y_bus); process_lagrange_multiplier(y_bus); - - // prefactorize - sparse_solver_.prefactorize(data_gain_, perm_); } /// Q_ij = 0 @@ -462,12 +467,7 @@ template class NewtonRaphsonSESolver { void fill_qt(YBus const& y_bus) { iterate_matrix_skip_fills( [this](Idx /* row */, Idx /* col */, Idx data_idx, Idx data_idx_transpose) { - auto& block = data_gain_[data_idx]; - - block.qt_P_theta() = data_gain_[data_idx_transpose].q_P_theta(); - block.qt_P_v() = data_gain_[data_idx_transpose].q_Q_theta(); - block.qt_Q_theta() = data_gain_[data_idx_transpose].q_P_v(); - block.qt_Q_v() = data_gain_[data_idx_transpose].q_Q_v(); + data_gain_[data_idx].qt() = hermitian_transpose(data_gain_[data_idx_transpose].q()); }, y_bus); } diff --git a/tests/cpp_unit_tests/test_grouped_index_vector.cpp b/tests/cpp_unit_tests/test_grouped_index_vector.cpp index ed6eb4054..60fd0e20e 100644 --- a/tests/cpp_unit_tests/test_grouped_index_vector.cpp +++ b/tests/cpp_unit_tests/test_grouped_index_vector.cpp @@ -55,7 +55,13 @@ TEST_CASE_TEMPLATE("Grouped idx data structure", IdxVectorConstructor, TypePair< auto const idx_vector = construct_from(groups, num_groups); - SUBCASE("Empty grouped idx vector") { + SUBCASE("Empty grouped idx vector - no explicit initialization") { + IdxVectorType const indices; + CHECK(indices.element_size() == 0); + CHECK(indices.size() == 0); + } + + SUBCASE("Empty grouped idx vector - explicit initialization") { IdxVectorType const indices{}; CHECK(indices.element_size() == 0); CHECK(indices.size() == 0); @@ -124,6 +130,13 @@ TEST_CASE_TEMPLATE("Enumerated zip iterator for grouped index data structures", auto const idx_vector_b = construct_from(groups_b, num_groups); auto const idx_vector_c = construct_from(groups_c, num_groups); + SUBCASE("empty input") { + auto const empty_idx_vector = A{}; + for ([[maybe_unused]] auto [index, element_range] : enumerated_zip_sequence(empty_idx_vector)) { + FAIL("this code should not be reached"); + } + } + SUBCASE("1 input") { // Test single zipped iteration IdxRanges actual_ranges_a{}; diff --git a/tests/data/state_estimation/distribution-case/input.json b/tests/data/state_estimation/distribution-case/input.json index 5c4d008e8..af1f30811 100644 --- a/tests/data/state_estimation/distribution-case/input.json +++ b/tests/data/state_estimation/distribution-case/input.json @@ -5,469 +5,71 @@ "attributes": {}, "data": { "node": [ - { - "id": 1, - "u_rated": 20000.0 - }, - { - "id": 2, - "u_rated": 400.0 - }, - { - "id": 3, - "u_rated": 400.0 - }, - { - "id": 4, - "u_rated": 400.0 - }, - { - "id": 5, - "u_rated": 400.0 - }, - { - "id": 6, - "u_rated": 400.0 - }, - { - "id": 7, - "u_rated": 400.0 - }, - { - "id": 8, - "u_rated": 400.0 - } + {"id": 1, "u_rated": 20000}, + {"id": 2, "u_rated": 400}, + {"id": 3, "u_rated": 400}, + {"id": 4, "u_rated": 400}, + {"id": 5, "u_rated": 400}, + {"id": 6, "u_rated": 400}, + {"id": 7, "u_rated": 400}, + {"id": 8, "u_rated": 400} ], "line": [ - { - "id": 9, - "from_node": 2, - "to_node": 3, - "from_status": 1, - "to_status": 1, - "r1": 0.000416, - "x1": 0.000136, - "c1": 1e-09, - "tan1": 0.0, - "r0": 0.001248, - "x0": 0.000272, - "c0": 3.0000000000000004e-09, - "tan0": 0.0, - "i_n": 10000.0 - }, - { - "id": 10, - "from_node": 2, - "to_node": 4, - "from_status": 1, - "to_status": 1, - "r1": 0.000385, - "x1": 0.000395, - "c1": 0.0, - "tan1": 0.0, - "r0": 0.001155, - "x0": 0.00079, - "c0": 0.0, - "tan0": 0.0, - "i_n": 10000.0 - }, - { - "id": 11, - "from_node": 3, - "to_node": 5, - "from_status": 1, - "to_status": 1, - "r1": 0.00542, - "x1": 0.00174, - "c1": 1e-09, - "tan1": 0.0, - "r0": 0.01626, - "x0": 0.00348, - "c0": 3.0000000000000004e-09, - "tan0": 0.0, - "i_n": 10000.0 - }, - { - "id": 12, - "from_node": 4, - "to_node": 6, - "from_status": 1, - "to_status": 1, - "r1": 0.0085, - "x1": 0.00286, - "c1": 0.0, - "tan1": 0.0, - "r0": 0.025500000000000002, - "x0": 0.00572, - "c0": 0.0, - "tan0": 0.0, - "i_n": 10000.0 - }, - { - "id": 13, - "from_node": 5, - "to_node": 7, - "from_status": 1, - "to_status": 0, - "r1": 0.0185, - "x1": 0.01485, - "c1": 1e-06, - "tan1": 0.0, - "r0": 0.055499999999999994, - "x0": 0.0297, - "c0": 3e-06, - "tan0": 0.0, - "i_n": 10000.0 - }, - { - "id": 14, - "from_node": 6, - "to_node": 7, - "from_status": 1, - "to_status": 1, - "r1": 0.098, - "x1": 0.025, - "c1": 1e-06, - "tan1": 0.0, - "r0": 0.29400000000000004, - "x0": 0.05, - "c0": 3e-06, - "tan0": 0.0, - "i_n": 10000.0 - }, - { - "id": 15, - "from_node": 7, - "to_node": 8, - "from_status": 1, - "to_status": 1, - "r1": 0.1, - "x1": 0.05, - "c1": 1e-06, - "tan1": 0.0, - "r0": 0.30000000000000004, - "x0": 0.1, - "c0": 3e-06, - "tan0": 0.0, - "i_n": 10000.0 - } + {"id": 9, "from_node": 2, "to_node": 3, "from_status": 1, "to_status": 1, "r1": 0.000416, "x1": 0.000136, "c1": 1e-09, "tan1": 0, "r0": 0.001248, "x0": 0.000272, "c0": 3e-09, "tan0": 0, "i_n": 10000}, + {"id": 10, "from_node": 2, "to_node": 4, "from_status": 1, "to_status": 1, "r1": 0.000385, "x1": 0.000395, "c1": 0, "tan1": 0, "r0": 0.001155, "x0": 0.00079, "c0": 0, "tan0": 0, "i_n": 10000}, + {"id": 11, "from_node": 3, "to_node": 5, "from_status": 1, "to_status": 1, "r1": 0.00542, "x1": 0.00174, "c1": 1e-09, "tan1": 0, "r0": 0.01626, "x0": 0.00348, "c0": 3e-09, "tan0": 0, "i_n": 10000}, + {"id": 12, "from_node": 4, "to_node": 6, "from_status": 1, "to_status": 1, "r1": 0.008500000000000001, "x1": 0.00286, "c1": 0, "tan1": 0, "r0": 0.0255, "x0": 0.00572, "c0": 0, "tan0": 0, "i_n": 10000}, + {"id": 13, "from_node": 5, "to_node": 7, "from_status": 1, "to_status": 0, "r1": 0.0185, "x1": 0.01485, "c1": 1e-06, "tan1": 0, "r0": 0.05549999999999999, "x0": 0.0297, "c0": 3e-06, "tan0": 0, "i_n": 10000}, + {"id": 14, "from_node": 6, "to_node": 7, "from_status": 1, "to_status": 1, "r1": 0.098, "x1": 0.025, "c1": 1e-06, "tan1": 0, "r0": 0.294, "x0": 0.05, "c0": 3e-06, "tan0": 0, "i_n": 10000}, + {"id": 15, "from_node": 7, "to_node": 8, "from_status": 1, "to_status": 1, "r1": 0.1, "x1": 0.05, "c1": 1e-06, "tan1": 0, "r0": 0.3, "x0": 0.1, "c0": 3e-06, "tan0": 0, "i_n": 10000} ], "transformer": [ - { - "id": 17, - "from_node": 1, - "to_node": 2, - "from_status": 1, - "to_status": 1, - "u1": 20000.0, - "u2": 400.0, - "sn": 630000.0, - "uk": 0.04, - "pk": 1000.0, - "i0": 0.001, - "p0": 100.0, - "winding_from": 2, - "winding_to": 1, - "clock": 5, - "tap_side": 0, - "tap_pos": 0, - "tap_min": -5, - "tap_max": 5, - "tap_nom": 0, - "tap_size": 2300.0 - }, - { - "id": 18, - "from_node": 1, - "to_node": 2, - "from_status": 1, - "to_status": 1, - "u1": 20000.0, - "u2": 400.0, - "sn": 630000.0, - "uk": 0.04, - "pk": 1000.0, - "i0": 0.001, - "p0": 100.0, - "winding_from": 2, - "winding_to": 1, - "clock": 5, - "tap_side": 0, - "tap_pos": 0, - "tap_min": -5, - "tap_max": 5, - "tap_nom": 0, - "tap_size": 2300.0 - } + {"id": 17, "from_node": 1, "to_node": 2, "from_status": 1, "to_status": 1, "u1": 20000, "u2": 400, "sn": 630000, "uk": 0.04, "pk": 1000, "i0": 0.001, "p0": 100, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -5, "tap_max": 5, "tap_nom": 0, "tap_size": 2300}, + {"id": 18, "from_node": 1, "to_node": 2, "from_status": 1, "to_status": 1, "u1": 20000, "u2": 400, "sn": 630000, "uk": 0.04, "pk": 1000, "i0": 0.001, "p0": 100, "winding_from": 2, "winding_to": 1, "clock": 5, "tap_side": 0, "tap_pos": 0, "tap_min": -5, "tap_max": 5, "tap_nom": 0, "tap_size": 2300} ], - "sym_load": [ - { - "id": 19, - "node": 5, - "status": 1, - "type": 0, - "p_specified": 65550.0, - "q_specified": 21540.0 - }, - { - "id": 20, - "node": 6, - "status": 1, - "type": 0, - "p_specified": 70000.0, - "q_specified": 30000.0 - }, - { - "id": 21, - "node": 8, - "status": 1, - "type": 0, - "p_specified": 50250.0, - "q_specified": 15800.0 - } - ], - "asym_load": [ - { - "id": 22, - "node": 3, - "status": 1, - "type": 0, - "p_specified": [ - 20000.0, - 19000.0, - 20500.0 - ], - "q_specified": [ - 5000.0, - 4500.0, - 5500.0 - ] - } + "source": [ + {"id": 16, "node": 1, "status": 1, "u_ref": 1, "sk": 1000000, "rx_ratio": 0.1, "z01_ratio": 1} ], "asym_gen": [ - { - "id": 23, - "node": 4, - "status": 1, - "type": 0, - "p_specified": [ - 15000.0, - 15500.0, - 14000.0 - ], - "q_specified": [ - 3000.0, - 3500.0, - 2500.0 - ] - } + {"id": 23, "node": 4, "status": 1, "type": 0, "p_specified": [15000, 15500, 14000], "q_specified": [3000, 3500, 2500]} ], - "source": [ - { - "id": 16, - "node": 1, - "status": 1, - "u_ref": 1.0, - "sk": 1000000.0, - "rx_ratio": 0.1, - "z01_ratio": 1.0 - } + "sym_load": [ + {"id": 19, "node": 5, "status": 1, "type": 0, "p_specified": 65550, "q_specified": 21540}, + {"id": 20, "node": 6, "status": 1, "type": 0, "p_specified": 70000, "q_specified": 30000}, + {"id": 21, "node": 8, "status": 1, "type": 0, "p_specified": 50250, "q_specified": 15800} ], - "sym_voltage_sensor": [ - { - "id": 24, - "measured_object": 1, - "u_sigma": 100.0, - "u_measured": 4323.72668 - }, - { - "id": 25, - "measured_object": 2, - "u_sigma": 100.0, - "u_measured": 84.4579757 - }, - { - "id": 26, - "measured_object": 3, - "u_sigma": 100.0, - "u_measured": 84.2855329 - }, - { - "id": 27, - "measured_object": 4, - "u_sigma": 100.0, - "u_measured": 84.1126605 - }, - { - "id": 28, - "measured_object": 5, - "u_sigma": 100.0, - "u_measured": 82.8973372 - }, - { - "id": 29, - "measured_object": 6, - "u_sigma": 100.0, - "u_measured": 79.6383203 - }, - { - "id": 30, - "measured_object": 7, - "u_sigma": 100.0, - "u_measured": 56.6848254 - }, - { - "id": 31, - "measured_object": 8, - "u_sigma": 100.0, - "u_measured": 31.5406048 - } + "asym_load": [ + {"id": 22, "node": 3, "status": 1, "type": 0, "p_specified": [20000, 19000, 20500], "q_specified": [5000, 4500, 5500]} ], "sym_power_sensor": [ - { - "id": 32, - "measured_object": 9, - "measured_terminal_type": 0, - "power_sigma": 100.0, - "p_measured": 105936.9431, - "q_measured": 36639.4089 - }, - { - "id": 33, - "measured_object": 9, - "measured_terminal_type": 1, - "power_sigma": 100.0, - "p_measured": -105872.3446, - "q_measured": -36618.31556 - }, - { - "id": 34, - "measured_object": 10, - "measured_terminal_type": 0, - "power_sigma": 100.0, - "p_measured": 182797.1614, - "q_measured": 70540.00026 - }, - { - "id": 35, - "measured_object": 10, - "measured_terminal_type": 1, - "power_sigma": 100.0, - "p_measured": -182614.4985, - "q_measured": -70352.59282 - }, - { - "id": 36, - "measured_object": 11, - "measured_terminal_type": 0, - "power_sigma": 100.0, - "p_measured": 65872.34459, - "q_measured": 21618.31556 - }, - { - "id": 37, - "measured_object": 11, - "measured_terminal_type": 1, - "power_sigma": 100.0, - "p_measured": -65550.00004, - "q_measured": -21514.85752 - }, - { - "id": 38, - "measured_object": 12, - "measured_terminal_type": 0, - "power_sigma": 100.0, - "p_measured": 132614.4985, - "q_measured": 50352.59282 - }, - { - "id": 39, - "measured_object": 12, - "measured_terminal_type": 1, - "power_sigma": 100.0, - "p_measured": -130495.6073, - "q_measured": -49639.64825 - }, - { - "id": 40, - "measured_object": 13, - "measured_terminal_type": 0, - "power_sigma": 100.0, - "p_measured": 3.65, - "q_measured": -25.14247914 - }, - { - "id": 41, - "measured_object": 13, - "measured_terminal_type": 1, - "power_sigma": 100.0, - "p_measured": 1.35, - "q_measured": -7.994 - }, - { - "id": 42, - "measured_object": 14, - "measured_terminal_type": 0, - "power_sigma": 100.0, - "p_measured": 60495.60729, - "q_measured": 19639.64825 - }, - { - "id": 43, - "measured_object": 14, - "measured_terminal_type": 1, - "power_sigma": 100.0, - "p_measured": -55425.12038, - "q_measured": -18368.78947 - }, - { - "id": 44, - "measured_object": 15, - "measured_terminal_type": 0, - "power_sigma": 100.0, - "p_measured": 55425.12038, - "q_measured": 18368.78947 - }, - { - "id": 45, - "measured_object": 15, - "measured_terminal_type": 1, - "power_sigma": 100.0, - "p_measured": -50250.0, - "q_measured": -15800.0 - }, - { - "id": 46, - "measured_object": 17, - "measured_terminal_type": 0, - "power_sigma": 100.0, - "p_measured": 144876.3773, - "q_measured": 59765.58305 - }, - { - "id": 47, - "measured_object": 17, - "measured_terminal_type": 1, - "power_sigma": 100.0, - "p_measured": -144367.0523, - "q_measured": -53589.70458 - }, - { - "id": 48, - "measured_object": 18, - "measured_terminal_type": 0, - "power_sigma": 100.0, - "p_measured": 144876.3773, - "q_measured": 59765.58305 - }, - { - "id": 49, - "measured_object": 18, - "measured_terminal_type": 1, - "power_sigma": 100.0, - "p_measured": -144367.0523, - "q_measured": -53589.70458 - } + {"id": 32, "measured_object": 9, "measured_terminal_type": 0, "power_sigma": 1000}, + {"id": 33, "measured_object": 9, "measured_terminal_type": 1, "power_sigma": 1000}, + {"id": 34, "measured_object": 10, "measured_terminal_type": 0, "power_sigma": 1000}, + {"id": 35, "measured_object": 10, "measured_terminal_type": 1, "power_sigma": 1000}, + {"id": 36, "measured_object": 11, "measured_terminal_type": 0, "power_sigma": 1000}, + {"id": 37, "measured_object": 11, "measured_terminal_type": 1, "power_sigma": 1000}, + {"id": 38, "measured_object": 12, "measured_terminal_type": 0, "power_sigma": 1000}, + {"id": 39, "measured_object": 12, "measured_terminal_type": 1, "power_sigma": 1000}, + {"id": 40, "measured_object": 13, "measured_terminal_type": 0, "power_sigma": 1000}, + {"id": 41, "measured_object": 13, "measured_terminal_type": 1, "power_sigma": 1000}, + {"id": 42, "measured_object": 14, "measured_terminal_type": 0, "power_sigma": 1000}, + {"id": 43, "measured_object": 14, "measured_terminal_type": 1, "power_sigma": 1000}, + {"id": 44, "measured_object": 15, "measured_terminal_type": 0, "power_sigma": 1000}, + {"id": 45, "measured_object": 15, "measured_terminal_type": 1, "power_sigma": 1000}, + {"id": 46, "measured_object": 17, "measured_terminal_type": 0, "power_sigma": 1000}, + {"id": 47, "measured_object": 17, "measured_terminal_type": 1, "power_sigma": 1000}, + {"id": 48, "measured_object": 18, "measured_terminal_type": 0, "power_sigma": 1000}, + {"id": 49, "measured_object": 18, "measured_terminal_type": 1, "power_sigma": 1000} + ], + "sym_voltage_sensor": [ + {"id": 24, "measured_object": 1, "u_sigma": 200}, + {"id": 25, "measured_object": 2, "u_sigma": 4}, + {"id": 26, "measured_object": 3, "u_sigma": 4}, + {"id": 27, "measured_object": 4, "u_sigma": 4}, + {"id": 28, "measured_object": 5, "u_sigma": 4}, + {"id": 29, "measured_object": 6, "u_sigma": 4}, + {"id": 30, "measured_object": 7, "u_sigma": 4}, + {"id": 31, "measured_object": 8, "u_sigma": 4} ] } } \ No newline at end of file diff --git a/tests/data/state_estimation/distribution-case/params.json b/tests/data/state_estimation/distribution-case/params.json index 1714acdad..6a3db639f 100644 --- a/tests/data/state_estimation/distribution-case/params.json +++ b/tests/data/state_estimation/distribution-case/params.json @@ -1,16 +1,10 @@ { "calculation_method": ["iterative_linear", "newton_raphson"], - "rtol": 1e-03, - "atol": { - "default": 1e-03, - ".+_residual": 1 - }, + "rtol": 1e-6, + "atol": 1e-6, "extra_params": { "newton_raphson": { - "experimental_features": "enabled", - "fail": { - "reason": "Experimental feature under development" - } + "experimental_features": "enabled" } } } \ No newline at end of file diff --git a/tests/data/state_estimation/distribution-case/sym_output_batch.json b/tests/data/state_estimation/distribution-case/sym_output_batch.json index 927bad1dc..ac44069d9 100644 --- a/tests/data/state_estimation/distribution-case/sym_output_batch.json +++ b/tests/data/state_estimation/distribution-case/sym_output_batch.json @@ -5,793 +5,81 @@ "attributes": {}, "data": [ { - "asym_gen": [ - { - "id": 23, - "energized": 1, - "p": -50776.60346271983, - "q": -20982.90744227271, - "i": 110.20218758287774, - "s": 54941.29470572454, - "pf": -0.9241974317257803 - } - ], - "asym_load": [ - { - "id": 22, - "energized": 1, - "p": 40643.32091020084, - "q": 15920.969271556894, - "i": 87.50196843413325, - "s": 43650.39286370087, - "pf": 0.9311100827227451 - } + "node": [ + {"id": 1, "energized": 1, "u_pu": 0.8560431728248089, "u": 17120.86345649618, "u_angle": -0.235669426481254, "p": 208796.5974370983, "q": 79187.68503019707}, + {"id": 2, "energized": 1, "u_pu": 0.8528526001314131, "u": 341.1410400525652, "u_angle": -2.862596343594322, "p": -1.997686330964493e-07, "q": -6.798281342824914e-09}, + {"id": 3, "energized": 1, "u_pu": 0.8524340340819745, "u": 340.9736136327898, "u_angle": -2.862612005735382, "p": -59499.99999993332, "q": -14999.99999999823}, + {"id": 4, "energized": 1, "u_pu": 0.85250335421984, "u": 341.001341687936, "u_angle": -2.86274812851491, "p": 44500.00000005522, "q": 8999.999999967109}, + {"id": 5, "energized": 1, "u_pu": 0.8495450062127854, "u": 339.8180024851142, "u_angle": -2.862590489406438, "p": -65549.99999999226, "q": -21539.99999999868}, + {"id": 6, "energized": 1, "u_pu": 0.8435284908262257, "u": 337.4113963304903, "u_angle": -2.862339370471785, "p": -70000.00000000138, "q": -30000.00000000225}, + {"id": 7, "energized": 1, "u_pu": 0.7992792459031395, "u": 319.7116983612558, "u_angle": -2.858988906779594, "p": 1.552825440000203e-10, "q": 7.381143611087364e-10}, + {"id": 8, "energized": 1, "u_pu": 0.7508434380440624, "u": 300.337375217625, "u_angle": -2.868715195841156, "p": -50249.99999999988, "q": -15800.00000000021} ], "line": [ - { - "id": 9, - "energized": 1, - "loading": 0.022821478624043434, - "p_from": 107450.73754130705, - "q_from": 37823.288032442666, - "i_from": 228.21476888954928, - "s_from": 113913.3974375094, - "p_to": -107385.73922439183, - "q_to": -37802.064658019895, - "i_to": 228.21478624043434, - "s_to": 113845.0397741518 - }, - { - "id": 10, - "energized": 1, - "loading": 0.03984278886379786, - "p_from": 185328.71819328095, - "q_from": 72143.19343698595, - "i_from": 398.4278886379786, - "s_from": 198875.27283815583, - "p_to": -185145.36796955753, - "q_to": -71955.08086978919, - "i_to": 398.4278886379786, - "s_to": 198636.20249984835 - }, - { - "id": 11, - "energized": 1, - "loading": 0.014079911348460677, - "p_from": 66742.41831418626, - "q_from": 21881.09538646623, - "i_from": 140.79909724895091, - "s_from": 70237.6874458254, - "p_to": -66420.07376404537, - "q_to": -21777.63801509134, - "i_to": 140.79911348460678, - "s_to": 69899.1539028734 - }, - { - "id": 12, - "energized": 1, - "loading": 0.02882599039071858, - "p_from": 134368.76450686302, - "q_from": 50972.17342752355, - "i_from": 288.2599039071858, - "s_from": 143711.95962419533, - "p_to": -132249.87331574826, - "q_to": -50259.228862042575, - "i_to": 288.2599039071858, - "s_to": 141477.98089398447 - }, - { - "id": 13, - "energized": 1, - "loading": 5.19877621090643e-06, - "p_from": 3.7500430276725806e-05, - "q_from": -25.809115517768543, - "i_from": 0.0519877621090643, - "s_from": 25.80911551779579, - "p_to": 0.0, - "q_to": 0.0, - "i_to": 0.0, - "s_to": 0.0 - }, - { - "id": 14, - "energized": 1, - "loading": 0.013133345967734326, - "p_from": 61307.132402148425, - "q_from": 19883.633766018433, - "i_from": 131.3181104314503, - "s_from": 64450.93773651168, - "p_to": -56236.65287704675, - "q_to": -18613.408847688042, - "i_to": 131.33345967734326, - "s_to": 59236.98266914547 - }, - { - "id": 15, - "energized": 1, - "loading": 0.013134727699283989, - "p_from": 56236.652877046996, - "q_from": 18613.408847688053, - "i_from": 131.3334596773438, - "s_from": 59236.98266914571, - "p_to": -51061.52466299375, - "q_to": -16045.191206662124, - "i_to": 131.34727699283988, - "s_to": 53523.148840178175 - } + {"id": 9, "energized": 1, "loading": 0.02209738886894574, "p_from": 125334.3178071244, "q_from": 36595.2834364627, "i_from": 220.9738713516455, "s_from": 130567.629946983, "p_to": -125273.3786464605, "q_to": -36575.39756158792, "i_to": 220.9738886894574, "s_to": 130503.5597379921}, + {"id": 10, "energized": 1, "loading": 0.01559403854311498, "p_from": 83230.71407053778, "q_from": 39530.02664483299, "i_from": 155.9403854311498, "s_from": 92141.05909545875, "p_to": -83202.62746913906, "q_to": -39501.21052132003, "i_to": 155.9403854311498, "s_to": 92103.32703229551}, + {"id": 11, "energized": 1, "loading": 0.01172088868262802, "p_from": 65773.37864652778, "q_from": 21575.39756159854, "i_from": 117.2088675818544, "s_from": 69221.63764691319, "p_to": -65550.00005270701, "q_to": -21503.72201602719, "i_to": 117.2088868262802, "s_to": 68987.04637431914}, + {"id": 12, "energized": 1, "loading": 0.02312825820373069, "p_from": 127702.6274692225, "q_from": 48501.21052127669, "i_from": 231.2825820373069, "s_from": 136602.8128721082, "p_to": -126338.5908339994, "q_to": -48042.25231224872, "i_to": 231.2825820373069, "s_to": 135164.7052345933}, + {"id": 13, "energized": 1, "loading": 6.163623957352205e-06, "p_from": 5.271160910508927e-05, "q_from": -36.27798397313444, "i_from": 0.06163623957352205, "s_from": 36.27798397317274, "p_to": 0, "q_to": 0, "i_to": 0, "s_to": 0}, + {"id": 14, "energized": 1, "loading": 0.01012429443022176, "p_from": 56338.59083399748, "q_from": 18042.25231224654, "i_from": 101.2246602903177, "s_from": 59157.0763785648, "p_to": -53325.58411675716, "q_to": -17307.56709249234, "i_to": 101.2429443022176, "s_to": 56063.97952388385}, + {"id": 15, "energized": 1, "loading": 0.01012600656038891, "p_from": 53325.58411675751, "q_from": 17307.56709249309, "i_from": 101.2429443022186, "s_from": 56063.97952388441, "p_to": -50249.99999999988, "q_to": -15800.00000000021, "i_to": 101.2600656038891, "s_to": 52675.44494354077} ], - "node": [ - { - "id": 1, - "energized": 1, - "u_pu": 0.7259399785455936, - "u": 14518.799570911871, - "u_angle": -3.733787243188074e-20 - }, - { - "id": 2, - "energized": 1, - "u_pu": 0.7204609389969087, - "u": 288.18437559876344, - "u_angle": -2.635489557458011 - }, - { - "id": 3, - "energized": 1, - "u_pu": 0.7200285468166636, - "u": 288.01141872666545, - "u_angle": -2.6354760491729166 - }, - { - "id": 4, - "energized": 1, - "u_pu": 0.7195948643061477, - "u": 287.8379457224591, - "u_angle": -2.6360372307328497 - }, - { - "id": 5, - "energized": 1, - "u_pu": 0.7165580507430377, - "u": 286.6232202972151, - "u_angle": -2.63544620329699 - }, - { - "id": 6, - "energized": 1, - "u_pu": 0.7084088807218124, - "u": 283.363552288725, - "u_angle": -2.6354368489298374 - }, - { - "id": 7, - "energized": 1, - "u_pu": 0.6510238893811835, - "u": 260.4095557524734, - "u_angle": -2.6297836058834707 - }, - { - "id": 8, - "energized": 1, - "u_pu": 0.5881660643874217, - "u": 235.26642575496868, - "u_angle": -2.6452811145087085 - } + "transformer": [ + {"id": 17, "energized": 1, "loading": 0.1772290080407286, "p_from": 104398.2987185491, "q_from": 39593.84251509853, "i_from": 3.76520880089557, "s_from": 111654.275065659, "p_to": -104282.5159388853, "q_to": -38062.65504066495, "i_to": 187.8773197710369, "s_to": 111011.7509063276}, + {"id": 18, "energized": 1, "loading": 0.1772290080407286, "p_from": 104398.2987185491, "q_from": 39593.84251509853, "i_from": 3.76520880089557, "s_from": 111654.275065659, "p_to": -104282.5159388853, "q_to": -38062.65504066495, "i_to": 187.8773197710369, "s_to": 111011.7509063276} ], "source": [ - { - "id": 16, - "energized": 1, - "p": 293121.6972065258, - "q": 116600.85490906338, - "i": 12.54455650469723, - "s": 315461.70724631316, - "pf": 0.9291831321310124 - } + {"id": 16, "energized": 1, "p": 208796.5974370964, "q": 79187.68503019326, "i": 7.530417601791036, "s": 223308.5501313149, "pf": 0.9350138958598546} ], - "sym_load": [ - { - "id": 19, - "energized": 1, - "p": 66420.07372654522, - "q": 21803.447130608554, - "i": 140.81531927928083, - "s": 69907.19920449499, - "pf": 0.9501177916204437 - }, - { - "id": 20, - "energized": 1, - "p": 70942.74091359925, - "q": 30375.595096024186, - "i": 157.2375597531328, - "s": 77172.20526699803, - "pf": 0.919278393926333 - }, - { - "id": 21, - "energized": 1, - "p": 51061.52466299375, - "q": 16045.191206662124, - "i": 131.3472769928399, - "s": 53523.148840178175, - "pf": 0.9540082332499734 - } - ], - "sym_power_sensor": [ - { - "id": 32, - "energized": 1, - "p_residual": -1513.7944413070593, - "q_residual": -1183.8791324426597 - }, - { - "id": 33, - "energized": 1, - "p_residual": 1513.3946243918313, - "q_residual": 1183.7490980198886 - }, - { - "id": 34, - "energized": 1, - "p_residual": -2531.5567932809313, - "q_residual": -1603.1931769859564 - }, - { - "id": 35, - "energized": 1, - "p_residual": 2530.8694695575227, - "q_residual": 1602.4880497891859 - }, - { - "id": 36, - "energized": 1, - "p_residual": -870.0737241862655, - "q_residual": -262.77982646622996 - }, - { - "id": 37, - "energized": 1, - "p_residual": 870.0737240453782, - "q_residual": 262.78049509134013 - }, - { - "id": 38, - "energized": 1, - "p_residual": -1754.2660068630423, - "q_residual": -619.5806075235469 - }, - { - "id": 39, - "energized": 1, - "p_residual": 1754.2660157482403, - "q_residual": 619.5806120425709 - }, - { - "id": 40, - "energized": 1, - "p_residual": 3.649962499569723, - "q_residual": 0.6666363777685459 - }, - { - "id": 41, - "energized": 1, - "p_residual": 1.35, - "q_residual": -7.994 - }, - { - "id": 42, - "energized": 1, - "p_residual": -811.525112148423, - "q_residual": -243.98551601843496 - }, - { - "id": 43, - "energized": 1, - "p_residual": 811.5324970467477, - "q_residual": 244.61937768804205 - }, - { - "id": 44, - "energized": 1, - "p_residual": -811.5324970469975, - "q_residual": -244.61937768805245 - }, - { - "id": 45, - "energized": 1, - "p_residual": 811.5246629937442, - "q_residual": 245.19120666212368 - }, - { - "id": 46, - "energized": 1, - "p_residual": -1684.47130326288, - "q_residual": 1465.1555954683163 - }, - { - "id": 47, - "energized": 1, - "p_residual": 2022.6755672728136, - "q_residual": 1393.536154727447 - }, - { - "id": 48, - "energized": 1, - "p_residual": -1684.47130326288, - "q_residual": 1465.1555954683163 - }, - { - "id": 49, - "energized": 1, - "p_residual": 2022.6755672728136, - "q_residual": 1393.536154727447 - } + "asym_gen": [ + {"id": 23, "energized": 1, "p": 44500.00000000001, "q": 9000.000000000002, "i": 76.86853766819721, "s": 45400.99117860755, "pf": 0.9801548125884952} ], - "sym_voltage_sensor": [ - { - "id": 24, - "energized": 1, - "u_residual": -195.07289091187153 - }, - { - "id": 25, - "energized": 1, - "u_residual": -3.726399898763466 - }, - { - "id": 26, - "energized": 1, - "u_residual": -3.7258858266654205 - }, - { - "id": 27, - "energized": 1, - "u_residual": -3.725285222459096 - }, - { - "id": 28, - "energized": 1, - "u_residual": -3.7258830972151102 - }, - { - "id": 29, - "energized": 1, - "u_residual": -3.7252319887250085 - }, - { - "id": 30, - "energized": 1, - "u_residual": -3.72473035247336 - }, - { - "id": 31, - "energized": 1, - "u_residual": -3.7258209549686505 - } + "sym_load": [ + {"id": 19, "energized": 1, "p": 65550, "q": 21540, "i": 117.228113796972, "s": 68998.36302406021, "pf": 0.9500225386092459}, + {"id": 20, "energized": 1, "p": 70000, "q": 30000, "i": 130.314764129984, "s": 76157.73105863907, "pf": 0.9191450300180581}, + {"id": 21, "energized": 1, "p": 50249.99999999999, "q": 15800, "i": 101.2600656038892, "s": 52675.44494354081, "pf": 0.9539549225233791} ], - "transformer": [ - { - "id": 17, - "energized": 1, - "loading": 0.25036643432247074, - "p_from": 146560.8486032629, - "q_from": 58300.42745453169, - "i_from": 6.272278252348615, - "s_from": 157730.85362315658, - "p_to": -146389.72786727283, - "q_to": -54983.24073472744, - "i_to": 313.28239124875597, - "s_to": 156374.8994779763 - }, - { - "id": 18, - "energized": 1, - "loading": 0.25036643432247074, - "p_from": 146560.8486032629, - "q_from": 58300.42745453169, - "i_from": 6.272278252348615, - "s_from": 157730.85362315658, - "p_to": -146389.72786727283, - "q_to": -54983.24073472744, - "i_to": 313.28239124875597, - "s_to": 156374.8994779763 - } + "asym_load": [ + {"id": 22, "energized": 1, "p": 59500, "q": 15000, "i": 103.8999907711124, "s": 61361.6329639295, "pf": 0.9696612871266996} ] }, { - "asym_gen": [ - { - "id": 23, - "energized": 1, - "p": -50780.842015388414, - "q": -21011.649280539903, - "i": 108.05645985017708, - "s": 54956.19456694805, - "pf": -0.9240239870234612 - } - ], - "asym_load": [ - { - "id": 22, - "energized": 1, - "p": 40647.84050755331, - "q": 15948.875641189485, - "i": 85.85499946622492, - "s": 43664.786409023225, - "pf": 0.9309066607309346 - } + "node": [ + {"id": 1, "energized": 1, "u_pu": 0.85889911850856, "u": 17177.9823701712, "u_angle": -0.2310256470571513, "p": 205479.70156377, "q": 78314.90865824612}, + {"id": 2, "energized": 1, "u_pu": 0.8557550719997815, "u": 342.3020287999126, "u_angle": -2.857750987392809, "p": 9.339526889029868e-08, "q": 2.724510626852009e-08}, + {"id": 3, "energized": 1, "u_pu": 0.8551878706006839, "u": 342.0751482402736, "u_angle": -2.857753180680732, "p": -59500.00000009832, "q": -14999.99999994298}, + {"id": 4, "energized": 1, "u_pu": 0.8555928560276003, "u": 342.2371424110401, "u_angle": -2.857805570616444, "p": 44499.99999998496, "q": 8999.999999953134}, + {"id": 5, "energized": 1, "u_pu": 0.8503582471485877, "u": 340.143298859435, "u_angle": -2.857544589280911, "p": -65549.99999999917, "q": -21540.00000000034}, + {"id": 6, "energized": 1, "u_pu": 0.8499482723700497, "u": 339.9793089480199, "u_angle": -2.857621661550209, "p": -70000.00000000307, "q": -29999.99999999695}, + {"id": 7, "energized": 1, "u_pu": 0.842561694093326, "u": 337.0246776373304, "u_angle": -2.860245900881301, "p": 1.567705059969451e-09, "q": -3.377063503214469e-11}, + {"id": 8, "energized": 1, "u_pu": 0.7969314955680196, "u": 318.7725982272078, "u_angle": -2.868940596515285, "p": -50249.99999999984, "q": -15800.00000000024} ], "line": [ - { - "id": 9, - "energized": 1, - "loading": 0.032135193684109754, - "p_from": 153384.47220267716, - "q_from": 56821.67300343072, - "i_from": 321.3519183313435, - "s_from": 163571.08190570437, - "p_to": -153255.59491009163, - "q_to": -56779.56715180347, - "i_to": 321.35193684109754, - "s_to": 163435.6038848092 - }, - { - "id": 10, - "energized": 1, - "loading": 0.028009054594746167, - "p_from": 132968.00433131895, - "q_from": 51432.80806099954, - "i_from": 280.0905459474617, - "s_from": 142568.6638812796, - "p_to": -132877.39375673077, - "q_to": -51339.843964993495, - "i_to": 280.0905459474617, - "s_to": 142450.62776250287 - }, - { - "id": 11, - "energized": 1, - "loading": 0.023551832071840015, - "p_from": 112607.7544025453, - "q_from": 40830.6915106283, - "i_from": 235.51830262799348, - "s_from": 119781.6835781667, - "p_to": -111705.83049263195, - "q_to": -40541.17085609119, - "i_to": 235.51832071840013, - "s_to": 118835.09204116181 - }, - { - "id": 12, - "energized": 1, - "loading": 0.017208315211049492, - "p_from": 82096.55174136074, - "q_from": 30328.19468447424, - "i_from": 172.08315211049492, - "s_from": 87519.38757007668, - "p_to": -81341.43015473349, - "q_to": -30074.11848003261, - "i_to": 172.08315211049492, - "s_to": 86723.01229759277 - }, - { - "id": 13, - "energized": 1, - "loading": 0.00971464598981019, - "p_from": 45285.85971695538, - "q_from": 18731.572717018338, - "i_from": 97.1264782890943, - "s_from": 49006.9475355965, - "p_to": -44762.18863176335, - "q_to": -18337.532896433582, - "i_to": 97.1464598981019, - "s_to": 48372.70556660385 - }, - { - "id": 14, - "energized": 1, - "loading": 0.002065605550301667, - "p_from": 10405.38536504522, - "q_from": -303.96475574912074, - "i_from": 20.65605550301667, - "s_from": 10409.824166038294, - "p_to": -10279.952765774597, - "q_to": 309.68262211702057, - "i_to": 20.654500344651176, - "s_to": 10284.61628807794 - }, - { - "id": 15, - "energized": 1, - "loading": 0.01163340447483496, - "p_from": 55042.14139753723, - "q_from": 18027.850274316213, - "i_from": 116.31871803247486, - "s_from": 57919.26031243531, - "p_to": -50982.56158257936, - "q_to": -16022.091720094215, - "i_to": 116.3340447483496, - "s_to": 53440.89266290944 - } + {"id": 9, "energized": 1, "loading": 0.0299292409082664, "p_from": 168842.8448571942, "q_from": 54581.25130631004, "i_from": 299.2923899915594, "s_from": 177445.8206147249, "p_to": -168731.0540835474, "q_to": -54544.74110847269, "i_to": 299.2924090826639, "s_to": 177328.2193976337}, + {"id": 10, "energized": 1, "loading": 0.007067594142570252, "p_from": 36407.45366697838, "q_from": 20744.42380415893, "i_from": 70.67594142570252, "s_from": 41902.67057694215, "p_to": -36401.68433953403, "q_to": -20738.50462405369, "i_to": 70.67594142570252, "s_to": 41894.72755367879}, + {"id": 11, "energized": 1, "loading": 0.01960684495438662, "p_from": 109231.0540834283, "q_from": 39544.74110852521, "i_from": 196.0684284766788, "s_from": 116168.8844980321, "p_to": -108605.973622321, "q_to": -39344.10607583347, "i_to": 196.0684495438662, "s_to": 115512.8399328782}, + {"id": 12, "energized": 1, "loading": 0.01454088670701457, "p_from": 80901.68433951557, "q_from": 29738.5046240185, "i_from": 145.4088670701457, "s_from": 86194.32223901636, "p_to": -80362.51900463869, "q_to": -29557.09134663639, "i_to": 145.4088670701457, "s_to": 85625.67436023102}, + {"id": 13, "energized": 1, "loading": 0.007910723632285711, "p_from": 43055.9736223224, "q_from": 17804.10607583407, "i_from": 79.08382484997621, "s_from": 46591.87759390765, "p_to": -42708.75914291397, "q_to": -17561.41177946627, "i_to": 79.10723632285712, "s_to": 46178.36388629868}, + {"id": 14, "energized": 1, "loading": 0.001761361724585608, "p_from": 10362.51900463823, "q_from": -442.9086533600936, "i_from": 17.61361724585608, "s_from": 10371.97995547185, "p_to": -10271.32194457317, "q_to": 430.175024429125, "i_to": 17.61102211191522, "s_to": 10280.32611548451}, + {"id": 15, "energized": 1, "loading": 0.009540400425559797, "p_from": 52980.08108748874, "q_from": 17131.2367550377, "i_from": 95.3859286189891, "s_from": 55680.95064556672, "p_to": -50249.99999999984, "q_to": -15800.00000000024, "i_to": 95.40400425559797, "s_to": 52675.44494354074} ], - "node": [ - { - "id": 1, - "energized": 1, - "u_pu": 0.7399713217954279, - "u": 14799.426435908557, - "u_angle": 3.662987133929909e-20 - }, - { - "id": 2, - "energized": 1, - "u_pu": 0.7346914922764103, - "u": 293.8765969105641, - "u_angle": -2.63445428895107 - }, - { - "id": 3, - "energized": 1, - "u_pu": 0.7340829405419351, - "u": 293.6331762167741, - "u_angle": -2.634422101308937 - }, - { - "id": 4, - "energized": 1, - "u_pu": 0.7340832230404806, - "u": 293.6332892161922, - "u_angle": -2.634833475314556 - }, - { - "id": 5, - "energized": 1, - "u_pu": 0.728281691312375, - "u": 291.31267652495, - "u_angle": -2.63412557096148 - }, - { - "id": 6, - "energized": 1, - "u_pu": 0.7274034947767671, - "u": 290.96139791070686, - "u_angle": -2.6345643436844237 - }, - { - "id": 7, - "energized": 1, - "u_pu": 0.7187084997642543, - "u": 287.48339990570173, - "u_angle": -2.6380148202479297 - }, - { - "id": 8, - "energized": 1, - "u_pu": 0.6630499659709971, - "u": 265.2199863883988, - "u_angle": -2.650448836323232 - } + "transformer": [ + {"id": 17, "energized": 1, "loading": 0.1745222263166267, "p_from": 102739.850781885, "q_from": 39157.45432912306, "i_from": 3.695374978764634, "s_from": 109949.0025794748, "p_to": -102625.1492619885, "q_to": -37662.83755524398, "i_to": 184.3831851614982, "s_to": 109317.9335413825}, + {"id": 18, "energized": 1, "loading": 0.1745222263166267, "p_from": 102739.850781885, "q_from": 39157.45432912306, "i_from": 3.695374978764634, "s_from": 109949.0025794748, "p_to": -102625.1492619885, "q_to": -37662.83755524398, "i_to": 184.3831851614982, "s_to": 109317.9335413825} ], "source": [ - { - "id": 16, - "energized": 1, - "p": 286680.17540511856, - "q": 114444.40960914124, - "i": 12.04210207362806, - "s": 308679.5196657764, - "pf": 0.9287307940465966 - } + {"id": 16, "energized": 1, "p": 205479.7015637694, "q": 78314.90865825058, "i": 7.3907499575293, "s": 219898.0051589506, "pf": 0.9344318581482396} ], - "sym_load": [ - { - "id": 19, - "energized": 1, - "p": 66419.97077567514, - "q": 21809.59813907278, - "i": 138.5521290889822, - "s": 69909.02008202794, - "pf": 0.950091571842104 - }, - { - "id": 20, - "energized": 1, - "p": 70936.04478968769, - "q": 30378.083235781483, - "i": 153.12136037934005, - "s": 77167.02917363506, - "pf": 0.9192532814768998 - }, - { - "id": 21, - "energized": 1, - "p": 50982.56158257936, - "q": 16022.091720094215, - "i": 116.3340447483496, - "s": 53440.89266290944, - "pf": 0.9539990640531294 - } - ], - "sym_power_sensor": [ - { - "id": 32, - "energized": 1, - "p_residual": -2116.828802677162, - "q_residual": -1446.6357234307197 - }, - { - "id": 33, - "energized": 1, - "p_residual": 2116.236810091626, - "q_residual": 1446.442871803469 - }, - { - "id": 34, - "energized": 1, - "p_residual": -1851.4243313189627, - "q_residual": -1382.3020009995357 - }, - { - "id": 35, - "energized": 1, - "p_residual": 1850.9349567307765, - "q_residual": 1381.7998849934982 - }, - { - "id": 36, - "energized": 1, - "p_residual": -1468.3963025452913, - "q_residual": -497.56723062829855 - }, - { - "id": 37, - "energized": 1, - "p_residual": 1468.3941926319499, - "q_residual": 497.56725609118035 - }, - { - "id": 38, - "energized": 1, - "p_residual": -1070.0929513607348, - "q_residual": -370.15060447424116 - }, - { - "id": 39, - "energized": 1, - "p_residual": 1070.0967647334915, - "q_residual": 370.15189003260923 - }, - { - "id": 40, - "energized": 1, - "p_residual": -598.4233869553851, - "q_residual": -227.96911701834094 - }, - { - "id": 41, - "energized": 1, - "p_residual": 598.4016417633422, - "q_residual": 228.63801643358343 - }, - { - "id": 42, - "energized": 1, - "p_residual": -134.05197504521954, - "q_residual": 7.931344149120689 - }, - { - "id": 43, - "energized": 1, - "p_residual": 134.09339577459718, - "q_residual": -7.234889517020594 - }, - { - "id": 44, - "energized": 1, - "p_residual": -732.4950375372299, - "q_residual": -221.40312431621206 - }, - { - "id": 45, - "energized": 1, - "p_residual": 732.5615825793525, - "q_residual": 222.09172009421408 - }, - { - "id": 46, - "energized": 1, - "p_residual": -1618.534602559285, - "q_residual": 1556.109795429382 - }, - { - "id": 47, - "energized": 1, - "p_residual": 1984.1265669806596, - "q_residual": 1414.4688622114502 - }, - { - "id": 48, - "energized": 1, - "p_residual": -1618.534602559285, - "q_residual": 1556.109795429382 - }, - { - "id": 49, - "energized": 1, - "p_residual": 1984.1265669806596, - "q_residual": 1414.4688622114502 - } + "asym_gen": [ + {"id": 23, "energized": 1, "p": 44500.00000000001, "q": 9000.000000000002, "i": 76.5909693313268, "s": 45400.99117860755, "pf": 0.9801548125884952} ], - "sym_voltage_sensor": [ - { - "id": 24, - "energized": 1, - "u_residual": -198.3291559085587 - }, - { - "id": 25, - "energized": 1, - "u_residual": -3.7999994105641033 - }, - { - "id": 26, - "energized": 1, - "u_residual": -3.799474316774054 - }, - { - "id": 27, - "energized": 1, - "u_residual": -3.7988469161922556 - }, - { - "id": 28, - "energized": 1, - "u_residual": -3.7994472249500255 - }, - { - "id": 29, - "energized": 1, - "u_residual": -3.7988318107068597 - }, - { - "id": 30, - "energized": 1, - "u_residual": -3.7997579057017283 - }, - { - "id": 31, - "energized": 1, - "u_residual": -3.8007322883988337 - } + "sym_load": [ + {"id": 19, "energized": 1, "p": 65550, "q": 21540, "i": 117.1160025764526, "s": 68998.36302406021, "pf": 0.9500225386092459}, + {"id": 20, "energized": 1, "p": 70000, "q": 30000, "i": 129.3304779741728, "s": 76157.73105863907, "pf": 0.9191450300180581}, + {"id": 21, "energized": 1, "p": 50249.99999999999, "q": 15800, "i": 95.40400425559811, "s": 52675.44494354081, "pf": 0.9539549225233791} ], - "transformer": [ - { - "id": 17, - "energized": 1, - "loading": 0.2449837457664892, - "p_from": 143340.08770255928, - "q_from": 57222.20480457062, - "i_from": 6.02105103681403, - "s_from": 154339.7598328882, - "p_to": -143176.23826698068, - "q_to": -54127.24053221145, - "i_to": 300.71357862845986, - "s_to": 153065.97718603275 - }, - { - "id": 18, - "energized": 1, - "loading": 0.2449837457664892, - "p_from": 143340.08770255928, - "q_from": 57222.20480457062, - "i_from": 6.02105103681403, - "s_from": 154339.7598328882, - "p_to": -143176.23826698068, - "q_to": -54127.24053221145, - "i_to": 300.71357862845986, - "s_to": 153065.97718603275 - } + "asym_load": [ + {"id": 22, "energized": 1, "p": 59500, "q": 15000, "i": 103.5654168152423, "s": 61361.6329639295, "pf": 0.9696612871266996} ] } ] diff --git a/tests/data/state_estimation/distribution-case/update_batch.json b/tests/data/state_estimation/distribution-case/update_batch.json index bd4cb8a71..1c10770f1 100644 --- a/tests/data/state_estimation/distribution-case/update_batch.json +++ b/tests/data/state_estimation/distribution-case/update_batch.json @@ -6,322 +6,72 @@ "data": [ { "line": [ - { - "id": 13, - "to_status": 0 - } - ], - "sym_voltage_sensor": [ - { - "id": 24, - "u_sigma": 100.0, - "u_measured": 14323.72668 - }, - { - "id": 25, - "u_sigma": 100.0, - "u_measured": 284.4579757 - }, - { - "id": 26, - "u_sigma": 100.0, - "u_measured": 284.2855329 - }, - { - "id": 27, - "u_sigma": 100.0, - "u_measured": 284.1126605 - }, - { - "id": 28, - "u_sigma": 100.0, - "u_measured": 282.8973372 - }, - { - "id": 29, - "u_sigma": 100.0, - "u_measured": 279.6383203 - }, - { - "id": 30, - "u_sigma": 100.0, - "u_measured": 256.6848254 - }, - { - "id": 31, - "u_sigma": 100.0, - "u_measured": 231.5406048 - } + {"id": 13, "to_status": 0} ], "sym_power_sensor": [ - { - "id": 32, - "power_sigma": 100.0, - "p_measured": 105936.9431, - "q_measured": 36639.4089 - }, - { - "id": 33, - "power_sigma": 100.0, - "p_measured": -105872.3446, - "q_measured": -36618.31556 - }, - { - "id": 34, - "power_sigma": 100.0, - "p_measured": 182797.1614, - "q_measured": 70540.00026 - }, - { - "id": 35, - "power_sigma": 100.0, - "p_measured": -182614.4985, - "q_measured": -70352.59282 - }, - { - "id": 36, - "power_sigma": 100.0, - "p_measured": 65872.34459, - "q_measured": 21618.31556 - }, - { - "id": 37, - "power_sigma": 100.0, - "p_measured": -65550.00004, - "q_measured": -21514.85752 - }, - { - "id": 38, - "power_sigma": 100.0, - "p_measured": 132614.4985, - "q_measured": 50352.59282 - }, - { - "id": 39, - "power_sigma": 100.0, - "p_measured": -130495.6073, - "q_measured": -49639.64825 - }, - { - "id": 40, - "power_sigma": 100.0, - "p_measured": 3.65, - "q_measured": -25.14247914 - }, - { - "id": 41, - "power_sigma": 100.0, - "p_measured": 1.35, - "q_measured": -7.994 - }, - { - "id": 42, - "power_sigma": 100.0, - "p_measured": 60495.60729, - "q_measured": 19639.64825 - }, - { - "id": 43, - "power_sigma": 100.0, - "p_measured": -55425.12038, - "q_measured": -18368.78947 - }, - { - "id": 44, - "power_sigma": 100.0, - "p_measured": 55425.12038, - "q_measured": 18368.78947 - }, - { - "id": 45, - "power_sigma": 100.0, - "p_measured": -50250.0, - "q_measured": -15800.0 - }, - { - "id": 46, - "power_sigma": 100.0, - "p_measured": 144876.3773, - "q_measured": 59765.58305 - }, - { - "id": 47, - "power_sigma": 100.0, - "p_measured": -144367.0523, - "q_measured": -53589.70458 - }, - { - "id": 48, - "power_sigma": 100.0, - "p_measured": 144876.3773, - "q_measured": 59765.58305 - }, - { - "id": 49, - "power_sigma": 100.0, - "p_measured": -144367.0523, - "q_measured": -53589.70458 - } + {"id": 32, "p_measured": 125334.3178071244, "q_measured": 36595.2834364627}, + {"id": 33, "p_measured": -125273.3786464605, "q_measured": -36575.39756158792}, + {"id": 34, "p_measured": 83230.71407053778, "q_measured": 39530.02664483299}, + {"id": 35, "p_measured": -83202.62746913906, "q_measured": -39501.21052132003}, + {"id": 36, "p_measured": 65773.37864652778, "q_measured": 21575.39756159854}, + {"id": 37, "p_measured": -65550.00005270701, "q_measured": -21503.72201602719}, + {"id": 38, "p_measured": 127702.6274692225, "q_measured": 48501.21052127669}, + {"id": 39, "p_measured": -126338.5908339994, "q_measured": -48042.25231224872}, + {"id": 40, "p_measured": 5.271160910508927e-05, "q_measured": -36.27798397313444}, + {"id": 41, "p_measured": 0, "q_measured": 0}, + {"id": 42, "p_measured": 56338.59083399748, "q_measured": 18042.25231224654}, + {"id": 43, "p_measured": -53325.58411675716, "q_measured": -17307.56709249234}, + {"id": 44, "p_measured": 53325.58411675751, "q_measured": 17307.56709249309}, + {"id": 45, "p_measured": -50249.99999999988, "q_measured": -15800.00000000021}, + {"id": 46, "p_measured": 104398.2987185491, "q_measured": 39593.84251509853}, + {"id": 47, "p_measured": -104282.5159388853, "q_measured": -38062.65504066495}, + {"id": 48, "p_measured": 104398.2987185491, "q_measured": 39593.84251509853}, + {"id": 49, "p_measured": -104282.5159388853, "q_measured": -38062.65504066495} + ], + "sym_voltage_sensor": [ + {"id": 24, "u_measured": 17120.86345649618}, + {"id": 25, "u_measured": 341.1410400525652}, + {"id": 26, "u_measured": 340.9736136327898}, + {"id": 27, "u_measured": 341.001341687936}, + {"id": 28, "u_measured": 339.8180024851142}, + {"id": 29, "u_measured": 337.4113963304903}, + {"id": 30, "u_measured": 319.7116983612558}, + {"id": 31, "u_measured": 300.337375217625} ] }, { "line": [ - { - "id": 13, - "to_status": 1 - } - ], - "sym_voltage_sensor": [ - { - "id": 24, - "u_sigma": 100.0, - "u_measured": 14601.09728 - }, - { - "id": 25, - "u_sigma": 100.0, - "u_measured": 290.0765975 - }, - { - "id": 26, - "u_sigma": 100.0, - "u_measured": 289.8337019 - }, - { - "id": 27, - "u_sigma": 100.0, - "u_measured": 289.8344423 - }, - { - "id": 28, - "u_sigma": 100.0, - "u_measured": 287.5132293 - }, - { - "id": 29, - "u_sigma": 100.0, - "u_measured": 287.1625661 - }, - { - "id": 30, - "u_sigma": 100.0, - "u_measured": 283.683642 - }, - { - "id": 31, - "u_sigma": 100.0, - "u_measured": 261.4192541 - } + {"id": 13, "to_status": 1} ], "sym_power_sensor": [ - { - "id": 32, - "power_sigma": 100.0, - "p_measured": 151267.6434, - "q_measured": 55375.03728 - }, - { - "id": 33, - "power_sigma": 100.0, - "p_measured": -151139.3581, - "q_measured": -55333.12428 - }, - { - "id": 34, - "power_sigma": 100.0, - "p_measured": 131116.58, - "q_measured": 50050.50606 - }, - { - "id": 35, - "power_sigma": 100.0, - "p_measured": -131026.4588, - "q_measured": -49958.04408 - }, - { - "id": 36, - "power_sigma": 100.0, - "p_measured": 111139.3581, - "q_measured": 40333.12428 - }, - { - "id": 37, - "power_sigma": 100.0, - "p_measured": -110237.4363, - "q_measured": -40043.6036 - }, - { - "id": 38, - "power_sigma": 100.0, - "p_measured": 81026.45879, - "q_measured": 29958.04408 - }, - { - "id": 39, - "power_sigma": 100.0, - "p_measured": -80271.33339, - "q_measured": -29703.96659 - }, - { - "id": 40, - "power_sigma": 100.0, - "p_measured": 44687.43633, - "q_measured": 18503.6036 - }, - { - "id": 41, - "power_sigma": 100.0, - "p_measured": -44163.78699, - "q_measured": -18108.89488 - }, - { - "id": 42, - "power_sigma": 100.0, - "p_measured": 10271.33339, - "q_measured": -296.0334116 - }, - { - "id": 43, - "power_sigma": 100.0, - "p_measured": -10145.85937, - "q_measured": 302.4477326 - }, - { - "id": 44, - "power_sigma": 100.0, - "p_measured": 54309.64636, - "q_measured": 17806.44715 - }, - { - "id": 45, - "power_sigma": 100.0, - "p_measured": -50250.0, - "q_measured": -15800.0 - }, - { - "id": 46, - "power_sigma": 100.0, - "p_measured": 141721.5531, - "q_measured": 58778.3146 - }, - { - "id": 47, - "power_sigma": 100.0, - "p_measured": -141192.1117, - "q_measured": -52712.77167 - }, - { - "id": 48, - "power_sigma": 100.0, - "p_measured": 141721.5531, - "q_measured": 58778.3146 - }, - { - "id": 49, - "power_sigma": 100.0, - "p_measured": -141192.1117, - "q_measured": -52712.77167 - } + {"id": 32, "p_measured": 168842.8448571942, "q_measured": 54581.25130631004}, + {"id": 33, "p_measured": -168731.0540835474, "q_measured": -54544.74110847269}, + {"id": 34, "p_measured": 36407.45366697838, "q_measured": 20744.42380415893}, + {"id": 35, "p_measured": -36401.68433953403, "q_measured": -20738.50462405369}, + {"id": 36, "p_measured": 109231.0540834283, "q_measured": 39544.74110852521}, + {"id": 37, "p_measured": -108605.973622321, "q_measured": -39344.10607583347}, + {"id": 38, "p_measured": 80901.68433951557, "q_measured": 29738.5046240185}, + {"id": 39, "p_measured": -80362.51900463869, "q_measured": -29557.09134663639}, + {"id": 40, "p_measured": 43055.9736223224, "q_measured": 17804.10607583407}, + {"id": 41, "p_measured": -42708.75914291397, "q_measured": -17561.41177946627}, + {"id": 42, "p_measured": 10362.51900463823, "q_measured": -442.9086533600936}, + {"id": 43, "p_measured": -10271.32194457317, "q_measured": 430.175024429125}, + {"id": 44, "p_measured": 52980.08108748874, "q_measured": 17131.2367550377}, + {"id": 45, "p_measured": -50249.99999999984, "q_measured": -15800.00000000024}, + {"id": 46, "p_measured": 102739.850781885, "q_measured": 39157.45432912306}, + {"id": 47, "p_measured": -102625.1492619885, "q_measured": -37662.83755524398}, + {"id": 48, "p_measured": 102739.850781885, "q_measured": 39157.45432912306}, + {"id": 49, "p_measured": -102625.1492619885, "q_measured": -37662.83755524398} + ], + "sym_voltage_sensor": [ + {"id": 24, "u_measured": 17177.9823701712}, + {"id": 25, "u_measured": 342.3020287999126}, + {"id": 26, "u_measured": 342.0751482402736}, + {"id": 27, "u_measured": 342.2371424110401}, + {"id": 28, "u_measured": 340.143298859435}, + {"id": 29, "u_measured": 339.9793089480199}, + {"id": 30, "u_measured": 337.0246776373304}, + {"id": 31, "u_measured": 318.7725982272078} ] } ] diff --git a/tests/data/state_estimation/sensor-update-il/input.json b/tests/data/state_estimation/sensor-update-il/input.json new file mode 100644 index 000000000..5d3701d2e --- /dev/null +++ b/tests/data/state_estimation/sensor-update-il/input.json @@ -0,0 +1,48 @@ +{ + "version": "1.0", + "type": "input", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 0, "u_rated": 20000}, + {"id": 1, "u_rated": 20000}, + {"id": 2, "u_rated": 20000}, + {"id": 3, "u_rated": 20000}, + {"id": 4, "u_rated": 20000}, + {"id": 5, "u_rated": 20000}, + {"id": 6, "u_rated": 20000} + ], + "line": [ + {"id": 7, "from_node": 1, "to_node": 2, "from_status": 1, "to_status": 1, "r1": 0.1, "x1": 1, "c1": 4e-06, "tan1": 0, "r0": 5, "x0": 1, "c0": 4e-06, "tan0": 0, "i_n": 500}, + {"id": 8, "from_node": 1, "to_node": 2, "from_status": 1, "to_status": 1, "r1": 0.6, "x1": 1.1, "c1": 4e-06, "tan1": 0, "r0": 5, "x0": 1, "c0": 4e-06, "tan0": 0, "i_n": 500}, + {"id": 9, "from_node": 1, "to_node": 2, "from_status": 1, "to_status": 1, "r1": 0.7, "x1": 1, "c1": 4e-06, "tan1": 0, "r0": 5, "x0": 1, "c0": 4e-06, "tan0": 0, "i_n": 500}, + {"id": 10, "from_node": 2, "to_node": 4, "from_status": 0, "to_status": 0, "r1": 0.3, "x1": 0.4, "c1": 2e-06, "tan1": 0, "r0": 1, "x0": 0.5, "c0": 2.1e-06, "tan0": 0, "i_n": 500}, + {"id": 11, "from_node": 2, "to_node": 4, "from_status": 0, "to_status": 0, "r1": 0.3, "x1": 0.4, "c1": 2e-06, "tan1": 0, "r0": 1, "x0": 0.5, "c0": 2.1e-06, "tan0": 0, "i_n": 500} + ], + "link": [ + {"id": 12, "from_node": 4, "to_node": 6, "from_status": 1, "to_status": 1}, + {"id": 13, "from_node": 4, "to_node": 5, "from_status": 1, "to_status": 1} + ], + "source": [ + {"id": 14, "node": 1, "status": 1, "u_ref": 1, "sk": 700000000, "rx_ratio": 0.1, "z01_ratio": 3} + ], + "sym_load": [ + {"id": 15, "node": 2, "status": 1, "type": 0, "p_specified": 0, "q_specified": 0}, + {"id": 16, "node": 2, "status": 1, "type": 0, "p_specified": 0, "q_specified": 0}, + {"id": 17, "node": 5, "status": 0, "type": 0, "p_specified": 0, "q_specified": 0}, + {"id": 18, "node": 6, "status": 0, "type": 0, "p_specified": 0, "q_specified": 0} + ], + "sym_power_sensor": [ + {"id": 21, "measured_object": 15, "measured_terminal_type": 4, "power_sigma": 200000, "p_measured": -2000000, "q_measured": 40000}, + {"id": 22, "measured_object": 16, "measured_terminal_type": 4, "power_sigma": 30000, "p_measured": 300000, "q_measured": 300000}, + {"id": 23, "measured_object": 7, "measured_terminal_type": 1, "power_sigma": 200000, "p_measured": -2000000, "q_measured": 20000}, + {"id": 24, "measured_object": 8, "measured_terminal_type": 1, "power_sigma": 300000, "p_measured": 3000000, "q_measured": -470000}, + {"id": 25, "measured_object": 9, "measured_terminal_type": 1, "power_sigma": 200000, "p_measured": -2000000, "q_measured": 200000} + ], + "sym_voltage_sensor": [ + {"id": 19, "measured_object": 3, "u_sigma": 2000, "u_measured": 20000, "u_angle_measured": 0}, + {"id": 20, "measured_object": 2, "u_sigma": 2000, "u_measured": 20000, "u_angle_measured": 0} + ] + } +} \ No newline at end of file diff --git a/tests/data/state_estimation/sensor-update/input.json.license b/tests/data/state_estimation/sensor-update-il/input.json.license similarity index 100% rename from tests/data/state_estimation/sensor-update/input.json.license rename to tests/data/state_estimation/sensor-update-il/input.json.license diff --git a/tests/data/state_estimation/sensor-update-il/params.json b/tests/data/state_estimation/sensor-update-il/params.json new file mode 100644 index 000000000..dbe663a6b --- /dev/null +++ b/tests/data/state_estimation/sensor-update-il/params.json @@ -0,0 +1,8 @@ +{ + "calculation_method": ["iterative_linear"], + "rtol": 1e-8, + "atol": { + "default": 1e-8, + ".+_residual": 5e-4 + } +} \ No newline at end of file diff --git a/tests/data/state_estimation/sensor-update/params.json.license b/tests/data/state_estimation/sensor-update-il/params.json.license similarity index 100% rename from tests/data/state_estimation/sensor-update/params.json.license rename to tests/data/state_estimation/sensor-update-il/params.json.license diff --git a/tests/data/state_estimation/sensor-update-il/sym_output_batch.json b/tests/data/state_estimation/sensor-update-il/sym_output_batch.json new file mode 100644 index 000000000..63e20b591 --- /dev/null +++ b/tests/data/state_estimation/sensor-update-il/sym_output_batch.json @@ -0,0 +1,92 @@ +{ + "version": "1.0", + "type": "sym_output", + "is_batch": true, + "attributes": {}, + "data": [ + { + "node": [ + {"id": 0, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0}, + {"id": 1, "energized": 1, "u_pu": 1.016856066759315, "u": 20337.12133518629, "u_angle": -0.00588802, "p": 1204413.206899185, "q": -2091970.044814419}, + {"id": 2, "energized": 1, "u_pu": 1.017598387170136, "u": 20351.96774340271, "u_angle": -0.00741331, "p": -1203287.874455313, "q": 534396.6611528599}, + {"id": 3, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0}, + {"id": 4, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0}, + {"id": 5, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0}, + {"id": 6, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0} + ], + "line": [ + {"id": 7, "energized": 1, "loading": 0.04883339598162564, "p_from": 595216.6907414331, "q_from": -620845.0132386544, "i_from": 24.41669799081282, "s_from": 860076.4148611958, "p_to": -595099.5276700356, "q_to": 101893.8760705976, "i_to": 17.12762353973427, "s_to": 603759.7285458759}, + {"id": 8, "energized": 1, "loading": 0.0445062225204312, "p_from": 327117.4464727216, "q_from": -712346.338631644, "i_from": 22.2531112602156, "s_from": 783864.2292825606, "p_to": -326665.2119423663, "q_to": 193052.6673886678, "i_to": 10.76423788920655, "s_to": 379446.2980175596}, + {"id": 9, "energized": 1, "loading": 0.04596259223770999, "p_from": 282079.0696849592, "q_from": -758778.6929440049, "i_from": 22.98129611885499, "s_from": 809514.488085386, "p_to": -281523.1348428322, "q_to": 239450.1176935939, "i_to": 10.48443466520908, "s_to": 369583.0546916504}, + {"id": 10, "energized": 0, "loading": 0, "p_from": 0, "q_from": 0, "i_from": 0, "s_from": 0, "p_to": 0, "q_to": 0, "i_to": 0, "s_to": 0}, + {"id": 11, "energized": 0, "loading": 0, "p_from": 0, "q_from": 0, "i_from": 0, "s_from": 0, "p_to": 0, "q_to": 0, "i_to": 0, "s_to": 0} + ], + "link": [ + {"id": 12, "energized": 0, "loading": 0, "p_from": 0, "q_from": 0, "i_from": 0, "s_from": 0, "p_to": 0, "q_to": 0, "i_to": 0, "s_to": 0}, + {"id": 13, "energized": 0, "loading": 0, "p_from": 0, "q_from": 0, "i_from": 0, "s_from": 0, "p_to": 0, "q_to": 0, "i_to": 0, "s_to": 0} + ], + "source": [ + {"id": 14, "energized": 1, "p": 1204413.206899185, "q": -2091970.044814419, "i": 68.52839064662854, "s": 2413907.587575387, "pf": 0.4989475210643585} + ], + "sym_load": [ + {"id": 15, "energized": 1, "p": -1398356.062772343, "q": 167801.66942357, "i": 39.95354487424834, "s": 1408388.113608428, "pf": -0.9928769273617469}, + {"id": 16, "energized": 1, "p": 2601643.937227657, "q": -702198.3305764298, "i": 76.44518484362567, "s": 2694741.856203994, "pf": 0.965452008413347}, + {"id": 17, "energized": 0, "p": 0, "q": 0, "i": 0, "s": 0, "pf": 0}, + {"id": 18, "energized": 0, "p": 0, "q": 0, "i": 0, "s": 0, "pf": 0} + ], + "sym_power_sensor": [ + {"id": 21, "energized": 1, "p_residual": -601643.9372276567, "q_residual": 132198.33057643}, + {"id": 22, "energized": 1, "p_residual": -601643.9372276565, "q_residual": 132198.3305764299}, + {"id": 23, "energized": 1, "p_residual": -1404900.472329964, "q_residual": 178106.1239294023}, + {"id": 24, "energized": 1, "p_residual": 3326665.211942366, "q_residual": -593052.6673886678}, + {"id": 25, "energized": 1, "p_residual": -1718476.865157168, "q_residual": 160549.882306406} + ], + "sym_voltage_sensor": [ + {"id": 19, "energized": 0, "u_residual": 0, "u_angle_residual": 0}, + {"id": 20, "energized": 1, "u_residual": -351.9677434027146, "u_angle_residual": 0.007413305340419221} + ] + }, + { + "node": [ + {"id": 0, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0}, + {"id": 1, "energized": 1, "u_pu": 1.021160371489411, "u": 20423.20742978822, "u_angle": -0.01687206, "p": -557350.7050741836, "q": -1384262.457840845}, + {"id": 2, "energized": 1, "u_pu": 1.021893986678029, "u": 20437.87973356057, "u_angle": -0.01659576, "p": 557585.7323375798, "q": -188741.75841289}, + {"id": 3, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0}, + {"id": 4, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0}, + {"id": 5, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0}, + {"id": 6, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0} + ], + "line": [ + {"id": 7, "energized": 1, "loading": 0.03199634553939745, "p_from": -143857.8987641422, "q_from": -547330.0897437728, "i_from": 15.99817276969872, "s_from": 565919.8902457489, "p_to": 143882.3684363607, "q_to": 23045.4733916594, "i_to": 4.116343071390573, "s_to": 145716.264674546}, + {"id": 8, "energized": 1, "loading": 0.02659605586378697, "p_from": -195318.162253929, "q_from": -427938.7393162349, "i_from": 13.29802793189349, "s_from": 470404.8778592975, "p_to": 195412.6120715364, "q_to": -96417.41575906395, "i_to": 6.155592993482622, "s_to": 217904.5823709932}, + {"id": 9, "energized": 1, "loading": 0.02620832940996184, "p_from": -218174.6440561206, "q_from": -408993.6287808958, "i_from": 13.10416470498092, "s_from": 463547.1536881443, "p_to": 218290.7518296681, "q_to": -115369.8160454852, "i_to": 6.974767598339325, "s_to": 246902.9096400665}, + {"id": 10, "energized": 0, "loading": 0, "p_from": 0, "q_from": 0, "i_from": 0, "s_from": 0, "p_to": 0, "q_to": 0, "i_to": 0, "s_to": 0}, + {"id": 11, "energized": 0, "loading": 0, "p_from": 0, "q_from": 0, "i_from": 0, "s_from": 0, "p_to": 0, "q_to": 0, "i_to": 0, "s_to": 0} + ], + "link": [ + {"id": 12, "energized": 0, "loading": 0, "p_from": 0, "q_from": 0, "i_from": 0, "s_from": 0, "p_to": 0, "q_to": 0, "i_to": 0, "s_to": 0}, + {"id": 13, "energized": 0, "loading": 0, "p_from": 0, "q_from": 0, "i_from": 0, "s_from": 0, "p_to": 0, "q_to": 0, "i_to": 0, "s_to": 0} + ], + "source": [ + {"id": 14, "energized": 1, "p": -557350.7050741836, "q": -1384262.457840845, "i": 42.18501531778093, "s": 1492254.120662519, "pf": -0.3734958391850414} + ], + "sym_load": [ + {"id": 15, "energized": 1, "p": -882724.4326039901, "q": -107929.8206230904, "i": 25.12181086646697, "s": 889298.1896393182, "pf": -0.9926079271138579}, + {"id": 16, "energized": 1, "p": 325138.7002664102, "q": 296671.5790359805, "i": 12.43371980259166, "s": 440146.7939433759, "pf": 0.7387051427852472}, + {"id": 17, "energized": 0, "p": 0, "q": 0, "i": 0, "s": 0, "pf": 0}, + {"id": 18, "energized": 0, "p": 0, "q": 0, "i": 0, "s": 0, "pf": 0} + ], + "sym_power_sensor": [ + {"id": 21, "energized": 1, "p_residual": -1117275.56739601, "q_residual": 147929.8206230904}, + {"id": 22, "energized": 1, "p_residual": -25138.70026641024, "q_residual": 3328.420964019529}, + {"id": 23, "energized": 1, "p_residual": -2143882.368436361, "q_residual": -3045.473391659403}, + {"id": 24, "energized": 1, "p_residual": 2804587.387928464, "q_residual": -373582.584240936}, + {"id": 25, "energized": 1, "p_residual": -2218290.751829668, "q_residual": 315369.8160454852} + ], + "sym_voltage_sensor": [ + {"id": 19, "energized": 0, "u_residual": 0, "u_angle_residual": 0}, + {"id": 20, "energized": 1, "u_residual": -437.8797335605755, "u_angle_residual": 0.0165957556764212} + ] + } + ] +} \ No newline at end of file diff --git a/tests/data/state_estimation/sensor-update/sym_output_batch.json.license b/tests/data/state_estimation/sensor-update-il/sym_output_batch.json.license similarity index 100% rename from tests/data/state_estimation/sensor-update/sym_output_batch.json.license rename to tests/data/state_estimation/sensor-update-il/sym_output_batch.json.license diff --git a/tests/data/state_estimation/sensor-update-il/update_batch.json b/tests/data/state_estimation/sensor-update-il/update_batch.json new file mode 100644 index 000000000..f851f0c52 --- /dev/null +++ b/tests/data/state_estimation/sensor-update-il/update_batch.json @@ -0,0 +1,34 @@ +{ + "version": "1.0", + "type": "update", + "is_batch": true, + "attributes": {}, + "data": [ + { + "sym_power_sensor": [ + {"id": 21, "power_sigma": 200000, "p_measured": -2000000, "q_measured": 300000}, + {"id": 22, "power_sigma": 200000, "p_measured": 2000000, "q_measured": -570000}, + {"id": 23, "power_sigma": 200000, "p_measured": -2000000, "q_measured": 280000}, + {"id": 24, "power_sigma": 300000, "p_measured": 3000000, "q_measured": -400000}, + {"id": 25, "power_sigma": 200000, "p_measured": -2000000, "q_measured": 400000} + ], + "sym_voltage_sensor": [ + {"id": 19, "u_sigma": 2000, "u_measured": 20000}, + {"id": 20, "u_sigma": 2000, "u_measured": 20000} + ] + }, + { + "sym_power_sensor": [ + {"id": 21}, + {"id": 22}, + {"id": 23}, + {"id": 24}, + {"id": 25} + ], + "sym_voltage_sensor": [ + {"id": 19, "u_sigma": 2000}, + {"id": 20, "u_sigma": 2000} + ] + } + ] +} \ No newline at end of file diff --git a/tests/data/state_estimation/sensor-update/update_batch.json.license b/tests/data/state_estimation/sensor-update-il/update_batch.json.license similarity index 100% rename from tests/data/state_estimation/sensor-update/update_batch.json.license rename to tests/data/state_estimation/sensor-update-il/update_batch.json.license diff --git a/tests/data/state_estimation/sensor-update-nr/input.json b/tests/data/state_estimation/sensor-update-nr/input.json new file mode 100644 index 000000000..5d3701d2e --- /dev/null +++ b/tests/data/state_estimation/sensor-update-nr/input.json @@ -0,0 +1,48 @@ +{ + "version": "1.0", + "type": "input", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 0, "u_rated": 20000}, + {"id": 1, "u_rated": 20000}, + {"id": 2, "u_rated": 20000}, + {"id": 3, "u_rated": 20000}, + {"id": 4, "u_rated": 20000}, + {"id": 5, "u_rated": 20000}, + {"id": 6, "u_rated": 20000} + ], + "line": [ + {"id": 7, "from_node": 1, "to_node": 2, "from_status": 1, "to_status": 1, "r1": 0.1, "x1": 1, "c1": 4e-06, "tan1": 0, "r0": 5, "x0": 1, "c0": 4e-06, "tan0": 0, "i_n": 500}, + {"id": 8, "from_node": 1, "to_node": 2, "from_status": 1, "to_status": 1, "r1": 0.6, "x1": 1.1, "c1": 4e-06, "tan1": 0, "r0": 5, "x0": 1, "c0": 4e-06, "tan0": 0, "i_n": 500}, + {"id": 9, "from_node": 1, "to_node": 2, "from_status": 1, "to_status": 1, "r1": 0.7, "x1": 1, "c1": 4e-06, "tan1": 0, "r0": 5, "x0": 1, "c0": 4e-06, "tan0": 0, "i_n": 500}, + {"id": 10, "from_node": 2, "to_node": 4, "from_status": 0, "to_status": 0, "r1": 0.3, "x1": 0.4, "c1": 2e-06, "tan1": 0, "r0": 1, "x0": 0.5, "c0": 2.1e-06, "tan0": 0, "i_n": 500}, + {"id": 11, "from_node": 2, "to_node": 4, "from_status": 0, "to_status": 0, "r1": 0.3, "x1": 0.4, "c1": 2e-06, "tan1": 0, "r0": 1, "x0": 0.5, "c0": 2.1e-06, "tan0": 0, "i_n": 500} + ], + "link": [ + {"id": 12, "from_node": 4, "to_node": 6, "from_status": 1, "to_status": 1}, + {"id": 13, "from_node": 4, "to_node": 5, "from_status": 1, "to_status": 1} + ], + "source": [ + {"id": 14, "node": 1, "status": 1, "u_ref": 1, "sk": 700000000, "rx_ratio": 0.1, "z01_ratio": 3} + ], + "sym_load": [ + {"id": 15, "node": 2, "status": 1, "type": 0, "p_specified": 0, "q_specified": 0}, + {"id": 16, "node": 2, "status": 1, "type": 0, "p_specified": 0, "q_specified": 0}, + {"id": 17, "node": 5, "status": 0, "type": 0, "p_specified": 0, "q_specified": 0}, + {"id": 18, "node": 6, "status": 0, "type": 0, "p_specified": 0, "q_specified": 0} + ], + "sym_power_sensor": [ + {"id": 21, "measured_object": 15, "measured_terminal_type": 4, "power_sigma": 200000, "p_measured": -2000000, "q_measured": 40000}, + {"id": 22, "measured_object": 16, "measured_terminal_type": 4, "power_sigma": 30000, "p_measured": 300000, "q_measured": 300000}, + {"id": 23, "measured_object": 7, "measured_terminal_type": 1, "power_sigma": 200000, "p_measured": -2000000, "q_measured": 20000}, + {"id": 24, "measured_object": 8, "measured_terminal_type": 1, "power_sigma": 300000, "p_measured": 3000000, "q_measured": -470000}, + {"id": 25, "measured_object": 9, "measured_terminal_type": 1, "power_sigma": 200000, "p_measured": -2000000, "q_measured": 200000} + ], + "sym_voltage_sensor": [ + {"id": 19, "measured_object": 3, "u_sigma": 2000, "u_measured": 20000, "u_angle_measured": 0}, + {"id": 20, "measured_object": 2, "u_sigma": 2000, "u_measured": 20000, "u_angle_measured": 0} + ] + } +} \ No newline at end of file diff --git a/tests/data/state_estimation/single-line-load/input.json.license b/tests/data/state_estimation/sensor-update-nr/input.json.license similarity index 100% rename from tests/data/state_estimation/single-line-load/input.json.license rename to tests/data/state_estimation/sensor-update-nr/input.json.license diff --git a/tests/data/state_estimation/sensor-update-nr/params.json b/tests/data/state_estimation/sensor-update-nr/params.json new file mode 100644 index 000000000..ce0ce1648 --- /dev/null +++ b/tests/data/state_estimation/sensor-update-nr/params.json @@ -0,0 +1,13 @@ +{ + "calculation_method": ["newton_raphson"], + "rtol": 1e-8, + "atol": { + "default": 1e-8, + ".+_residual": 5e-4 + }, + "extra_params": { + "newton_raphson": { + "experimental_features": "enabled" + } + } +} \ No newline at end of file diff --git a/tests/data/state_estimation/single-line-load/params.json.license b/tests/data/state_estimation/sensor-update-nr/params.json.license similarity index 100% rename from tests/data/state_estimation/single-line-load/params.json.license rename to tests/data/state_estimation/sensor-update-nr/params.json.license diff --git a/tests/data/state_estimation/sensor-update-nr/sym_output_batch.json b/tests/data/state_estimation/sensor-update-nr/sym_output_batch.json new file mode 100644 index 000000000..52f2f70ae --- /dev/null +++ b/tests/data/state_estimation/sensor-update-nr/sym_output_batch.json @@ -0,0 +1,92 @@ +{ + "version": "1.0", + "type": "sym_output", + "is_batch": true, + "attributes": {}, + "data": [ + { + "node": [ + {"id": 0, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0}, + {"id": 1, "energized": 1, "u_pu": 1.07310261144027, "u": 21462.0522288054, "u_angle": 0.001377157114121523, "p": 1186703.126398293, "q": -2248344.028696971}, + {"id": 2, "energized": 1, "u_pu": 1.073869469204214, "u": 21477.38938408427, "u_angle": 5.312187516667019e-14, "p": -1185648.071781754, "q": 513227.7253200568}, + {"id": 3, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0}, + {"id": 4, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0}, + {"id": 5, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0}, + {"id": 6, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0} + ], + "line": [ + {"id": 7, "energized": 1, "loading": 0.0485563885680485, "p_from": 595966.1576117347, "q_from": -677742.2187398296, "i_from": 24.27819428402425, "s_from": 902502.1751114409, "p_to": -595856.3114591262, "q_to": 99595.12073886127, "i_to": 16.23988146998454, "s_to": 604122.4478370785}, + {"id": 8, "energized": 1, "loading": 0.04446400501766552, "p_from": 319134.2923108619, "q_from": -762334.3334453589, "i_from": 22.23200250883276, "s_from": 826438.3416071245, "p_to": -318710.3001549388, "q_to": 183866.0928708464, "i_to": 9.890994065793686, "s_to": 367944.2831903247}, + {"id": 9, "energized": 1, "loading": 0.04587589387473227, "p_from": 271602.6764756736, "q_from": -808267.4765116, "i_from": 22.93794693736614, "s_from": 852680.6714445796, "p_to": -271081.4601676962, "q_to": 229766.511710288, "i_to": 9.552595736245635, "s_to": 355355.8891451838}, + {"id": 10, "energized": 0, "loading": 0, "p_from": 0, "q_from": 0, "i_from": 0, "s_from": 0, "p_to": 0, "q_to": 0, "i_to": 0, "s_to": 0}, + {"id": 11, "energized": 0, "loading": 0, "p_from": 0, "q_from": 0, "i_from": 0, "s_from": 0, "p_to": 0, "q_to": 0, "i_to": 0, "s_to": 0} + ], + "link": [ + {"id": 12, "energized": 0, "loading": 0, "p_from": 0, "q_from": 0, "i_from": 0, "s_from": 0, "p_to": 0, "q_to": 0, "i_to": 0, "s_to": 0}, + {"id": 13, "energized": 0, "loading": 0, "p_from": 0, "q_from": 0, "i_from": 0, "s_from": 0, "p_to": 0, "q_to": 0, "i_to": 0, "s_to": 0} + ], + "source": [ + {"id": 14, "energized": 1, "p": 1186703.126398293, "q": -2248344.028696971, "i": 68.3905021601785, "s": 2542305.092151768, "pf": 0.4667823425527131} + ], + "sym_load": [ + {"id": 15, "energized": 1, "p": -1407175.964109123, "q": 178386.1373399716, "i": 38.13012066627709, "s": 1418437.805461176, "pf": -0.9920603911509599}, + {"id": 16, "energized": 1, "p": 2592824.035890877, "q": -691613.8626600284, "i": 72.1367021438589, "s": 2683480.243287991, "pf": 0.9662169275798222}, + {"id": 17, "energized": 0, "p": 0, "q": 0, "i": 0, "s": 0, "pf": 0}, + {"id": 18, "energized": 0, "p": 0, "q": 0, "i": 0, "s": 0, "pf": 0} + ], + "sym_power_sensor": [ + {"id": 21, "energized": 1, "p_residual": -592824.0358908768, "q_residual": 121613.8626600284}, + {"id": 22, "energized": 1, "p_residual": -592824.0358908768, "q_residual": 121613.8626600284}, + {"id": 23, "energized": 1, "p_residual": -1404143.688540874, "q_residual": 180404.8792611387}, + {"id": 24, "energized": 1, "p_residual": 3318710.300154939, "q_residual": -583866.0928708464}, + {"id": 25, "energized": 1, "p_residual": -1728918.539832304, "q_residual": 170233.488289712} + ], + "sym_voltage_sensor": [ + {"id": 19, "energized": 0, "u_residual": 0, "u_angle_residual": 0}, + {"id": 20, "energized": 1, "u_residual": -1477.389384084273, "u_angle_residual": -5.312187516667019e-14} + ] + }, + { + "node": [ + {"id": 0, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0}, + {"id": 1, "energized": 1, "u_pu": 1.092205560860152, "u": 21844.11121720304, "u_angle": -0.0001969570549001009, "p": -548822.6987342365, "q": -1621380.473946841}, + {"id": 2, "energized": 1, "u_pu": 1.092991911186064, "u": 21859.83822372128, "u_angle": -3.110046534260386e-14, "p": 549075.5269048279, "q": -178157.5878091146}, + {"id": 3, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0}, + {"id": 4, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0}, + {"id": 5, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0}, + {"id": 6, "energized": 0, "u_pu": 0, "u": 0, "u_angle": 0, "p": 0, "q": 0} + ], + "line": [ + {"id": 7, "energized": 1, "loading": 0.03400643301680723, "p_from": -127130.7284617272, "q_from": -630631.8790233056, "i_from": 17.00321650840361, "s_from": 643318.5750152677, "p_to": 127157.0514609219, "q_to": 30839.77709538874, "i_to": 3.455766620782379, "s_to": 130843.4468650563}, + {"id": 8, "energized": 1, "loading": 0.02863593534461891, "p_from": -197180.5834416728, "q_from": -504561.6138358167, "i_from": 14.31796767230945, "s_from": 541721.8886504424, "p_to": 197282.1868652671, "q_to": -95307.44514068299, "i_to": 5.78668848742736, "s_to": 219097.6274485565}, + {"id": 9, "energized": 1, "loading": 0.02830817029890169, "p_from": -224511.3868307821, "q_from": -486186.981087843, "i_from": 14.15408514945084, "s_from": 535521.3752932667, "p_to": 224636.2885786155, "q_to": -113689.919763634, "i_to": 6.649546821724111, "s_to": 251767.4720893002}, + {"id": 10, "energized": 0, "loading": 0, "p_from": 0, "q_from": 0, "i_from": 0, "s_from": 0, "p_to": 0, "q_to": 0, "i_to": 0, "s_to": 0}, + {"id": 11, "energized": 0, "loading": 0, "p_from": 0, "q_from": 0, "i_from": 0, "s_from": 0, "p_to": 0, "q_to": 0, "i_to": 0, "s_to": 0} + ], + "link": [ + {"id": 12, "energized": 0, "loading": 0, "p_from": 0, "q_from": 0, "i_from": 0, "s_from": 0, "p_to": 0, "q_to": 0, "i_to": 0, "s_to": 0}, + {"id": 13, "energized": 0, "loading": 0, "p_from": 0, "q_from": 0, "i_from": 0, "s_from": 0, "p_to": 0, "q_to": 0, "i_to": 0, "s_to": 0} + ], + "source": [ + {"id": 14, "energized": 1, "p": -548822.6987342365, "q": -1621380.473946841, "i": 45.24231367119211, "s": 1711747.935866147, "pf": -0.3206212125248053} + ], + "sym_load": [ + {"id": 15, "energized": 1, "p": -874401.493305455, "q": -118281.0877172473, "i": 23.30455486243683, "s": 882365.2232530386, "pf": -0.9909745650239664}, + {"id": 16, "energized": 1, "p": 325325.9664006273, "q": 296438.6755263619, "i": 11.62443008943587, "s": 440128.2458128833, "pf": 0.7391617545467346}, + {"id": 17, "energized": 0, "p": 0, "q": 0, "i": 0, "s": 0, "pf": 0}, + {"id": 18, "energized": 0, "p": 0, "q": 0, "i": 0, "s": 0, "pf": 0} + ], + "sym_power_sensor": [ + {"id": 21, "energized": 1, "p_residual": -1125598.506694545, "q_residual": 158281.0877172473}, + {"id": 22, "energized": 1, "p_residual": -25325.96640062729, "q_residual": 3561.32447363805}, + {"id": 23, "energized": 1, "p_residual": -2127157.051460922, "q_residual": -10839.77709538874}, + {"id": 24, "energized": 1, "p_residual": 2802717.813134733, "q_residual": -374692.554859317}, + {"id": 25, "energized": 1, "p_residual": -2224636.288578616, "q_residual": 313689.9197636339} + ], + "sym_voltage_sensor": [ + {"id": 19, "energized": 0, "u_residual": 0, "u_angle_residual": 0}, + {"id": 20, "energized": 1, "u_residual": -1859.83822372128, "u_angle_residual": 3.110046534260386e-14} + ] + } + ] +} \ No newline at end of file diff --git a/tests/data/state_estimation/single-line-load/sym_output.json.license b/tests/data/state_estimation/sensor-update-nr/sym_output_batch.json.license similarity index 100% rename from tests/data/state_estimation/single-line-load/sym_output.json.license rename to tests/data/state_estimation/sensor-update-nr/sym_output_batch.json.license diff --git a/tests/data/state_estimation/sensor-update-nr/update_batch.json b/tests/data/state_estimation/sensor-update-nr/update_batch.json new file mode 100644 index 000000000..f851f0c52 --- /dev/null +++ b/tests/data/state_estimation/sensor-update-nr/update_batch.json @@ -0,0 +1,34 @@ +{ + "version": "1.0", + "type": "update", + "is_batch": true, + "attributes": {}, + "data": [ + { + "sym_power_sensor": [ + {"id": 21, "power_sigma": 200000, "p_measured": -2000000, "q_measured": 300000}, + {"id": 22, "power_sigma": 200000, "p_measured": 2000000, "q_measured": -570000}, + {"id": 23, "power_sigma": 200000, "p_measured": -2000000, "q_measured": 280000}, + {"id": 24, "power_sigma": 300000, "p_measured": 3000000, "q_measured": -400000}, + {"id": 25, "power_sigma": 200000, "p_measured": -2000000, "q_measured": 400000} + ], + "sym_voltage_sensor": [ + {"id": 19, "u_sigma": 2000, "u_measured": 20000}, + {"id": 20, "u_sigma": 2000, "u_measured": 20000} + ] + }, + { + "sym_power_sensor": [ + {"id": 21}, + {"id": 22}, + {"id": 23}, + {"id": 24}, + {"id": 25} + ], + "sym_voltage_sensor": [ + {"id": 19, "u_sigma": 2000}, + {"id": 20, "u_sigma": 2000} + ] + } + ] +} \ No newline at end of file diff --git a/tests/data/state_estimation/sensor-update-nr/update_batch.json.license b/tests/data/state_estimation/sensor-update-nr/update_batch.json.license new file mode 100644 index 000000000..760105916 --- /dev/null +++ b/tests/data/state_estimation/sensor-update-nr/update_batch.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/sensor-update/input.json b/tests/data/state_estimation/sensor-update/input.json deleted file mode 100644 index f3ec64939..000000000 --- a/tests/data/state_estimation/sensor-update/input.json +++ /dev/null @@ -1,299 +0,0 @@ -{ - "version": "1.0", - "type": "input", - "is_batch": false, - "attributes": { - "line": [ - "id", - "from_node", - "to_node", - "from_status", - "to_status", - "r1", - "x1", - "c1", - "tan1", - "r0", - "x0", - "c0", - "tan0", - "i_n" - ], - "link": [ - "id", - "from_node", - "to_node", - "from_status", - "to_status" - ], - "node": [ - "id", - "u_rated" - ], - "source": [ - "id", - "node", - "status", - "u_ref", - "sk", - "rx_ratio", - "z01_ratio" - ], - "sym_load": [ - "id", - "node", - "status", - "type", - "p_specified", - "q_specified" - ], - "sym_power_sensor": [ - "id", - "measured_object", - "measured_terminal_type", - "power_sigma", - "p_measured", - "q_measured" - ], - "sym_voltage_sensor": [ - "id", - "measured_object", - "u_sigma", - "u_measured", - "u_angle_measured" - ] - }, - "data": { - "line": [ - [ - 7, - 1, - 2, - 1, - 1, - 0.1, - 1.0, - 4.0e-06, - 0, - 5.0, - 1.0, - 4.0e-06, - 0, - 500 - ], - [ - 8, - 1, - 2, - 1, - 1, - 0.6, - 1.1, - 4.0e-06, - 0, - 5.0, - 1.0, - 4.0e-06, - 0, - 500 - ], - [ - 9, - 1, - 2, - 1, - 1, - 0.7, - 1.0, - 4.0e-06, - 0, - 5.0, - 1.0, - 4.0e-06, - 0, - 500 - ], - [ - 10, - 2, - 4, - 0, - 0, - 0.3, - 0.4, - 2e-06, - 0, - 1.0, - 0.5, - 2.1e-06, - 0, - 500 - ], - [ - 11, - 2, - 4, - 0, - 0, - 0.3, - 0.4, - 2e-06, - 0, - 1.0, - 0.5, - 2.1e-06, - 0, - 500 - ] - ], - "link": [ - [ - 12, - 4, - 6, - 1, - 1 - ], - [ - 13, - 4, - 5, - 1, - 1 - ] - ], - "node": [ - [ - 0, - 20000 - ], - [ - 1, - 20000 - ], - [ - 2, - 20000 - ], - [ - 3, - 20000 - ], - [ - 4, - 20000 - ], - [ - 5, - 20000 - ], - [ - 6, - 20000 - ] - ], - "source": [ - [ - 14, - 1, - 1, - 1, - 700000000, - 0.1, - 3 - ] - ], - "sym_load": [ - [ - 15, - 2, - 1, - 0, - 0, - 0 - ], - [ - 16, - 2, - 1, - 0, - 0, - 0 - ], - [ - 17, - 5, - 0, - 0, - 0, - 0 - ], - [ - 18, - 6, - 0, - 0, - 0, - 0 - ] - ], - "sym_power_sensor": [ - [ - 21, - 15, - 4, - 200000, - -2000000, - 40000 - ], - [ - 22, - 16, - 4, - 30000, - 300000, - 300000 - ], - [ - 23, - 7, - 1, - 200000, - -2000000, - 20000 - ], - [ - 24, - 8, - 1, - 300000, - 3000000, - -470000 - ], - [ - 25, - 9, - 1, - 200000, - -2000000, - 200000 - ] - ], - "sym_voltage_sensor": [ - [ - 19, - 3, - 2000, - 20000, - 0 - ], - [ - 20, - 2, - 2000, - 20000, - 0 - ] - ] - } -} \ No newline at end of file diff --git a/tests/data/state_estimation/sensor-update/params.json b/tests/data/state_estimation/sensor-update/params.json deleted file mode 100644 index cef0eb1f8..000000000 --- a/tests/data/state_estimation/sensor-update/params.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "calculation_method": ["iterative_linear", "newton_raphson"], - "rtol": 1e-8, - "atol": { - "default": 1e-8, - ".+_residual": 5e-4 - }, - "extra_params": { - "newton_raphson": { - "experimental_features": "enabled", - "fail": { - "reason": "Experimental feature under development" - } - } - } -} \ No newline at end of file diff --git a/tests/data/state_estimation/sensor-update/sym_output_batch.json b/tests/data/state_estimation/sensor-update/sym_output_batch.json deleted file mode 100644 index 6c114f489..000000000 --- a/tests/data/state_estimation/sensor-update/sym_output_batch.json +++ /dev/null @@ -1,588 +0,0 @@ -{ - "version": "1.0", - "type": "sym_output", - "is_batch": true, - "attributes": { - "line": [ - "id", - "energized", - "loading", - "p_from", - "q_from", - "i_from", - "s_from", - "p_to", - "q_to", - "i_to", - "s_to" - ], - "link": [ - "id", - "energized", - "loading", - "p_from", - "q_from", - "i_from", - "s_from", - "p_to", - "q_to", - "i_to", - "s_to" - ], - "node": [ - "id", - "energized", - "u_pu", - "u", - "u_angle", - "p", - "q" - ], - "source": [ - "id", - "energized", - "p", - "q", - "i", - "s", - "pf" - ], - "sym_load": [ - "id", - "energized", - "p", - "q", - "i", - "s", - "pf" - ], - "sym_power_sensor": [ - "id", - "energized", - "p_residual", - "q_residual" - ], - "sym_voltage_sensor": [ - "id", - "energized", - "u_residual", - "u_angle_residual" - ] - }, - "data": [ - { - "line": [ - [ - 7, - 1, - 0.04883339598162564, - 595216.6907414331, - -620845.0132386544, - 24.41669799081282, - 860076.4148611958, - -595099.5276700356, - 101893.8760705976, - 17.12762353973427, - 603759.7285458759 - ], - [ - 8, - 1, - 0.0445062225204312, - 327117.4464727216, - -712346.338631644, - 22.2531112602156, - 783864.2292825606, - -326665.2119423663, - 193052.6673886678, - 10.76423788920655, - 379446.2980175596 - ], - [ - 9, - 1, - 0.04596259223770999, - 282079.0696849592, - -758778.6929440049, - 22.98129611885499, - 809514.488085386, - -281523.1348428322, - 239450.1176935939, - 10.48443466520908, - 369583.0546916504 - ], - [ - 10, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 11, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] - ], - "link": [ - [ - 12, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 13, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] - ], - "node": [ - [ - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 1, - 1, - 1.016856066759315, - 20337.12133518629, - -0.00588802, - 1204413.206899185, - -2091970.044814419 - ], - [ - 2, - 1, - 1.017598387170136, - 20351.96774340271, - -0.00741331, - -1203287.874455313, - 534396.6611528599 - ], - [ - 3, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 4, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 5, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 6, - 0, - 0, - 0, - 0, - 0, - 0 - ] - ], - "source": [ - [ - 14, - 1, - 1204413.206899185, - -2091970.044814419, - 68.52839064662854, - 2413907.587575387, - 0.4989475210643585 - ] - ], - "sym_load": [ - [ - 15, - 1, - -1398356.062772343, - 167801.66942357, - 39.95354487424834, - 1408388.113608428, - -0.9928769273617469 - ], - [ - 16, - 1, - 2601643.937227657, - -702198.3305764298, - 76.44518484362567, - 2694741.856203994, - 0.965452008413347 - ], - [ - 17, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 18, - 0, - 0, - 0, - 0, - 0, - 0 - ] - ], - "sym_power_sensor": [ - [ - 21, - 1, - -601643.9372276567, - 132198.33057643 - ], - [ - 22, - 1, - -601643.9372276565, - 132198.3305764299 - ], - [ - 23, - 1, - -1404900.472329964, - 178106.1239294023 - ], - [ - 24, - 1, - 3326665.211942366, - -593052.6673886678 - ], - [ - 25, - 1, - -1718476.865157168, - 160549.882306406 - ] - ], - "sym_voltage_sensor": [ - [ - 19, - 0, - 0, - 0 - ], - [ - 20, - 1, - -351.9677434027146, - 0.007413305340419221 - ] - ] - }, - { - "line": [ - [ - 7, - 1, - 0.03199634553939745, - -143857.8987641422, - -547330.0897437728, - 15.99817276969872, - 565919.8902457489, - 143882.3684363607, - 23045.4733916594, - 4.116343071390573, - 145716.264674546 - ], - [ - 8, - 1, - 0.02659605586378697, - -195318.162253929, - -427938.7393162349, - 13.29802793189349, - 470404.8778592975, - 195412.6120715364, - -96417.41575906395, - 6.155592993482622, - 217904.5823709932 - ], - [ - 9, - 1, - 0.02620832940996184, - -218174.6440561206, - -408993.6287808958, - 13.10416470498092, - 463547.1536881443, - 218290.7518296681, - -115369.8160454852, - 6.974767598339325, - 246902.9096400665 - ], - [ - 10, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 11, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] - ], - "link": [ - [ - 12, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 13, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ] - ], - "node": [ - [ - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 1, - 1, - 1.021160371489411, - 20423.20742978822, - -0.01687206, - -557350.7050741836, - -1384262.457840845 - ], - [ - 2, - 1, - 1.021893986678029, - 20437.87973356057, - -0.01659576, - 557585.7323375798, - -188741.75841289 - ], - [ - 3, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 4, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 5, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 6, - 0, - 0, - 0, - 0, - 0, - 0 - ] - ], - "source": [ - [ - 14, - 1, - -557350.7050741836, - -1384262.457840845, - 42.18501531778093, - 1492254.120662519, - -0.3734958391850414 - ] - ], - "sym_load": [ - [ - 15, - 1, - -882724.4326039901, - -107929.8206230904, - 25.12181086646697, - 889298.1896393182, - -0.9926079271138579 - ], - [ - 16, - 1, - 325138.7002664102, - 296671.5790359805, - 12.43371980259166, - 440146.7939433759, - 0.7387051427852472 - ], - [ - 17, - 0, - 0, - 0, - 0, - 0, - 0 - ], - [ - 18, - 0, - 0, - 0, - 0, - 0, - 0 - ] - ], - "sym_power_sensor": [ - [ - 21, - 1, - -1117275.56739601, - 147929.8206230904 - ], - [ - 22, - 1, - -25138.70026641024, - 3328.420964019529 - ], - [ - 23, - 1, - -2143882.368436361, - -3045.473391659403 - ], - [ - 24, - 1, - 2804587.387928464, - -373582.584240936 - ], - [ - 25, - 1, - -2218290.751829668, - 315369.8160454852 - ] - ], - "sym_voltage_sensor": [ - [ - 19, - 0, - 0, - 0 - ], - [ - 20, - 1, - -437.8797335605755, - 0.0165957556764212 - ] - ] - } - ] -} \ No newline at end of file diff --git a/tests/data/state_estimation/sensor-update/update_batch.json b/tests/data/state_estimation/sensor-update/update_batch.json deleted file mode 100644 index 1d80de15d..000000000 --- a/tests/data/state_estimation/sensor-update/update_batch.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "version": "1.0", - "type": "update", - "is_batch": true, - "attributes": { - "sym_power_sensor": [ - "id", - "power_sigma", - "p_measured", - "q_measured" - ], - "sym_voltage_sensor": [ - "id", - "u_sigma", - "u_measured" - ] - }, - "data": [ - { - "sym_power_sensor": [ - [ - 21, - 200000, - -2000000, - 300000 - ], - [ - 22, - 200000, - 2000000, - -570000 - ], - [ - 23, - 200000, - -2000000, - 280000 - ], - [ - 24, - 300000, - 3000000, - -400000 - ], - [ - 25, - 200000, - -2000000, - 400000 - ] - ], - "sym_voltage_sensor": [ - [ - 19, - 2000, - 20000 - ], - [ - 20, - 2000, - 20000 - ] - ] - }, - { - "sym_power_sensor": [ - [ - 21, - null, - null, - null - ], - [ - 22, - null, - null, - null - ], - [ - 23, - null, - null, - null - ], - [ - 24, - null, - null, - null - ], - [ - 25, - null, - null, - null - ] - ], - "sym_voltage_sensor": [ - [ - 19, - 2000, - null - ], - [ - 20, - 2000, - null - ] - ] - } - ] -} \ No newline at end of file diff --git a/tests/data/state_estimation/single-line-load/input.json b/tests/data/state_estimation/single-line-load-il/input.json similarity index 100% rename from tests/data/state_estimation/single-line-load/input.json rename to tests/data/state_estimation/single-line-load-il/input.json diff --git a/tests/data/state_estimation/single-line-load-il/input.json.license b/tests/data/state_estimation/single-line-load-il/input.json.license new file mode 100644 index 000000000..760105916 --- /dev/null +++ b/tests/data/state_estimation/single-line-load-il/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/single-line-load-il/params.json b/tests/data/state_estimation/single-line-load-il/params.json new file mode 100644 index 000000000..61b8599f8 --- /dev/null +++ b/tests/data/state_estimation/single-line-load-il/params.json @@ -0,0 +1,5 @@ +{ + "calculation_method": ["iterative_linear"], + "rtol": 1e-5, + "atol": 1e-5 +} \ No newline at end of file diff --git a/tests/data/state_estimation/single-line-load-il/params.json.license b/tests/data/state_estimation/single-line-load-il/params.json.license new file mode 100644 index 000000000..760105916 --- /dev/null +++ b/tests/data/state_estimation/single-line-load-il/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/single-line-load/sym_output.json b/tests/data/state_estimation/single-line-load-il/sym_output.json similarity index 100% rename from tests/data/state_estimation/single-line-load/sym_output.json rename to tests/data/state_estimation/single-line-load-il/sym_output.json diff --git a/tests/data/state_estimation/single-line-load-il/sym_output.json.license b/tests/data/state_estimation/single-line-load-il/sym_output.json.license new file mode 100644 index 000000000..760105916 --- /dev/null +++ b/tests/data/state_estimation/single-line-load-il/sym_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/single-line-load/params.json b/tests/data/state_estimation/single-line-load/params.json deleted file mode 100644 index e65639572..000000000 --- a/tests/data/state_estimation/single-line-load/params.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "calculation_method": ["iterative_linear"], - "rtol": 1e-5, - "atol": 1e-5, - "extra_params": { - "newton_raphson": { - "experimental_features": "enabled" - } - } -} \ No newline at end of file diff --git a/tests/unit/test_0Z_model_validation.py b/tests/unit/test_0Z_model_validation.py index f679bdd3e..0c41f3600 100644 --- a/tests/unit/test_0Z_model_validation.py +++ b/tests/unit/test_0Z_model_validation.py @@ -103,6 +103,10 @@ def test_single_validation( base_kwargs = get_kwargs(sym=sym, calculation_method=calculation_method, params=params) result = calculation_function(model, **supported_kwargs(kwargs=base_kwargs, supported=calculation_args)) + # export data if needed + if EXPORT_OUTPUT: + save_json_data(f"{case_id}.json", result) + # Compare the results reference_result = case_data["output"] compare_result(result, reference_result, rtol, atol) @@ -115,10 +119,6 @@ def test_single_validation( # check assert np.all(input_array["id"][indexer_array] == ids_array) - # export data if needed - if EXPORT_OUTPUT: - save_json_data(f"{case_id}.json", result) - # test calculate with only node and source result kwargs = dict(base_kwargs, **{"output_component_types": ["node", "source"]}) result = calculation_function(model, **supported_kwargs(kwargs=kwargs, supported=calculation_args)) @@ -152,23 +152,26 @@ def test_batch_validation( base_kwargs = get_kwargs(sym=sym, calculation_method=calculation_method, params=params) + calculation_function, calculation_args = calculation_function_arguments_map[calculation_type] + + # export data without comparing first, if needed + if EXPORT_OUTPUT: + model_copy = copy(model) + kwargs = dict(base_kwargs, update_data=update_batch) + result_batch = calculation_function(model_copy, **supported_kwargs(kwargs=kwargs, supported=calculation_args)) + save_json_data(f"{case_id}.json", result_batch) + # execute batch calculation by applying update method for update_data, reference_result in zip(update_list, reference_output_list): model_copy = copy(model) model_copy.update(update_data=update_data) - calculation_function, calculation_args = calculation_function_arguments_map[calculation_type] result = calculation_function(model_copy, **supported_kwargs(kwargs=base_kwargs, supported=calculation_args)) compare_result(result, reference_result, rtol, atol) # execute in batch one go for threading in [-1, 0, 1, 2]: - calculation_function, calculation_args = calculation_function_arguments_map[calculation_type] kwargs = dict(base_kwargs, update_data=update_batch, threading=threading) result_batch = calculation_function(model, **supported_kwargs(kwargs=kwargs, supported=calculation_args)) result_list = convert_batch_dataset_to_batch_list(result_batch) for result, reference_result in zip(result_list, reference_output_list): compare_result(result, reference_result, rtol, atol) - - # export data if needed - if EXPORT_OUTPUT: - save_json_data(f"{case_id}.json", result_batch) diff --git a/tests/unit/utils.py b/tests/unit/utils.py index 7cab5f60f..a3523c8d6 100644 --- a/tests/unit/utils.py +++ b/tests/unit/utils.py @@ -5,8 +5,6 @@ import json import os import re -import sys -import warnings from pathlib import Path from typing import Any, Dict, List, Optional, Union @@ -132,15 +130,14 @@ def _add_cases(case_dir: Path, calculation_type: str, **kwargs): if calculation_type == "short_circuit" and sym: continue # only asym short circuit calculations are supported - for calculation_method in calculation_methods: - yield from add_case( - case_dir=case_dir, - params=params, - calculation_type=calculation_type, - calculation_method=calculation_method, - sym=sym, - **kwargs, - ) + yield from add_case( + case_dir=case_dir, + params=params, + calculation_type=calculation_type, + calculation_method=calculation_method, + sym=sym, + **kwargs, + ) def pytest_cases(get_batch_cases: bool = False, data_dir: Optional[str] = None, test_cases: Optional[List[str]] = None):