pwrs.core.cpf_plim_event_cb#

pwrs.core.cpf_plim_event_cb.cpf_plim_event_cb(k, nx, cx, px, done, rollback, evnts, cb_data, cb_args, results=None)[source]#

Handle CPF active-power limit events.

Implements MATPOWER’s callback logic for PLIM events by fixing generators at Pmax, updating the base and target cases, optionally switching the reference bus, and forcing a zero-length continuation step restart when needed.

Parameters:
  • k (int) – Current continuation step index.

  • nx (dict) – Next-step CPF state struct.

  • cx (dict) – Current-step CPF state struct.

  • px (dict) – Previous-step CPF state struct.

  • done (dict) – CPF completion flag/message struct.

  • rollback (bool) – Whether the current step is being rolled back.

  • evnts (dict or list of dict) – Detected CPF events for the current step.

  • cb_data (dict) – CPF callback data struct.

  • cb_args (dict) – Callback arguments struct.

  • results (dict, optional) – CPF results accumulator.

Returns:

Updated (nx, cx, done, rollback, evnts, cb_data, results).

Return type:

tuple