-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
If a node has both voltage phasor measurement and voltage magnitude measurement. The phasor measurement will be treated as magnitude only. This means the phase angle information is dropped which is not correct. In some cases, the grid can become not observable. In other cases, the grid is still observable, but phase angle of that voltage phasor is not taken into account.
It concerns the following code segment:
Lines 278 to 287 in 8b003c8
| // check if there is nan | |
| if (auto const start = input.measured_voltage.cbegin() + *sensors.begin(); | |
| std::any_of(start, start + sensors.size(), [](auto const& x) { return is_nan(imag(x.value)); })) { | |
| // only keep magnitude | |
| aggregated = combine_measurements<true>(input.measured_voltage, sensors); | |
| } else { | |
| // keep complex number | |
| aggregated = combine_measurements(input.measured_voltage, sensors); | |
| angle_measured = true; | |
| } |
Lines 439 to 452 in 8b003c8
| // combine multiple measurements of one quantity | |
| // using Kalman filter | |
| // if only_magnitude = true, combine the abs value of the individual data | |
| // set imag part to nan, to signal this is a magnitude only measurement | |
| template <bool only_magnitude = false> | |
| static VoltageSensorCalcParam<sym> combine_measurements(std::vector<VoltageSensorCalcParam<sym>> const& data, | |
| IdxRange const& sensors) { | |
| auto complex_measurements = sensors | std::views::transform([&data](Idx pos) -> auto& { return data[pos]; }); | |
| if constexpr (only_magnitude) { | |
| return statistics::combine_magnitude(complex_measurements); | |
| } else { | |
| return statistics::combine(complex_measurements); | |
| } | |
| } |
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Q4 2025