Professional Documents
Culture Documents
Sparsity Techniques PDF
Sparsity Techniques PDF
Sparsity Technique
84
programming will increase. However, for any general purpose load flow program, which is expected
to handle any large size power system, enhancement in the complexity of programming is often a
small cost as compared to the advantage of optimized memory utilization.
Below we will discuss some schemes for solving a set of linear equations (note that equation (2.48)
is a set of linear equations) utilizing the sparse nature of the Jacobian matrix and also some schemes
for storing a sparse matrix. We will start with the Gaussian Elimination method for solving a set of
linear equations.
Ax = b (3.1)
Where x and b are both (n×1) vectors and A is a (n×n) co-efficient matrix. The most obvious
method for solving equation (3.1) is to invert matrix A, that is x = A−1 b. However, equation
(3.1) can also be solved indirectly by converting the matrix A into an upper triangular form with
appropriate changes reflected in the vector b and then by back substitution. To illustrate the basic
procedure, let us consider a 4th order system as shown in equations (3.2)-(3.5).
Step 1:
a) Equation (3.2) is divided throughout by a11 .
b) Multiply equation (3.6) by a21 , a31 , a41 (one by one) and subtract the resulting expression
from equations (3.3), (3.4) and (3.5) respectively to yield:
aj1 a1k
a(1)
jk = ajk − for j, k = 2, 3, 4 (3.14)
a11
(1)
a23 a(1) b2(1)
x2 + (1)
x3 + 24
x4 = (3.15)
a22 a(1)
22 a(1)
22
(1) (1)
b) Multiplying equation (3.15) by a32 and a42 (one by one) and subtracting the resulting
expressions from equations (3.12) and (3.13) respectively one can obtain;
(1)
a23 a(1) b2(1)
x2 + (1)
x3 + 24
x4 = (3.18)
a22 a(1)
22 a(1)
22
(2) (2)
a33 x3 + a34 x4 = b3(2) (3.19)
(2) (2)
a43 x3 + a44 x4 = b4(2) (3.20)
(1) (1)
(2) (1) aj2 a2k
a jk =a jk − (1)
for j, k = 3, 4 (3.21)
a22
Step 3: In this step we will work with equations (3.19) and (3.20).
86
(2)
a) Equation (3.19) is divided throughout by a33 .
(2)
a34 b3(2)
x3 + (2)
x4 = (2)
(3.22)
a33 a33
(2)
b) Multiplying equation (3.22) by a43 and subtracting it from equation (3.20) one can obtain,
Equation (3.23) contains only one unknown, x4 . Therefore, the value of x4 can be calculated
from this equation. With the value of x4 thus calculated, x3 can be calculated from equation (3.22).
Going back in this manner, x2 can be calculated from equation (3.18) (with the known values of x3
and x4 ) and lastly, the value of x1 can be calculated from equation (3.10) (with the known values
of x2 , x3 and x4 ).
The steps described in equations (3.6)-(3.23) can easily be expressed in terms of standard matrix
operations. To see this, let us represent equations (3.2)-(3.5) in matrix notation as shown in equation
(3.24). In this equation, it is assumed that a11 ≠ 0.
⎡ ⎤⎡ ⎤ ⎡ ⎤
⎢a11 a12 a13 a14 ⎥ ⎢x1 ⎥ ⎢b1 ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢a a24 ⎥⎥ ⎢⎢x2 ⎥⎥ ⎢⎢b2 ⎥⎥
⎢ 21 a22 a23
⎢ ⎥⎢ ⎥ = ⎢ ⎥ (3.24)
⎢a31 a32 a33 a34 ⎥⎥ ⎢⎢x3 ⎥⎥ ⎢⎢b3 ⎥⎥
⎢
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢a41 a42 a43 a44 ⎥⎦ ⎢⎣x4 ⎥⎦ ⎢⎣b4 ⎥⎦
⎣
Starting with this matrix, the various steps for Gaussian elimination are as follows.
Step M1
On equation (3.24), the operation R1/a11 (where ‘R1’ is the first row of the co-efficient matrix
of equation (3.24)) is carried out to obtain equation (3.6) and the resulting matrix equation is shown
in equation (3.25).
⎡ ⎤⎡ ⎤ ⎡ ⎤
⎢ 1 a12 /a11 a13 /a11 a14 /a11 ⎥ ⎢x1 ⎥ ⎢b1 /a11 ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢a ⎥ ⎢x ⎥ ⎢ b ⎥
⎢ 21 a a a 24 ⎥ ⎢ 2 ⎥ ⎢ 2 ⎥
⎢ ⎥⎢ ⎥ = ⎢ ⎥
22 23
(3.25)
⎢a31 a a a ⎥ ⎢x ⎥ ⎢ b3 ⎥
⎢ 32 33 34 ⎥⎢ ⎥ ⎢
3 ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢a41 a a a ⎥ ⎢x ⎥ ⎢ b 4 ⎥
⎣ 42 43 44
⎦⎣ ⎦ ⎣
4
⎦
Step M2
On equation (3.25), the operations (R2 − R1 ∗ a21 ), (R3 − R1 ∗ a31 ) and (R4 − R1 ∗ a41 ) are
carried out (where ‘Ri’ denotes the ith (i = 1, 2, 3, 4) row of the co-efficient matrix of equation (3.25))
to obtain equations (3.10)-(3.13) and the resulting matrix equation is shown in equation (3.26). In
87
(1)
this equation, it is assumed that a22 ≠ 0.
⎡1 a /a a /a a /a ⎤ ⎡x ⎤ ⎡b /a ⎤
⎢ 11 ⎥ ⎢ 1 ⎥ ⎢ ⎥
⎢ 12 11 13 11 14
⎥ ⎢ ⎥ ⎢ 1 11 ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢0 a(1) a (1)
a (1)
⎥ ⎢x2 ⎥ ⎢ b(1) ⎥
⎢ 22 23 24 ⎥⎢ ⎥ ⎢ 2 ⎥
⎢ ⎥ ⎢ ⎥ = ⎢ ⎥ (3.26)
⎢0 a(1) (1) (1) ⎥ ⎢ ⎥ ⎢ (1) ⎥
⎢ a a ⎥ ⎢ 3⎥ ⎢ 3 ⎥
x b
⎢ 32 33 34
⎥⎢ ⎥ ⎢ ⎥
⎢ (1) (1) (1) ⎥ ⎢ ⎥ ⎢ (1) ⎥
⎢0 a42 a43 a44 ⎥⎦ ⎢⎣x4 ⎥⎦ ⎢⎣ b4 ⎥⎦
⎣
Step M3
(1)
On equation (3.26), the operation ‘R2/a22 ’ is carried out (corresponding to equation (3.15)) to
obtain the resulting matrix equation shown in equation (3.27).
(1) (1)
On equation (3.27), the operations (R3 − R2 ∗ a32 ) and (R4 − R2 ∗ a42 ) are carried out cor-
responding to the equations (3.18)-(3.21) and the resulting matrix equation is shown in equation
(2)
(3.28). In this equation, it is assumed that a33 ≠ 0.
(2)
On equation (3.28), the operation ‘R3/a33 ’ is carried out to obtain the matrix equation shown
in equation (3.29).
⎡1 a /a a13 /a11 a14 /a11 ⎤⎥ ⎡⎢x1 ⎤⎥ ⎡⎢ b1 /a11 ⎤⎥
⎢
⎢ 12 11
⎥⎢ ⎥ ⎢ ⎥
⎢ (1) (1) (1) (1) ⎥ ⎢ ⎥ ⎢ (1) (1) ⎥
⎢0 1 a23 /a22 a24 /a22 ⎥⎥ ⎢⎢x2 ⎥⎥ ⎢⎢b2 /a22 ⎥⎥
⎢
⎢ ⎥ ⎢ ⎥ = ⎢ (2) (2) ⎥ (3.29)
⎢0 (2)
/a33(2) ⎥ ⎢ ⎥ ⎢ ⎥
⎢ 0 1 a34 ⎥ ⎢x3 ⎥ ⎢b3 /a33 ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ (2) (2) ⎥ ⎢ ⎥ ⎢ (2) ⎥
⎢0 0 a43 ⎥ ⎢
a44 ⎦ ⎣x4 ⎦ ⎣ b4 ⎥ ⎢ ⎥
⎣ ⎦
Step M6
(2)
Lastly, on equation (3.29), the operation (R4 − R3 ∗ a43 ) is carried out to obtain the matrix
88
equation shown in equation (3.30).
89