Skip to content

Commit

Permalink
update calc_param
Browse files Browse the repository at this point in the history
Signed-off-by: petersalemink95 <peter.salemink95@gmail.com>
  • Loading branch information
petersalemink95 committed Jan 8, 2025
1 parent c250f3b commit 87b323f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ template <symmetry_tag sym_type> struct PowerSensorCalcParam {

// current sensor calculation parameters for state estimation
// The value is the complex current
// * for appliances, it is always in injection direction
// * for branches, the direction is node -> branch
template <symmetry_tag sym_type> struct CurrentSensorCalcParam {
using sym = sym_type;
Expand All @@ -119,8 +118,8 @@ template <symmetry_tag sym_type> struct CurrentSensorCalcParam {

AngleMeasurementType angle_measurement_type{};
ComplexValue<sym> value{};
double i_variance{}; // variance (sigma^2) of the error range of the current, in p.u.
double i_angle_variance{}; // variance (sigma^2) of the error range of the current angle, in p.u.
double i_real_variance{}; // variance (sigma^2) of the error range of real part of the current, in p.u.
double i_imag_variance{}; // variance (sigma^2) of the error range of imaginary part of the current, in p.u.
};

template <typename T>
Expand Down
8 changes: 4 additions & 4 deletions tests/cpp_unit_tests/test_current_sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ TEST_CASE("Test current sensor") {

// Check symmetric sensor output for symmetric parameters
CHECK(sym_sensor_param.angle_measurement_type == AngleMeasurementType::local);
CHECK(sym_sensor_param.i_variance == doctest::Approx(0.0));
CHECK(sym_sensor_param.i_angle_variance == doctest::Approx(0.0));
CHECK(sym_sensor_param.i_real_variance == doctest::Approx(0.0));
CHECK(sym_sensor_param.i_imag_variance == doctest::Approx(0.0));
CHECK(real(sym_sensor_param.value) == doctest::Approx(0.0));
CHECK(imag(sym_sensor_param.value) == doctest::Approx(0.0));

Expand All @@ -70,8 +70,8 @@ TEST_CASE("Test current sensor") {
CHECK(is_nan(sym_sensor_output.i_angle_residual));

// Check symmetric sensor output for asymmetric parameters
CHECK(asym_sensor_param.i_variance == doctest::Approx(0.0));
CHECK(asym_sensor_param.i_angle_variance == doctest::Approx(0.0));
CHECK(asym_sensor_param.i_real_variance == doctest::Approx(0.0));
CHECK(asym_sensor_param.i_imag_variance == doctest::Approx(0.0));
CHECK(real(asym_sensor_param.value[0]) == doctest::Approx(0.0));
CHECK(imag(asym_sensor_param.value[1]) == doctest::Approx(0.0));

Expand Down

0 comments on commit 87b323f

Please sign in to comment.