pwrs.core.cpf_target_lam_event_cb#
- pwrs.core.cpf_target_lam_event_cb.cpf_target_lam_event_cb(k, nx, cx, px, done, rollback, evnts, cb_data, cb_args, results=None)[source]#
Handle CPF target-lambda events and step adjustments.
Implements the MATPOWER callback logic for the
TARGET_LAMevent. It marks CPF completion when the target is reached exactly and otherwise adjusts the next predictor step to avoid overshooting the configured lambda target or full-curve stopping point.- 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