@@ -353,8 +353,12 @@ TEST_CASE_TEMPLATE_DEFINE("Test math solver - SE, measurements", SolverType, tes
353
353
source_0(p) load_0
354
354
355
355
*/
356
+ // to make the distinction between global and local angle current measurement
357
+ auto const global_shift = phase_shift (1.0 + 1 .0i);
358
+
356
359
topo.power_sensors_per_source = {from_sparse, {0 , 1 }};
357
360
topo.current_sensors_per_branch_from = {from_sparse, {0 , 1 }};
361
+ se_input.measured_voltage = {{.value = 1.0 * global_shift, .variance = 0.1 }};
358
362
359
363
auto param_ptr = std::make_shared<MathModelParam<symmetric_t > const >(param);
360
364
auto topo_ptr = std::make_shared<MathModelTopology const >(topo);
@@ -377,19 +381,23 @@ TEST_CASE_TEMPLATE_DEFINE("Test math solver - SE, measurements", SolverType, tes
377
381
CHECK (real (output.bus_injection [0 ]) == doctest::Approx (1.95 ));
378
382
CHECK (real (output.source [0 ].s ) == doctest::Approx (1.95 ));
379
383
CHECK (real (output.branch [0 ].s_f ) == doctest::Approx (1.95 ));
384
+ CHECK (real (output.branch [0 ].i_f ) == doctest::Approx (real (1.95 * global_shift)));
385
+ CHECK (imag (output.branch [0 ].i_f ) == doctest::Approx (imag (1.95 * global_shift)));
380
386
} else {
381
387
CHECK_FALSE (real (output.bus_injection [0 ]) == doctest::Approx (1.95 ));
382
388
CHECK_FALSE (real (output.source [0 ].s ) == doctest::Approx (1.95 ));
383
389
CHECK_FALSE (real (output.branch [0 ].s_f ) == doctest::Approx (1.95 ));
390
+ CHECK_FALSE (real (output.branch [0 ].i_f ) == doctest::Approx (real (1.95 * global_shift)));
391
+ CHECK_FALSE (imag (output.branch [0 ].i_f ) == doctest::Approx (imag (1.95 * global_shift)));
384
392
}
385
393
}
386
394
SUBCASE (" Global angle current sensor" ) {
387
395
se_input.measured_source_power = {{.real_component = {.value = 1.93 , .variance = 0.05 },
388
396
.imag_component = {.value = 0.0 , .variance = 0.05 }}};
389
397
se_input.measured_branch_from_current = {
390
398
{.angle_measurement_type = AngleMeasurementType::global_angle,
391
- .measurement = {.real_component = {.value = 1.97 , .variance = 0.05 },
392
- .imag_component = {.value = 0.0 , .variance = 0.05 }}}};
399
+ .measurement = {.real_component = {.value = real ( 1.97 * global_shift) , .variance = 0.05 },
400
+ .imag_component = {.value = imag ( 1.97 * global_shift) , .variance = 0.05 }}}};
393
401
394
402
output = run_state_estimation (solver, y_bus_sym, se_input, error_tolerance, num_iter, info);
395
403
@@ -398,10 +406,14 @@ TEST_CASE_TEMPLATE_DEFINE("Test math solver - SE, measurements", SolverType, tes
398
406
CHECK (real (output.bus_injection [0 ]) == doctest::Approx (1.95 ));
399
407
CHECK (real (output.source [0 ].s ) == doctest::Approx (1.95 ));
400
408
CHECK (real (output.branch [0 ].s_f ) == doctest::Approx (1.95 ));
409
+ CHECK (real (output.branch [0 ].i_f ) == doctest::Approx (real (1.95 * global_shift)));
410
+ CHECK (imag (output.branch [0 ].i_f ) == doctest::Approx (imag (1.95 * global_shift)));
401
411
} else {
402
412
CHECK_FALSE (real (output.bus_injection [0 ]) == doctest::Approx (1.95 ));
403
413
CHECK_FALSE (real (output.source [0 ].s ) == doctest::Approx (1.95 ));
404
414
CHECK_FALSE (real (output.branch [0 ].s_f ) == doctest::Approx (1.95 ));
415
+ CHECK_FALSE (real (output.branch [0 ].i_f ) == doctest::Approx (real (1.95 * global_shift)));
416
+ CHECK_FALSE (imag (output.branch [0 ].i_f ) == doctest::Approx (imag (1.95 * global_shift)));
405
417
}
406
418
}
407
419
}
0 commit comments