
Учебники / 0841558_16EA1_federico_milano_power_system_modelling_and_scripting
.pdf
280 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 Transmission Devices |
||||||
|
|
|
|
|
|
|
|
|
|
|
φmax |
|
|
|
|
|
|
|
|
|
|
|
|
|
pref |
− |
|
|
|
|
Kp s + Ki |
|
|
|
|
|
|
|
|
|
|
pk |
|
||||
|
|
|
|
|
|
|
|
PhST & |
|
|
|||||||||||||
|
|
|
|
+ |
|
|
|
s |
|
|
|
|
|
Network |
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
φmin |
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
pmes |
|
|
|
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tms + 1 |
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||
|
|
|
Fig. 11.12 |
Phase shifting transformer control diagram |
|
|
|||||||||||||||||
|
|
Table 11.4 Phase shifting transformer control parameters |
|
|
|||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
Variable |
Description |
|
|
|
|
|
Unit |
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
Ki |
|
Integral gain |
|
|
|
|
|
rad/s/pu |
|
|
|
||||||
|
|
|
|
|
|
Kp |
|
Proportional gain |
rad/pu |
|
|
|
|||||||||||
|
|
|
|
|
|
pref |
|
Reference power |
|
|
|
|
|
pu |
|
|
|
||||||
|
|
|
|
|
|
Tm |
|
Measurement time constant |
s |
|
|
|
|||||||||||
|
|
|
|
|
|
φmax |
|
Maximum phase angle |
rad |
|
|
|
|||||||||||
|
|
|
|
|
|
φmin |
|
Minimum phase angle |
rad |
|
|
|
typically are the impedances of the triangle branches, whose relationships with the resulting star impedances are as follows:
z¯12 = z¯1 + z¯2 |
(11.36) |
z¯13 = z¯1 + z¯3 |
|
z¯23 = z¯2 + z¯3 |
|
Thus, one has: |
|
z¯1 = (¯z12 + z¯13 − z¯23)/2 |
(11.37) |
z¯2 = (¯z12 + z¯23 − z¯13)/2 |
|
z¯3 = (¯z13 + z¯23 − z¯12)/2 |
|
Table 11.5 defines three-winding transformer parameters. Tap ratios and the phase shifts are with respect to each winding. For example m1 is the ratio
V1/Vn,1.
From the implementation viewpoint, three-winding transformer can be converted into a two-winding transformers during the parsing of input data.

11.2 Transformer |
|
|
|
|
|
|
281 |
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
z¯2, Vn,1/Vn,2 |
||||
|
z¯12 |
|
|
2 |
|
|
|
z¯1, Vn,1/Vn,1 |
|
|
|
|
2 |
||||
|
|
|
|
|
|
|
|||||||||||
Vn,1 |
|
|
Vn,2 |
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
z¯23 |
|
|
|
|
|
|
z¯3, Vn,1/Vn,3 |
||||||
|
|
|
|
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
1 |
z¯13 |
|
|
Vn,3 |
1 |
|
m1 φ1 : 1 |
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
3 |
|
|
0 |
|
|
|
|
3 |
|||
|
|
|
|
|
|
|
|
|
|||||||||
|
|
|
Fig. 11.13 Three-winding transformer equivalent circuit |
||||||||||||||
|
|
|
|
Table 11.5 Three-winding transformer parameters |
|||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
||||||
|
|
|
|
Variable |
Description |
|
|
|
|
Unit |
|
||||||
|
|
|
|
|
|
|
|
||||||||||
|
|
|
|
I1max, I2max, I3max |
Winding current limits |
kA |
|
||||||||||
|
|
|
|
m1, m2, m3 |
Fixed tap ratios |
kV/kV |
|
||||||||||
|
|
|
P1max, P2max, P3max |
Winding active power limits |
kA |
|
|||||||||||
|
|
|
|
r12, r23, r13 |
Branch resistances |
pu |
|
||||||||||
|
|
|
S1max, S2max, S3max |
Winding apparent power limits |
kA |
|
|||||||||||
|
|
|
|
x12, x23, x13 |
Branch reactances |
pu |
|
||||||||||
|
|
|
|
Vn,1, Vn,2, Vn,3 |
Winding voltage ratings |
kV |
|
||||||||||
|
|
|
|
φ1, φ2, φ3 |
Fixed phase shifts |
rad |
|
Thus, the three-winding transformer class requires only a method for creating the set of equivalent two-winding transformers.
Example 11.5 Three-Winding Transformer of the IEEE 14-Bus
System
The IEEE 14-bus system contains a three-winding transformer that connects buses 4, 8 and 9. Provided that x47 = 0.20912 pu, x87 = 0.17615 pu and x79 = 0.11001 (see Appendix D), from (11.36) one obtains the original impedances of the three-winding transformer as:
x48 = 0.38527 pu x89 = 0.28616 pu x49 = 0.31913 pu
Finally, the winding at bus 4 has the tap ratio m4 = 0.978 kV/kV.
Bus 7 is a fictitious bus introduced by the transformation of the threewinding transformer into three branches. I guess that the IEEE 14-bus system is not known as the (14 − 1)-bus system just for superstition.
282 |
11 Transmission Devices |
11.3Vectorial Implementation
Equations (11.6) and (11.27) are written as power injections at buses h and k. This is the most versatile form of modelling transmission lines. However, in most power system analysis books and software packages, particular relevance
¯
is devoted to the construction of the admittance matrix Y , which allows rewriting (11.3) in vectorial form:
s¯ |
¯ |
v¯ |
(11.38) |
= vY¯ |
¯
The admittance matrix Y is formed as follows:
1.The diagonal element (h, h) is computed as the sum of all shunt and series admittances of line incident at bus h.
2.The element (h, k) is computed as the sum of series admittances of branches that connect buses h and k changed of sign.
Table 11.6 depicts the full admittance matrix for the IEEE 14-bus system. Using adequate matrix manipulation libraries (e.g., BLAS), the admittance
matrix allows e ciently calculating current and power flow vectors, as well as forming the Jacobian and Hessian matrix of the transmission system. Sample scripts implementing these calculations are provided below. However, the admittance matrix also has important drawbacks, as follows.
1.The information provided by (11.38) is “less” than the information provided by (11.6) and (11.27). In fact, the admittance matrix merges together all parallel lines and shunt devices. In other words, from the knowledge of the admittance matrix, one cannot unequivocally go back to line and transformer parameters.
2.Any change in the system topology (e.g., line outages) as well as in branch parameters requires re-building the whole admittance matrix. Line outages are relatively uncommon events and re-building the admittance matrix can be acceptable. However, regulating transformers that vary continuously or almost continuously the tap ratio and/or the phase shift cannot be e ciently handled through the admittance matrix.
3.As discussed in Subsection 11.1.5, simple coupling devices cannot be included in the admittance matrix. Actually, most series FACTS devices as well as HVDC systems cannot be modelled through the admittance matrix.
The limitations above lead to some issues when it comes to implement a general power system devices model. Moreover, using the admittance matrix model prevents from using the transmission line model as a base class for other devices, such as series devices. Nevertheless, the admittance matrix approach is so widely accepted that it deserves further discussion.

284 |
11 Transmission Devices |
Script 11.1 Sparse Matrix Implementation of the Admittance
Matrix
The following script is an e cient sparse matrix-based implementation for the computation of the admittance matrix. The following code can be used as a method of the class that models both transmission lines and two-winding transformers.
def build y(self):
# process line data and build admittance matrix [Y] u = self.u + 0j
yh0 = mul(u, self.gh0 + self.bh0*1j) yk0 = mul(u, self.gk0 + self.bk0*1j) yhk = div(u, self.rhk + self.xhk*1j)
m = mul(self.m + 0j, exp(self.phi*0.017453292519943295*1j)) m2 = abs(t)**2 + 0j
self.Y = spmatrix(div(yhk + yh0, m2), self.afr, \ self.afr, (self.nb, self.nb), ’z’)
self.Y -= spmatrix(div(yhk, m.H.T), self.afr, \ self.ato, (self.nb, self.nb), ’z’)
self.Y -= spmatrix(div(yhk, m), self.ato, self.afr, \
(self.nb, self.nb), ’z’)
self.Y += spmatrix(yhk + yk0, self.ato, self.ato, \
(self.nb, self.nb), ’z’)
# check for missing connections (0 diagonal elements) for item in range(self.nb):
if abs(self.Y[item, item]) == 0: self.Y[item, item] = 1e-6 + 0j
In the code above, self.nb is the number of network buses, while self.afr and self.ato are lists of indexes of branch sending and receiving-end buses, respectively. All other parameters are vectors whose length is the number of branch elements. The function spmatrix works properly also in case of parallel branches since elements of repeated indexes are summed.
11.3.1Incidence Matrix
Subsection 4.4.8 of Chapter 4 describes the dc power flow model. The resulting dc power flow equations are synthesized in (4.64) which is repeated below for clarity:
p = X−1Cθ + CT X−1φ |
(11.39) |
where C is the incidence matrix of the transmission system. this matrix is built as follows:
11.3 Vectorial Implementation |
285 |
1.If the sending-end of branch h is bus k, set chk = 1.
2.If the receiving-end of branch h is bus k, set chk = −1.
3.Otherwise, set chk = 0.
Table 11.6 depicts the full incidence matrix for the IEEE 14-bus system.
Table 11.7 Incidence matrix of the IEEE 14-bus system
Line |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
|
10 11 12 13 14 |
||||
1 |
1 -1 0 0 0 0 0 0 0 0 0 0 0 0 |
||||||||||||||
2 |
1 0 |
0 |
0 -1 0 0 0 0 0 0 0 0 0 |
||||||||||||
3 |
0 1 -1 0 |
0 0 0 0 0 0 0 0 0 0 |
|||||||||||||
4 |
0 1 |
0 -1 0 |
0 |
0 |
0 |
0 |
|
0 |
0 |
0 |
0 |
0 |
|||
5 |
0 1 |
0 |
0 -1 0 0 0 0 0 0 0 0 0 |
||||||||||||
6 |
0 0 |
1 -1 0 |
0 |
0 |
0 |
0 |
|
0 |
0 |
0 |
0 |
0 |
|||
7 |
0 0 |
0 |
1 -1 0 0 |
0 |
0 |
0 0 0 0 0 |
|||||||||
8 |
0 0 |
0 |
1 |
0 |
0 -1 0 0 |
|
0 |
0 |
0 |
0 |
0 |
||||
9 |
0 0 |
0 |
1 |
0 |
0 |
0 |
0 -1 |
0 |
0 |
0 |
0 |
0 |
|||
10 |
0 0 |
0 |
0 |
1 -1 0 0 0 0 0 |
0 |
0 |
0 |
||||||||
11 |
0 0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
|
0 |
-1 0 |
0 |
0 |
||
12 |
0 0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
|
0 |
0 |
-1 0 |
0 |
||
13 |
0 0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
|
0 |
0 |
0 |
-1 |
0 |
|
14 |
0 0 |
0 |
0 |
0 |
0 |
1 -1 0 |
|
0 |
0 |
0 |
0 |
0 |
|||
15 |
0 0 |
0 |
0 |
0 |
0 |
1 |
0 -1 0 |
0 |
0 |
0 |
0 |
||||
16 |
0 0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
|
-1 |
0 |
0 |
0 |
0 |
|
17 |
0 0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
|
0 |
0 |
0 |
0 |
-1 |
|
18 |
0 0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
1 |
-1 |
0 |
0 |
0 |
|
19 |
0 0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
0 |
0 |
1 |
-1 0 |
||
20 |
0 0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
0 |
0 |
0 |
1 |
-1 |
Script 11.2 Incidence Matrix Implementation
The following script implements the incidence matrix C using the CVXOPT function spmatrix. the variables self.n and self.nb are the number of branches and network buses, respectively. The status vector self.u is used for removing o -line branches from the incidence matrix. For being used in (11.39), the column correspondent to the slack bus should be removed from the resulting matrix self.C.
def incidence(self):
self.C = spmatrix(self.u, range(self.n), self.afr, \
(self.n, self.nb), ’d’) - \ spmatrix(self.u, range(self.n), self.ato, \
(self.n, self.nb), ’d’)
11.3.2Jacobian and Hessian Matrices
The admittance matrix along with e cient routines for manipulating sparse matrices allows a very compact implementation of the Jacobian and Hessian matrices of the transmission system. This compactness allows speeding up power flow, continuation power flow and optimal power flow solvers.
The computation of the Hessian matrix has a further complication due to the size of the Hessian matrix itself. By definition, gyy is a three-dimensional
286 |
11 Transmission Devices |
array, which can be di cult to handle and manipulate. Fortunately, the Hessian matrix always appears in the calculations multiplied by a vector. For example, in the IPM-OPF problem, the Hessian matrix of the transmission system is multiplied by dual variables of power flow equations. The product of the Hessian matrix by a vector is a two-dimensional array that can be handled in a conventional way.
Script 11.3 Transmission System Power Flow Jacobian Matrix
The following scripts implements the Jacobian matrix for equations (11.6) and (11.27). The variables self.a and self.v are the indexes of active and reactive power flow equations, respectively, as well as the indexes of bus voltage angles and magnitudes, respectively. Finally, self.nb indicates the number of network buses.
def jacobian(self, dae):
Vn = exp(dae.y[self.a]*1j)
Vc = mul(dae.y[self.v] + 0j, Vn)
Ic = self.Y*Vc
diagVn = spmatrix(Vn, self.a, self.a, (self.nb, self.nb), ’z’) diagVc = spmatrix(Vc, self.a, self.a, (self.nb, self.nb), ’z’) diagIc = spmatrix(Ic, self.a, self.a, (self.nb, self.nb), ’z’)
dS = self.Y*diagVn dS = diagVc*dS.H.T
dS += diagIc.H.T*diagVn
dR = diagIc
dR -= self.Y*diagVc dR = diagVc.H.T*dR
return sparse([[dR.imag(), dR.real()], \
[dS.real(), dS.imag()]])
Script 11.4 Transmission System Power Flow Hessian Matrix
The following scripts implements the Hessian matrix for equations (11.6) and (11.27). Variables have the same meanings as in the previous Script 11.3. Furthermore, dae.rho indicates the vector of dual variables associated with power flow equations.
def hessian(self, dae):
ang = exp(dae.y[self.a]*1j) vol = dae.y[self.v]
V = matrix(1.0, (1, self.nb), ’d’)
Ma = ang*V
MW = dae.rho[self.a]*V
MM = dae.rho[self.v]*V
11.3 |
Vectorial Implementation |
287 |
S0 |
= mul(Ma, mul(self.Y, Ma.H)) |
|
S1 |
= mul(Ma, mul(self.Y.H.T, |
Ma.H)) |
S2 |
= S0.H.T |
|
A1 |
= S1.real() |
|
B1 |
= S1.imag() |
|
A2 |
= S2.real() |
|
B2 |
= S2.imag() |
|
H22 = mul(MW, A1) + mul(MW.T, A2) + \ mul(MM, B1) + mul(MM.T, B2)
H11 = mul(vol*vol.T, H22)
H11 = H11 - spdiag(V*H11)
H21 = mul(V.T*vol.T, mul(MW, B1) - mul(MW.T, B2) - \ mul(MM, A1) + mul(MM.T, A2))
H21 = H21 - spdiag(V*H21.T)
return sparse([[H11, H21], [H21.T, H22]])
11.3.3Network Connectivity
The network connectivity provides information about the existence of islanded buses or islanded regions of a given network. This information is important for various reasons.
1.For power flow analysis, islanded buses have to be carefully treated to avoid singularities in the Jacobian matrix. Furthermore, each islanded region requires a reference bus.
2.For time domain simulations, islanded regions may lead to inconsistent calculations of the center of inertia or cause loss of synchronism of generators.
The network connectivity can be determined e ciently using the topological data of series devices. Let us define the connectivity matrix T as a binary matrix built as follows:
1.The element thh = 1 if there exists a branch starting or ending at bus h, thh = 0 otherwise.
2.The element thk = 1 if there exists a branch connecting buses h and k, thk = 0 otherwise.
¯
In practice, T has the same non-zero elements as the admittance matrix Y . A straightforward information provided by the connectivity matrix T is that if a diagonal element is thh = 0, then bus h is islanded. Furthermore, each non-zero element thk indicates the first-level connectivity of buses h and k. Another interesting property of T is that o -diagonal elements of T n provide the n-level connectivity of buses. For example, if an o -diagonal element (h, k) of T 2 is not zero, then there is a path that connects buses h and k through a third bus j. The Goderya’s algorithm takes advantage of

288 |
11 Transmission Devices |
the properties of T powers to set up an e cient method that assesses the connectivity of the whole network [108]. In fact, by multiplying iteratively T by itself, one can find two situations:
1. For a given iteration n, T n is full. Thus, the network is fully connected.
2.For a given iteration n, the non-zeros elements of T n are the same of T n−1. Then, the system presents some islands and the non-zeros elements of each row (or column) correspond to the buses that belong to a certain island.
Script 11.5 Network Connectivity
The following script finds islanded buses as well as islanded areas using the Goderya’s algorithm. The variables self.n, self.nb, self.afr and self.ato have the meaning of the previous Script 11.3.
def connectivity(self, bus):
n = self.nb fr = self.afr to = self.ato
os = [0]*self.n
# find islanded buses
diag = list(matrix(spmatrix(1.0, to, os, (n, 1), ’d’) + \ spmatrix(1.0, fr, os, (n, 1), ’d’)))
nib = bus.n islanded buses = diag.count(0) bus.islanded buses = []
for bus in range(n): if diag[bus] == 0:
bus.islanded buses.append(bus)
# find islanded areas
temp = spmatrix(1.0, fr + to + fr + to, \
to + fr + fr + to, (n, n), ’d’) cons = temp[0, :]
nelm = len(cons.J)
conn = spmatrix([], [], [], (1, n), ’d’) bus.island sets = []
idx = islands = 0
while 1: while 1:
cons = cons*temp
new nelm = len(cons.J)
if new nelm == nelm: break nelm = new nelm
bus.island sets.append(list(cons.J)) conn += cons
islands += 1
nconn = len(conn.J)
if nconn >= (n - nib): break for element in conn.J[idx:]:

11.3 Vectorial Implementation |
289 |
idx += 1
if not diag[element]:
# this is an isolated bus
continue
if element > (idx - 1): break
cons = temp[idx, :]
It is worth observing that in the discussion of [108], a reviewer argues that a minimum spanning tree algorithm could do the same job as the Goderya’s algorithm, but without the need of matrix multiplications. This concern was very adequate having in mind system programming languages available in 1980, which is the date of publication of [108]. However, as discussed in Chapter 3, for scripting languages, for-loops are much less e cient than matrix multiplications obtained using external FORTRAN-based libraries.
The following code implements a recursive minimum spanning tree algorithm and does the same as the double while-loop in the previous script:
def find_conn(item, group, fr, to): while 1:
if item in fr:
idx = fr.index(item) fr.pop(idx)
new_item = to.pop(idx) elif item in to:
idx = to.index(item) to.pop(idx)
new_item = fr.pop(idx) else:
break group.add(new_item)
group, fr, to = find conn(new_item, group, fr, to) return group, fr, to
bus.island sets = [] islands = 0
while 1:
if not len(fr): break islands += 1
group = set([])
group, fr, to = find conn(fr[0], group, fr, to) bus.island sets.append(group)
However, the minimum spanning tree algorithm is much slower than the Goderya’s algorithm, at least for a scripting language as Python. For example, for the 11856-bus system discussed in Example 4.3 of Chapter 4, the Goderya’s algorithm takes 3.5 s to find the 208 islands, while the minimum spanning tree algorithm takes about 66 s, i.e., it is almost 20 times more time consuming.