|
18 | 18 |
|
19 | 19 | #include <doctest/doctest.h> |
20 | 20 |
|
21 | | -#include <algorithm> |
22 | 21 | #include <complex> |
23 | 22 |
|
24 | 23 | namespace power_grid_model { |
@@ -54,38 +53,6 @@ void execute_subcases(const AsymLineInput& input, const ComplexTensor<asymmetric |
54 | 53 | ComplexTensor<asymmetric_t> const ytt = y_series + 0.5 * y_shunt; |
55 | 54 | ComplexTensor<asymmetric_t> const branch_shunt = 0.5 * y_shunt + inv(inv(y_series) + 2.0 * inv(y_shunt)); |
56 | 55 |
|
57 | | - double constexpr nominal_current = 216.0; |
58 | | - DoubleComplex const u1f = 1.0; |
59 | | - DoubleComplex const u1t = 0.9; |
60 | | - ComplexValue<asymmetric_t> const uaf{1.0}; |
61 | | - ComplexValue<asymmetric_t> const uat{0.9}; |
62 | | - |
63 | | - // Symmetric results |
64 | | - DoubleComplex const i1f = (yff1 * u1f + yft1 * u1t) * base_i; |
65 | | - DoubleComplex const i1t = (yft1 * u1f + yff1 * u1t) * base_i; |
66 | | - DoubleComplex const s_f = conj(i1f) * u1f * 10e3 * sqrt3; |
67 | | - DoubleComplex const s_t = conj(i1t) * u1t * 10e3 * sqrt3; |
68 | | - double const loading_sym = std::max(cabs(i1f), cabs(i1t)) / nominal_current; |
69 | | - |
70 | | - // Asymmetric results |
71 | | - ComplexValue<asymmetric_t> const i_f = dot(ytt, uaf) + dot(-y_series, uat); |
72 | | - ComplexValue<asymmetric_t> const i_t = dot(-y_series, uaf) + dot(ytt, uat); |
73 | | - ComplexValue<asymmetric_t> const i3pf = base_i * cabs(i_f); |
74 | | - ComplexValue<asymmetric_t> const i3pt = base_i * cabs(i_t); |
75 | | - |
76 | | - ComplexValue<asymmetric_t> const s_f_asym = uaf * conj(i_f); |
77 | | - ComplexValue<asymmetric_t> const s_t_asym = uat * conj(i_t); |
78 | | - |
79 | | - RealValue<asymmetric_t> const i_from_asym = base_i * cabs(i_f); |
80 | | - RealValue<asymmetric_t> const i_to_asym = base_i * cabs(i_t); |
81 | | - |
82 | | - ComplexValue<asymmetric_t> const p3pf = base_power<asymmetric_t> * real(s_f_asym); |
83 | | - ComplexValue<asymmetric_t> const p3pt = base_power<asymmetric_t> * real(s_t_asym); |
84 | | - ComplexValue<asymmetric_t> const q3pf = base_power<asymmetric_t> * imag(s_f_asym); |
85 | | - ComplexValue<asymmetric_t> const q3pt = base_power<asymmetric_t> * imag(s_t_asym); |
86 | | - |
87 | | - double const max_i = std::max(max_val(i_from_asym), max_val(i_to_asym)); |
88 | | - double const loading_asym = max_i / nominal_current; |
89 | 56 | // Short circuit results |
90 | 57 | DoubleComplex const if_sc{1.0, 1.0}; |
91 | 58 | DoubleComplex const it_sc{2.0, 2.0 * sqrt3}; |
@@ -164,21 +131,6 @@ void execute_subcases(const AsymLineInput& input, const ComplexTensor<asymmetric |
164 | 131 | CHECK((cabs(param.yft() - 0.0) < numerical_tolerance).all()); |
165 | 132 | } |
166 | 133 |
|
167 | | - SUBCASE("Symmetric results") { |
168 | | - BranchOutput<symmetric_t> const output = branch.get_output<symmetric_t>(1.0, 0.9); |
169 | | - CHECK(output.id == 1); |
170 | | - CHECK(output.energized); |
171 | | - CHECK(output.loading == doctest::Approx(loading_sym)); |
172 | | - CHECK(output.i_from == doctest::Approx(cabs(i1f))); |
173 | | - CHECK(output.i_to == doctest::Approx(cabs(i1t))); |
174 | | - CHECK(output.s_from == doctest::Approx(cabs(s_f))); |
175 | | - CHECK(output.s_to == doctest::Approx(cabs(s_t))); |
176 | | - CHECK(output.p_from == doctest::Approx(real(s_f))); |
177 | | - CHECK(output.p_to == doctest::Approx(real(s_t))); |
178 | | - CHECK(output.q_from == doctest::Approx(imag(s_f))); |
179 | | - CHECK(output.q_to == doctest::Approx(imag(s_t))); |
180 | | - } |
181 | | - |
182 | 134 | SUBCASE("Symmetric results with direct power and current output") { |
183 | 135 | BranchSolverOutput<symmetric_t> branch_solver_output{}; |
184 | 136 | branch_solver_output.i_f = 1.0 - 2.0i; |
@@ -224,19 +176,6 @@ void execute_subcases(const AsymLineInput& input, const ComplexTensor<asymmetric |
224 | 176 | CHECK(output.i_to_angle(1) == 0.0); |
225 | 177 | } |
226 | 178 |
|
227 | | - SUBCASE("Asymmetric results") { |
228 | | - BranchOutput<asymmetric_t> const output = branch.get_output<asymmetric_t>(uaf, uat); |
229 | | - CHECK(output.id == 1); |
230 | | - CHECK(output.energized); |
231 | | - CHECK(output.loading == doctest::Approx(loading_asym)); |
232 | | - CHECK((cabs(output.i_from - i3pf) < numerical_tolerance).all()); |
233 | | - CHECK((cabs(output.i_to - i3pt) < numerical_tolerance).all()); |
234 | | - CHECK((cabs(output.p_from - p3pf) < numerical_tolerance).all()); |
235 | | - CHECK((cabs(output.p_to - p3pt) < numerical_tolerance).all()); |
236 | | - CHECK((cabs(output.q_from - q3pf) < numerical_tolerance).all()); |
237 | | - CHECK((cabs(output.q_to - q3pt) < numerical_tolerance).all()); |
238 | | - } |
239 | | - |
240 | 179 | SUBCASE("Asym short circuit results") { |
241 | 180 | BranchShortCircuitOutput const asym_output = branch.get_sc_output(if_sc_asym, it_sc_asym); |
242 | 181 | CHECK(asym_output.id == 1); |
|
0 commit comments