LU and Fast Power Flow
LU and Fast Power Flow
1. Introduction
We saw in previous notes that the very common
problem, to solve for the n×1 vector x in
Ax b (1)
when n is very large, is done without inverting the
n×n matrix A, using LU decomposition.
1
Pj ( x)
V j Vk G jk sin( j k ) B jk cos( j k )
P
J jk (T7.47)
k
Pj ( x)
N
J jj P V j Vk G jk sin( j k ) B jk cos( j k ) (T7.48)
2
B jj V j
j k 1
Q j ( x)
V j Vk G jk cos( j k ) B jk sin( j k )
Q
J jk (T7.49)
k
Q j ( x)
N
J jj Q V j Vk G jk cos( j k ) B jk sin( j k ) (T7.50)
2
G jj V j
k k 1
Pj ( x)
V j G jk cos( j k ) B jk sin( j k )
PV
J jk (T7.51)
Vk
Pj ( x)
N
J jj PV G jj V j Vk G jk cos( j k ) B jk sin( j k ) (T7.52)
V j k 1
Q j ( x)
V j G jk sin( j k ) B jk cos( j k )
QV
J jk (T7.53)
Vk
Q j ( x)
N
J jj QV
B jj V j Vk G jk sin( j k ) B jk cos( j k ) (T7.54)
V j k 1
2
Consider a power system having N buses and L
branches. Let’s just consider the Y-bus for now.
3
(Answer 1 indicates that JjkPθ is zero when Gjk and Bjk
are zero which occurs only when the corresponding
element in the Y-bus is zero which occurs when there
is no connection between buses j and k).
2. Storage techniques
4
2.1 Entry-row-column storage method
5
For example, if we wanted an element in position
(j,k), we could do a “golden search” (choose an
element I and identify whether it is below or above
element (j,k). If above, choose I/2. If below, choose
2I. Then repeat.
6
creates the need for making 3×7N=21N stores. So
total number of stores is 21N, which means our
storage requirement, as a percentage of the number of
matrix elements (giving us a sense of what we need
to store relative to what we would store if we just
kept the entire matrix in memory) is 21N/N2=21/N.
This is illustrated below.
Size Percent of matrix filled Percent of stores required
N=500 7/500=1.4% filled. 4.2%
N=2000 7/2000=0.35% filled. 1.05%
N=10000 7/10000=0.075% filled. 0.21%
N=50000 7/50000=0.0145% filled. 0.042%
What this says, for example (for the first case of 500
buses), is that whereas only 1.4% of the matrix size will
have non-zero elements, our storage scheme will require
a storage space requirement of only 4.2% of the matrix
size. This is much better than storing the entire matrix!
7
I STO[I] IR[I] IC[I]
I STO[I] IR[I] IC[I] 1 1 1 1
1 1 1 1 2 1 1 4
2 1 1 4 3 4 2 1
3 4 2 1 4 3 2 2
4 3 2 2 5 5 3 3
5 2 3 4 6 2 3 4
6 1 4 3 7 1 4 3
In the modified data structures on the right, all values
“below” the inserted non-zero element at I=5 had to
be “pushed down” the array structures, i.e.,
what was STO[5], IR[5], and IC[5] has now
become STO[6], IR[6], and IC[6], and
what was STO[6], IR[6], and IC[6] has now
become STO[7], IR[7], and IC[7].
This “pushing down” the array structures for an
insertion takes time, and when the matrices are very
large, this can take significant time (even for sparse
matrices), especially when an element needs to be
inserted “high” up the array structures.
8
2.2 Chained data structure method
9
K LOC[K] NEXT[I] signals you
(with a zero) where the
1 1 current row ends.
2 3 LOC[K] tells you
where in STO and IC
3 5 row K begins.
4 6
A common need is to obtain the element in position (j,k).
For example, lets obtain the element in position (2,3).
10
showing a typical tradeoff between computation and
memory. However, if the matrix is sparse, the above
search on a row is very fast, since typically there will
only be a very few non-zero elements in each row.
It is interesting to see what the storage requirement of
this scheme is like.
11
What this says, for example (for the first case of 500
buses) is that whereas only 1.4% of the matrix will have
non-zero elements, our storage scheme will require a
storage space requirement of only 4.4% of the matrix
size. This is much better than storing the entire matrix!
3. Optimal ordering
12
General speed-up strategy: Minimize the number of
row operations.
13
Remaining Lower Triangular Element (RLTE): This
is an element in the LT but to the right of the ith
column when row i is the pivot row, as illustrated in
Fig. 2. An RLTE can be denoted akl, where k,l > i.
_ _ _ _ _ _ _
th
i pivot _ 1 _ _ _ _ _
row
_ _ _ _ _ _ _
_ _ _ _ _ _ _
_ _ _ _ _ _ _
_ _ _ _ _ _ _
_ _ _ _ _ _ _
aji's RLTE’s
Fig. 2
Observe that
The RLTE’s are the future aji’s. To take
advantage of Speedup approach #1, we want as
many of these elements as possible to be zero.
If RLTE akl is initially zero (before the Gaussian
elimination process is started), it could become
non-zero during a row operation. We call such
elements “fill-ups”. This will add a future row
operation. An illustration of such a case is below.
14
3 x1 3 x2 6 x3 9 x4 1
x1 3x2 4 x3 x4 3
x1 2 x2 5 x3 6 x4 2
x1 x3 4 x4 1
3 3 6 9
1 3 4 1
1 2 5 6
1 0 1 4
Divide first row by 3 and then add multiples of it to
remaining rows so that first element in remaining
rows gets zeroed.
1 1 2 3
0 2 2 2
0 1 3 3
0 1 3 1
Observe that the element in row 4, col 2 (circled) was
a zero in the original matrix but became a “fill” (and
therefore a “fill-up”). We just created an extra row
operation for ourselves!
15
What if we could have started so that that original
zero was in the first column, as shown below?
3 x2 3x1 6 x3 9 x4 1
3 x2 x1 4 x3 x4 3
2 x2 x1 5 x3 6 x4 2
x1 x3 4 x4 1
3 3 6 9
3 1 4 1
2 1 5 6
0 1 1 4
Observe that we just exchanged the first two
columns, which is equivalent to interchanging the
order of variables x1 and x2.
16
1 1 2 3
0 2 2 8
0 1 1 0
0 1 1 4
So what is the general approach to take here?
Speed-up approach #2:
Minimize row operations.
Minimize row operations by minimizing fill-ups.
Minimize fill-ups by pushing zero elements in LT
to left-hand side of matrix. This will effectively move
them away from positions where a row operation can
affect them.
17
We will illustrate the power of this method. But to do
so, we will need another concept.
5
2 7
Fig. 3
Table 1: Fills
1 2 3 4 5 6 7 8
1 X X X X X
2 X X X X
3 X X X X
4 X X X
5 X X X
6 X X X
7 X X
8 X X
Now perform the symbolic factorization and count the number
of row operations and fills for each pivot. We place an “Fk” for
each fill-up produced by a row operation based on pivot row k.
19
Table 2: Fills & Fill-ups produced by pivot row 1
1 2 3 4 5 6 7 8
1 X X X X X
2 X X F1 X F1 X F1
3 X F1 X X X F1 F1
4 X X X
5 X X X
6 X F1 F1 X X F1
7 X X
8 X F1 F1 F1 X
20
Continuing in this manner, we show the complete
symbolic factorization in the table below.
21
Now renumber according to OOS1, shown in Fig. 4,
and re-perform the symbolic factorization.
1 8
4
7 2
Fig. 4
22
Table 7: Summary for OOS1
Pivot Row ops Fill-ups
1 1 0
2 1 0
3 2 2
4 2 0
5 2 1
6 2 0
7 1 0
TOTAL 11
23
We know (4,3)
must be a fill, (3,8) is a fill (by symmetry) (8,3) is a fill
otherwise the
row operation (4,3) is a fill (by symmetry) (3,4) is a fill
that filled (4,8)
would not have
(8,4) is 0 (because (4,8) just got filled so it must have
been necessary been 0 previously, then by symmetry (8,4) is 0)
If (8,3) is a fill, then we will have to eliminate it using
pivot row 3. When we do this, (3,4) will fill-up (8,4).
1 2 3 4 5 6 7 8
1 X X
2 X X
3 X X X
4 X X X F3
5 X X X
6 X X X F5 X
7 X X F5 X X
8 X X F3 X X X
This leads us to optimal ordering scheme #2.
Optimal Ordering Scheme #2 (OOS2):
The nodes of a network are ordered in such a way
that a lower numbered node has less or equal number
of actual or fictitious adjacent branches than any
higher numbered node.
Compare to OOS1:
Optimal Ordering Scheme #1 (OOS1):
The nodes of a network are ordered in such a way
that a lower numbered node has less or equal number
of actual adjacent branches than any higher
numbered node.
24
The main difference between these schemes is that
OOS1 does one ordering at the beginning based only
on number of actual branches for each node, whereas
OOS2 also does a check for re-ordering at the
beginning of each elimination.
Let’s see how it works for our previous example.
25
Table 8: Fills and Fill-ups for OOS2
1 2 3 5 4 6 7 8
1 X X
2 X X
3 X X X
5 X X X
4 X X X F3
6 X X X F5 X
7 X X F5 X X
8 X X F3 X X X
1 8
4
7 2
26
In this case, the row operations were the same, but
for larger systems, OOS2 outperforms OOS1.
27