pwrs.core.opf_args#
- pwrs.core.opf_args.opf_args(baseMVA, bus=None, gen=None, branch=None, areas=None, gencost=None, Au=None, lbu=None, ubu=None, mpopt=None, N=None, fparm=None, H=None, Cw=None, z0=None, zl=None, zu=None, nargout=1)[source]#
Parse and initialize OPF input arguments.
This function preserves the MATLAB
opf_argscalling conventions and fills in defaults for omitted arguments.- Parameters:
baseMVA – OPF inputs accepted by MATPOWER. The problem data may be supplied as a case name, a case dict, or as the individual matrices/vectors. Optional user constraint, cost, initializer, and bound data may also be supplied directly or through fields in the case dict.
bus – OPF inputs accepted by MATPOWER. The problem data may be supplied as a case name, a case dict, or as the individual matrices/vectors. Optional user constraint, cost, initializer, and bound data may also be supplied directly or through fields in the case dict.
gen – OPF inputs accepted by MATPOWER. The problem data may be supplied as a case name, a case dict, or as the individual matrices/vectors. Optional user constraint, cost, initializer, and bound data may also be supplied directly or through fields in the case dict.
branch – OPF inputs accepted by MATPOWER. The problem data may be supplied as a case name, a case dict, or as the individual matrices/vectors. Optional user constraint, cost, initializer, and bound data may also be supplied directly or through fields in the case dict.
areas – OPF inputs accepted by MATPOWER. The problem data may be supplied as a case name, a case dict, or as the individual matrices/vectors. Optional user constraint, cost, initializer, and bound data may also be supplied directly or through fields in the case dict.
gencost – OPF inputs accepted by MATPOWER. The problem data may be supplied as a case name, a case dict, or as the individual matrices/vectors. Optional user constraint, cost, initializer, and bound data may also be supplied directly or through fields in the case dict.
Au – OPF inputs accepted by MATPOWER. The problem data may be supplied as a case name, a case dict, or as the individual matrices/vectors. Optional user constraint, cost, initializer, and bound data may also be supplied directly or through fields in the case dict.
lbu – OPF inputs accepted by MATPOWER. The problem data may be supplied as a case name, a case dict, or as the individual matrices/vectors. Optional user constraint, cost, initializer, and bound data may also be supplied directly or through fields in the case dict.
ubu – OPF inputs accepted by MATPOWER. The problem data may be supplied as a case name, a case dict, or as the individual matrices/vectors. Optional user constraint, cost, initializer, and bound data may also be supplied directly or through fields in the case dict.
mpopt – OPF inputs accepted by MATPOWER. The problem data may be supplied as a case name, a case dict, or as the individual matrices/vectors. Optional user constraint, cost, initializer, and bound data may also be supplied directly or through fields in the case dict.
N – OPF inputs accepted by MATPOWER. The problem data may be supplied as a case name, a case dict, or as the individual matrices/vectors. Optional user constraint, cost, initializer, and bound data may also be supplied directly or through fields in the case dict.
fparm – OPF inputs accepted by MATPOWER. The problem data may be supplied as a case name, a case dict, or as the individual matrices/vectors. Optional user constraint, cost, initializer, and bound data may also be supplied directly or through fields in the case dict.
H – OPF inputs accepted by MATPOWER. The problem data may be supplied as a case name, a case dict, or as the individual matrices/vectors. Optional user constraint, cost, initializer, and bound data may also be supplied directly or through fields in the case dict.
Cw – OPF inputs accepted by MATPOWER. The problem data may be supplied as a case name, a case dict, or as the individual matrices/vectors. Optional user constraint, cost, initializer, and bound data may also be supplied directly or through fields in the case dict.
z0 – OPF inputs accepted by MATPOWER. The problem data may be supplied as a case name, a case dict, or as the individual matrices/vectors. Optional user constraint, cost, initializer, and bound data may also be supplied directly or through fields in the case dict.
zl – OPF inputs accepted by MATPOWER. The problem data may be supplied as a case name, a case dict, or as the individual matrices/vectors. Optional user constraint, cost, initializer, and bound data may also be supplied directly or through fields in the case dict.
zu – OPF inputs accepted by MATPOWER. The problem data may be supplied as a case name, a case dict, or as the individual matrices/vectors. Optional user constraint, cost, initializer, and bound data may also be supplied directly or through fields in the case dict.
nargout (int, optional) – Number of outputs to emulate from the MATLAB interface.
- Returns:
With
nargout == 2, returns(mpc, mpopt). Otherwise returns the fully expanded OPF argument tuple in MATLAB order.- Return type:
tuple
- pwrs.core.opf_args.opf_args_case(*args)[source]#
Normalize OPF inputs to
(mpc, mpopt).- Parameters:
args (object)
- Return type:
tuple[CaseData | MatpowerCase, MatpowerConfig]