
Учебники / 0841558_16EA1_federico_milano_power_system_modelling_and_scripting
.pdfChapter 12
OPF Devices
The object of this chapter are the models that define the objective function and inequality constraints for the optimal power flow analysis discussed in Chapter 6. Sections 12.1 describes typical network security constraints. Section 12.2 describes technical limits and o ering functions of generators. Finally Section 12.3 describes technical limits and bidding functions of loads.
12.1Network Constraints
This section briefly outlines typical network technical limits, namely the bus voltage limits (Subsection 12.1.1) and transmission line flow limits (Subsection 12.1.2).
12.1.1 Bus Voltage Limits
Bus voltage limits are:
vmin ≤ vh ≤ vmax |
(12.1) |
These limits are generally required for all buses, hence also for pure transit nodes (see Table 10.1). However, generator and load devices can impose more restrictive limits.
12.1.2Transmission Line limits
Branch flow constraints are:
φhk |
≤ |
φhkmax |
(12.2) |
φkh |
≤ |
φhkmax |
|
where φij and φji are current, active power or apparent power flows (see Tables 11.1, 11.2 and 11.5). Transformer tap ratios and phase shifts can also be subjected to inequalities constraints:
F. Milano: Power System Modelling and Scripting, Power Systems, pp. 291–304. springerlink.com c Springer-Verlag Berlin Heidelberg 2010

292 |
12 OPF Devices |
mmin ≤ m ≤ mmax |
(12.3) |
φmin ≤ φ ≤ φmax |
|
Finally, as discussed in Subsection 11.1.2 of Chapter 11, tie line constraints can be included in an OPF problem as inequalities:
pmin ≤ ph ≤ pmax |
(12.4) |
12.2Generator Constraints
This section describes most relevant generator constraints an technical limits. Subsection 12.2.1 defines the static synchronous generator capability curve. Subsection 12.2.2 to 12.2.5 describe generator supply o ers, the reactive power payment function, and reserve and ramp limits.
12.2.1Capability Curve
Generator technical limits form the so-called capability curve and are of particular relevance in OPF analysis. Active power limits are simply:
pGmin ≤ ph ≤ pGmax |
(12.5) |
where pmaxG are associated with the generator capacity whereas pminG are associated with the minimum technical power output. For thermal plants, pminG cannot be zero because the plant requires power for feeding internal compressors and pumps. Hydro plants can show pminG = 0.
Analogously to (12.5), reactive power limits can be approximated as:
qGmin ≤ qh ≤ qGmax |
(12.6) |
where both qGmin and qGmax are constant and approximate minimum and maximum field current limits. Constraints (12.5) and (12.6) define the simplest and most commonly used generator capability curve, as shown in Figure 12.1.a.
A more precise curve can be defined considering the physical cause behind reactive power limits. These are thermal constraints, namely (i) stator current limit, (ii) rotor current limit, and (iii) under-excitation limit.
The stator thermal limit or stator current limit can be written as:
| ¯ | 2 2 ≤ max
v¯hih = ph + qh sG (12.7)
where smaxG is the nominal generator power in pu. The rotor thermal limit is as follows:
ph |
+ |
|
v2 |
|
2 |
|
vhifmax |
|
2 |
qh + xd |
≤ |
xd |
(12.8) |
||||||
2 |
|
|
h |
|
|
|
|
|
|

12.2 Generator Constraints |
293 |
where |
|
1.7 pu ≤ ifmax ≤ 1.79 pu |
(12.9) |
for salient-pole alternators and |
|
2.6 pu ≤ ifmax ≤ 2.73 pu |
(12.10) |
for turbo-generators. Finally, the under-excitation limit is also a thermal limit. Due to the low field current if , the leakage flux re-closes in the end of stator windings. This flux creates eddy currents that overheat the end of stator windings. The under-excitation limit can be approximated as a straight line:
qh ≤ −q0(vh) + βpGmax |
(12.11) |
where typical values of the parameters β and q0 are β (0.1, 0.2) pu/pu, and q0 depends on the bus voltage set point and can be approximated with q0 ≈ 0.4 pu. Figure 12.1.b illustrates the detailed generator capability curve while Table 12.1 defines the parameters required for defining generator limits.
qh |
|
|
qh |
|
|
|
qGmax |
Rotor thermal |
|
|
|
|
|
limit |
|
|
|
|
|
v¯hifmax |
|
sGmax |
Stator thermal |
|
|
xd |
|
|
limit |
|
|
|
|
|
|
|
ph |
|
|
|
ph |
|
|
|
−q0 |
|
Under-excitation |
|
qGmin |
|
|
limit |
|
pGmin |
pGmax |
|
pGmin |
pGmax |
|
|
|
|
vh2 |
|
|
|
(a) |
|
−xd |
(b) |
|
|
|
|
|
Fig. 12.1 Capability curve: (a) simplified model; (b) detailed model
12.2.2Supply O er
Apart from the technical limits discussed in the previous section, electricity markets require the definition of economical data. These are expressed in form of o ers, as depicted in Table 12.2. Generator costs have the same mathematical form as price o ers. However, in restructured power systems, generator costs are confidential. Since electricity markets are nowadays the common trend, this section refers to o ers rather than to costs. O ers can

294 |
|
|
12 OPF Devices |
|
|
Table 12.1 Capability curve parameters |
|||
|
|
|
|
|
|
Variable |
Description |
Unit |
|
|
ifmax |
Maximum field current |
pu |
|
|
pGmax |
Generator capacity |
pu |
|
|
pGmin |
Technical minimum |
pu |
|
|
q0 |
Under-excitation limit o -set |
pu |
|
|
qGmax |
Maximum reactive power |
pu |
|
|
qGmin |
Minimum reactive power |
pu |
|
|
xd |
Synchronous reactance |
pu |
|
|
β |
Slope of the under-excitation limit |
pu/pu |
|
|
|
|
|
|
Table 12.2 Supply o er parameters
Variable |
Description |
Unit |
CS0 |
Fixed o er price |
e/h |
CS1 |
Proportional o er price |
e/MWh |
CS2 |
Quadratic o er price |
e/MW2h |
kTB |
Tie breaking cost |
e/MW2h |
pSmax |
Maximum power o er |
pu |
pSmin |
Minimum power o er |
pu |
be associated with active power are generally modelled using a polynomial model:1
cS (pS ) = cS0 + cS1pS + cS2pS2 |
(12.12) |
Another kind of supply data are tie breaking costs kTB. The tie breaking involves a penalty cost kTB prorated by the amount scheduled over the maximum amount that could be scheduled for the generator by means of a quadratic function added to the objective function:
p2
cTB = kTB S (12.13)
(pmaxS )2
If the generator does not supply power, this cost is zero, whereas if pS is close to the maximum power the tie breaking cost increases quadratically and penalizes the generator. Thus two otherwise tied energy o ers will be
1The di erence in the notation of upper case prices CS in Table 12.2 and lower case price cS in (12.12) is due to quantity units. CS is used for absolute values, while cS for pu ones. The relation is as follows:
cS0 = CS0/Sn
cS1 = CS1
cS2 = CS2Sn
where Sn is the device nominal base.

12.2 Generator Constraints |
295 |
scheduled to the point where their modified costs are identical, e ectively achieving a prorated result. Generally, the value of kTB is small (e.g., 0.0005).
Supply o er blocks are:
pSmin ≤ pS ≤ pSmax |
(12.14) |
Several o er blocks can be defined for each generator (piece-wise bids). The constraints that have to be satisfied are:
|
(12.15) |
pS,j ≤ pGmax |
jS
pminS,j ≥ pminG
jS
where S is the set of supply blocks of the generator. A more precise supply o er block includes a unit commitment binary variable uC :
uC pSmin ≤ pS ≤ uC pSmax |
(12.16) |
The unit commitment discrete variable uC allows putting o -line generators whose technical minimum pminS = 0. However, including discrete variables in the OPF leads to a MINLP problem whose optimum can be hardly found (see also the discussion provided in Example 1.1 of Chapter 1). Thus, nonlinear OPF problems are generally formulated without unit commitment variables.
Script 12.1 Implementation of Supply O ers
This example provides a possible implementation of the methods for computing the objective function, g(z), h(z) as well as Jacobian and Hessian matrices associated with the supply o er constraints. These methods are called by the IPM-OPF method described in Script 6.1 of Chapter 6.
from cvxopt.base import spmatrix, sparse, matrix, mul, div from cvxopt.blas import dotu
def gcall opf(self, dae):
zeros = [0]*self.n
dae.h += spmatrix(self.pmin - dae.z[self.p], \ self.pn, zeros, (dae.nh, 1), ’d’)
dae.h += spmatrix(dae.z[self.p] - self.pmax, \ self.px, zeros, (dae.nh, 1), ’d’)
dae.g -= spmatrix(dae.z[self.p], self.a, zeros, \
(dae.ng, 1), ’d’)
def gycall opf(self, dae):
dae.Hz -= spmatrix(1.0, self.pn, self.p, \
(dae.nh, dae.nz), ’d’)

296 |
12 OPF Devices |
dae.Hz += spmatrix(1.0, self.px, self.p, \
(dae.nh, dae.nz), ’d’)
dae.Gz -= spmatrix(1.0, self.a, self.p, \
(dae.ng, dae.nz), ’d’) dae.Oz[self.p] = self.cp1 + 2*mul(self.cp2 + \
self.tie, dae.z[self.p])
dae.Hes += spmatrix(2*(self.cp2 + self.tie), \
self.p, self.p, (dae.nz, dae.nz), ’d’)
def call obj(self, dae):
p = dae.z[self.p]
dae.obj += sum(self.cp0) dae.obj += dotu(self.cp1, p)
dae.obj += dotu(self.cp2 + self.tie, p**2)
In the code above, dae.nh is the number of inequality constraints h, dae.ng is the number of equality constraints g, and dae.nz is the number of variables z. Furthermore, self.p are the indexes of variables ph in the vector z, whereas self.px and self.pn are the indexes of dual variables associated with the maximum and minimum limits of ph, respectively.
12.2.3Reactive Power Payment Function
In restructured power systems, generator reactive powers can be subjected to payment. Reactive power payments are generally associated with the loss of opportunity of generating active power. Figure 12.2 shows the payment function proposed in [85, 358]. The production of reactive power can be divided into three regions:
1.Region I: for qGC ≤ qh ≤ 0, the generator is under-excited and produces inductive reactive power.
2.Region II: for 0 ≤ qh ≤ qGA, the generator is over-excited and produces capacitive reactive power without the need of reducing its active power production.
3.Region III: for qGA ≤ qh ≤ qGB, the generator is over-excited and produces capacitive reactive power but has to reduce its active power production to provide the required reactive power. It is assumed that, in this region, the payment increases quadratically with respect to the reactive power.

298 |
|
|
12 OPF Devices |
|
Table 12.3 Generator reactive power payment parameters |
||||
|
|
|
|
|
|
Variable |
Description |
Unit |
|
|
CQ0 |
Availability cost |
e/h |
|
|
CQ1 |
Under-excitation loss cost |
e/MVArh |
|
|
CQ2 |
Over-excitation loss cost |
e/MVArh |
|
|
CQ |
Cost of opportunity loss |
e/MVAr2h |
|
|
3 |
|
|
|
|
Sn |
Power rating |
MVA |
|
|
qGlead |
Minimum mandatory reactive power |
pu |
|
|
qlag |
Maximum mandatory reactive power |
pu |
|
|
G |
|
|
|
12.2.4Generator Power Reserve
The operating reserve of a system is associated with the power that is not directly used by loads but can be requested and generators have to provide quickly. The power reserve has an associated o er:
cR(pR) = cR1pR |
(12.18) |
and limits: |
(12.19) |
pRmin ≤ pR ≤ pRmax |
along with the inequalities that ensure that the sum of the power supply and the power reserve is less than the total available power supply pmaxS and that the total power reserve must be less than the total power demand:
pS + pR ≤ pSmax |
(12.20) |
pR,j ≤ |
pD,i |
jR |
iD |
where D and R are the set of demands and reserves, respectively. Reserve parameters are shown in Table 12.4.
Table 12.4 Generator reserve parameters
Variable |
Description |
Unit |
|
|
|
- |
|
- |
CR1 |
Reserve o er price |
e/MWh |
pRmax |
Maximum power reserve |
pu |
pRmin |
Minimum power reserve |
pu |
Sn |
Power rating |
MVA |

12.2 Generator Constraints |
299 |
12.2.5Generator Power Ramp
Generation facilities have limits on their ability to move from one level of production to another, and these limits are generally taken in account by the so-called ramp constraints. Some typical generator ramp parameters are depicted in Table 12.5.
The parameters used in the multi-period OPF problems are the up and down ramp rates, i.e. rup and rdw. These quantities express the amount of power that can be moved each minute up or down by the generator and are associated to technical limits of the generation plants. Ramp constraints are modelled as follows:
pS (t) − pS (t − Δt) ≤ pSmaxrupΔt, |
t T |
(12.21) |
−pS (t) + pS (t − Δt) ≤ pSmaxrdwΔt, |
t T |
|
where T is set of periods of the multi-period time horizon, Δt is the time interval in which is divided the complete time horizon spanned by the multiperiod OPF.
Along with ramp limits (12.21), one should also define a maximum reserve ramp rate rrmax, that multiplied by the time interval Δt, expresses the maximum amount of power that can be dedicated to the reserve, thus:
pR(t) ≤ rrmaxΔt, t T |
(12.22) |
If the generator output is low, also the operating reserve can decrease, and the operating reserve loading point pRLP allows to reduce the power reserve for low outputs:
pR(t) ≤ pS (t) |
rmaxΔt |
|
(12.23) |
r |
, t T |
||
pRLP |
Thus, the power reserve pR is the minimum value as obtained from (12.22) and (12.23).
Table 12.5 Generator power ramp parameters
Variable |
Description |
Unit |
|
|
|
|
|
|
DT |
Minimum # of period down |
h |
pRLP |
Operating reserve loading point |
pu |
rup |
Ramp rate up |
pu/h |
rdw |
Ramp rate down |
pu/h |
rrmax |
Maximum reserve ramp rate |
pu/h |
U T |
Minimum # of period up |
h |
α0 |
# of periods up for t = 0 |
int |
β0 |
# of periods down for t = 0 |
int |

300 |
12 OPF Devices |
Minimum on-line and o -line time constraints can be formulated as proposed in [66] and in [65]. These are as follows:
Minimum up time:
U T0 |
|
|
|
(1 − uOL(t)) = 0 |
(12.24) |
t=1
t+U T −1
uOL(τ ) ≥ U T uSU(t), t = U T0 + 1, . . . , T − U T + 1
τ =t
T
(uOL(τ ) − uSU(t)) ≥ 0, t = T − U T + 2, . . . , T
τ =t
Minimum down time:
DT0 |
|
|
|
uOL(t) = 0 |
(12.25) |
t=1
t+DT −1
(1 − ui(τ )) ≥ DT uSD(t), t = DT0 + 1, . . . , T − DT + 1
τ =t
T
(1 − uOL(τ ) − uSD(t)) ≥ 0, t = T − DT + 2, . . . , T
τ =t
where uOL(t) is a binary variable that is equal to 1 if the generator is on-line in period t;3 uSU(t) is a binary variable that is equal to 1 if the generator is started up at the beginning of period t; uSD(t) is a binary variable that is equal to 1 if the generator is shut down at the beginning of period t; T is the scheduled time horizon (e.g. 24 hours); and U T0 and DT0 are the number of period units during which the generator must be on-line and o -line at the beginning of the time horizon respectively, as follows:
U T0 |
= min{T, (U T − α0)uOL(0)} |
(12.26) |
DT0 |
= min{T, (DT − β0)(1 − uOL(0))} |
|
where α0 is the number of time periods that the generator has been on-line at the beginning of the market horizon; and β0 is the number of time periods that the generator has been o -line at the beginning of the market horizon. Finally, the start-up and the shut-down status of the units are managed as follows:
3Observe that, if considering minimum up and down constraints, (12.21), (12.22)
and (12.23) have to be modified by multiplying the supply powers pS (t) and pS (t − Δt) by the binary variable uOL(t) and uOL(t − Δt), respectively.