8/13/2019 05 EE394J 2 Spring12 Power System Matrices
1/33
_05_EE394J_2_Spring12_Power_System_Matrices.doc
Page 1 of 33
Power System Matrices and Matrix Operations
Nodal equations using Kirchhoff's current law. Admittance matrix and building algorithm.
Gaussian elimination. Kron reduction. LU decomposition. Formation of impedance matrix by
inversion, Gaussian elimination, and direct building algorithm.
1. Admittance Matrix
Most power system networks are analyzed by first forming the admittance matrix. The
admittance matrix is based upon Kirchhoff's current law (KCL), and it is easily formed and very
sparse.
Consider the three-bus network shown in Figure that has five branch impedances and one current
source.
1 2 3
ZE
ZA
ZB
ZC
ZDI3
Figure 1. Three-Bus Network
Applying KCL at the three independent nodes yields the following equations for the bus voltages
(with respect to ground):
At bus 1, 0211 =
+AE Z
VV
Z
V,
At bus 2, 032122 =
+
+CAB Z
VV
Z
VV
Z
V,
At bus 3, 3233 I
Z
VV
Z
V
CD
=
+ .
Collecting terms and writing the equations in matrix form yields
8/13/2019 05 EE394J 2 Spring12 Power System Matrices
2/33
_05_EE394J_2_Spring12_Power_System_Matrices.doc
Page 2 of 33
=
+
++
+
33
2
1
0
0
1110
11111
0111
IV
V
V
ZZZ
ZZZZZ
ZZZ
DCC
CCBAA
AAE
,
or in matrix form,
IYV= ,
where Yis the admittance matrix, Vis a vector of bus voltages (with respect to ground), andIis a
vector of current injections.
Voltage sources, if present, can be converted to current sources using the usual network rules. If
a bus has a zero-impedance voltage source attached to it, then the bus voltage is already known,
and the dimension of the problem is reduced by one.
A simple observation of the structure of the above admittance matrix leads to the following rule
for building Y:
1. The diagonal terms of Y contain the sum of all branch admittances connected directly to the
corresponding bus.
2. The off-diagonal elements of Ycontain the negative sum of all branch admittances connected
directly between the corresponding busses.
These rules make Yvery simple to build using a computer program. For example, assume thatthe impedance data for the above network has the following form, one data input line per branch:
From To Branch Impedance (Entered
Bus Bus as Complex Numbers)
1 0 ZE
1 2 ZA
2 0 ZB
2 3 ZC
3 0 ZD
The following FORTRAN instructions would automatically build Y, without the need of
manually writing the KCL equations beforehand:
COMPLEX Y(3, 3) , ZB, YB
DATA Y/ 9 * 0. 0/
1 READ( 1, *, END=2) NF, NT, ZB
8/13/2019 05 EE394J 2 Spring12 Power System Matrices
3/33
_05_EE394J_2_Spring12_Power_System_Matrices.doc
Page 3 of 33
YB = 1. 0 / ZB
C MODI FY THE DI AGONAL TERMS
I F( NF . NE. 0) Y(NF, NF) = Y( NF, NF) + YB
I F( NT . NE. 0) Y(NT, NT) = Y( NT, NT) + YB
I F( NF . NE. 0 . AND. NT . NE. 0) THEN
C MODI FY THE OFF- DI AGONAL TERMS
Y( NF, NT) = Y( NF, NT) - YB
Y( NT, NF) = Y( NT, NF) - YB
ENDI F
GO TO 1
2 STOP
END
Of course, error checking is needed in an actual computer program to detect data errors and
dimension overruns. Also, if bus numbers are not compressed (i.e. bus 1 through bus N), then
additional logic is needed to internally compress the busses, maintaining separate internal andexternal (i.e. user) bus numbers.
Note that the Y matrix is symmetric unless there are branches whose admittance is direction-
dependent. In AC power system applications, only phase-shifting transformers have this
asymmetric property. The normal 30ophase shift in wye-delta transformers creates asymmetry.
2. Gaussian Elimination and Backward Substitution
Gaussian elimination is the most common method for solving bus voltages in a circuit for which
KCL equations have been written in the form
YVI= .
Of course, direct inversion can be used, where
IYV1= ,
but direct inversion for large matrices is computationally prohibitive or, at best, inefficient.
The objective of Gaussian elimination is to reduce the Ymatrix to upper-right-triangular-plus-
diagonal form (URT+D), then solve for Vvia backward substitution. A series of row operations
(i.e. subtractions and additions) are used to change equation
=
NNNNNN
N
N
N
N V
V
V
V
yyyy
yyyy
yyyy
yyyy
I
I
I
I
M
L
MOMMM
L
L
L
M
3
2
1
,3,2,1,
,33,32,31,3
,23,22,21,2
,13,12,11,1
3
2
1
8/13/2019 05 EE394J 2 Spring12 Power System Matrices
4/33
_05_EE394J_2_Spring12_Power_System_Matrices.doc
Page 4 of 33
into
=
NNN
N
N
N
N V
V
V
V
y
yy
yyy
yyyy
I
I
I
I
M
L
MOMMM
L
L
L
M
3
2
1
,'
,3'
3,3'
,2'
3,2'
2,2'
,13,12,11,1
'
'3
'2
1
000
00
0
,
in which the transformed Ymatrix has zeros under the diagonal.
For illustrative purposes, consider the two equations represented by Rows 1 and 2, which are
NN
NN
VyVyVyVyI
VyVyVyVyI
,233,222,211,22
,133,122,111,11
++++=
++++=
L
L.
Subtracting (1,1
1,2
y
y Row 1) from Row 2 yields
NNN
NN
Vyy
yyVy
y
yyVy
y
yyVy
y
yyI
y
yI
VyVyVyVyI
++
+
+
=
++++=
,11,1
1,2,233,1
1,1
1,23,222,1
1,1
1,22,211,1
1,1
1,21,21
1,1
1,22
,133,122,111,11
L
L.
The coefficient of 1V in Row 2 is forced to zero, leaving Row 2 with the desired "reduced" form
of
NNVyVyVyI ' ,23' 3,22' 2,2'2 0 ++++= L .
Continuing, Row 1 is then used to "zero" the 1V coefficients in Rows 3 through N, one row at a
time. Next, Row 2 is used to zero the 2V coefficients in Rows 3 through N, and so forth.
After the Gaussian elimination is completed, and the Ymatrix is reduced to (URT+D) form, the
bus voltages are solved by backward substitution as follows:
For RowN,
NNNN VyI ' ,' = , so ( )'' ,1
N
NN
N Iy
V = .
Next, for RowN-1,
NNNNNNN VyVyI'
,11'
1,1'
1 += , so ( )NNNNNN
N VyIy
V'
,1'
1'1,1
11
= .
8/13/2019 05 EE394J 2 Spring12 Power System Matrices
5/33
_05_EE394J_2_Spring12_Power_System_Matrices.doc
Page 5 of 33
Continuing for Rowj, where 2,,3,2 L= NNj ,
NNjjjjjjjj VyVyVyI',1
'1,
',
' +++= ++ L , so
( )NNjjjjjjjj VyVyIyV',1
'1,
'
',
1
= ++ L ,
which, in general form, is described by
=
+=kkj
N
jk
j
jj
j VyIy
V ' ,1
'
',
1.
A simple FORTRAN computer program for solving V in an N-dimension problem using
Gaussian elimination and backward substitution is given below.
COMPLEX Y( N, N) , V( N) , I ( N) , YMM
C GAUSSI AN ELI MI NATE Y AND I
NM1 = N - 1
C PI VOT ON ROW M, M = 1, 2, 3, . . . , N- 1
DO 1 M = 1, NM1
MP1 = M + 1
YMM = 1. 0 / Y( M, M)
C OPERATE ON THE ROWS BELOW THE PI VOT ROW
DO 1 J = MP1, N
C THE J TH ROW OF II ( J ) = I ( J ) - Y( J , M) *YMM * I (M)
C THE J TH ROW OF Y, BELOW AND TO THE RI GHT OF THE PI VOT
C DI AGONAL
DO 1 K = M, N
Y( J , K) = Y( J , K) - Y( J , M) * YMM * Y( M, K)
1 CONTI NUE
C BACKWARD SUBSTI TUTE TO SOLVE FOR V
V( N) = I ( N) / Y( N, N)
DO 2 M = 1, NM1
J = N - MC BACKWARD SUBSTI TUTE TO SOLVE FOR V, FOR
C ROW J = N- 1, N- 2, N- 3, . . . , 1
V( J ) = I ( J )
J P1 = J + 1
DO 3 K = J P1, N
V( J ) = V(J ) - Y( J , K) * V( K)
8/13/2019 05 EE394J 2 Spring12 Power System Matrices
6/33
_05_EE394J_2_Spring12_Power_System_Matrices.doc
Page 6 of 33
3 CONTI NUE
V( J ) = V( J ) / Y( J , J )
2 CONTI NUE
STOP
END
One disadvantage of Gaussian elimination is that ifIchanges, even though Yis fixed, the entire
problem must be re-solved since the elimination of Ydetermines the row operations that must be
repeated onI. Inversion and LU decomposition to not have this disadvantage.
3. Kron Reduction
Gaussian elimination can be made more computationally efficient by simply not performing
operations whose results are already known. For example, instead of arithmetically forcing
elements below the diagonal to zero, simply set them to zero at the appropriate times. Similarly,
instead of dividing all elements below and to the right of a diagonal element by the diagonal
element, divide only the elements in the diagonal row by the diagonal element, make the
diagonal element unity, and the same effect will be achieved. This technique, which is actually a
form of Gaussian elimination, is known as Kron reduction.
Kron reduction "pivots" on each diagonal element ' ,mmy , beginning with 1,1y , and continuing
through 1,1 NNy . Starting with Row m = 1, and continuing through Row m = N - 1, the
algorithm for Kron reducing YVI= is
1. Divide the elements in Row m, that are to the right of the diagonal, by the diagonal
element ' ,mmy . (Note - the elements to the left of the diagonal are already zero).
2. Replace element 'mI with ',
'
mm
m
y
I.
3. Replace diagonal element ' ,mmy with unity.
4. Modify the 'Y elements in rows greater than mand columns greater than m (i.e. below
and to the right of the diagonal element) using
',
',
',
', kmmjkjkj yyyy = , forj > m, k > m.
5. Modify the 'I elements below the mthrow according to
'',
''mmjjj IyII = , forj > m.
6. Zero the elements in Column mof 'Y that are below the diagonal element.
8/13/2019 05 EE394J 2 Spring12 Power System Matrices
7/33
_05_EE394J_2_Spring12_Power_System_Matrices.doc
Page 7 of 33
A FORTRAN code for Kron reduction is given below.
COMPLEX Y( N, N) , V( N) , I ( N) , YMM
C KRON REDUCE Y, WHI LE ALSO PERFORMI NG ROW OPERATI ONS ON I
NM1 = N - 1
C PI VOT ON ROW M, M = 1, 2, 3, . . . , N- 1DO 1 M = 1, NM1
MP1 = M + 1
YMM = 1. 0 / YMM
C DI VI DE THE PI VOT ROW BY THE PI VOT
DO 2 K = MP1, N
Y( M, K) = Y( M, K) * YMM
2 CONTI NUE
C OPERATE ON THE I VECTOR
I ( M) = I ( M) * YMM
C SET THE PI VOT TO UNI TYY( M, M) = 1. 0
C REDUCE THOSE ELEMENTS BELOW AND TO THE RI GHT OF THE PI VOT
DO 3 J = MP1, N
DO 4 K = MP1, N
Y( J , K) = Y( J , K) - Y( J , M) * Y( M, K)
4 CONTI NUE
C OPERATE ON THE I VECTOR
I ( J ) = I ( J ) - Y( J , M) * I (M)
C SET THE Y ELEMENTS DI RECTLY BELOW THE PI VOT TO ZERO
Y( J , M) = 0. 0
3 CONTI NUE
1 CONTI NUE
4. LU Decomposition
An efficient method for solving Vin matrix equation YV = Iis to decompose Yinto the product
of a lower-left-triangle-plus-diagonal (LLT+D) matrixL, and an (URT+D) matrix U, so that YV
= Ican be written as
LUV = I.
The benefits of decomposing Ywill become obvious after observing the systematic procedure for
finding V.
It is customary to set the diagonal terms of U equal to unity, so that there are a total of 2N
unknown terms inLand U. LU= Yin expanded form is then
8/13/2019 05 EE394J 2 Spring12 Power System Matrices
8/33
_05_EE394J_2_Spring12_Power_System_Matrices.doc
Page 8 of 33
=
NNNNN
N
N
N
N
N
N
NNNNN yyyy
yyyy
yyyy
yyyy
u
uu
uuu
llll
lll
ll
l
,3,2,1,
,33,32,31,3
,23,22,21,2
,13,12,11,1
,3
,23,2
,13,12,1
,3,2,1,
3,32,31,3
2,21,2
1,1
1000
100
10
1
0
00
000
L
MOMMM
L
L
L
L
MOMMM
L
L
L
L
MOMMM
L
L
L
.
Individual land uterms are easily found by calculating them in the following order:
1. Starting from the top, work down Column 1 ofL, finding 1,1l , then 1,2l , then 1,3l , ,
lN,1. For the special case of Column 1, these elements are 1,1, jj yl = ,j = 1,2,3, ,N.
2. Starting from the left, work across Row 1 of U, finding 2,1u , then 3,1u , then 4,1u , ,
Nu ,1 . For the special case of Row 1, these elements are1,1
,1,1
l
yu
kk = , k = 2,3,4, ,N.
3. Work down Column (k= 2) ofL, finding 2,2l , then 2,3l , then 2,4l , , 2,Nl , using
Nkkkjulyl km
k
m
mjkjkj ,,2,1,,,
1
1
,,, L++==
=
, Column Nkk 2, .
4. Work across Row (k= 2) of U, finding 3,2u , then 4,2u , then 5,2u , , Nu ,2 , using
Nkkjl
uly
ukk
k
mjmmkjk
jk ,,2+,1+=,,
1
1 ,,,
, L
=
= , Row )1(2, Nkk .
5. Repeat Steps 3 and 4, first for Column kofL, then for Row kof U. Continue for all k=
3,4,5, ,(N1) forLand U, then for k=NforL.
The procedure given above in Steps 1 - 5 is often referred to as Crout's method. Note that
elements of L and Unever look "backward" for previously used elements of Y. Therefore, in
order to conserve computer memory,Land Uelements can be stored as they are calculated in the
same locations at the corresponding Yelements. Thus, Crout's method is a memory-efficient "in
situ" procedure.
An intermediate column vector is needed to find V. The intermediate vectorDis defined as
D = UV,
so that
8/13/2019 05 EE394J 2 Spring12 Power System Matrices
9/33
_05_EE394J_2_Spring12_Power_System_Matrices.doc
Page 9 of 33
=
N
N
N
N
N V
V
V
V
u
uu
uuu
d
d
d
d
M
L
MOMMM
L
L
L
M
3
2
1
,3
,23,2
,13,12,1
3
2
1
1000
100
10
1
.
SinceLUV=I, thenLD = I. Vector D is found using forward-substitution from
=
NNNNNNN I
I
I
I
d
d
d
d
llll
lll
ll
l
MM
L
MOMMM
L
L
L
3
2
1
3
2
1
,3,2,1,
3,32,31,3
2,21,2
1,1
0
00
000
,
which proceeds as follows:
From Row 1, ( )11,1
1111,11
, Il
dIdl == ,
From Row 2, ( )11,222,2
2222,211,21
, dlIl
dIdldl ==+ ,
From Row k,
==+++
= jjk
k
jkkkkkkkkkk
dlIl
dIdldldl,
1
1,,22,11,
1,L .
Now, sinceD= UV, or
=
N
N
N
N
N V
V
V
V
u
uu
uuu
d
d
d
d
M
L
MOMMM
L
L
L
M
3
2
1
,3
,23,2
,13,12,1
3
2
1
1000
100
10
1
,
whereDand Uare known, then Vis found using backward substitution.
An important advantage of LU decomposition over Gaussian elimination or Kron reduction is
that theIvector is not modified during decomposition. Therefore, once Yhas been decomposed
intoLand U, Ican be modified, and Vrecalculated, with minimal work, using the forward and
backward substitution steps shown above.
8/13/2019 05 EE394J 2 Spring12 Power System Matrices
10/33
_05_EE394J_2_Spring12_Power_System_Matrices.doc
Page 10 of 33
A special form of Lis helpful when Y is symmetric. In that case, let both Land Uhave unity
diagonal terms, and define a diagonal matrixDso that
Y = LDU,
or
=
1000
100
10
1
000
000
000
000
1
0
01
001
0001
,3
,23,2
,13,12,1
,
3,3
2,2
1,1
3,2,1,
2,31,3
1,2
L
MOMMM
L
L
L
L
MOMMM
L
L
L
L
OMMM
L
L
L
N
N
N
NNNNN
u
uu
uuu
d
d
d
d
lll
ll
l
Y .
Since Yis symmetric, then TYY= , and [ ] TTTTTT DLULDULDULDU === . Therefore,
an acceptable solution is to allow
T
UL=
. Incorporating this into the above equation yields
=
NN
N
N
N
NNN d
ldd
ldldd
ldldldd
lll
ll
l
Y
,
3,3,33,3
2,2,22,32,22,2
1,1,11,31,11,21,11,1
3,2,1,
2,31,3
1,2
000
00
0
1
0
01
001
0001
L
MOMMM
L
L
L
L
OMMM
L
L
L
,
which can be solved by working from top-to-bottom, beginning with Column 1 of Y, as follows:
Working down Column 1 of Y,
1,11,1 dy = ,
1,11,21,21,11,21,2 /so, dyldly == ,
1,11,1,1,11,1, /so, dyldly jjjj == .
Working down Column 2 of Y,
1,21,11,22,22,22,21,21,11,22,2so, ldlyddldly =+= ,
Njdldlyldlldly jjjjjj
8/13/2019 05 EE394J 2 Spring12 Power System Matrices
11/33
_05_EE394J_2_Spring12_Power_System_Matrices.doc
Page 11 of 33
mkmm
k
m
mkkkkkkkmkmm
k
m
mkkk ldlyddldly ,,
1
1,,,,,,
1
1,, so,
=
=
=+= ,
Njkdldlylldlykkmkmm
k
m mjkjkjmkmm
k
m mjkj
Top Related