You are on page 1of 38

Chapter 1: INTRODUCTION

Power flow* (or load flow) is the solution for the normal balanced three-phase steady-state
operating conditions of an electric power system. In general, power flow calculations are
performed for power system planning and operational planning, and in connection with system
operation and control. The data obtained from power flow studies are used for the studies of
normal operating mode, contingency analysis, outage security assessment, and optimal
dispatching and stability. Note that, normally it is understood that a “contingency” is the loss
of a major transmission element or a large generating unit. When a system is able to withstand
any single major contingency, it is now called “N-1 secure” according to the new terminology
suggested by National Electric Reliability Council (NERC). A “double contingency” is the loss
of two transmission lines, or two generators, or a line and a generator [1]. In this case, it can be
said that such system is “N-2 secure.”

As has been succinctly put by Shipley [2], “the difficulties and the importance of the power
flow problem have fascinated mathematicians and engineers throughout the world for a number
of years. Many people have devoted a large proportion of their professional life to the solution
of the problem. It has received more attention than all the other power system problems
combined. The amount of effort devoted to the problem has resulted in an enormous amount
of technical publications. The nature of the problem probably precludes the development of a
perfect procedure. Therefore, it is likely that progress will continue to be made on improved
solutions for a long time.”

Before 1929, all power flow (or load flow, as it was then called) calculations were made by
hand. In 1929, network calculators (of Westinghouse) or network analysers (of General
Electric) were employed to perform power flow calculations. The first paper describing the
first digital method to solve the power flow problem was published in 1954 [3]. However, the
first really successful digital method was developed by Ward and Hale in 1956 [4]. Most of the
early iterative methods were based on the Y-matrix of the Gauss–Seidel method [4–10]. It
requires minimum computer storage and needs only a small number of iterations for small
networks. Unfortunately, as the size of the network is increased, the number of iterations
required increases dramatically for large systems. In some cases, the method does not provide
a solution at all. Therefore, the slowly converging behaviour of the Gauss–Seidel method and
its frequent failure to converge in ill-conditioned situations caused the development of the Z-
matrix methods [11–25].

Even though these methods have considerably better converging characteristics, they also have
the disadvantage of needing a significantly larger computer storage memory owing to the fact
that the Z-matrix is full, contrary to the Y-matrix, which is sparse. These difficulties
encountered in load flow studies led to the development of the Newton–Raphson method. The
method was originally developed by Van Ness and Griffin [16–18] and later by others [19–24].
The method is based on the Newton–Raphson algorithm to solve the simultaneous quadratic
Equations of the power network. Contrary to the Gauss–Seidel algorithm, it needs a larger time
per iteration, but only a few iterations, and is significantly independent of the network size.
Therefore, most of the power flow problems that could not be solved by the Gauss–Seidel
method (e.g., systems with negative impedances) are solved with no difficulty by this method.
However, it was not computationally competitive on large systems because of the rapid
increase of computer time and storage requirement with problem size. The present-day trends
are toward the development of interactive power flow programs [46] where the planning
engineer can modify data on a computer, either in a dialog mode with the program or on graphic
displays, and then direct the program for the solution of the problem. The program algorithm
may allow the planner to choose any portion of output data to be displayed after the solution.
It is foreseeable that the future power flow programs will provide improved interactive
capabilities and faster algorithms to minimize the difficulties encountered in arriving at
solutions within proper limits of time and effort.
Chapter 2: POWER FLOW PROBLEM

The power flow problem can be defined as the calculation of the real and reactive powers
flowing in each line, and the magnitude and phase angle of the voltage at each bus of a given
transmission system for specified generation and load conditions. The information obtained
from the power flow studies can be used to test the system’s capability to transfer energy from
generation to load without overloading lines and to determine the adequacy of voltage
regulation by shunt capacitors, shunt reactors, tap-changing transformers, and the var-
supplying capability of rotating machines.

It is possible to define the bus power in terms of generated power, load power, and transmitted
power at a given bus. For example, the bus power (i.e., the net power) of the ith bus of an n bus
power system can be expressed as
𝑆𝑖 = 𝑃𝑖 + 𝑗𝑄𝑖 (2.1)

= (𝑃𝐺𝑖 − 𝑃𝐿𝑖 − 𝑃𝑇𝑖 ) + 𝑗(𝑄𝐺𝑖 − 𝑄𝐿𝑖 − 𝑄𝑇𝑖 )

Where,
Si = three-phase complex bus power at ith bus
P = three-phase real bus power at ith bus
Qi = three-phase reactive bus power at ith bus
Pi = three-phase real generated power flowing into ith bus
PGi = three-phase real load power flowing out of ith bus
PLi = three-phase real transmitted power flowing out of ith bus
QTi = three-phase reactive generated power flowing into ith bus
QGi = three-phase reactive load power flowing out of ith bus
QLi,Ti = three-phase reactive transmitted power flowing out of ith bus

In load flow studies, the basic assumption is that the given power system is a balanced three-
phase system operating in its steady state with a constant 60-Hz frequency. Therefore, the
system can be represented by its single-phase positive-sequence network with a lumped series
and shunt branches. The power flow problem can be solved either by using the bus admittance
matrix (Y) or the bus impedance matrix (Z) representation of the given network. It is customary
to use the nodal analysis approach. Thus, if the bus voltages are known, the bus currents can
be expressed as
[𝐼𝑏𝑢𝑠 ] = [𝑌𝑏𝑢𝑠 ] [𝑉𝑏𝑢𝑠 ] (2.2)

Or in its inverse form,

[𝑉𝑏𝑢𝑠 ] = [𝑌𝑏𝑢𝑠 ]−1 [𝐼𝑏𝑢𝑠 ] (2.3)

= [𝑍𝑏𝑢𝑠 ] [𝐼𝑏𝑢𝑠 ]

If the bus voltages are known, then the bus currents can be calculated from Equation 2.2.
Otherwise, if the bus currents are known, then the bus voltages can be found from Equation
2.3. However, in a given power flow problem, nodal active and reactive powers are the
independent variables and nodal voltages are the dependent variables. Therefore, the
determination of the nodal voltages, which initially seems to be simple, given that the nodal
currents are known, becomes a nonlinear problem dictating an iterative solution method since
it is nodal power rather than current that is known.

Each bus of a network has four variable quantities associated with it: the real and reactive
power, the (line-to-ground) voltage magnitude, and voltage phase angle. Any two of the four
may be the independent variables and are specified, whereas the other two remain to be
determined. Because of the physical characteristics of generation and load, the electrical
conditions at each bus are defined in terms of active and reactive power rather than by bus
current. Since the complex power flowing into the ith bus can be expressed as

𝑉𝑖 𝐼𝑖 ∗ = 𝑃𝑖 + 𝑗𝑄𝑖 (2.4)

In general, there are three types of buses in a load flow problem. Each with its own specified
variables: (1) Slack (generator) bus, (2) generator buses, and (3) load buses. Since transmission
losses in a given system are associated with the bus voltage profile, until a solution is obtained,
the total power generation requirement cannot be determined. Therefore, the generator at the
slack bus is used to supply the additional active and reactive power necessary owing to the
transmission losses.

Thus, at the slack bus, the magnitude and phase angle of the voltage are known, and the real
and reactive power generated are the quantities to be determined. It is only after a solution is
converged, that is, all bus voltages are known, that the real and reactive power generation
requirements at the slack bus can be determined. In other words, the losses are not known in
advance, and consequently the power at the slack bus cannot be specified.

Table 2.1

To define the power flow problem to be solved, it is necessary to specify the real power and
the voltage magnitude at each generator bus. This is because these quantities are controllable
through the governor and excitation controls, respectively. The generator bus is also known as
the PV bus. Since an overexcited synchronous generator supplies current at a lagging power
factor, the reactive power Q of a generator is not required to be specified. The load bus is also
known as the PQ bus. This is because the real and reactive powers are specified at a given load
bus. Table 2.1 gives the bus types with corresponding known and unknown variables. Note
that, the slack bus voltage is set to 1.0 pu with a phase angle of 0° (i.e., the slack bus voltage is
used as a reference voltage).

It is possible that some load buses may have transformers capable of lap-changing and phase
shifting operations. These types of load buses are known as the voltage-controlled load buses.
At the voltage-controlled load buses, the known quantities are the voltage magnitude in
addition to the real and reactive powers, and the unknown quantities are the voltage phase angle
and the turns ratio.
Chapter 3: BUS SELECTION

We use IEEE 9-bus system for the test case. Using this system, we came across compete
power flow analysis by using different load flow algorithms.

Fig: Line diagram of IEEE 9-bus system with complete line parameter data.

Fig: Line data of IEEE-9 bus system


Table-2: Load data of IEEE-9 bus system
Chapter 4: Gauss-Iterative method for Power flow

Assume that a set of simultaneous linear equations with n unknowns (x1, x2, x3, ⋯, xn
independent variables) is given as

(4.1)

where the ‘a’ coefficient and the b dependent variables are known. The given Equation set 4.1
can be re-expressed as

(4.2)

(4.3)
Assume that the initial approximation values of the independent variables are
(0) (0) (0) (0)
𝑥1 , 𝑥2 , 𝑥3 , … … . . , 𝑥4 . Thus, after the substitution, the equation set (4.2) Can be written
as above.

Where the initial values* are usually selected as,

(4.4)
If the results obtained from Equation 8.8 match the initial values within a predetermined
tolerance, a convergence (i.e., solution) has been achieved. Otherwise the new corrected values
(1) (1) (1) (1)
of the independent variable (ie., 𝑥1 , 𝑥2 , 𝑥3 , … … . . , 𝑥4 ) are substituted in the next
iteration. Therefore, after the k+1 iteration,

(4.5)
IEEE-9 bus system power flow analysis using Gauss-Iterative method

Voltage of all nine buses using Gauss-iteration method is shown I table below. This table also
contain the power loss across each line (reactive and active). Fundamental of finding Y-bus is
identical and traditional. The value of error took by us is 0.000001 and the total no. of iterations
is 10.

Bus Number Voltage (pu)


1 1.0400
2 1.0250
3 1.0250
4 1.0260
5 0.9958
6 1.0128
7 1.0258
8 1.0159
9 1.0324

Voltage P.U
1.05

1.04 1.04

1.03 1.0324
1.025 1.025 1.026 1.0258
1.02
1.0159
1.0128
1.01

1
0.9958
0.99

0.98

0.97
1 2 3 4 5 6 7 8 9

Fig: Voltage profile of IEEE-9 bus system using Gauss Iteration method
Chapter 5: GAUSS-SEIDEL METHOD
The basic power flow equations (4.6) and (4.7) are nonlinear. In an n -bus power system, let
the number of P-Q buses be np and the number of P-V (generator) buses be ng such that n = np
+ ng + 1. Both voltage magnitudes and angles of the P-Q buses and voltage angles of the P-V
buses are unknown making a total number of 2np + ng quantities to be determined. Amongst
the known quantities are 2np numbers of real and reactive powers of the P-Q buses, 2ng numbers
of real powers and voltage magnitudes of the P-V buses and voltage magnitude and angle of
the slack bus. Therefore, there are sufficient numbers of known quantities to obtain a solution
of the load flow problem. However, it is rather difficult to obtain a set of closed form equations
from (4.6) and (4.7). We therefore have to resort to obtain iterative solutions of the load flow
problem.

At the beginning of an iterative method, a set of values for the unknown quantities are chosen.
These are then updated at each iteration. The process continues till errors between all the known
and actual quantities reduce below a pre-specified value. In the Gauss-Seidel load flow we
denote the initial voltage of the i th bus by Vi(0) , i = 2, ... , n . This should read as the voltage of
the i th bus at the 0th iteration, or initial guess. Similarly, this voltage after the first iteration will
be denoted by Vi (1). In this Gauss-Seidel load flow the load buses and voltage-controlled buses
are treated differently. However, in both these types of buses we use the complex power
equation given in (4.5) for updating the voltages. Knowing the real and reactive power injected
at any bus we can expand (4.5) as

(4.11)

We can rewrite (4.11) as

(4.12)

In this fashion the voltages of all the buses are updated. We shall outline this procedure with
the help of the system of Fig. 4.1, with the system data given in Tables 4.1 to 4.3. It is to be
noted that the real and reactive powers are given respectively in MW and MVAr. However,
they are converted into per unit quantities where a base of 100 MVA is chosen.
Updating Load Bus Voltages

Let us start the procedure with bus-2 of the 5 bus 7-line system given in fig: 4.1. Since this is
load bus, both the real and reactive power into this bus is known. We can therefore write from
(4.12)

(4.13)

From the data given in Table 4.3 we can write and reactive

It is to be noted that since the real power is drawn from this bus, both these quantities appear
in the above equation with a negative sign. With the values of the Y bus elements given in Table
4.2 we get V21 = 0.9927 < − 2.5959°.

The first iteration voltage of bus-3 is given by

(4.14)

Note that in the above equation since the update for the bus-2 voltage is already available, we
used the 1st iteration value of this rather than the initial value. Substituting the numerical data,
we get V3(1) = 0.9883 < − 2. 8258°. Finally, the bus-4 voltage is given by

(4.15)

Solving we get V4(1) = 0. 9968 < −3.4849°.

Updating P-V Bus Voltages

It can be seen from Table 4.3 that even though the real power is specified for the P-V bus-5, its
reactive power is unknown. Therefore, to update the voltage of this bus, we must first estimate
the reactive power of this bus. Note from Fig. 4.11 that
(4.16)

And hence we can write the kth iteration values as

(4.17)

For the system of Fig. 4.1 we have

(4.18)

This is computed as 0.0899 per unit. Once the reactive power is estimated, the bus-5 voltage is
updated as

(4.19)

It is to be noted that even though the power generation in bus-5 is 48 MW, there is a local load
that is consuming half that amount. Therefore, the net power injected by this bus is 24 MW and
consequently the injected power P5, inj in this case is taken as 0.24 per unit. The voltage is
calculated as V5(1) = 1.0169 < − 0.8894°. Unfortunately, however the magnitude of the voltage
obtained above is not equal to the magnitude given in Table 4.3. We must therefore force this
voltage magnitude to be equal to that specified. This is accomplished by

(4.20)

This will fix the voltage magnitude to be 1.02 per unit while retaining the phase of − 0.8894°
The corrected voltage is used in the next iteration.

Convergence of the Algorithm

As can be seen from Table 4.3 that a total number of 4 real and 3 reactive powers are known
to us. We must then calculate each of these from (4.6) and (4.7) using the values of the voltage
magnitudes and their angle obtained after each iteration. The power mismatches are then
calculated from (4.9) and (4.10). The process is assumed to have converged when each of ΔP2
, ΔP3, ΔP4 , ΔP5 , ΔQ2 , ΔQ3 and ΔQ4 is below a small pre-specified value. At this point the
process is terminated.

Sometimes to accelerate computation in the P-Q buses the voltages obtained from (4.12) is
multiplied by a constant. The voltage update of bus- i is then given by

(4.21)

where λ is a constant that is known as the acceleration factor. The value of λ has to be below
2.0 for the convergence to occur. Table 4.4 lists the values of the bus voltages after the 1st
iteration and number of iterations required for the algorithm to converge for different values of
λ. It can be seen that the algorithm converges in the least number of iterations when λ is 1.4
and the maximum number of iterations are required when λ is 2. In fact, the algorithm will start
to diverge if larger values of acceleration factor are chosen. The system data after the
convergence of the algorithm will be discussed later.

IEEE-9 bus system power flow analysis using Gauss-Seidel method


Voltage of all nine buses using Gauss-seidel method is shown I table below. This table also
contain the power loss across each line (reactive and active). Fundamental of finding Y-bus is
identical and traditional. The value of error took by us is 0.000001 and the total no. of iterations
is 136.

Bus Number Voltage (pu)


1 1.0400
2 1.0250
3 1.0250
4 1.0000
5 1.0000
6 1.0000
7 1.0000
8 1.0000
9 1.0000
Voltage pu
1.05

1.04 1.04

1.03
1.025 1.025
1.02

1.01

1 1 1 1 1 1 1

0.99

0.98
1 2 3 4 5 6 7 8 9

Fig: Voltage profile of IEEE-9 bus system using Gauss Seidel method
Chapter 6: Newton-Raphson Method

Let us assume that an n -bus power system contains a total np number of P-Q buses while the
number of P-V (generator) buses be ng such that n = np + ng + 1. Bus-1 is assumed to be the
slack bus. We shall further use the mismatch equations of ΔPi and ΔQi given in (4.9) and (4.10)
respectively. The approach to Newton-Raphson load flow is similar to that of solving a system
of nonlinear equations using the Newton-Raphson method: At each iteration we have to form
a Jacobian matrix and solve for the corrections from an equation of the type given in (4.11).
For the load flow problem, this equation is of the form

(6.1)

where the Jacobian matrix is divided into submatrices as

(6.2)

It can be seen that the size of the Jacobian matrix is ( n + np − 1) x ( n + np −1). For example
for the 5-bus problem. this matrix will be of the size (7 x 7). The dimensions of the submatrices
are as follows:

J11: (n − 1)  (n − 1), J12: (n − 1)  np, J21: np  (n − 1) and J22: np  np

The submatrices are

(6.4)
(6.5)

(6.6)

(6.7)

Load Flow Algorithm: The Newton-Raphson procedure is as follows:

Step-1: Choose the initial values of the voltage magnitudes |V| (0) of all np load buses and n −
1 angles δ (0) of the voltages of all the buses except the slack bus.

Step-2: Use the estimated |V|(0) and δ (0) to calculate a total n − 1 number of injected real power
Pcalc(0) and equal number of real power mismatch ΔP (0) .

Step-3: Use the estimated |V| (0)


and δ (0) to calculate a total np number of injected reactive
power Qcalc(0) and equal number of reactive power mismatch ΔQ (0) .

Step-3: Use the estimated |V| (0) and δ (0) to formulate the Jacobian matrix J (0).

Step-4: Solve (4.30) for δ (0) and Δ |V| (0) ÷ |V| (0).

Step-5: Obtain the updates from


(6.8)

(6.9)

Step-6: Check if all the mismatches are below a small number. Terminate the process if yes.
Otherwise go back to step-1 to start the next iteration with the updates given by (6.8) and (6.9).

Solution of Newton-Raphson Load Flow

The Newton-Raphson load flow program is tested on the system of Fig. 4.1 with the system
data and initial conditions given in Tables 4.1 to 4.3. From (4.41) we can write

Similarly, from (6.7) we have

Hence from (6.6) we get

In a similar way the rest of the components of the matrix J11(0) are calculated. This matrix is
given by

For forming the off-diagonal elements of J21 we note from (6.10) that
Also, from (6.11) the real power injected at bus-2 is calculated as

Hence from (6.12) we have

Similarly, the rest of the elements of the matrix J21 are calculated. This matrix is then given as

For calculating the off diagonal elements of the matrix J12 we note from (6.12) that they are
negative of the off diagonal elements of J21 . However, the size of J21 is (3 X 4) while the size
of J12 is (4 X 3). Therefore, to avoid this discrepancy we first compute a matrix M that is given
by

The elements of the above matrix are computed in accordance with (6.13) and (6.14). We can
then define
Furthermore, the diagonal elements of J12 are overwritten in accordance with (6.15). This
matrix is then given by

Finally, it can be noticed from (4.50) that J22 = J11 (1:3, 1:3). However, the diagonal elements
of J22 are then overwritten in accordance with (6.16). This gives the following matrix

From the initial conditions the power and reactive power are computed as

Consequently, the mismatches are found to be

Then the updates at the end of the first iteration are given as

IEEE-9 bus system power flow analysis using Newton-Raphson method


Voltage of all nine buses using Newton-Raphson method is shown I table below. This table
also contain the power loss across each line (reactive and active). Fundamental of finding Y-
bus is identical and traditional. The value of error took by us is 0.000001 and the total no. of
iterations is 136.
Bus Number Voltage (pu)
1 1.0400
2 1.0250
3 1.0250
4 1.0260
5 0.9958
6 1.0128
7 1.0258
8 1.0159
9 1.0324

Voltage (pu)
1.05

1.04 1.04

1.03 1.0324
1.025 1.025 1.026 1.0258
1.02
1.0159
1.0128
1.01

1
0.9958
0.99

0.98

0.97
1 2 3 4 5 6 7 8 9

Fig: Voltage profile of IEEE-9 bus system using Newton-Raphson method.


Chapter 7: Fast-Decoupled Method
Consider the power flow problem defined in polar coordinating Equation 7.1,

(7.1)

which is known in the literature [16–18] as

(7.2)

In general, in a given power system, the real power flow is considered to be much less sensitive
to the change in voltage magnitude than to the change in voltage angle. Therefore, the elements
of submatrix N (or J*2) can be considered to be zero as an approximation. Likewise, the
reactive power is much less sensitive to change in voltage angle and voltage Magnitude. Thus,
the elements of Sub-matrix J (or J3) can be considered to be zero. Therefore, equation 7.3
becomes

(7.3)

(7.4)

(7.5)

(7.6)

Note that the solution involves the inversion of H and L matrices whose dimensions are
approximately one-fourth the full-size Jacobian matrix. It is apparent that this approach
significantly reduces not only the computation time for each iteration but also the computer
memory requirement.

(7.7)
Consider the decoupled load flow of Equations 8.47 and 8.48 where the elements of submatrices H and L can be
expressed as

(7.8)

(7.9)

which are known as the two decoupled power flow equations in the literature [28]. They are
solved separately, so that

(7.10)

(7.11)

(7.12)

(7.13)

(7.14)

(7.15)

One can observe that even though the decoupled load flow method reduces the memory storage
requirements considerably, it still requires significant amounts of computational effort. Thus,
Stott and Alsac [30] have developed the fast-decoupled power flow method.

IEEE-9 bus system power flow analysis using Fast-Decoupled method


Voltage of all nine buses using Newton-Raphson method is shown I table below. This table
also contain the power loss across each line (reactive and active). Fundamental of finding Y-
bus is identical and traditional. The value of error took by us is 0.000001 and the total no. of
iterations is 136.
Bus Number Voltage (pu)
1 1.0400
2 1.0250
3 1.0250
4 1.0260
5 0.9958
6 1.0128
7 1.0258
8 1.0159
9 1.0324

Voltage (pu)
1.05

1.04 1.04

1.03 1.0324
1.025 1.025 1.026 1.0258
1.02
1.0159
1.0128
1.01

1
0.9958
0.99

0.98

0.97
1 2 3 4 5 6 7 8 9

Fig: Voltage profile of IEEE-9 bus system using Fast-Decoupled method.


Chapter 8: References

1. Brown, H. E., Solution of Large Networks by Matrix Methods. Wiley, New York, 1975.
2. Shipley, R. B., Introduction to Matrices and Power Systems. Wiley, New York, 1976.
3. Dunstan, L. E., Digital load flow studies. Trans. Am. Inst. Electr. Eng., Part 3A 73, 825–831
(1954).
4. Ward, J. B., and Hale, H. W., Digital computer solution of power flow problems. Trans. Am.
Inst. Electr. Eng., Part 3 75, 398–404 (1956).
5. Glimn, A. F., and Stagg, G. W., Automatic calculation of load flows. Trans. Am. Inst. Electr.
Eng., Part 376, 817–828 (1957).
6. Trevino, C., Cases of difficult convergence in load flow problems. IEEE Power Eng. Soc.
Winter Power Meet., 1971, Pap. No. 71 CP 62-PWR (1971).
7. Hubert, F. J., and Hayes, D. R., A rapid digital computer solution for power system network
load-flow. IEEE Trans. Power Appar. Syst. PAS-90, 934–940 (1971).
8. Maslin, W. W. et al., A power system planning computer program package emphasizing
flexibility and compatibility. IEEE Power Eng. Soc. Summer Power Meet., 1970, Pap. No. 70
CP 684-PWR (1970).
9. Podmore, R., and Undrill, J. M., Modified nodal iterative load flow algorithm to handle
series capacitive branches. IEEE Trans. Power Appar. Syst. PAS-92, 1379–1387 (1973).
10. Treece, J. A., Bootstrap Gauss–Seidel load flow. Proc. IEEE 116, 866–870 (1969).
11. Gupta, P. P., and Humphrey Davies, M. W., Digital computers in power system analysis.
Proc. Inst. Electr. Eng., Part A 109, 383–404 (1961).
12. Brameller, A., and Denmead, J. K., Some improved methods of digital network analysis.
Proc. Inst. Electr. Eng. Part A 109, 109–116 (1962).
13. Brown, H. E., Cater, O. K., Happ, H. H., and Person, C. E., Power flow solution by
impedance matrix iterative method. IEEE Trans. Power Appar. Syst. PAS-82, 1–10 (1963).
14. Freris, L. L., and Sasson, A. M., Investigations on the load-flow problem. Proc. Inst. Electr.
Eng. 114, 1960 (1967).
15. Brown, H. E., Cater, G. K., Happ, H. H., and Person, C. E., Z-matrix algorithms in load-
flow programs. IEEE Trans. Power Appar. Syst. PAS·S7, 807–814 (1968).
16. Van Ness, J. E., Iteration methods for digital load flow studies. Trans. Am. Inst. Electr.
Eng., Part 3 78, 583–588 (1959).
17. Van Ness, J. E., Convergence of iterative load flow studies. Trans. Am. Inst. Electr. Eng.
78, 1590–1597 (1960).
18. Van Ness, J. E., and Griffin, J. H., Elimination methods for load-flow studies. Trans. Am.
Inst. Electr. Eng. 80, 299–304 (1961).
19. Tinney, W. F., and Hart, C. E., Power flow solution by Newton’s method. IEEE Trans.
Power Appar. Syst. PAS-86, 1449–1456 (1967).
20. Britton, J. P., Improved area interchange control for Newton’s method load flows. IEEE
Trans. Power Appar. Syst. PAS-88, 1577–1581 (1969).
21. Dommel, H. W., Tinney, W. F., and Powell, W. L., Further developments in Newton’s
method for power system applications. IEEE Power Eng. Soc. Winter Power Meet., 1970, Pap.
No. 70 CP 161-PWR (1970).
22. Stott, B., Effective starting process for Newton–Raphson load flows. Proc. Inst. Electr.
Eng. 11S, 983– 987 (1971).
23. Britton, J. P., Improved load flow performance through a more general equation form. IEEE
Trans. Power Appar. Syst. PAS·90, 109–116 (1971).
24. Peterson, N. M., and Meyer, W. S., Automatic adjustment of transformer and phase-shifter
taps in the Newton power flow. IEEE Trans. Power Appar. Syst. PAS·90, 103–108 (1971).
24a. Sato, N., and Tinney, W. F., Techniques for exploring the sparsity of the network
admittance matrix. Trans. Am. Inst. Electr. Eng., Part 3 82, 944–949 (1983).
24b. Tinney, W. P., and Walker, J. W., Direct solutions of sparse network equations by
optimally ordered triangular factorization. Proc. IEEE 55, 1801–1809 (1967).
25. Stagg, G. W., and Phadke, A. G, Real-time evaluation of power-system contingencies
detection of steadystate overloads. IEEE Power Eng. Soc. Summer Power Meet., 1970, Pap.
No. 70 CP 692-PWR (1970).
26. Despotovic, S. T., Babic, B. S., and Mastilovic, V. P., A rapid and reliable method for
solving load flow problems. IEEE Trans. Power Appar. Syst. PAS·90, 123–130 (1971).
27. Uemura, K., Power flow solution by a Z-matrix type method and its application to
contingency evaluation. Proc. IEEE Power Ind. Comput. Appl. Conf. 1971, 151–159 (1971).
28. Stott, B., Decoupled Newton load flow. IEEE Trans. Power Appar. Syst. PAS-91, 1955
1959 (1972).
29. Peterson, N. M., Tinney, W. F., and Bree, D. W., Jr., Iterative linear ac power flow solution
for fast approximate outage studies. IEEE Trans. Power Appar. Syst. PAS-91, 2048–2056
(1972).
30. Stott, B., and Alsac, O., Fast decoupled load flow. IEEE Trans. Power Appar. Syst. PAS
93, 859–869 (1974).
Appendix
Code 1: Y-bus matrix formation code

% element# start end r x ysh


data=[1 1 2 0.02 0.04 0.00001;
2 1 3 0.01 0.03 0.000001;
3 2 3 0.0125 0.025 0.00001];
b1=max(data(:,3));
b2=max(data(:,2));
b=max(b1,b2);
a=size(data);
e=a(1,1);
for k=1:e
if (data(k,2)~= 0 | data(k,3)~= 0)
ybus(data(k,2),data(k,3))=-1/(data(k,4)+i*data(k,5));
ybus(data(k,3),data(k,2))=-1/(data(k,4)+i*data(k,5));

ybus(data(k,2),data(k,2))=ybus(data(k,2),data(k,2))+i*data(k,6)/2;

ybus(data(k,3),data(k,3))=ybus(data(k,3),data(k,3))+i*data(k,6)/2;
end
if (data(k,2)~=0)

ybus(data(k,2),data(k,2))=ybus(data(k,2),data(k,2))+1/(data(k,4)+i*d
ata(k,5));
end
if (data(k,3)~=0)

ybus(data(k,3),data(k,3))=ybus(data(k,3),data(k,3))+1/(data(k,4)+i*d
ata(k,5));
end

end

Code 2: Gauss-Iteration Method


% element # start end r x ysh
datae=[1 4 1 0.0 0.05676 0.0;
2 6 4 0.017 0.092 0.158;
3 9 6 0.039 0.170 0.3580;
4 9 3 0 0.0586 0;
5 9 8 0.0119 0.1006 0.209;
6 8 7 0.0085 0.072 0.149;
7 7 2 0 0.0625 0;
8 7 5 0.032 0.161 0.306;
9 5 4 0.01 0.085 0.176];

e=length(datae);
b=max(max(datae(:,2)),max(datae(:,3)));
ybus(b,b)=0;
for k=1:e
if ((datae(k,2)~=0) && (datae(k,3)~=0))
ybus(datae(k,2),datae(k,3))=ybus(datae(k,2),datae(k,3))-
1/(datae(k,4)+i*datae(k,5));

ybus(datae(k,3),datae(k,2))=ybus(datae(k,2),datae(k,3));

ybus(datae(k,2),datae(k,2))=ybus(datae(k,2),datae(k,2))+1/(datae(k,4
)+i*datae(k,5))+i*datae(k,6)/2;

ybus(datae(k,3),datae(k,3))=ybus(datae(k,3),datae(k,3))+1/(datae(k,4
)+i*datae(k,5))+i*datae(k,6)/2;
else
m=datae(k,2)+datae(k,3);
ybus(m,m)=ybus(m,m)+1/(datae(k,4)+i*datae(k,5));
end
end
% bus # v pg Qg Pl Ql type
datab=[1 1.04 0 0 0 0 0;
2 1.025 1.63 0 0 0 2;
3 1.025 0.85 0 0 0 2;
4 1 0 0 0 0 1;
5 1 0 0 1.25 0.5 1;
6 1 0 0 0.9 0.3 1;
7 1 0 0 0 0 1;
8 1 0 0 1 0.35 1;
9 1 0 0 0 0 1] ;
for k=1:b
pt(k,1)=datab(k,3)-datab(k,5);
qt(k,1)=datab(k,4)-datab(k,6);
end
for k=1:b
if (datab(k,7)== 1)
vbus(k,1)=1;
else
vbus(k,1)=datab(k,2);
end
end

acc=0.00000001;
error=10;
it=0

while (error >= acc)

it=it+1

for k = 2:b
if (datab(k,7) == 1)
A=(pt(k,1)-i*qt(k,1))/conj(vbus(k,1));
c=0;
for h=1:b
if (k ~= h)
c=c+vbus(h,1)*ybus(k,h);
end
end
vbus(k,1)=(A-c)/ybus(k,k);

else
m=0;
for h=1:b

m=m+abs(vbus(k,1)*vbus(h,1)*ybus(k,h))*sin(angle(vbus(h,1)*ybus(k,h)
/vbus(k,1)));
end
A=(pt(k,1)+i*m)/conj(vbus(k,1));
c=0;
for h=1:b
if (k ~= h)
c=c+vbus(h,1)*ybus(k,h);
end
end
v=(A-c)/ybus(k,k);
vbus(k,1)=datab(k,2)*(cos(angle(v))+i*sin(angle(v)));
end

end
ibus=ybus*vbus;
for k=1:b
s(k,1)=vbus(k,1)*conj(ibus(k,1));
end
for k=2:b
dp(k,1)=pt(k,1)-real(s(k,1));
end
error=max(abs(dp))
end

Code 3: Gauss-Seidel Method


% element # start end r x ysh
datae=[1 4 1 0.0 0.05676 0.0;
2 6 4 0.017 0.092 0.158;
3 9 6 0.039 0.170 0.3580;
4 9 3 0 0.0586 0;
5 9 8 0.0119 0.1006 0.209;
6 8 7 0.0085 0.072 0.149;
7 7 2 0 0.0625 0;
8 7 5 0.032 0.161 0.306;
9 5 4 0.01 0.085 0.176];

e=length(datae);
b=max(max(datae(:,2)),max(datae(:,3)));
ybus(b,b)=0;
for k=1:e
if ((datae(k,2)~=0) & (datae(k,3)~=0))

ybus(datae(k,2),datae(k,3))=ybus(datae(k,2),datae(k,3))-
1/(datae(k,4)+i*datae(k,5));

ybus(datae(k,3),datae(k,2))=ybus(datae(k,2),datae(k,3));
ybus(datae(k,2),datae(k,2))=ybus(datae(k,2),datae(k,2))+1/(datae(k,4
)+i*datae(k,5))+i*datae(k,6)/2;

ybus(datae(k,3),datae(k,3))=ybus(datae(k,3),datae(k,3))+1/(datae(k,4
)+i*datae(k,5))+i*datae(k,6)/2;
else
m=datae(k,2)+datae(k,3);
ybus(m,m)=ybus(m,m)+1/(datae(k,4)+i*datae(k,5));
end
end
% bus # v pg Qg Pl Ql type
datab=[1 1.04 0 0 0 0 0;
2 1.025 1.63 0 0 0 1;
3 1.025 0.85 0 0 0 1;
4 1 0 0 0 0 2;
5 1 0 0 1.25 0.5 2;
6 1 0 0 0.9 0.3 2;
7 1 0 0 0 0 2;
8 1 0 0 1 0.35 2;
9 1 0 0 0 0 2] ;
% flat start
for k = 1:b
if (datab(k,7) == 2)
vbus(k,1)=1;
else
vbus(k,1)=datab(k,2);
end
end

for k =1:b
pn(k,1)=datab(k,3)-datab(k,5);
qn(k,1)=datab(k,4)-datab(k,6);
end

% B1

r=0;
for k =2:b
r=r+1;
c=0;
for m=2:b
c=c+1;
b1(r,c)=imag(ybus(k,m));
end
end

acc=0.000001;
error=10;
it=0;

while (error >= acc)


it=it+1;

ibus=ybus*vbus;
for k=1:b
scal(k,1)=vbus(k,1)*conj(ibus(k,1));
end

for k=2:b
dp(k-1,1)=pn(k,1)-real(scal(k,1));
dpv(k-1,1)=dp(k-1,1)/abs(vbus(k,1));
end

r=0;
for k=2:b
if(datab(k,7) == 2)
r=r+1;
dq(r,1)=qn(k,1)-imag(scal(k,1));
dqv(r,1)=dq(r,1)/abs(vbus(k,1));
end
end

dd=-inv(b1)*dpv;

for k=2:b
a=angle(vbus(k,1));
a=a+dd(k-1,1);
vbus(k,1)=abs(vbus(k,1))*(cos(a)+i*sin(a));
end

error=max(abs(dp));
end

r=0;

for k =1:e
r=r+1;
pf(r,1)=k;
pf(r,2)=datae(k,2);
pf(r,3)=datae(k,3);
b=conj(-ybus(datae(k,2),datae(k,3))*(vbus(datae(k,2),1)-
vbus(datae(k,3),1)));
a=vbus(datae(k,2),1)*b;
pf(r,4)=abs(real(a));
pf(r,5)=imag(a);

r=r+1;
pf(r,1)=k;
pf(r,2)=datae(k,3);
pf(r,3)=datae(k,2);
b=conj(-ybus(datae(k,3),datae(k,2))*(vbus(datae(k,3),1)-
vbus(datae(k,2),1)));
a=vbus(datae(k,3),1)*b;
pf(r,4)=abs(real(a));
pf(r,5)=imag(a);

pf(r,6)= abs(pf(r,4)-pf(r-1,4));
pf(r-1,6)=pf(r,6);

end
total_loss=sum(pf(:,6))/2;

Code 4: Newton Raphson Method

% element # start end r x ysh


datae=[1 4 1 0.0 0.05676 0.0;
2 6 4 0.017 0.092 0.158;
3 9 6 0.039 0.170 0.3580;
4 9 3 0 0.0586 0;
5 9 8 0.0119 0.1006 0.209;
6 8 7 0.0085 0.072 0.149;
7 7 2 0 0.0625 0;
8 7 5 0.032 0.161 0.306;
9 5 4 0.01 0.085 0.176];

e=length(datae);
b=max(max(datae(:,2)),max(datae(:,3)));
ybus(b,b)=0;
for k=1:e
if ((datae(k,2)~=0) & (datae(k,3)~=0))

ybus(datae(k,2),datae(k,3))=ybus(datae(k,2),datae(k,3))-
1/(datae(k,4)+i*datae(k,5));

ybus(datae(k,3),datae(k,2))=ybus(datae(k,2),datae(k,3));

ybus(datae(k,2),datae(k,2))=ybus(datae(k,2),datae(k,2))+1/(datae(k,4
)+i*datae(k,5))+i*datae(k,6)/2;

ybus(datae(k,3),datae(k,3))=ybus(datae(k,3),datae(k,3))+1/(datae(k,4
)+i*datae(k,5))+i*datae(k,6)/2;
else
m=datae(k,2)+datae(k,3);
ybus(m,m)=ybus(m,m)+1/(datae(k,4)+i*datae(k,5));
end
end
% bus # v pg Qg Pl Ql type
datab=[1 1.04 0 0 0 0 0;
2 1.025 1.63 0 0 0 1;
3 1.025 0.85 0 0 0 1;
4 1 0 0 0 0 2;
5 1 0 0 1.25 0.5 2;
6 1 0 0 0.9 0.3 2;
7 1 0 0 0 0 2;
8 1 0 0 1 0.35 2;
9 1 0 0 0 0 2];
for k = 1:b
if (datab(k,7) == 2)
vbus(k,1)=1;
else
vbus(k,1)=datab(k,2);
end
end

for k =1:b
pn(k,1)=datab(k,3)-datab(k,5);
qn(k,1)=datab(k,4)-datab(k,6);
end

it=0;
acc=0.00001;
error = 10;
while (error > acc)

it=it+1;
ibus=ybus*vbus;
for k=1:b
scal(k,1)=vbus(k,1)*conj(ibus(k,1));
end
% J1
r=0;
for k = 2:b
r=r+1;
c=0;
for m=2:b
if (datab(m,7)== 2)
c=c+1;
if(k==m)

j1(r,c)=real(scal(k,1))/abs(vbus(k,1))+abs(vbus(k,1))*real(ybus(k,k)
);
else

j1(r,c)=abs(vbus(m,1)*ybus(m,k))*cos(angle(ybus(k,m)*vbus(m,1)/vbus(
k,1)));
end
end
end
end

% J2
r=0;
for k = 2:b
r=r+1;
c=0;
for m=2:b
if (datab(m,7)~= 0)
c=c+1;
if(k==m)
j2(r,c)=-imag(scal(k,1))-
(abs(vbus(k,1)))^2*imag(ybus(k,k));
else
j2(r,c)=-
abs(vbus(k,1)*vbus(m,1)*ybus(m,k))*sin(angle(ybus(k,m)*vbus(m,1)/vbu
s(k,1)));
end
end
end
end

%J3
r=0;
for k = 2:b
if( datab(k,7)== 2)
r=r+1;
c=0;
for m=2:b
if (datab(m,7)== 2)
c=c+1;
if(k==m)
j3(r,c)=imag(scal(k,1))/abs(vbus(k,1))-
abs(vbus(k,1))*imag(ybus(k,k));
else
j3(r,c)=-
abs(vbus(m,1)*ybus(m,k))*sin(angle(ybus(k,m)*vbus(m,1)/vbus(k,1)));
end
end
end
end

end

% J4
r=0;
for k = 2:b
if (datab(k,7) == 2)
r=r+1;
c=0;
for m=2:b
c=c+1;
if(k==m)
j4(r,c)=real(scal(k,1))-
(abs(vbus(k,1)))^2*real(ybus(k,k));
else
j4(r,c)=-
abs(vbus(k,1)*vbus(m,1)*ybus(m,k))*cos(angle(ybus(k,m)*vbus(m,1)/vbu
s(k,1)));
end

end
end
end
J=[j1 j2;j3 j4];
r=0;
for k=2:b
r=r+1;
dp(r,1)=pn(k,1)-real(scal(k,1));
end

r=0;
for k=2:b
if(datab(k,7)== 2)
r=r+1;
dq(r,1)=qn(k,1)-imag(scal(k,1));
end
end

dpq=[dp;dq];

dvd=inv(J)*dpq;
npq=length(dvd)-b+1;
for k=1:npq
dv(k,1)=dvd(k,1);
end

r=0;
for k=npq+1:length(dvd)
r=r+1;
dd(r,1)=dvd(k,1);
end

r=0;
for k=2:b
r=r+1;
new=angle(vbus(k,1))+dd(r,1);
vbus(k,1)= abs(vbus(k,1))*(cos(new)+i*sin(new));
end

r=0;
for k= 2:b
if(datab(k,7)==2)
r=r+1;
new=abs(vbus(k,1))+dv(r,1);

vbus(k,1)=new*(cos(angle(vbus(k,1)))+i*sin(angle(vbus(k,1))));
end
end
error=max(abs(dp));
end

Case 5: Fast-Decoupled Method

% element # start end r x ysh


datae=[1 4 1 0.0 0.05676 0.0;
2 6 4 0.017 0.092 0.158;
3 9 6 0.039 0.170 0.3580;
4 9 3 0 0.0586 0;
5 9 8 0.0119 0.1006 0.209;
6 8 7 0.0085 0.072 0.149;
7 7 2 0 0.0625 0;
8 7 5 0.032 0.161 0.306;
9 5 4 0.01 0.085 0.176];

e=length(datae);
b=max(max(datae(:,2)),max(datae(:,3)));
ybus(b,b)=0;
for k=1:e
if ((datae(k,2)~=0) & (datae(k,3)~=0))

ybus(datae(k,2),datae(k,3))=ybus(datae(k,2),datae(k,3))-
1/(datae(k,4)+i*datae(k,5));

ybus(datae(k,3),datae(k,2))=ybus(datae(k,2),datae(k,3));

ybus(datae(k,2),datae(k,2))=ybus(datae(k,2),datae(k,2))+1/(datae(k,4
)+i*datae(k,5))+i*datae(k,6)/2;

ybus(datae(k,3),datae(k,3))=ybus(datae(k,3),datae(k,3))+1/(datae(k,4
)+i*datae(k,5))+i*datae(k,6)/2;
else
m=datae(k,2)+datae(k,3);
ybus(m,m)=ybus(m,m)+1/(datae(k,4)+i*datae(k,5));
end
end
% bus # v pg Qg Pl Ql type
datab=[1 1.04 0 0 0 0 0;
2 1.025 1.63 0 0 0 1;
3 1.025 0.85 0 0 0 1;
4 1 0 0 0 0 2;
5 1 0 0 1.25 0.5 2;
6 1 0 0 0.9 0.3 2;
7 1 0 0 0 0 2;
8 1 0 0 1 0.35 2;
9 1 0 0 0 0 2];
for k = 1:b
if (datab(k,7) == 2)
vbus(k,1)=1;
else
vbus(k,1)=datab(k,2);
end
end

for k =1:b
pn(k,1)=datab(k,3)-datab(k,5);
qn(k,1)=datab(k,4)-datab(k,6);
end

% B1

r=0;
for k =2:b
r=r+1;
c=0;
for m=2:b
c=c+1;
b1(r,c)=imag(ybus(k,m));
end
end
%B2
r=0;
for k =2:b
if(datab(k,7)== 2)
r=r+1;
c=0;
for m=2:b
if(datab(m,7)== 2)
c=c+1;
b2(r,c)=imag(ybus(k,m));
end
end
end
end
acc=0.000001;
error=10;
it=0;

while (error >= acc)


it=it+1;

ibus=ybus*vbus;
for k=1:b
scal(k,1)=vbus(k,1)*conj(ibus(k,1));
end

for k=2:b
dp(k-1,1)=pn(k,1)-real(scal(k,1));
dpv(k-1,1)=dp(k-1,1)/abs(vbus(k,1));
end

r=0;
for k=2:b
if(datab(k,7) == 2)
r=r+1;
dq(r,1)=qn(k,1)-imag(scal(k,1));
dqv(r,1)=dq(r,1)/abs(vbus(k,1));
end
end
dd=-inv(b1)*dpv;
dv=-inv(b2)*dqv;
for k=2:b
a=angle(vbus(k,1));
a=a+dd(k-1,1);
vbus(k,1)=abs(vbus(k,1))*(cos(a)+i*sin(a));
end

r=0;
for k=2:b
if(datab(k,7) == 2)
r=r+1;
a=abs(vbus(k,1));
a=a+dv(r,1);
aa=angle(vbus(k,1));
vbus(k,1)=a*(cos(aa)+i*sin(aa));
end
end

error=max(abs(dp))
end

You might also like