pwrs.core.opf#
- pwrs.core.opf.opf(*args, nargout=1)[source]#
Solve an optimal power flow.
This port preserves the MATLAB
opfcalling conventions, supporting case dicts, case names, and the extended argument forms handled byopf_args().- Parameters:
*args – MATPOWER OPF inputs. Supported forms include
opf(mpc),opf(mpc, mpopt), user linear/cost extensions, and the expandedbaseMVA, bus, gen, branch, ...signatures.nargout (int, optional) – Number of outputs to emulate from the MATLAB interface.
- Returns:
With one or two outputs, returns the structured solved result and optional success flag. With more outputs, returns
(bus, gen, branch, f, success, info, et, g, jac, xr, pimul)withgandjaccurrently left asNone.- Return type:
OptimalPowerFlowResult or tuple
- pwrs.core.opf.opf_with_success(*args)[source]#
Solve an OPF and return
(results, success).- Parameters:
args (Any)
- Return type:
tuple[OptimalPowerFlowResult, bool]