Ensuring Reliable Operation of Electricity Grid by Placement of FACTS Devices for Developing Countries

: Flexible AC Transmission Systems (FACTS) are essential devices used for the efﬁcient performance of modern power systems and many developing countries lack these devices. Due to the non-existence of these advanced technologies, the national grid remains weak and vulnerable to power stability issues that can jeopardize system stability. This study proposes novel research to solve issues of an evolving national grid through the installation of FACTS devices. FACTS devices play a crucial role in minimizing active power losses while managing reactive power ﬂows to keep the voltages within their respective limits. Due to the high costs of FACTS, optimization must be done to discover optimal locations as well as ratings of these devices. However, due to the nonlinearity, it is a challenging task to ﬁnd the optimal locations and appropriate sizes of these devices. Shunt VARs Compensators (SVCs) and Thyristor-Controlled Series Compensators (TCSCs) are the two FACTS devices considered for the study. Optimal locations for SVCs and TCSCs are determined by Voltage Collapse Proximity Index (VCPI) and Line Stability Index ( L mn ), respectively. Particle Swarm Optimization (PSO) is employed to ﬁnd the ideal rating for FACTS devices to minimize the system operating cost (cost due to active power loss and capital cost of FACTS devices). This technique is applied to IEEE (14 and 30) bus systems. Moreover, reliable operation of the electricity grid through the placement of FACTS for developing countries has also been analysed; Pakistan being a developing country has been selected as a case study. The planning problem has been solved for the present as well as for the forecasted power system. Consequently, in the current national network, 6.21% and 6.71% reduction in active and reactive power losses have been observed, respectively. Moreover, voltage proﬁles have been improved signiﬁcantly. A detailed ﬁnancial analysis covering the calculation of Operation Cost (OC) of the national grid before and after the placement of FACTS devices is carried out.


Introduction
Despite the fact several developing countries have taken steps in the past to improve the electricity access for their deprived communities, most of them still lag far behind developed countries. Statistics show the electricity deprived population of the world sums up to 1.1 billion [1]. When analyzed geographically, Africa leads the list with about 62.5% (609 million) of the total population living without electricity. 20% of the total South Asian more reliable as compared to STAT-COM for long-distance transmission lines [25]. When SVCs are compared to STAT-COM, STAT-COM gives efficient results at a higher cost [26]. Furthermore, the effectiveness of SVC and TCSC to decrease real power losses and to improve voltage profile have been discussed in the literature [27,28].
Optimum placement and sizing (OPS) of FACTS is very critical due to the high capital cost of these devices. In literature, various techniques for OPS of FACTS devices have been studied for standard IEEE systems. Basnal et al. discussed the OPS of FACTS devices to control reactive power using GA in [29]. In [30], authors have proposed a novel method to find out optimum locations of different types of FACTS devices based on bus and line voltage stability indices. Mixed Integer Linear Programming (MILP) for optimum placement of FACTS controllers has been proposed by Sharma in [31]. In [15], Biogeography Optimization (BO), Improved Weight PSO (IWPSO), and PSO have been applied to discover the optimal location of SVCs and ultimately reduce the power losses and voltage deviations. In [32], the application of PSO has been discussed for the optimal placement of FACTS to decrease the total system installation cost and to increase system load-ability. Power system stability has been improved using various FACTS devices in [33]. In [16], Whale Optimization Algorithm (WOA) has been applied for optimal placement of SVC and TCSC to achieve a reduction in total system operating cost. In [34], WOA has been used on multiple types of FACTS devices, and results are compared with existing metaheuristic optimization techniques. WOA showed considerable improvement in results as compared to others.
In [35], the placement of multiple SVC on the Nigerian grid system for steady-state operational enhancement is discussed. A Mixed-integer programming problem is used for placement of SVCs on 41 bus Nigerian national grid system. Contingency analysis in presence of an SVC controller is investigated for Sudan national grid [36]. After finding the locations for SVC placement, the mathematical models for the simulation of transmission line outages are carried out. In [37], the optimal placement of FACTs devices in the Iraqi National Super Grid System (INSGS) using a hybrid line stability index has been investigated. Only the optimal placement has been done on the national grid whereas a rating of the proposed FACTS devices has not been carried out. The literature study reveals PSO has been widely applied on standard systems to solve the planning problem of the FACTS devices. Few studies have been carried out for FACTS placement on the national grid, but no work has been reported in which PSO has been tested for the optimal sizing of TCSC and SVC on a national grid of any developing country.
The presented methodology is tested on IEEE-14 and 30 bus transmission systems [38]. After that, it is applied to the national power system of the developing country (Pakistan). As a result, a comprehensive planning model for reliable operation of the national grid for the developing country is presented. The main issues of improvement of voltage profile as well as reactive power compensation of practical national electrical transmission network are addressed through OPS of FACTS. It is observed that the active and reactive power losses of the national grid are seen to be reduced significantly. Moreover, significant financial savings have been observed as a result of FACTS placement. The payback period for the FACTS placement, both for the present and forecasted model is less than one year.

Methodology
SVC and TCSC are the two types of FACTS that are considered in this study. The main reason for selecting these devices is because of their higher cost to benefit ratio as compared to other FACTS devices [39]. TCSCs compensate for the inductive reactance of the transmission line by series connection and shunt connected SVCs are used for voltage control applications [40]. An SVC device can absorb or inject the required quantity of reactive power by controlling the firing angle of its thyristor [41]. Therefore, an SVC can help to regulate the bus voltage at a specified value despite load variations.
In the proposed method of placement and sizing of FACTS, sensitivity analysis has been carried out to determine weak buses and lines in the network. Weak lines and buses were identified using L mn and VCPI indices, respectively [16]. The main reason for selecting these indices for finding weak locations in the system is because they can be applied to a large power system with many buses and lines such as the national grid of any country. Moreover, as L mn index is a good pointer to determine weak transmission lines, the best locations for placement of TCSC can be obtained. Similarly, the VCPI index helps to determine buses prone to voltage collapse. All buses and lines are listed in order of decreasing indices so that the weakest buses and lines appear at the top of the list. Data clustering technique is applied to select clusters of weak buses and lines as the locations of SVCs and TCSCs. Since practical electrical networks constantly evolve due to the addition of more load, generation and transmission assets, it is agreed that some other lines and buses may turn out to be weaker, depending on the system under study. In such a case, the newly identified lines and buses can be considered for the placement of additional FACTS in the next phases.
After identifying the weakest locations in the system, PSO is applied to find optimal sizes of FACTS for the selected locations. It is pertinent to note that the optimal sizes of the FACTS device have been calculated with respect to each other and for simultaneous placement. Therefore, it is planned to simultaneously place all the finalized FACTS devices on the identified buses and lines.

Modelling of TCSC
Initially, TCSC was presented by Vithayatil to rapidly adjust the impedance of an electrical network [42]. TCSC is generally defined as a capacitive reactance compensator. The basic structure of TCSC consists of a capacitor, connected in shunt with thyristorcontrolled reactors [28]. The number of such compensators can be placed in series to get desired operational characteristics.
By modifying the firing angle of the thyristor, TCSC can provide both inductive and capacitive compensations. The connection of TCSC to the transmission network and its characteristics with changing firing angle are discussed in detail in [19]. Active and reactive power flows in the presence of TCSC from bus p to bus q are presented in Equations (1) and (2).
where V p represents the voltage of sending bus, V q is the receiving end bus voltage, G pq represents the line conductance, B pq is the susceptance of the line and δ pq is the bus angle difference between the buses. Similarly, the power flow equations from the bus q to bus p can be written as: Equations (5) and (6) represent G pq and B pq of the transmission line, respectively: where G pq represents the line conductance, B pq is the susceptance of the line R represents the resistance of line and X pq is the reactance of line and X TCSC is the reactance of TCSC.

Modelling of SVC
SVCs are used in high voltage transmission networks. These electrical devices are used to provide quick-response reactive power for enhancing power system stability, power factor correction, and voltage profile improvement. Primarily, SVCs are installed for two primary purposes, (i) To improve and regulate the voltage of the transmission network (transmission SVC) and (ii) To adjust the power quality of industrial loads (industrial SVC). In transmission networks, SVCs are generally used to enhance grid voltages. If the power system has a capacitive load, then SVC consumes "var" by utilizing thyristor-controlled reactors and regulates system voltages. However, if the power system load is inductive and the power factor is low, then SVC injects reactive power into the system for voltage profile and power factor improvement. The flexible nature of SVC mainly lies in inverse parallel and series-connected thyristors, which forms thyristor valves. The single line and control block diagram of typical SVC has been discussed in detail by F. Gandoman in [19].
SVCs are made of two or more fixed or switched banks of shunt reactors or capacitors, and one of the banks is thyristor switched. Typically, thyristor switched capacitors, mechanically switched reactors and capacitors, thyristor controlled reactors, and harmonic filters are used to make SVC. An SVC model is discussed in detail in [42]. The reactive support provided by SVC is mathematically shown as where "V n " is the voltage of bus at node "n", and "B" represents the susceptance where SVC is connected.

Optimal Allocation of FACTS
FACTS devices take account of the transfer capacity of power transmission lines and regulate various parameters in the transmission network such as voltage, current, and impedance. However, the full benefit of any of these devices can be taken if they are utilized efficiently by optimal placement and appropriate sizing. Weak lines and buses are calculated in the system through L mn and VCPI, respectively, for optimal placement of FACTS which are discussed in the following sections.

Optimal Allocation of TCSC
TCSC is installed in a weak transmission line, which can be identified by the stability index (L mn ) of the transmission line. A transmission line with the value of L mn index closer to 1.0 is more unstable than a transmission line with the value of L mn index deviating further away from 1.0. L mn index can be calculated using Equation (8) where "X" represents the line impedance and "Q r " is reactive power demand of the receiving node of the transmission line, "V s " is the source voltage, "θ" is the angle of impedance, and "δ" is the difference in angle between buses.

Optimal Allocation of SVC
For optimal placements of SVCs, the VCPI index is used. The index helps to find out the unstable buses in a transmission system. VCPI index for all the buses are calculated, buses with index values close to 1.0 are considered weak. Therefore, such buses are the candidate locations for the placement of SVCs. VCPI works on the principle of maximum power transfer via line, and it is defined as: where P = V r Icos∅ (10) where V s represents source voltage and Z s is impedance. θ is the impedance angle and ∅ is the angle difference between sending ("From" Bus) and receiving end bus ("To" Bus).

Optimal Sizing of FACTS
To decrease total system operation cost, PSO is used to calculate optimal sizes of TCSCs and SVCs for each selected location.

Mathematical Formulation
The main objective of finding the optimal rating of FACTS is to minimize both the costs due to active power loss and FACTS installation cost. The objective function is mathematically written in Equation (12). Ratings of FACTS devices are changed in each iteration by PSO; hence active power loss is calculated in every iteration, which is then multiplied by the cost of electrical energy. In Equation (13), "0.09$" is the per-unit cost of electrical energy [43], which is multiplied by total active power losses of the entire system (P L ) for the whole year (365 × 24). To minimize this value, active power losses are calculated in every iteration of PSO using the Newton Raphson power flow method, which is run in MATPOWER. The overall objective function is as follow where C PL is the cost associated with active power loss and calculated as follows where O 1 = (x 1 , x 2 ) is an active power loss function that needs to be minimized. G k is the conductance of line k. V i and V j are the voltage magnitude of sending and receiving buses δ ij is the phase difference between ith and jth bus. Here x 1 is an array of dependent variables and x 2 is an array of control variables and can be defined as follows.  (20) and (21).
Moreover, C FACTS is the cost of FACTS devices and are given by the quadratic equation as shown in Equations (17) and (18).
where t and s are the sizes of TCSC and SVC in kvar, respectively. The quadratic cost functions of TCSC and SVC are defined by ABB, as discussed in [34]. Equality Constraints that need to be satisfied are as follows: where P Gi , P Di , Q Gi , and Q Di are the active and reactive power generation and demand at bus i and j and the total numbers of buses are represented by n.
While the Inequality Constraints of the optimization problem are given below: V min and V max represent the minimum and maximum allowable voltages. Equations (22) and (23) have been used to ensure that FACTS devices are within their respective permissible limits. Since the optimization problem is nonlinear, PSO is applied to find out the optimum solution.

Particle Swarm Optimization
PSO is a heuristic optimization technique based on the food searching behavior of a set of birds or fishes [44]. In this technique, each affiliate of the group alters its behavior based upon the behavior of the swarm. A set of elements is initialized by randomly placing each particle of the group in the search space and then updating their positions based on their fitness evaluation. The velocity of each particle is updated, and a new solution is achieved. The iterative process continues until the optimal solution is obtained.
PSO has been applied in the following way: Step 1: PSO initialization PSO is initialized by specifying the bus and transmission line data. Candidate locations for placement of FACTS devices that have already been obtained by L mn and VCPI indices are initialized as array particles. The total number of particles, starting inertial weights, and the maximum number of iterations are finalized. Moreover, constraints on the size of FACTS devices are defined in the search space. Velocities and particle sizes are initialized arbitrarily. Particles are nothing but sizes of SVCs and TCSCs.
AC power flow is run in each iteration to find out active and reactive power losses. The objective function for every particle array is assessed by calling the objective function independently.
Step 3: G best and P best Evaluation P best denotes personal best (minimum value of the objective function) of each array among all iterations. G best (global best) is the minimum value of the fitness function. P best and G best are updated in each iteration after comparison with the previous iteration values.
where f i p is the particle fitness value at iteration "i", and "p" specifies the particle. The formula used to update G best is, Energies 2021, 14, 2283 8 of 21 Step 4: Update position and velocity After updating the values of P best and G best , particle velocity is updated to lead it towards the optimum position. Velocity is updated after every iteration as: where "i" represents iteration number, "w" is the inertial weight, rand 1 and rand 2 are random numbers in the range of [0, 1], "c2" and "c1" are acceleration coefficients ranging between [1,2] and "s" represents the particle position."w" is updated in every iteration using Equation (25).

Flow Chart for Placement and Sizing of FACTS
The complete procedure of the placement and sizing of FACTS devices is presented as a flowchart in Figure 1.
The proposed method for placement and sizing of FACTS devices is more compact, flexible and easy to implement as compared to other methodologies present in the literature. For instance, in [40] researchers have used the Fast Voltage Stability Index (FVSI) for the placement of TCSCs, however, as reactive power changes its results can become inaccurate and sub-optimal. Similarly, the authors of [34] have constructed PV curves of all load busses. Buses with more voltage deviations are weak and consequently optimal locations for SVCs placement. However, in a meshed network, where there are several interconnected buses, it is almost impossible to construct PV curves of all load buses to identify weak buses. In [40], researchers have calculated sensitivity indices for placement of TCSCs and SVCs by partial differentiating reactive power balance equation for the control parameter of respective FACTS device. Although this technique can give accurate results, implementing it on an extensive meshed system is very difficult. Similarly, in [16,45] and [22] authors have considered locations carrying higher active and reactive power as the best locations for FACTS placement. However, just considering the flow of real and reactive power for the placement of FACTS will not give accurate results, and thus the solution may not be optimal. The selected indices i.e., VCPI and L mn are easy to implement, will give accurate results and can be applied to any system irrespective of the complexity of the power network.

Results and Discussion
The method is initially tested on IEEE-14 and 30 bus systems, then it is applied to the Pakistani grid. Results of the test systems and Pakistan Grid are explained below.

Test Case IEEE-14 and 30 Bus Systems
IEEE-14 and 30 bus systems considered are from MATPOWER [38]. Summary of power generating units, transmission lines, and load buses have been summarized in Table 1.

Results and Discussion
The method is initially tested on IEEE-14 and 30 bus systems, then it is applied to the Pakistani grid. Results of the test systems and Pakistan Grid are explained below.

Test Case IEEE-14 and 30 Bus Systems
IEEE-14 and 30 bus systems considered are from MATPOWER [38]. Summary of power generating units, transmission lines, and load buses have been summarized in Table 1. Transmission Lines 20 41 3 Load Busses 9 20 To find the candidate locations for TCSC and SVC placements, weak lines and buses are identified using L mn and VCPI indices, respectively. Load flows are calculated using the Newton Raphson power flow method in MATPOWER to calculate these indices. L mn and VCPI indices are determined by using Equations (8) and (9) respectively. Results for L mn index for IEEE-14 Bus systems are shown in Table 2.  Table 3, and those buses which have a VCPI value close to 1 are considered weak and thus optimal locations for placement of SVC. Here buses 14, 4, 9, and 5 are weak buses. After finding candidate locations for TCSC and SVC, PSO is utilized to find the optimal rating for these devices. The optimal rating of FACTS devices and their effect on power loss is shown in Table 4.
SVC can greatly improve the voltage of the whole power system because they can effectively control VAr in the system, as illustrated in Figure 2. The voltages before FACTS are scattered between 0.95 and 1.05 but mostly fall below 1 p.u. However, after the placement of SVC and TCSC voltage profile is almost stable above 1 p.u.  SVC can greatly improve the voltage of the whole power system because they can effectively control VAr in the system, as illustrated in Figure 2. The voltages before FACTS are scattered between 0.95 and 1.05 but mostly fall below 1 p.u. However, after the placement of SVC and TCSC voltage profile is almost stable above 1pu. Similarly, the effect of FACTS placement in the IEEE-30 Bus system is shown in Table 5.  It can be observed from the above-mentioned figure that the solution with only 1 SVC (dark green line) improves the voltage of bus 14, but is not able to improve the voltages of the other buses (e.g., bus 4). Similarly, the solution with only 1 TCSC (purple line) shows a lot of variability in the voltages of buses 1 through 5. However, the proposed solution (light green line) is able to keep the voltage profiles of all the buses sufficiently stable. Similarly, the effect of FACTS placement in the IEEE-30 Bus system is shown in Table 5.  Figure 3 shows that there is a significant enhancement in the overall voltage profile of the IEEE-30 bus system after adding FACTS devices. Hence by placing SVCs of optimal rating at the weakest locations can greatly enhance the overall voltage profile of the network.  Figure 3 shows that there is a significant enhancement in the overall voltage profile of the IEEE-30 bus system after adding FACTS devices. Hence by placing SVCs of optimal rating at the weakest locations can greatly enhance the overall voltage profile of the network.

Practical National Grid of Developing Country
The proposed method of optimal placement and sizing of FACTS devices is tested on standard IEEE systems and then applied on the national grid of a developing county (Pakistan). The electricity deficit for the year 2013 to 2017 for the electric grid has been summarized in Figure 4. T&D losses in lines are one of the biggest problems in most developing countries. The losses include technical losses due to heating in lines and un-metered losses because of theft. In the Pakistan grid, the distribution losses in some Distribution Companies (DISCOs) are more than 30% [5]. With the addition of 10,000 MW generation capacity in the past few years, some improvement in energy deficit has been observed. However, transmission lines started operating at their maximum loading point due to severe overloading [46].

Practical National Grid of Developing Country
The proposed method of optimal placement and sizing of FACTS devices is tested on standard IEEE systems and then applied on the national grid of a developing county (Pakistan). The electricity deficit for the year 2013 to 2017 for the electric grid has been summarized in Figure 4.  Figure 3 shows that there is a significant enhancement in the overall voltage profile of the IEEE-30 bus system after adding FACTS devices. Hence by placing SVCs of optimal rating at the weakest locations can greatly enhance the overall voltage profile of the network.

Practical National Grid of Developing Country
The proposed method of optimal placement and sizing of FACTS devices is tested on standard IEEE systems and then applied on the national grid of a developing county (Pakistan). The electricity deficit for the year 2013 to 2017 for the electric grid has been summarized in Figure 4. T&D losses in lines are one of the biggest problems in most developing countries. The losses include technical losses due to heating in lines and un-metered losses because of theft. In the Pakistan grid, the distribution losses in some Distribution Companies (DISCOs) are more than 30% [5]. With the addition of 10,000 MW generation capacity in the past few years, some improvement in energy deficit has been observed. However, transmission lines started operating at their maximum loading point due to severe overloading [46].  T&D losses in lines are one of the biggest problems in most developing countries. The losses include technical losses due to heating in lines and un-metered losses because of theft. In the Pakistan grid, the distribution losses in some Distribution Companies (DISCOs) are more than 30% [5]. With the addition of 10,000 MW generation capacity in the past few years, some improvement in energy deficit has been observed. However, transmission lines started operating at their maximum loading point due to severe overloading [46]. Figure 5 summarizes the total transmission and distribution losses for the Pakistan grid from years 2015 to 2020 [10].
Most of the developing countries lack adequate power system planning but the implementation of envisaged plans is even more challenging. For long term planning, it is crucial to model processes and components of generation, transmission, and distribution systems. There are various commercial software's available for power system planning and analysis. In this research work [21], MATPOWER has been used to model and study the electrical network. The study has been implemented on current (for the year 2018) as well as forecasted national gird (Year 2025) of Pakistan. The research has been done in collaboration Most of the developing countries lack adequate power system planning but the implementation of envisaged plans is even more challenging. For long term planning, it is crucial to model processes and components of generation, transmission, and distribution systems. There are various commercial software's available for power system planning and analysis. In this research work [21], MATPOWER has been used to model and study the electrical network. The study has been implemented on current (for the year 2018) as well as forecasted national gird (Year 2025) of Pakistan. The research has been done in collaboration with the power system planning department of the National Transmission and Dispatch Company (NTDC). NTDC is responsible to manage the transmission backbone to link Power Generation Units with Load Centers spread all over the country. All the data used in the research has been shared by NTDC containing its real grid expansion plans. Present national grid model consists of 3651 buses, 4147 overhead transmission lines, 277 generating buses, and 1930 load buses. The total active power loss in the present electric grid was 853 MW, whereas the reactive power loss was 9951 MVAr. Data of the national network is in per-unit, referred to as the base voltage of 500 kV and base power of 100 MVA. The T&D network of Pakistan includes six voltage levels: 500, 220, 132, 66, 33, and 11 kV, out of which high voltage transmission network (500 kV, 220 kV and 132 kV) are owned and operated by NTDC and remaining by the Distribution Companies (DISCOs). The number of buses at each voltage level in the network model 2018 and 2025 are listed in Table 6. Table 6. Buses Details of National Grid.

Sr. No Bus Voltage (kV) Number of Buses Present Model
Forecasted Model  1  500  26  53  2  220  86  192  3  132  1222  1994  4  66  153  233  5  33  16  114  6  11  2148  3094 According to the data used for simulations (i.e., data for peak load condition in summer 2018 and 2025), 277 GENCOs were connected to the NTDC transmission network  Table 6. According to the data used for simulations (i.e., data for peak load condition in summer 2018 and 2025), 277 GENCOs were connected to the NTDC transmission network in 2018 which is forecasted to be increased to 797 generating stations till the year 2025. These power plants are mainly thermal and hydropower plants, but nuclear, wind, and solar PV plants are also part of the energy mix of the country with minor contributions. The peak load in 2018 reached 21,483.6 MW on 11 July 2018 which is forecasted to rise to 42,000 MW by 2025. The peak demand was mainly driven by air-conditioning systems. In the anticipated national grid for the year 2025, predicted load is around 41,000 MW whereas generation is around 42,000 MW. The grid system model includes 6007 busses, 797 generator busses and 2961 load busses and 10,110 transmission lines. An overview of the electrical components of the Pakistan national grid used in this study is presented in Table 7. AC load flow analysis is done using the Newton Raphson method and is carried out in MATPOWER. According to load flow results, the power system is weak and vulnerable and has very high active and reactive power losses. Thus, the system is in dire need of modern devices such as FACTS.

Finding Weak Lines Using L mn Index
Weak lines in the whole system are identified as optimal locations for TCSC's placement. Therefore, starting with the cluster of the weakest lines in the first phase, FACTS can be placed on clusters with decreasing vulnerability in subsequent phases. From the results, a bunch of seven lines listed in Table 8 were identified as the weakest lines and thus suggested as candidate locations for placement of TCSCs.

Finding Weak Buses Using VCPI Index
VCPI values for the national grid were calculated and the list of buses was sorted in order of descending VCPI values. A cluster of six most vulnerable buses with the highest values of VCPI, listed in Table 9, were selected for placement of SVC in the first phase.
Optimal locations of FACTS devices in the 2018 and 2025 model are marked on the country's map, as shown in Figure 6. In 2018, the cluster of weak locations is in central and southern Punjab i.e., the buses and transmission lines in the areas of Guddu, Multan and Muzaffargarh. The problem has been well identified and tackled by the planning department of NTDC. In the network planned for 2025, the weak lines that appeared as weak lines for the year 2018 are now stable. Some industrial load hubs, planned under the China-Pakistan Economic Corridor (CPEC) program, turn out to be relatively weak links. For example, the load of special economic zones near Peshawar, Quetta and Faisalabad will turn nearby buses and lines into relatively stressed points in the national grid planned for 2025.

Optimal Rating of FACTS and Its Effect on National Grid Losses
After determining suitable locations of FACTS devices, the next task was to find out appropriate ratings for the selected devices. A heuristic-based optimization technique called PSO has been utilized to minimize the total Operating Cost (OC), including costs of FACTS devices and power loss. The number of iterations for PSO, as well as the number of particles, are a hundred each. Particles represent decision variables of optimization, i.e., sizes of corresponding FACTS devices. Optimal ratings for the corresponding devices for both 2018 and 2025 models of the national grid are presented in Table 10. Note that SVC of large sizes are required at Ludewala and Guddu nodes in the 2018 model, whereas Muzaffar Garh node needs SVC of large size in the 2025 model. Moreover, no large-sized TCSC is required for the 2018 model but two large-sized TCSCs are required for lines connecting Okara to Yousafwala and Sumundri to Multan.

Optimal Rating of FACTS and Its Effect on National Grid Losses
After determining suitable locations of FACTS devices, the next task was to find out appropriate ratings for the selected devices. A heuristic-based optimization technique called PSO has been utilized to minimize the total Operating Cost (OC), including costs of FACTS devices and power loss. The number of iterations for PSO, as well as the number of particles, are a hundred each. Particles represent decision variables of optimization, i.e., sizes of corresponding FACTS devices. Optimal ratings for the corresponding devices  Table 10. Note that SVC of large sizes are required at Ludewala and Guddu nodes in the 2018 model, whereas Muzaffar Garh node needs SVC of large size in the 2025 model. Moreover, no large-sized TCSC is required for the 2018 model but two large-sized TCSCs are required for lines connecting Okara to Yousafwala and Sumundri to Multan. Load flow studies have been done before and after the optimal placement of FACTS devices. Power losses are significantly decreased by placing FACTS devices in the grid. Before FACTS devices in the network model for 2018, total active power losses were 853.67 MW, which was reduced to 792.12 MW after the placement of properly sized FACTS devices. Similarly, the reactive power loss was reduced from 9951.2 MVAr to 9283.86 MVAr in the 2018 model. Therefore, approximately 6.21% and 6.71% reductions in active and reactive power losses, respectively, have been observed. Similar improvements have also been observed in the national grid model for the year 2025, as shown in Figure 7. Load flow studies have been done before and after the optimal placement of FACTS devices. Power losses are significantly decreased by placing FACTS devices in the grid. Before FACTS devices in the network model for 2018, total active power losses were 853.67 MW, which was reduced to 792.12 MW after the placement of properly sized FACTS devices. Similarly, the reactive power loss was reduced from 9951.2 MVAr to 9283.86 MVAr in the 2018 model. Therefore, approximately 6.21 % and 6.71% reductions in active and reactive power losses, respectively, have been observed. Similar improvements have also been observed in the national grid model for the year 2025, as shown in Figure 7. A detailed financial analysis covering the calculation of Operation Cost (OC) of the national grid before and after placement of FACTS devices is carried out. VAR compensation and voltage profile improvement are the main advantages of FACTS placement. As a result of voltage profile improvement, the losses are reduced in the network and hence more real power will flow. Cost-Benefit Analysis and payback period for placement of FACTs have been calculated considering the extra real power transfer. The savings have been calculated by subtracting the Operating Cost (OC) with FACTS from OC without FACTS. OC without FACTS is the cost due to active power loss whereas the OC with FACTS is the sum of the capital cost of FACTS and the cost due to real power loss. The cost of real power loss after FACTS placement is calculated after considering the addition of real power transfer as a result of FACTS placement. Total 61 MW and 96 MW power loss, which is around 6% of the total loss will be avoided by addition of FACTS devices in the present as well as forecasted grid models, respectively. As a result, the transmission line capacity is increased by 6%. Energy savings at the rate of $0.09/kWh (electricity tariff in Pakistan) has been considered in computing financial analysis and the payback period. Operating cost, cost of FACTS and net saving in each of the scenario before and after placement of FACTS is presented in Figure 8. Total net saving is calculated by subtracting OC before placement of FACTS from OC after placing FACTS. The OC is reduced significantly after optimal sizing and placement of FACTS. The payback period calculated for both present, as well as the forecasted national grid, is less than one year, which proves the financial viability of the project. The OC is reduced significantly after optimal sizing and placement of FACTS. The payback period calculated for both present, as well as the forecasted national grid, is less than one year, which proves the financial viability of the project.  [36]. The voltage profile is generally unstable before placement of FACTS but improves afterwards. In the voltage profile of buses for the grid model 2018, the voltages varied from 0.779 p.u to 1.526 p.u with Standard Deviation (σ) 0.081. After the placement of six SVCs, σ is reduced to 0.06. More improvement can be attained by the placement of more SVCs depending on the budget availability. Similarly, for the forecasted grid the σ before placement of FACTs is 0.02, which is improved to 0.019 after placement of six SVCs.  [36]. The voltage profile is generally unstable before placement of FACTS but improves afterwards. In the voltage profile of buses for the grid model 2018, the voltages varied from 0.779 p.u to 1.526 p.u with Standard Deviation (σ) 0.081. After the placement of six SVCs, σ is reduced to 0.06. More improvement can be attained by the placement of more SVCs depending on the budget availability. Similarly, for the forecasted grid the σ before placement of FACTs is 0.02, which is improved to 0.019 after placement of six SVCs.
FACTS. The operating range of voltage at any bus is generally 0.95-1.05 p.u [36]. The voltage profile is generally unstable before placement of FACTS but improves afterwards. In the voltage profile of buses for the grid model 2018, the voltages varied from 0.779 p.u to 1.526 p.u with Standard Deviation (σ) 0.081. After the placement of six SVCs, σ is reduced to 0.06. More improvement can be attained by the placement of more SVCs depending on the budget availability. Similarly, for the forecasted grid the σ before placement of FACTs is 0.02, which is improved to 0.019 after placement of six SVCs.  An overall summary of the planning problem that has been solved for FACTS devices in both the current 2018 and forecasted 2025 model is presented in Table 11.  An overall summary of the planning problem that has been solved for FACTS devices in both the current 2018 and forecasted 2025 model is presented in Table 11.

Conclusions
In this study, a comprehensive planning model is presented for improving the performance of the national grid for both the present as well as the forecasted scenario by the placement of FACTS devices. Initially, analysis is carried out to find optimum locations of FACTS devices using line stability and voltage collapse proximity indices. Lines with the value of L mn index close to unity are considered weak lines and candidate locations for TCSC placement. Similarly, buses with VCPI value close to unity are chosen as candidate locations for SVC placement. After finding the candidate locations for FACTS devices, optimal sizes of these devices have been determined using PSO. Results show that an optimized solution significantly reduces power system losses. Active power losses in the Pakistani national grid model 2018 are reduced by 6.21% and the reactive losses by 6.71% using eight TCSCs and six SVCs. The losses can be further reduced by installing more FATCS devices based on the available budget. The voltage profiles for both the present and forecasted grid are improved to a great extent. For the present model, the standard deviation of bus voltages before placement of FACTS is 0.08, which is improved to 0.064 after FACTS placement. Detailed financial analysis, covering the operational cost before and after placement of FACTS as well as the payback period has been calculated. The analysis presented in the current study will serve as the guidelines for policymakers in developing countries to enhance the performance of the national grid for the present and forecasted scenarios.
In future work, it is planned to also include the small-signal stability of the power system in the objective function. Thus, FACTS will be placed and sized to satisfy smallsignal stability as well as the objectives achieved in this work.
Author Contributions: Conceptualization, investigation, writing-original draft: A.N.K.; Supervision, methodology, reviewing and editing: K.I.; supervising the research work and editing the paper: A.P. The rest of the authors reviewed drafts of the paper and added value to revisions. All authors have read and agreed to the published version of the manuscript.