#### 6.4 Standard Extensions

In addition to making this extensible OPF structure available to end users, Matpower also takes advantage of it internally to implement several additional capabilities.

##### 6.4.1 Piecewise Linear Costs

The standard OPF formulation in (6.1)–(6.4) does not directly handle the non-smooth piecewise linear cost functions that typically arise from discrete bids and oﬀers in electricity markets. When such cost functions are convex, however, they can be modeled using a constrained cost variable (CCV) method. The piecewise linear cost function is replaced by a helper variable and a set of linear constraints that form a convex “basin” requiring the cost variable to lie in the epigraph of the function .

Figure 6-3 illustrates a convex -segment piecewise linear cost function (6.52)

deﬁned by a sequence of points , , where denotes the slope of the -th segment (6.53)

and and .

The “basin” corresponding to this cost function is formed by the following constraints on the helper cost variable : (6.54)

The cost term added to the objective function in place of is simply the variable .

Matpower uses this CCV approach internally to automatically generate the appropriate helper variable, cost term and corresponding set of constraints for any piecewise linear costs on real or reactive generation. All of Matpower’s OPF solvers, for both AC and DC OPF problems, use the CCV approach with the exception of two that are part of the optional TSPOPF package , namely the step-controlled primal/dual interior point method (SCPDIPM) and the trust region based augmented Lagrangian method (TRALM), both of which use a cost smoothing technique instead .

Note that Matpower (in opf_setup) automatically converts any single-segment piecewise linear costs into polynomial (linear) form to avoid unnecessarily creating extra variables and constraints. It is this modiﬁed cost, rather than the original piecewise linear equivalent, that is returned in the gencost ﬁeld of the results struct.

##### 6.4.2 Dispatchable Loads

A simple approach to dispatchable or price-sensitive loads is to model them as negative real power injections with associated negative costs. This is done by specifying a generator with a negative output, ranging from a minimum injection equal to the negative of the largest possible load to a maximum injection of zero.

Consider the example of a price-sensitive load whose marginal beneﬁt function is shown in Figure 6-4. The demand of this load will be zero for prices above , for prices between and , and for prices below .

This corresponds to a negative generator with the piecewise linear cost curve shown in Figure 6-5. Note that this approach assumes that the demand blocks can be partially dispatched or “split”. Requiring blocks to be accepted or rejected in their entirety would pose a mixed-integer problem that is beyond the scope of the current Matpower implementation.

It should be noted that, with this deﬁnition of dispatchable loads as negative generators, if the negative cost corresponds to a beneﬁt for consumption, minimizing the cost of generation is equivalent to maximizing social welfare.

With an AC network model, there is also the question of reactive dispatch for such loads. Typically the reactive injection for a generator is allowed to take on any value within its deﬁned limits. Since this is not normal load behavior, the model used in Matpower assumes that dispatchable loads maintain a constant power factor. When formulating the AC OPF problem, Matpower will automatically generate an additional equality constraint to enforce a constant power factor for any “negative generator” being used to model a dispatchable load.

The power factor, which can be lagging or leading, is determined by the ratio of reactive to active power for the load and is speciﬁed by the active and reactive limits deﬁning the nominal load in the gen matrix. For all dispatchable loads, the value in the PMIN column is negative and deﬁnes the nominal active power of the load. And PMAX is zero, allowing the load to be fully curtailed depending on the price. The reactive limits, QMIN and QMAX, depend on whether the power ﬂow is lagging or leading. One deﬁnes the nominal reactive load and the other must be zero to allow the load to be fully curtailed. The values of PG and QG must be deﬁned to be consistent with the nominal power factor.

• Lagging Power Factor – The reactive injection is negative, meaning that reactive power is consumed by the load. Hence, QMIN is negative, QMAX is zero, and PG and QG must be set so that QG is equal to PG * QMIN/PMIN.
• Leading Power Factor – The reactive injection is positive, that is, reactive power is produced by the load. Hence, QMAX is positive, QMIN is zero, and PG and QG must be set so that QG is equal to PG * QMAX/PMIN.
##### 6.4.3 Generator Capability Curves

The typical AC OPF formulation includes box constraints on a generator’s real and reactive injections, speciﬁed as simple lower and upper bounds on ( and ) and ( and ). On the other hand, the true - capability curves of physical generators usually involve some tradeoﬀ between real and reactive capability, so that it is not possible to produce the maximum real output and the maximum (or minimum) reactive output simultaneously. To approximate this tradeoﬀ, Matpower includes the ability to add an upper and lower sloped portion to the standard box constraints as illustrated in Figure 6-6, where the shaded portion represents the feasible operating region for the unit.

The two sloped portions are constructed from the lines passing through the two pairs of points deﬁned by the six parameters , , , , , and . If these six parameters are speciﬁed for a given generator in columns PC1QC2MAX (11–16), Matpower automatically constructs the corresponding additional linear inequality constraints on and for that unit.
If one of the sloped portions of the capability constraints is binding for generator , the corresponding shadow price is decomposed into the corresponding and or components and added to the respective column (MU_PMAX, MU_QMIN or MU_QMAX) in the row of gen.
The diﬀerence between the bus voltage angle at the from end of a branch and the angle at the to end can be bounded above and below to act as a proxy for a transient stability limit, for example. If these limits are provided in columns ANGMIN (12) and ANGMAX (13) of the branch matrix, Matpower creates the corresponding constraints on the voltage angle variables.39