Enhancing energy utilization efficiency of Pakistani system considering FACTS devices and distributed generation: Feasibility study

In recent years, voltage stability issues have become a serious concern with regard to the safety of electrical systems, these issues are more evident and have wider consequences in vertical networks with an insufficient reactive power reserve. Pakistan is currently suffering from the worst energy crisis in its history. Owing to an increase in energy demand, the current transmission system is becoming increasingly inadequate. It has thus become necessary to reduce losses and enhance the system voltage profile for more efficient energy utilization. In this study, the main emphasis is on assessing the feasibility of using flexible AC transmission system devices and distributed generation to compensate power failures on the power lines of the Pakistani power transmission system. The load flow and contingency analyses are performed on a 132 kV transmission system that feeds power to the Quetta electric supply company. The region of Baluchistan is studied to evaluate the effectiveness of the proposed method. The system is simulated using NEPLAN, which accurately models the details of all system elements and the optimal power flow. The simulation results indicate that the proposed method helps reduce system losses, voltage deviation, and power flow congestion, with all system constraints within permissible limits.


Introduction1
Pakistan is a developing country and its power transmission network plays a key role in the electrical power system. Currently, Pakistan is facing an energy crisis owing to the increasing energy demand and the gap between power generation and consumption [1] . The modern power systems need to adapt to the increasing power demand, and therefore, it is necessary that they use all available transmission network resources. To this end, Pakistan will need to implement serious measures to address these deficiencies and overcome the performance issues of the current power system. Power consumption increases daily because of the increase in the industrial load demand caused by the lack of generation lines and monitoring; thus, all these issues need to be integrated to meet the Manuscript  increasing electricity demand [2] . Further, there is an urgent need to increase the efficiency of the existing infrastructure to improve energy production. The current energy system faces severe challenges that affect its performance; for example, voltage regulation, harmonic, system imbalance, load balancing, excess neutral current, and power system grid interruptions, severely affect system performance and efficiency [3] . These problems can indeed lead to the collapse of the energy sector in the future. In Pakistan, power line losses are considerably higher than those in other countries; further, the electricity transmission and distribution losses are the highest in the region of Baluchistan. The average distribution loss in Pakistan is around 20%, and for some distribution companies, it is 38%. These losses increase each year, and it has become an important challenge for the country [4] . Pakistan is currently facing a shortfall of 1 266 MW, and the generating target for 2021 is 5 000 MW. An analysis of the renewable energy resources indicated a potential capacity of 167.7 GW. The main objective of differentiating between the energy mixes in the system that is an alternate energy source to increase the power potential has already been evaluated [5] . The daily energy scenario in Pakistan indicates an energy crisis; load shedding occurs for 14-12 hours daily in both rural and urban areas [6] . Therefore, comprehensive control of energy flow in a composite system is necessary to enhance system performance. In addition, the efficiency of the power transmission characteristics needs to be increased to improve stability. The capability to sustain voltage constancy is becoming an increasingly serious problem. In addition, it is necessary to maintain the line voltage within an acceptable voltage range during initial exposure to the specified operating conditions for all system buses. With an increase in demand, transmission systems become increasingly limited, and this increases the susceptibility of the system to voltage instability [7] . Most global electrical systems include connectivity in their utility sector to sustain the load demand, which extends to the interconnection of the distribution sector to inter-regional and international connections. Unfortunately, Pakistan is experiencing the worst energy crisis in its history compared to other developing countries that have the fastest-growing economies of energy; these countries are meeting their energy requirements by exploring the problems and identifying viable solutions. These problems have become a cause of concern in the operation and planning of modern power systems [8] .
The modernization of power electronics technology has provided a unique opportunity to employ flexible AC transmission system (FACTS) devices to ensure that power systems run smoothly. Many power electronics-based devices, called FACTS devices, thyristor-controlled series capacitors (TCSC), and static var compensators (SVCs) have been implemented, and they are effectively used for voltage control, power flow control, improved transient stability, and minimum loss. Further, these devices are a costeffective option for enhancing the power capacity of the transmission network [9] . System efficiency can be improved by using two DG units and reducing the abovementioned losses. This indicates that power is generated at the network using renewable energy sources that can provide low-cost electricity and advanced power reliability and safety with fewer environmental changes compared to an outdated power generator [10] . An LC filter three-phase inverter is extensively used in various industrial areas, and it is mostly employed in nonconnected power grids. A power quality criterion for industries is the ability to increase power generation over time; more advanced and cost-effective control approaches are required to achieve this goal without affecting system stability [11] . A load-flow study was performed to determine all parameters of the system essential to determine the system power loss and voltage profile. Many topologies can be used to improve power flow considerations. However, the specific and precise topology is still being developed within the time limit [12] . Power transmission lines between companies often face congestion, which causes them to overload. The modern power system is a complex network, and for this study, an N-1 contingency analysis is performed to identify the most severed transmission lines in such a network. These lines are considered for the analysis to improve system performance [13] .
This paper proposes a 132 kV transmission network model that uses a FACTS device, thyristor-controlled series capacitors (TCSC), and static var compensator (SVC) and two DG units. Using the TCSC and SVC in the power network, the dynamic and transient stability, voltage stability, and power transfer capability in the transmission lines can be improved, along with power development, voltage regulation, and loss mitigation. Owing to system security constraints, the combination of the SVC and the TCSC is the most suitable and economical. Through reactive power injection and network absorption, bus voltage is controlled within system requirements via the SVC. This indicates that a significant amount of losses and costs can be overcome using the TCSC device in the power system [14][15] . Therefore, the TCSC is used in the analysis and determination of system difficulties using NEPLAN, it is used when performing load flow, optimal power flow, and contingency analyses that are easy to understand and help develop system configuration. To avoid system losses, load flow analysis is performed to determine parameters such as voltage drop, bus overvoltage, active and reactive power, optimal power flow, and voltage deviation; these factors help calculate the power loss in the network. After obtaining reliable results compared to the current power system network, costs have considerably reduced compared to the current networks. This study overcomes the issues in the Pakistani power system using real system data to perform analyses and determine solutions for the problems, which will help ensure system stability. A considerable amount of research on the Pakistani power system has been conducted for various cases. However, to the best of our knowledge, studies on 132 kV transmission lines that feed the QESCO network are limited.
In recent years, there has been a change in the traditional patterns and approaches of power systems owing to the deregulation of the transmission network. The most ideal use of current power systems is improving power efficiency by inserting FACTS devices and DG units such as renewable sources [10][11][12][13][14][15][16] . The TCSC and SVC play an increasingly significant part in the operation and control of power systems [14] . The motivation behind the placement of the TCSC and SVC to sustain the real power loss of the system to ensure transfer capability enhancement in addition to voltage improvement and power loss minimization has been suggested [15] . The Newton-Raphson (N-R) method is the most suitable technique for solving load flow difficulties following the implementation of an SVC on real system data because of its advantages such as convergence time, less number of iterations, and other time-based requirements [17] . Optimization was performed to minimize cost and losses in the system via load flow analysis, and the TCSC was used to control active and reactive power flow by compensating line impedance [18] . Further, a significant amount of losses and costs were overcome using the TCSC device in the power system. Various FACTS controller configurations and their cost comparison with TCSC, SVC, and UPFC have also been reported [19] . FACTS devices increase the voltage profile and decrease network losses of the system, and therefore, they can be incorporated with the SVC and TCSC in the system to achieve optimum results. The models of TCSC and SVC necessary to understand the effect on the system to improve dynamic voltage stability have been reported [20] . Further, the voltage stability constrained optimal power flow formulation by combining TCSC, SVC, and UPFC has been presented [21] . This formulation affects the topology, and hence, the power flow. The TCSC and SVC have an effect on the network, and the results show that, as per the appearance of the system's security constraints, the combination of SVC and TCSC is the most suitable. A comprehensive study of the effect of FACTS devices using the Gauss-Seidel method (G-S) and the N-R method to improve voltage stability and decrease losses on the power transmission system have been presented [22] . After the estimation, the system results clearly show that the N-R method can locate the optimal solution efficiently for load flow difficulties. The load flow analysis was performed using the N-R method [23] , which implemented models of SVC and TCSC, and it was incorporated to enhance or reduce the possibility of load encroachment to ensure that the system stays under the considerable limit. In modern power systems, it is more important to enhance the system voltage to the desired limit and minimize power losses using SVC [24] . Further, the load flow analysis needs to be performed using the N-R method to understand parameters necessary to enhance system performance.

Power sectors of Pakistan
The total installed capacity of Pakistan was 23 617 MW in 2012-2013. Pakistan faces several operational and technical challenges in meeting the current energy demands. The economy and energy consumption of a country share a conventional relationship, and strong polices are required to meet upcoming challenges [25] . Further, the country needs to introduce serious measures to overcome its energy deficiency. Although Pakistan has the capability to generate a considerable amount of power to meet the current demand for electricity, government policies related to power distribution, which include power plants with inefficient energy production and an inappropriate energy mix, are insufficient to meet the current electricity demands [26] . An installed capacity of 1 175 MW was added in 2012-2013; the cumulative installed electric power capacity from thermal (68.4%), hydro (23.8%), renewable (4.2%), and nuclear power plants (3.6%) was 35 372 MW in 2017-2018.
In the Pakistan Electric Power Company (PEPCO), 32 525 MW is connected to the National Transmission and Dispatch Company (NTDC) system, and 2 847 MW is connected to the Karachi Electric Supply Company (KESC); the thermal power generation is distributed among the Water and Power Development Authority (WAPDA), independent power producers (IPPs), and KESC; and hydropower and nuclear power are entirely controlled by WAPDA and the Pakistan atomic energy commission (PAEC). Further, the renewable energy sector, such as wind, solar and biogas plants, is making overall progress in all power generation sectors in Pakistan. The 2012-2018 data on Pakistan's power generation capacity is summarized in Tab. 1.  Pakistan's power sector is owned by two utility companies: WAPDA and KESC. Since the privatization of KESC, (renamed as K-Electric) it has been responsible for power production, transmission, and distribution in Karachi and its surrounding areas, while WAPDA is responsible for monitoring electricity in other parts of the country. However, by the end of the 21th century, the demand for rapid power development exceeded expectations and the existing power generation infrastructure was insufficient to meet this rising demand [27] . Other factors that contributed to this failure included financial constraints and lack of proper management. Under the new arrangement, the National Electricity Regulatory Authority (NEPRA) was established as an independent regulator to ensure transparency, competition, and commercialization of Pakistan's electricity market [28] . By February 2018, Pakistan's power generation capacity had surged to 35 372 MW, compared with 23 617 MW in 2012-2013, which was a 45% increase over the last five years [27] . If the cumulative per capita electricity consumption is considered, Pakistan still has a long road ahead to match the living standards of established countries. The transmission and distribution networks are operated by several government agencies under the Ministry of Energy, Pakistan.
The transmission network consists of 500 kV and 220 kV transmission lines and substations, while DISCO operates through 132 kV and 11 kV lines and substations. DISCO is a distribution company of PEPCO, and it is responsible for electricity distribution. They purchase electricity from WAPDA, PEPCO, and other IPPs and sell it to customers in their corresponding areas. Besides the privatized K-Electric, all companies are owned by the Pakistani government. In Pakistan, the generation sector produces electricity using hydro stations, thermal stations, IPPS stations, and via nuclear and renewable resources. WAPDA is concerned only with the development of the hydro sector, and in the thermal industry, there are no developmental arrangements. In a deregulated and updated environment, the transmission setup is called the NTDC; this is the only company in this new scenario that is responsible. The transmission sector is also deregulated and restructured under this new setup, and distribution companies have been established. These distribution companies provide electricity services to customers. Each distribution company can make independent decisions about expansion, deregulation and restructuring in Pakistan, marking an era in which companies have the ability to understand the demand for electricity. The NTDC maintains and operates a transmission network, whereas the distribution operations are performed by nine distribution companies commonly referred to as a distribution company (DISCO). Only vertically integrated utility power companies operate in the metropolitan area of Karachi. The generated electricity is fed into the NTDC's national grid and transmitted to the end-user for further distribution to the DISCO network, as shown in Fig. 1 [29] . Pakistan is a suitable country for installing hydro, solar, and wind power plants, which are more affordable resources in Pakistan, as the generation demand increases. Pakistan's rural prosperity is based on the production of biogas from animal and agricultural waste, which provides an attractive opportunity for these areas. To eliminate the gap between the nationwide power supply and demand, the restoration and transformation of old transmission and distribution systems is also necessary. As descrybed in Fig. 1, after electricity generation, PEPCO maintains the electrical supply through transmissions such as NTDC and distribution DISCOs companies. The K-Electric company consumes electricity directly from the IPPs and feeds the Karachi province in Pakistan.

QESCO case study
The QESCO Company was established on May 13, 1998, under the Ordinance of 1984; it is a public limited company. In May 1998, it became a corporation for WAPDA and trade operations in Pakistan. QESCO took over the asset business, and the former electric energy district board was converted into a company. QESCO deals with the power supply systems in almost all of Baluchistan city except in the Lasbella district, where more than 55% of the province is provided with electricity in significantly isolated areas through the existing network. This city is the smallest in terms of number of customers but the largest in terms of area (it covers 43% area of the country). QESCO is endeavoring to assure uninterrupted electricity to its consumers despite various challenges [30] . In the power system, the security demonstrates the flexibility of the system to work in a state of balance in both minor and unusual circumstances. Voltage vulnerability is recognized as an essential issue that needs to be resolved to ensure reliable and secure operation. Over the past several years, the power system has emerged into a complex system, and it is now equipped with new technology controls and can operate in stressful environments, which would cause system instability previously [31] .

QESCO network configuration
We investigate the 132 kV transmission network that supports the QESCO network in the Balochistan area provinces, namely Quetta, Mastung, Khuzdar, Kalat, Loralai, Qila Saifullah, Muslim Bagh, and Pashin cities. The existing conditions of QESCO's distribution and transmission systems are insufficient to meet the rapidly growing electricity demand.
The capacity of electricity generation in Pakistan has increased substantially, and even if it is used at the full load transmission and distribution, it fails to transmit the power at full load; it recorded 30% transmission and distribution losses during peak loads. The demand and supply gap in Pakistan remains high and is increasing annually. The distribution network in the central part of Baluchistan Province faces 8 h of daily load shedding and a shortage of transmission maintenance. Increasing power efficiency reliability and quality result in reduced technical and commercial power loss in terms of permanent availability and improved voltage profiles in the distribution network system [32] .
The investigation of these transmission lines was necessary to supply sufficient and stable electricity to areas of Baluchistan Province. At the time, many areas of thermal power generation were located in center and southern Pakistan, and most hydroelectric power plants were located in the northern part, far from the center of power demand. To overcome this situation, existing power infrastructure needs to be improved and upgraded. This research effort is designed to help to improve the power utilization efficiency and quality, reduce overall losses, sustain availability, and improve the voltage profile in the distribution network systems [33] . This successively leads to problems in determining the power system because the goals of system stability are limited. Consequently, the effectiveness of the FACTS devices can be assessed in terms of fast and accurate performance monitoring. The load-flow analysis is related to the scenario wherein the electric power system is operating. The load flow is analyzed to determine all parameters of this network [34] . The results of this study notify operators regarding any possible overloads or voltage failures in the system by detecting disturbances only in the initial state of the operating system. Contingency analysis is very demanding and usually performed to understand system violations. In this study, we investigated 41 busbars of the 132 kV network configuration using NEPLAN to model and understand the parameters that complicate the system. As shown in Fig. 2, the 132 kV network is configured on NEPLAN using DG, TCSC, and SVC to ensure that the system is more efficient within the required limit. The NEPLAN controls all types of Fig. 2 132 kV transmission network model in NEPLAN electrical networks to transmit, distribute, and generate electricity. There are no limitations on the size of the drawings and the number of nodes and items because this tool can analyze, plan, optimize, and simulate electrical networks.
A 132 kV network comprising loads, generators, and transmission lines was constructed on NEPLAN. These network lines can be of any length from an electrical network that feeds the QESCO section. To find the amount of reactive and active power loss, voltage drop and several known quantities that depend simultaneously on the type of buses, loads and generators of this network are employed. Therefore, the system losses and voltage profile of this network can be improved.

TCSC modeling for the power system
In the modern era, new power lines or FACTS devices on existing transmission networks can reduce transmission overload problems. FACTS devices advocate the protection of modern power grids based on their overall performance over the past two decades [9] . One of the most popular FACTS devices of the TCSC produces many benefits such as power flow control, rapid response, good performance, and improved system efficiency. Therefore, it is very important to research the optimal configuration of the FACTS device. To realize the continuous control ability of the TCSC to the distribution line, it is necessary to control the accuracy of the angle of the thyristor to provide controllable and reliable series compensation [35] . The TCSC used in the NEPLAN model specification works similar to a parallel LC circuit with variable electrical resistance, as shown in Fig. 3. For this DGs model, the line flow regulation is 50 MW, 30 MVar from the busbar MARIABAD (Busbar 19), and MASTANG (Busbar 5); the voltage regulation is 99.97% at the transmission end, and min: 91.1% and max: 100% at the receiving end. The transformer loading leakage impedance is zero. An SVC device can achieve fast and reliable power flow in a power network. The operational point of view of the SCV consists of a thyristor-controlled reactor (TCR) in parallel with capacitors called the thyristor switched capacitor (TSC); it absorbs and generates power to regulate terminal voltage at the desired set point by controlling the reactive power of the power system of its chosen place. The rapid response of the SVC thus provides fast reactive power, a wide voltage regulation operational range, and high reliability because of the ability to control the firing angle that enables the SVC instantaneous speed response. In this study, sustaining the defined voltage levels is necessary for the precise operation and utilization of loads [36] . The structure of the SVC is shown in Fig. 4. The SVC plays the function of the control valve to produce harmonic currents. For fundamental waves, the filter is capacitive and provides reactive power to the power network [37] . The main function is to dynamically compensate the reactive components and unbalance components in the system to improve the stability of the system, maintain the voltage level, eliminate voltage flicker, suppress system oscillation, and so on. To reduce the harmonic pollution to the power system, a filter is also installed in the SVC.

Problem formulation
For the N-R method used to calculate the power flow solution, refers to Ref. [17]. For load buses, the objective function is to minimize the active/reactive power losses expressed in where ΔP i (k) is the mismatch between the specified and calculated bus active power injections, and ΔQ i (k) is the mismatch between the specified and calculated bus reactive power injections with calculated injections computed using bus voltage magnitudes and angles at the k th iteration. For voltage-controlled buses, P i (k) and ΔP i (k) are calculated as where the mutual conductance and element are given by G ij and B ij , respectively, and the phase difference between the voltages of buses i and j is denoted θ ij . The elements of the Jacobian matrix (J 1 , J 2 , J 3 , and J 4 ) are | || || |sin( ) The linear simultaneous equations given below are explained directly by optimally ordered triangular factorization and Gaussian eradication.
The voltage magnitudes and phase angles are calculated as The procedure is continued up until the residuals ΔP i (k) and ΔQ i (k) are less than the specified accuracy as shown in The optimal power flow (OPF) problem considering the existence of FACTS devices is formulated to find the optimal values for minimizing power losses as ( 1) min( ) The OPF problem considering TCSC and SVC device has the following control variables.
(1) The output active power of the generators.
(2) The locations and size of the TCSC and SVC devices. (

3) The locations and size of the DG units. (4) The status of transmission lines for reconfiguration processes.
Another assessment aim is to enhance the voltage profile by minimizing the bus voltage deviations between V i and a reference voltage V ref . This is given as Power flow congestion can be measured as where PFD is the summation of the power flow difference of lines power flow PF ij and the corresponding thermal limit PF ref . Further, the objective function in Eq. (9) is subjected to the power system equality and inequality constraints as follows.
(1) The total active and reactive power balance.
where QG i is the reactive power generation and PD i , QD i are the loading terms at bus i.
(2) Active and reactive power balance at each bus where the number of DG units is also limited to the available committed units NDG.
(4) Security constraints. The voltage on the load bus VL is considered, and the transmission line load Sl needs to be kept within the allowable limits VL i max , VL i min , and Sl i max .

Results and discussion
The 132 kV transmission network under consideration is located in Quetta, Balochistan, Pakistan. The 132 kV transmission network is modelled on NEPLAN. In this research, considering four cases to determine the improvement in the system caused by stepping up and placing the FACTS devices and DGs units into this network to enhance its performance. The DGs sources indicate that the power is generated at the distribution system by using renewable energy sources such as wind and solar energy. In this paper, the analysis of the performance of the transmission and distribution lines along with the distributed generation sources is conducted. These are the following four cases under study.

Base case
In this case, the basic system configuration is used to perform load flow and contingency analyses in NEPLAN software without using the FACTS devices and DG units. For the base case of this network, the active and reactive power losses (3.099 MW, 77.791 MVar) are shown in Fig. 5 and the voltage profile (91.11%) is shown in Fig. 6. The N-R method is used to perform the load flow analysis to investigate the active, reactive power loss, and to evaluate the voltage drop precisely.

Case 2
In this case, to improve the power flow, the power line is compensated using TCSC. The optimal power flow (OPF) analysis is performed, and the results are obtained with the TCSC in the NEPLAN software. The OPF results are shown in Tab. 2, which indicates the most suitable location of TCSC that achieves better improvement results when inserted between bus 12 (SORAB) and 16 (BHAGBANA). The FACTS device is a new integrated idea that can enhance system performance in terms of its ability to transmit power from a stability perspective, maintain system security, and operate reliably. The OPF results are improved as shown in Fig 7. As mentioned in Tab. 2, the busbar lines result shows the line that has high losses in term of P losses and Q losses . As seen in Tab. 2, the TCSC on the bus between 12 and 16 shows the best improvement in terms of voltage profile and active, reactive power losses. The results show that the TCSC increased voltage stability in the best position on the bus. Fig. 8 shows the active power losses. Fig. 9 shows the reactive power losses that are better than those in the base case.

Tab. 2 OPF results of TCSC
The best results were achieved by installing TCSC between buses 12 and 16, and the active power

Case 3
The purpose of the power flow study was to determine the steady state of the operational condition in the power system, which shows that the flow of active and reactive options passes through all power lines in the entire network with the desired voltages of all buses and network losses. The line between busbars (19)(20) is investigated as it is key to avoiding high losses and voltage violations with a large value as compared to the allowable limits. In this case, the DG unit is installed on bus 19 (MARIABAD) to improve the efficiency of the system to an acceptable level. Voltage profile enhancement results are shown in Fig. 10, and these results are compared with the base case. In this case, the voltage level increased by 91.11% to 98.62%, and the minimum voltage level is 98.24% of all buses. The results show that the optimal placement of the TCSC between busbar 12 and 16, and the DG unit at busbar 19 is suitable for increasing voltage stability and active and reactive power losses.

Case 4
In case 4, the TCSC and the two DG units are used in the network as in case 3; however, the second DG unit is used on the bus of 5 (MASTANG). The DG units can provide excessive compensation for the system. However, it is not possible to build and link the distributed generators without considering the effects of the distributed generators on this system. Planning studies are essential to maximize the benefits, and they can help estimate any possible complications.
The generation of distribution networks supports the need to develop new systems to protect these networks. In this network, a notable increase in the number of distributed generation (DG) could meet the demand. In this case, by using the SVC to maintain the voltage profile of its desired limit at 18 (QS-MAND), an OPF analysis is performed, and the results show that the system loss is high on bus 18; the OPF results show the best location for SVC to enhance the network voltage after inserting SVC.
For example, many bus voltage profiles of different lines are increased from their desired limits after SVC is added to the network to increase system performance and efficiency. Fig. 13 shows the voltage profile with SVC and without SVC and its results, compared with the base case. Depending on the results of this work and the different case results mentioned above, we explain the modeling of the 132 kV transmission system, in addition to the use of TCSC, DGs, and SVC across the network to enhance the voltage profile of the power system, its active/ reactive losses, and the improvements in the line loading elements of each bus with the desired limit.  The results are extracted successfully, as shown in Fig. 14. It shows that the voltage profile increased from 91.1% to 99.9%, and its minimum voltage is 99.78% for the network, which shows the voltage level of each bus under the consideration limit, and the enhancements in the voltage level. Network active power losses are shown in Fig. 15 that compare the results with all cases. In this case 4, the results of the active power losses decreased from 3.099 MW to 0.172 9 MW. Fig. 16 shows the results of the reactive power losses of the network that decreased from 77.791 MW to 1.571 2 MW. In all these cases, the sum of voltage deviation (VD) to nominal per unit value (PU) decreased from that of the base case (3.55) to 0.042 4 in this case. The power flow congestion is the summation of the power flow difference of lines. The power flow sum PFD moved away from the limit 25.02% to 31.77%. The NEPLAN results for all cases are summarized in Tab. 3. In this case study, the performance of Pakistan's power system was developed and it met the expectation levels. The key element of both FACTS devices TCSC and SVC is their ability to provide more comprehensive control of the network,   Fig. 17 shows the reduction of lines and the flow of energy for various cases in the study. Further, although TCSC, DGs units, and SVC are added to the network to ensure compensation at acceptable levels, the results are expected to achieve better network performance. In these different cases, the results show that different bus line power flow congestion reduction in each case. Case 4 indicates a high performance that shows the system has been contracted successfully the results depict the enhancement of overall power system efficiency, which indicates the most suitable position of the FACTS devices.

N-1 contingency analysis of the network
In a deregulated power system, one of the technical challenges of congestion power is the need to maintain a stable system. One of the objective functions of congestion control is the N-1 contingency analysis. Find the worst line with N-1 contingency analysis, and provide assistance to the entire system to stabilize after the line interruption [37] . The contingency analysis is performed to evaluate the electrical system in the NEPLAN software and study for additional problems that may arise in the electrical system.
This N-1 contingency analysis uses of a load flow solution that indicates the results of active power flow, reactive power flow, and bus voltage. In this power network, the approach considers measuring the severity violation of the system using the performance index. The contingency analysis is computed by using the load flow (N-R) method constructed in NEPLAN for each contingency analysis [38] .

Active power performance index (PPI)
In this method, the measured degree of the line overload can be expressed as [38] where P i is active power flow in line i and P imax is maximum active power flow of line i; NL is number of lines of the power system; W represents the real non-negative weighting factor; and n is the penalty function.
where V i and V j is the voltage at bus i, j obtained using the N-R load flow, respectively, and X represents the reactance of the line connecting buses i and j. Finally, R represents the resistance of the line connecting buses i and j.

Voltage performance index (VPI)
This function determines the voltages bus out of limit.
where n is a penalty function, NB is the number of buses in the system, and W represents the real non-negative increment factor. Further, V i shows the voltage magnitude corresponding to the bus i, SP i v indicates the specified voltage magnitude corresponding to bus i, and ΔV i lim represents the voltage deviation limit of the system. The voltage of the bus depends on the reactive power generated by the generating units and the VPI provides the weight of the abnormal voltage as long as the jet power lies within the limit. In the event of contingency circumstances, the reactive power may approach the limitations, and in this scenario, the AC voltage flow calculates the voltage of the bus considering the reactive power into the voltage limitations. Therefore, the voltage disturbance is observed from their actual voltage in the generator buses.
where Q i specifies the reactive power at bus i; Q i max shows reactive power limit at bus i; NG is the quantity of generating units; and W is the real non-negative weighting factor. In NEPLAN, it is easy to run a contingency analysis with a quick response using NR load flow solutions. A 132 kV network model designed in NEPLAN using the given systems line and bus data perform load-flow analysis without considering the line contingency for the base case for the next step required to remove a line and proceed to the next step. The results of the base case are shown in Fig. 18. The base case results in violation of busbars lines and compared with single line outage contingencies calculated based on the branches overload. Load flow analysis was performed to obtain the results of the remaining lines and values P max. The case 2 represents the results of inserting TCSC in the bus between 16 and 12 and the same buses are disconnected. The results show the violation of lines that are decreased as compared with the base case as shown in Fig. 19. The power flow analysis is performed to define the voltage and its angle at specific bus, active and reactive power flow in each line, and line losses in the power system network for the specified bus or terminal conditions of the system.   Fig. 21 for the four cases under study. Case 4 shows the best results of contingency analysis that decreased violation lines 141 to 45 by use of DG inserted on bus 5 and SVC installed on bus 18, which helps maintain the voltage level on its required limit. Bus voltages are influenced by the reactive power produced by the generating units, and the PIV indicates the severity of the abnormal voltages until the reactive power lines are in the limits. Under the contingency case, the reactive power may approach the limits, and in this scenario, the AC load flow computes the bus voltages by considering the reactive power limits to monitor violated nodes and elements. Thus, the voltage violation is observed from their actual voltage at the generator buses. In this case, the voltage study during contingency involves the generators of reactive power constraints.

Uncertainty analysis
The current study on the 132 kV transmission system examined the effects of uncertainty on the photovoltaic (PV) source in the power system. Tab. 4 shows the results of the uncertainty effect on PV source in the power network.
As shown in Tab. 4, unit 1 (Bus 5) and unit 2 (Bus 19) show the effect of uncertainty in PV sharing with respect to tests under different uncertainties values between ±5% and ±15%.
The uncertainty of PV power has a considerable effect on the economic risk situation of the power system. To control the economic risk assessment of investment in grid-connected photovoltaic systems, uncertainty is calculated, which is an important case based on the power flow in photovoltaic power sources. The objectives of the various input parameter, as well as the contribution of specific input parameters in terms of uncertainty about the energy yield, are summarized in Tab. 5. The different steps in PV modeling are controlled to uncertainties as shown in Tab. 5. As a result of the uncertainty analysis conducted on the network, it can be observed that the integration of PV with the grid developed and increased the voltage distribution of the network. The smaller the difference between power generation and the demand in the power system, the smaller is the deviation of the voltage curve in the bus. The consequences and performance of integrating the PV on the power system are listed in Tab. 5.

Conclusions
This paper proposed a method to enhance the Pakistani energy system. The NEPLAN simulator was used to maximize the optimal power flow. Different cases were applied to a real system of 132 kV transmission network that feeds electricity to the QESCO. In this study, line loss and voltage drop were considered major problem leading to problems with efficient operation of the power system. The DG units and FACTS devices have a considerable impact on system voltage. Better voltage profiles are obtained by using multiple DGs and FACTS or a combination of them instead of using DG or FACTS devices alone.