[FEATURE] Addition of phasor voltage sensors to the necessary and sufficient conditions for observability in radial grids
Background
The full observability check for any grid (radial or meshed) with any type of sensors is described in #84. In #508, we implemented a necessary condition check for observability, which was later extended in #838 to a necessary and sufficient condition for observability in radial grids. However, the checks implemented in #508 and #838 have not yet been extended to meshed grids. Additionally, they only consider regular voltage sensors and do not account for phasor voltage sensors.
Proposal
This issue focuses solely on incorporating phasor voltage sensors into the necessary and sufficient condition check for observability in radial grids, extending #838 and serving as an additional intermediate step toward the full observability check described in #84.
Mathematics
Build graph
We don't need to build any additional graph. The one used in #858 is enough to perform the observability check. Accounting for phasor voltage sensors doesn't modify the graph, but adds a new tag in the already constructed vertex, similarly to what the injection sensors did in #858. Details are explained in the next section.
Check observability
To check observability, we traverse the vertices of the above grid in the reverse order of the DFS results. For each vertex, we do the following:
- If the predecessor edge is
not_measured.- If the current vertex has
injection_available- change the predecessor edge to
measured. - change the current vertex to
injection_unavailable.
- change the predecessor edge to
- Else if the predecessor vertex has
injection_available- change the predecessor edge to
measured. - change the predecessor vertex to
injection_unavailable.
- change the predecessor edge to
- Else if the current vertex has
phasor_voltage_sensor_available- change the predecessor edge to
measured. - change the current vertex to
phasor_voltage_sensor_unavailable.
- change the predecessor edge to
- Else if the predecessor vertex has
phasor_voltage_sensor_available- change the predecessor edge to
measured. - change the predecessor vertex to
phasor_voltage_sensor_unavailable.
- change the predecessor edge to
- If the current vertex has
- Change the current vertex to
injection_unavailable, regardless of the original state.
Note: phasor_voltage_sensor_available is the new separate vertex tag introduced by the addition of phasor voltage sensors.
After traversing all the vertices in reverse order, do the following:
-
If all the edges are now
measured- If at least one phasor voltage sensor is present
- if there is at least one vertex with
phasor_voltage_sensor_available- the system is observable.
- Else
- the system is NOT observable.
- if there is at least one vertex with
- Else if at least one voltage sensor is present
- the system is observable.
- Else
- the system is NOT observable.
- If at least one phasor voltage sensor is present
-
Else
- the system is NOT observable.
This is the full necessary and sufficient condition check for radial grids considering phasor voltage sensors.
Note: The same order layed out in the logic, is not necessarily the most efficient order for the implementation details.
Implementation
The implementation follows directly from #868. The DFS search information is already contained and ordered in the YBusStructure; its upper triangle contains all the information on the predecessor vertex and edge. In addition, the measured_values in the already implemented necessary_observability_check also contain the information of the phasor voltage sensors.
In short, the implementation proposal is as follows:
- Add the new
phasor_voltage_sensor_availabletag to all the vertexes in the graph. This can probably be done by generalizing/extending thecount_flow_sensorsfunction to add the new sensors. - Since each vertex can potentially have two sensors now, move either one to different branches if needed. This can probably be done by generalizing/extending the
assign_injection_sensor_radialfunction to move available phasor voltage sensors to unmeasured branches. - This is enough for the sufficient observability condition, as the necessary condition is already implemented, even for phasor voltage sensors.
Note: Everything can be implemented directly inside observability.hpp