Simulation and Modeling of Detailed Load flow Analysis for the 400kVA and 132kVA Iraqi Grid

A load flow program is developed using MATLAB and based on the Newton–Raphson method, which shows very fast and efficient rate of convergence as well as computationally the proposed method is very efficient and it requires less computer memory through the use of sparsing method and other methods in programming to accelerate the run speed to be near the real time. The designed program computes the voltage magnitudes and phase angles at each bus of the network under steady–state operating conditions. It also computes the power flow and power losses for all equipment, including transformers and transmission lines taking into consideration the effects of off–nominal, tap and phase shift transformers, generators, shunt capacitors, shunt inductors, line reactors and bus reactors. Thus, overloaded transformers and transmission lines are identified, and remedial measure can be designed and implemented. It also provides the ability of tie lines, area splitting, and contingency analysis. Any generator station(s) or busbar(s) that exceeds the specified operation limits will be automatically checked and flagged and then the program will automatically suggest the best solution to the problem. It also automatically checks whether the system is sub divided into sub areas or not. If yes, it will find the solution for each area separately. A complete report about the results and the state of the system (the violated generators, busbars, and transmission lines, the required modifications to overcome the violations, the names of the areas splitted,...) will be displayed in working window as well as generating a text file containing all details . It is important to mention that this program is used by the national control center of the Ministry of Electricity and its efficiency was tested through applying the data of the two major Iraqi networks (400kV and 132kV), the program shows very accurate results and provides efficient notes about the status of the networks.


INTRODUCTION
Power flow analysis is the solution for the static operating condition of a power system [T. Gonen]. It is the most frequently performed of routine power network calculations in digital computers. Power flow analysis is used in power system planning, operational planning, and operations/control. It is also employed in multiple assessments, stability analysis, and system optimization [H. E. Brown].
The well-established power flow methods (Newton-Raphson N-R, Gauss-Seidel, and Fast-Decoupled) are all based on classical methodologies of applied mathematics. Classical computer programs for solving the power flow based on these methods have been in practical use for a relatively long number of years. All of these programs met with strict limitations to power network size and calculation speed [J. Mahseredjian]. With the development of objectoriented programming and operations methodology new boundaries are being set for power flow calculations [Bhabani Sankar Hota, G¨oran Andersson]. This paper presents fundamental concepts of applying object-oriented programming algebra to power system modeling of a package for the purposes of power flow, contingency, and tie line calculations.
This package is designed to perform a steady state analysis of a power transmission or distribution network. The algorithm consists of an efficient and robust method based on the recursive solution of a full N-R AC Load flow. Because of the size and complexity of the problem much effort has been devoted to the improvement of convergence, reliability, accuracy, reduction of computation time and computer storage requirements. This paper describes the implementation of N -R method to solve the load flow, contingency and tie lines problems using MATLAB software package all of them in one detailed program. It is subdivided into three parts; the first part presents the method used and the implementation of the algorithm. The second parts deals with the program structure and facilities. Finally the third part takes a case study to check the efficiency of the program with a given results and conclusions.

SOLUTION OF THE LOAD FLOW PROBLEM USING NEWTON-RAPHSON METHOD
The load flow problem can be solved by the Newton -Raphson (N-R) method using a set of nonlinear equations to express the specified real and reactive power in terms of bus voltages. The power at bus p is [T. Gonen , YongLi Zhu]: P p -jQ p = E P ×I p (1) (2) Where E p = e p + jf p , Y pq = G pq + jB pq Hence Separating the real and imaginary parts: The N-R method requires that a set of linear equations be formed expressing the relationship between the changes in real and reactive powers and the components of bus voltages.
Note that P i and Q i are functions of e i , e j , f i , and f j . For each PQ load bus, P i and Q i can be calculated from eq. (3), for some estimated values of e and f. After each iteration, the calculated values of P p and Q p are compared against the known (or specified) values of P s and Q s . also, for each PV generator bus, the magnitude of the bus voltage can be calculated from the estimated values of e and f as (6) Then the calculated voltage magnitude is compared with its specified value. Therefore, the corrected values for the k th iteration can be expressed as The resultant values of ∆P p (k) , ∆Q p (k) , and ∆V p  2 can be used to determine the changes in the real and imaginary components of the bus voltages. Since the changes in P, Q, and V 2 are related to the changes in e and f, it is possible to express them in a general form as: Where the coefficient matrix is the jacobian and the 1 st bus is the slack bus.
Equations for determining the elements of the jacobian can be derived from the bus power equations. The real and reactive power from eq.(4 ) and eq. (5) is: Differentiating the off-diagonal elements of eq. (11), and eq. (12) then:  Differentiation the diagonal elements of eq. (11), and eq. (12) then: The equation for the current at bus p is: Substituting eq.(16) and eq.(17) in eq.(11) and eq.(12), then: and eq. (14) will be: Given an initial set of bus voltages, the real and reactive powers are calculated from eq. (18). The change in power is the difference between the specified and calculated values: The estimated bus voltages and calculated powers are used to compute bus currents in order to evaluate the elements of the jacobian. The linear set of eq.(10) can be solved for ∆f p and ∆e p , p=1,2,…,n-1, by a direct or iterative methods. Then, the new estimates for bus voltages are: The process is repeated until ∆P p k , ∆Q p k , and ∆V p  2 for all buses are within a specified limit.

PROBLEM FORMULATION
The Newton-Raphson method is a very powerful load flow solution technique that incorporates firstderivative information when computing voltage updates. Normally, only 3 to 5 iterations are required to solve the load flow problem, regardless of system size (It is generally quadratic in convergence) [Mbuli].
Typically the power flow is formulated to minimize the production cost and satisfy some constraints, including entire power flow equations, generation limits, voltage ranges and line transfer capability… etc. The general steps for problem formulation are goes in the following sequence [M. delimar, Ian A. Hiskens] 1. Inputting the data 2. Converting the transformers (phase-shift transformers and tap transformers) to their π -equivalent. 3. Performing contingency analysis (removing transmission lies, busbars, and/or generators) if it is required. 4. Y-matrix formulation (admittance) for the area and for each area in case of area splitting. 5. Starting the iterative solving algorithm program (Newton Raphson method). 6. If the parameters converged within the specified tolerance then stop the iteration and print the results else continue with the iterative method of step 4. 7. Flagging the generators, that violated their reactive generation limit and then finding the correct operating voltage of the generators that maintain the reactive generation of the generators within the limit. This is can be done by converting the violated P-V busbars to P-Q busbars and the reactive power demand at these busbars are set equal to negative of the violated limit. The program (step 5) is run again to solve for the voltage magnitude at these busbars. 8. Flagging the busbars which violated their voltage magnitude limit then finding the required per unit MVAR that have to be connected at the violated busbars to bring the voltages back within the limits.
Converting the violated P-Q busbars to P-V busbars, setting the violated busbars to the violated voltage limit, does this and the power generation at these busbars is set equal to zero. The program (step 5 for Newton Raphson method) is run again to solve for the generation reactive powers at these busbars. 9. Modifying the system (setting the new values of voltages for the violated P-V busbars and adding the MVAR to the violated P-Q busbars) the program will run again (step5) and finds the final results 10. Repeat step 4 for the next area in case of area splitting. 11. End The program was written in a structured format. It asks the user to supply the name of the text file that contains the input data. The expected output will be two text files provide a record of all the results one for the flow results while the other for the bus results a third text file may be generated if we have tie lines. The sequence of steps for the load flow solution is shown in flowchart (see figure 1)

PACKAGE STRUCTURE
The package has the following options:

I-Load Flow Analysis
This function starts the execution of the program without the facilities of contingency and tie line but with the optional system correction facility.

II-Contingency Analysis
This function starts the execution of the program without the facility of tie line but with the contingency and the optional system correction facilities. In this case the outage of branches, buses (with all connected lines), and the outage of generation stations are permissible for the user through the execution of the program. For the purpose of planning, control, fault estimation…etc

III-Tie Line Analysis
This function starts the execution of the program without the facility of contingency but with the tie line and the optional system correction facilities. Large-scale power systems usually consist of several, or perhaps many, individual electric utility companies. In these cases, each area may have a desired net input or output power to satisfy sales and purchase agreements. The area interchange feature in a load flow program sums the tie line lows into each area for a net area power input. If these nets are not the desired values, to within a few megawatts, then an area-control generator within the area is adjusted by the error amount. The sum of all input powers for all areas must, of course, be zero [De Oliveira].

PACKAGE FACILITIES
Some of the important facilities of the package are a) Input Data File Is a text file, which contains detailed information about the network to be solved (buses, branches, capacitors, reactors, tap changers (for all types of transformers), cables).

b) Voltage and VAR Compensation
This paper looks at the problem of placing Static VAR Compensators (SVC) to provide maximum transfer capability for all possible generation mixes. The margin to low voltage limit is one of the quantities used to determine power system transfer capability. A fast method for finding the location of SVC systems that will have the greatest impact on the low voltage margin is used.
The program asks the user whether he wants the program automatically diagnose the network violations after convergence to the solution within the specified tolerance or not, if yes, it will check and flag any violation in busbars voltages (in case of load busbars) and generators reactive power (in case of generator busbars), after that it will automatically fix them and gives the best solution to the problem then repeat solving of the network with the suggested modification without clearing the previous (actual) results.

c) Splitting (Self Insertion)
This software is designed to automatically identify the electrical island and nodal connectivity of a network. It checks the network whether it is subdivided into areas or not and tell the user if yes with the display of the names of each area busbars, then tell the program to run each area alone with the monitoring of each area selected slack busbare.

d) Multi Area
The software takes into consideration the case of tie lines and the problem of power transfer between countries.

e) Output Reports
The output results consists of two reports (three in case of tie line) one for bus results showing generated and/or consumed power at each busbare, also shows the removed buses or transmission lines in case of contingency analysis and the results of each area in case of area splitting all of these information are shown before and after modification (compensation) in case of voltage or Q violation. The second report for the flow results showing the power flow and losses in the transmission lines, also shows and flag the overloaded transmission lines (lines that exceed the rated MVA of the line), all of these information are shown before and after modification (compensation) in case of voltage or Q violation. The third report is automatically generated in case of multi area (tie line), which contains information about the required modification on the areas regulating generators in order to give the specified power transfer.

f) User Error Detection
When the user inputs any invalid, or out of range data the program flags theses errors for example, in contingency analysis, when the user try to remove a branch and he enters the sending and receiving buses of not found branch, the program will flag this entrance error, also when the user try to remove a generation station, or part of the generation, the program display an error message when the entered busbare identifier is not generator busbare or when the required amount of generation is out of the generation capability, and so on.

g) Visual Display
The package provide a visual link with the user, for example, figure 2 shows the main menu of choices which appear for the user when he starts the execution of the program, clicking any one of these three choices will make the package execute the corresponding program, when the user clicks "CONTINGENCY" bottom, another menu will appear (figure 3) asking him to choose which type of contingency he wants to done, if he clicks "REMOVING BUSBARS" for example, a third menu will appear (figure 4) asking him to enter the number of busbars he wants to remove, and so on.

CASE STUDY
To demonstrate the application of power for analyzing the performance of a power system, a 15-bus test system is considered [M. Kezunovic]. The one-line diagram of the test system is shown in figure 5. The system power base used is 100 MVA, and the voltage bases are selected to match the nominal voltages in various parts of the system. The input data file are provided in figure 6 in which transformer data of fixed-tap, which is set at 100%, and the percent resistances and reactances given are based on the device ratings, the system load data, and the system generator data are shown also. The generators at buses 1 and 4 represent infeeds from the neighboring power system that is charged with the bulk-power generation and transmission in the region. The South generator is connected to bus 1, which is chosen as slack bus.
The transmission line parameters are calculated and converted to per unit based on the chosen bases. The transformer impedances are also automatically converted to per unit based on system bases. The load data and generator data are, likewise, automatically converted to system bases. The system input bus data are given in which a "flat voltage" start is assumed; that is, the voltage phase angle at each bus is set equal to zero, while the voltage magnitude at each load bus is set equal to 1.0 per unit. The voltage at each generator bus is held at the specified value provided the generator reactive power stays within specified minimum and maximum limits. The test system was analyzed using the software package. A converged solution was reached in 3 iterations. The bus data from the converged solution are shown in figure 7. Figure 8 shows another results when bus 12 is removed through the application of contingency analysis program.

RESULTS
The program flagged the West generator as having violated its reactive generation limit. As can be seen from figure 6, the reactive power generated by the West generator is 1.18 per unit, exceeding its upper limit of 0.9 per unit. This means that the specified voltage at bus 13 is too high, and the generator cannot maintain it at this level. To find the correct operating voltage of the generator, the P-V bus 13 is automatically (if we choose the correction facility of the package) converted to a P-Q bus and the reactive power demand at this bus is set equal to the negative of the violated limit Q G max , or -0.90 per unit. The program was run again to solve for the voltage magnitude at this bus. It was found to be 1.00 per unit.
The program also automatically checks all bus voltages and flags those that are less than 0.95 per unit or higher than 1.05 per unit. The voltages at load buses 14 and 15 are 0.935 and 0.922 per unit, respectively, which are both less than the minimum allowable level of 0.95 per unit. These P-Q buses are converted to P-V buses, with their power generations set equal to zero. The voltage magnitudes are set equal to the violated limit V min, or 0.95 per unit. The program is run again to find the generator reactive powers at buses 14 and 15. These are equal to the per-unit MVAR of the capacitors that have to be connected at the two buses to bring the voltages back within limits. These are 0.116 per unit and 0.139 per unit for buses 14 and 15, respectively.
Finally, with the generator voltage at bus 13 set to 1.00 per unit and capacitors of 0.116 and 0.139 per unit MVAR connected to buses 14 and 15, respectively, the program was run again. The final bus results are presented in figure 7 also. It may be noted that all previous constraint violations have been resolved. Another set of results (not shown in this paper) is available considering the power flow and losses through the transmission lines before and after correction of the system. Figure 8 shows the results when we remove bus 12 from the network (see figure 5). The results show that due to the removal of this bus (with all its connections): bus 13 is disconnected from the circuit and hence removed from the analysis of the system (because it has no effect on the system) also the results show that the system is divided into two areas, the first one with first 11 buses and the second with two buses (14, 15). Here, the contingency analysis is performed without the facility of correction. Also there is another set of results (not shown in this paper) that show the power flow and losses through the transmission lines also shows the removed busbars.

CONCLUSION
In this paper effective power system operation requires power system engineers and operators to analyze vast amounts of information. In systems containing thousands of buses, a key challenge is to present this data in a form such that the user can assess the state of the system in an intuitive and quick manner. This is particularly true when trying to analyze relationships between actual network power flows, the scheduled power flows, and the capacity of the transmission system. With restructuring and the move towards having a single entity, such as an independent system operator or pool, operate a much larger system; this need has become more acute. This paper presents power system visualization technique to help in this task.
One contribution of the paper is introducing an efficient power flow model; obviously much computing time is saved. By observation, the time of computing the whole program running time. The efficiency is shown by comparison with a MATLAB based programming. The developed program based on Newton method is promising to be used to solve the load flow problem of large size practical power system because of its high efficiency in modeling power system and computing the Jacobian of power flows.