Package pypower :: Module opf_args
[hide private]
[frames] | no frames]

Module opf_args

source code

Parses and initializes OPF input arguments.

Functions [hide private]
 
opf_args(*args)
Parses and initializes OPF input arguments.
source code
 
opf_args2(*args)
Parses and initializes OPF input arguments.
source code
Variables [hide private]
  __package__ = 'pypower'
Function Details [hide private]

opf_args(*args)

source code 

Parses and initializes OPF input arguments.

Returns the full set of initialized OPF input arguments, filling in default values for missing arguments. See Examples below for the possible calling syntax options.

Input arguments options:

   opf_args(ppc)
   opf_args(ppc, ppopt)
   opf_args(ppc, userfcn, ppopt)
   opf_args(ppc, A, l, u)
   opf_args(ppc, A, l, u, ppopt)
   opf_args(ppc, A, l, u, ppopt, N, fparm, H, Cw)
   opf_args(ppc, A, l, u, ppopt, N, fparm, H, Cw, z0, zl, zu)

   opf_args(baseMVA, bus, gen, branch, areas, gencost)
   opf_args(baseMVA, bus, gen, branch, areas, gencost, ppopt)
   opf_args(baseMVA, bus, gen, branch, areas, gencost, userfcn, ppopt)
   opf_args(baseMVA, bus, gen, branch, areas, gencost, A, l, u)
   opf_args(baseMVA, bus, gen, branch, areas, gencost, A, l, u, ppopt)
   opf_args(baseMVA, bus, gen, branch, areas, gencost, A, l, u, ...
                               ppopt, N, fparm, H, Cw)
   opf_args(baseMVA, bus, gen, branch, areas, gencost, A, l, u, ...
                               ppopt, N, fparm, H, Cw, z0, zl, zu)

The data for the problem can be specified in one of three ways:

  1. a string (ppc) containing the file name of a PYPOWER case which defines the data matrices baseMVA, bus, gen, branch, and gencost (areas is not used at all, it is only included for backward compatibility of the API).
  2. a dict (ppc) containing the data matrices as fields.
  3. the individual data matrices themselves.

The optional user parameters for user constraints (A, l, u), user costs (N, fparm, H, Cw), user variable initializer (z0), and user variable limits (zl, zu) can also be specified as fields in a case dict, either passed in directly or defined in a case file referenced by name.

When specified, A, l, u represent additional linear constraints on the optimization variables, l <= A*[x z] <= u. If the user specifies an A matrix that has more columns than the number of "x" (OPF) variables, then there are extra linearly constrained "z" variables. For an explanation of the formulation used and instructions for forming the A matrix, see the MATPOWER manual.

A generalized cost on all variables can be applied if input arguments N, fparm, H and Cw are specified. First, a linear transformation of the optimization variables is defined by means of r = N * [x z]. Then, to each element of r a function is applied as encoded in the fparm matrix (see Matpower manual). If the resulting vector is named w, then H and Cw define a quadratic cost on w: (1/2)*w'*H*w + Cw * w. H and N should be sparse matrices and H should also be symmetric.

The optional ppopt vector specifies PYPOWER options. See ppoption for details and default values.

Authors:
Ray Zimmerman (PSERC Cornell), Carlos E. Murillo-Sanchez (PSERC Cornell & Universidad Autonoma de Manizales), Richard Lincoln