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 offers 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 c(x )  is replaced by a helper variable y  and a set of linear constraints that form a convex “basin” requiring the cost variable y  to lie in the epigraph of the function c(x)  .

Figure 6-3:Constrained Cost Variable

Figure 6-3 illustrates a convex n  -segment piecewise linear cost function

       (
       |  m  (x − x ) + c ,    x ≤  x
       ||{    1      1     1           1
c(x) =    m2 (x − x2) + c2,  x1 < x ≤ x2
       ||          ...               ...
       |(  m  (x − x ) + c ,   x    <  x
            n      n     n     n− 1
(6.52)

defined by a sequence of points (xj,cj)  , j = 0...n  , where mj  denotes the slope of the j  -th segment

      cj − cj−1
mj =  ---------,  j = 1 ...n
      xj − xj−1
(6.53)

and x <  x  < ⋅⋅⋅ < x
 0    1          n  and m  ≤  m  ≤ ⋅⋅⋅ < m
  1    2           n  .

The “basin” corresponding to this cost function is formed by the following n  constraints on the helper cost variable y  :

y ≥ mj (x − xj) + cj,  j = 1...n.
(6.54)

The cost term added to the objective function in place of c(x)  is simply the variable y  .

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 [28], 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 [8].

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 modified cost, rather than the original piecewise linear equivalent, that is returned in the gencost field 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 benefit function is shown in Figure 6-4. The demand pd  of this load will be zero for prices above λ1   , p1   for prices between λ1   and λ2   , and p1 + p2   for prices below λ2   .

Figure 6-4:Marginal Benefit or Bid Function

Figure 6-5:Total Cost Function for Negative Injection

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 definition of dispatchable loads as negative generators, if the negative cost corresponds to a benefit for consumption, minimizing the cost f(x)  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 defined 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 specified by the active and reactive limits defining the nominal load in the gen matrix. For all dispatchable loads, the value in the PMIN column is negative and defines 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 flow is lagging or leading. One defines 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 defined to be consistent with the nominal power factor.

6.4.3 Generator Capability Curves

The typical AC OPF formulation includes box constraints on a generator’s real and reactive injections, specified as simple lower and upper bounds on p  (pmin   and pmax   ) and q  (qmin   and qmax   ). On the other hand, the true P  -Q  capability curves of physical generators usually involve some tradeoff 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 tradeoff, 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.

Figure 6-6:Generator P  -Q  Capability Curve

The two sloped portions are constructed from the lines passing through the two pairs of points defined by the six parameters p1   , qmin
 1   , qmax
 1   , p2   , qmin
 2   , and qmax
 2   . If these six parameters are specified for a given generator in columns PC1QC2MAX (11–16), Matpower automatically constructs the corresponding additional linear inequality constraints on p  and q  for that unit.

If one of the sloped portions of the capability constraints is binding for generator k  , the corresponding shadow price is decomposed into the corresponding μ
 Pmax   and μ
 Qmin   or μQmax   components and added to the respective column (MU_PMAX, MU_QMIN or MU_QMAX) in the  th
k   row of gen.

6.4.4 Branch Angle Difference Limits

The difference between the bus voltage angle 𝜃f  at the from end of a branch and the angle 𝜃t  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