pwrs.core.opf_execute#

pwrs.core.opf_execute.opf_execute(om, mpopt, nargout=1)[source]#

Execute the OPF described by an OPF model object.

Parameters:
  • om (OPFModel) – OPF model object produced by opf_setup().

  • mpopt (dict) – MATPOWER options dict controlling AC/DC model selection, solver choice, and formulation details.

  • nargout (int, optional) – Number of outputs to emulate from the MATLAB interface.

Returns:

Returns internal-order results, success flag, and raw solver output. The results are kept in internal indexing with in-service equipment only, matching MATLAB opf_execute.

Return type:

dict or tuple

pwrs.core.opf_execute.opf_execute_full(om, mpopt)[source]#

Return OPF execution results, success flag and raw data.

Parameters:

mpopt (MatpowerConfig)

Return type:

tuple[dict[str, Any], float, dict[str, Any]]