opf_args

opf_args(baseMVA, bus, gen, branch, areas, gencost, Au, lbu, ubu, mpopt, N, fparm, H, Cw, z0, zl, zu)

opf_args() - Parses and initializes OPF input arguments.

[MPC, MPOPT] = OPF_ARGS( ... )
[BASEMVA, BUS, GEN, BRANCH, GENCOST, A, L, U, MPOPT, ...
    N, FPARM, H, CW, Z0, ZL, ZU, USERFCN] = OPF_ARGS( ... )
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.

Examples:
    Output argument options:

    [mpc, mpopt] = opf_args( ... )
    [baseMVA, bus, gen, branch, gencost, A, l, u, mpopt, ...
        N, fparm, H, Cw, z0, zl, zu, userfcn] = opf_args( ... )

    Input arguments options:

    opf_args(mpc)
    opf_args(mpc, mpopt)
    opf_args(mpc, userfcn, mpopt)
    opf_args(mpc, A, l, u)
    opf_args(mpc, A, l, u, mpopt)
    opf_args(mpc, A, l, u, mpopt, N, fparm, H, Cw)
    opf_args(mpc, A, l, u, mpopt, N, fparm, H, Cw, z0, zl, zu)

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

The data for the problem can be specified in one of three ways:
(1) a string (mpc) containing the file name of a MATPOWER 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 struct (mpc) 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 struct,
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 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 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 mpopt vector specifies MATPOWER options. See MPOPTION
for details and default values.