Skip to content

[BUG] inconsistent sensor output behavior on disconnected branches vs appliances #1464

Description

@mgovers

Describe the bug

When running state estimation with a disabled power/current sensor on a disabled branch, the output is empty (energized = 0, p_residual = 0, q_residual = 0).

However, when running state estimation with a disabled power/current sensor on a disabled shunt or load/gen, the output is not empty (energized = 1, p_residual = 6924.0000000000009, q_residual = -69280).

This behavior is unexpected

Input Data Validity

  • I checked the validity of input data using the helper function (examples here).

Data Dump

Input data

{
  "version": "1.0",
  "type": "input",
  "is_batch": false,
  "attributes": {},
  "data": {
    "node": [
      {
        "id": 1,
        "u_rated": 10e3
      }
    ],
    "line": [
      {
        "id": 5,
        "from_node": 1,
        "to_node": 1,
        "from_status": 0,
        "to_status": 0,
        "r1": 1000000.0,
        "x1": 1000000.0,
        "c1": 2.0e-5,
        "tan1": 0.1,
        "r0": 1000000.0,
        "x0": 1000000.0,
        "c0": 1.0e-6,
        "tan0": 0.2
      }
    ],
    "shunt": [
      {
        "id": 7,
        "node": 1,
        "status": 0,
        "g1": 6.283185307179587e-4,
        "b1": 6.283185307179587e-3,
        "g0": 6.283185307179587e-5,
        "b0": 3.141592653589793e-4
      }
    ],
    "source": [
      {
        "id": 10,
        "node": 1,
        "status": 1,
        "u_ref": 1.05,
        "sk": 1e12
      }
    ],
    "sym_voltage_sensor": [
      {
        "id": 13,
        "measured_object": 1,
        "u_measured": 6062.1931942119563,
        "u_sigma": 0.1,
        "u_angle_measured": -1.4832085023115637e-06,
        "u_angle_sigma": 0.1
      }
    ],
    "asym_power_sensor": [
      {
        "id": 16,
        "measured_object": 5,
        "measured_terminal_type": 0,
        "power_sigma": 5.0,
        "p_measured": [1154.0, 1153.0, 1155.0],
        "q_measured": [-11540.0, -11550.0, -11550.0]
      },
      {
        "id": 17,
        "measured_object": 7,
        "measured_terminal_type": 3,
        "power_sigma": 10.0,
        "p_measured": [2308.0, 2306.0, 2310.0],
        "q_measured": [-23080.0, -23100.0, -23100.0]
      }
    ]
  }
}

Update data

{
  "version": "1.0",
  "type": "update",
  "is_batch": true,
  "attributes": {},
  "data": [
      {
          "line": [
              {
                  "id": 5,
                  "from_status": 0,
                  "to_status": 0
              }
          ],
          "shunt": [
              {
                  "id": 7,
                  "status": 1
              }
          ],
          "asym_power_sensor": [
              {
                  "id": 16,
                  "power_sigma": "inf"
              }
          ]
      },
      {
          "line": [
              {
                  "id": 5,
                  "from_status": 1,
                  "to_status": 1
              }
          ],
          "shunt": [
              {
                  "id": 7,
                  "status": 0
              }
          ],
          "asym_power_sensor": [
              {
                  "id": 17,
                  "power_sigma": "inf"
              }
          ]
      }
  ]
}

To reproduce

Run symmetric state estimation with newton_raphson

Symmetric output data (current)

{
  "version": "1.0",
  "type": "sym_output",
  "is_batch": true,
  "attributes": {},
  "data": [
    {
      "asym_power_sensor": [
        {"id": 16, "energized": 0, "p_residual": 0, "q_residual": 0},
        {"id": 17, "energized": 1, "p_residual": -14400.013604963937, "q_residual": 143960.13604963932}
      ]
    },
    {
      "asym_power_sensor": [
        {"id": 16, "energized": 1, "p_residual": -7200.0068024819693, "q_residual": 71980.068024819673},
        {"id": 17, "energized": 1, "p_residual": 6924.0000000000009, "q_residual": -69280}
      ]
    }
  ]
}

To Reproduce

Run state estimation with e.g. newton_raphson calculation method and symmetric = True

Expected behavior

The sensor output on the disabled shunt is empty

Symmetric output data (expected)

{
  "version": "1.0",
  "type": "sym_output",
  "is_batch": true,
  "attributes": {},
  "data": [
    {
      "asym_power_sensor": [
        {"id": 16, "energized": 0, "p_residual": 0, "q_residual": 0},
        {"id": 17, "energized": 1, "p_residual": -14400.013604963937, "q_residual": 143960.13604963932}
      ]
    },
    {
      "asym_power_sensor": [
        {"id": 16, "energized": 1, "p_residual": -7200.0068024819693, "q_residual": 71980.068024819673},
        {"id": 17, "energized": 0, "p_residual": 0, "q_residual": 0}
      ]
    }
  ]
}

Screenshots

No response

Additional context

This will need to be fixed in the output.hpp.

The underlying reason is that, topologically, branches are treated differently from appliances for caching reasons:

  • disabling branches (and source appliances) changes the topology and therefore, the entire topology needs to be rebuilt
  • disabling appliances (except sources) does not change the topology - only the Ybus parameters (shunts) or even only the actual values (loads). The topology is therefore cached. In particular, appliances will always be added to the topology and the actual output for those components is created based on the internal status - not the topological configuration.

However, the current sensor output only looks at the topological status of the measured object. This results in different behavior depending on whether the topological status is updated or not when the measured object status changes.

Instead of checking the measured object topology, the measured object status should be used to determine whether the sensor should get null_output.

Community Meeting

  • I wish to discuss this bug in the bi-monthly PGM community meeting. Please join the PGM community meeting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueIndicates a good issue for first-time contributors

    Type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions