7.1 Direct Specification

This section describes the additional fields that can be added to mpc (the Matpower case struct) or, alternatively, the input parameters that can be passed directly to the opf function. The former is the preferred approach, as it allows the normal use of runopf and related functions.

7.1.1 User-defined Variables

In the case of direct specification, additional variables are created implicitly based on the difference between the number of columns in A  and the number nx  of standard OPF variables. If A  has more columns than x  has elements, the extra columns are assumed to correspond to a new z  variable. The initial value and lower and upper bounds for z  can also be specified in the optional fields or arguments, z0, zl and zu, respectively.

7.1.2 User-defined Constraints

7.1.3 User-defined Costs

7.1.4 Additional Comments

For a simple formulation extension to be used for a small number of OPF cases, this method has the advantage of being direct and straightforward. While Matpower does include code to eliminate the columns of A  and N  corresponding to Vm  and Qg  when running a DC OPF48 , as well as code to reorder and eliminate columns appropriately when converting from external to internal data formats, this mechanism still requires the user to take special care in preparing the A  and N  matrices to ensure that the columns match the ordering of the elements of the optimization vectors x  and z  . All extra constraints and variables must be incorporated into a single set of parameters that are constructed before calling the OPF. The bookkeeping needed to access the resulting variables and shadow prices on constraints and variable bounds must be handled manually by the user outside of the OPF, along with any processing of additional input data and processing, printing or saving of the additional result data. Making further modifications to a formulation that already includes user-supplied costs, constraints or variables, requires that both sets be incorporated into a new single consistent set of parameters.