A Simple Approach to Incorporating STATCOM into a Newton- Based Power Flow and Optimal Power Flow Algorithms

Incorporating STATCOM into existing power flow (PF) or optimal power flow (OPF) algorithm usually requires the development of complex program codes to represent associated derivatives introduced by STATCOM power flow models. This procedure is time consuming as it may require various corrections of errors before having a suitable program that effectively solves the problem. To avoid this stress, an efficient way of incorporating STATCOM’s power flow models into an existing Newton-based PF and OPF algorithm is presented in this paper. These models introduce the magnitude and angle of the STATCOM’s source converter’s voltage as a state variable into the PF and OPF problem formulations. This work simply treats the STATCOM as a PV-bus with zero real power in existing PF and OPF algorithms. The proposed procedures were applied to a 5bus test system and the results obtained were validated with similar works available in open literature. After a satisfactory performance, it was further applied to the 30-bus and 57-bus IEEE test systems. The results obtained show the effectiveness of the proposed procedures in voltage profile improvement. For example, the PF results show that the voltage magnitudes of the two buses with STATCOM in the 30-bus system were improved from 0.9881 pu and 0.9702 pu to 1.027 pu and 1.041 pu, respectively. Also, the OPF results show that the voltage magnitudes of the three buses with STATCOM in the 57-bus system were improved from 1.063 pu, 0.90 pu and 0.9683 pu to 1.039 pu, 0.9796 pu and 1.0144 pu, respectively.


I. Introduction
In electric power systems operations, low or high voltage at load centers is a common occurrence and anticipating how to mitigate it (if it happens), is part of good planning practices. Voltages that are outside tolerable limits are usually caused by; significant shunt capacitances on medium or long transmission lines, nature of load (lagging or leading) and amount of load. Both low and high voltage magnitude can trigger protective devices which can interrupt electric supply to the consumers [1]. Regulating voltage magnitude in the network requires the regulation of available reactive power. Examples of devices that are used for such purpose are; shunt reactor, shunt capacitor, static var compensator (SVC) and static synchronous compensator (STATCOM). Shunt capacitor and reactor are conventional compensators which have been used for a very long time. SVC and STATCOM belong to a family of compensators that are referred to as flexible alternating-current transmission systems (FACTS) devices. FACTS devices can flexibly control power systems parameters as against the conventional compensators. Shunt reactors are designed to regulate high voltage magnitude by absorbing reactive power from the system while shunt capacitors are designed for the regulation of low voltage magnitude by injecting reactive power. Unlike these two devices, the SVC's and STATCOM's can conveniently and flexibly perform the functions of these two devices depending on the operating condition of the network. In principle, the STATCOM does the same voltage regulation as the SVC but in a more robust manner [2], [3]. A detailed comparison between SVC and STATCOM can be found in [4]. Various works in the past had used these two devices and others in power flow (PF) and optimal power flow (OPF) analysis for various forms of compensation with high degree of successes [3]- [5].
Power flow (PF) problem involves finding the steady state voltages at each bus. These voltages are then used to determine power injections of some buses and the real and reactive power flows in each line. For every power system bus, there exist four parameters. These are the voltage magnitude, phase angle, real and reactive power. For every bus, two of these parameters are known while two are unknown. The known and the unknown parameters of the buses form the basis for the categorization of the buses. Bus where voltage magnitude and phase angle are known is referred to as slack bus. In this bus, the real and reactive powers are not known. Bus where the real power and the voltage magnitude are known is referred to as voltage regulated bus. The unknown parameters here are the voltage phase angle and the reactive power. Bus where the real and the reactive powers are known is the load bus. It is expected to find the voltage magnitude and the phase angle of this bus.
Gauss Siedel and Newton-Raphson are the most used methods in solving the power flow problem. However, Newton-Raphson method is most widely used due to its fast convergence characteristics [1]. Many authors [1], [3] have solved the power flow problem using Newton-Raphson methods and have developed software for solving same. These software are freely available for solving the problems that involves different sizes of network. Several works [3], [6]- [9] in the past performed a Newton-Raphson's based load flow analysis with the inclusion of STATCOM by developing a STATCOM-based power flow algorithm to augment the main power flow Jacobian matrix and power mismatch vector. These procedures usually require developing complex computer program codes to determine required parameters. However, a close look at the power flow equation models for STATCOM shows that the equations are like the power flow equations of other buses, hence, its inclusion does not require a separate algorithm. As a result of this, this work proposes a method that easily incorporates STATCOM into the power flow algorithm without necessarily developing any complex codes. The basic criterion to do this is to make STATCOM a PV bus that is connected to an existing bus through its coupling transformer's reactance in any existing power flow algorithm. STATCOM as a PV bus has known voltage magnitude and real power generation of zero. It is worthy of note that the works of the authors in [7], [8] also presented STATCOM as a PV bus. Just as presented in [3], [6], the approaches in both works also developed an algorithm to specifically include STATCOM's power flow models' derivatives into the Jacobian matrix and its power balance equations into the power mismatch vector. On the contrary, this work utilized existing power flow software [1] to present an easy method of incorporating STATCOM into the power flow solution algorithm. The 5-bus test system was used to validate the proposed procedure by comparing the results obtained with the one presented in [3]. After validation, further tests of the proposed procedure were carried out.
In contrast to PF analysis, OPF analysis involves the minimization or maximization of a specified objective function(s) while ensuring system security. The systems securities that are mostly ensured are the power balance, voltage stability, line flow limit, real and reactive generation limits and so on. The popular objective functions that are considered in OPF are, fuel cost, emission, transmission loss, customers satisfaction and so on. More than one of the objectives can be considered to have a multi-objective function problem. Newton-Raphson's approach has been one of the most popular deterministic methods of solving OPF problems [3], [10]. As mentioned earlier, the reason for its popular adoption in solving power systems problems is strictly due to its fast convergence characteristics. The Newton formulation appears to be as fundamental and effective for OPF as it is for power flow. One of the earliest applications of the Newton's approach to optimization of power systems operation was carried out with nonseparable objective function [10]. This method has also been effectively extended to solve hydrothermal optimal power flow (HTOPF) problems [11], [12]. Authors in [3] successfully incorporated several FACTS devices into Newtonbased OPF algorithm without any discussion on the incorporation of STATCOM in OPF. Further survey of the literature shows that there is paucity of works on the subject matter. In a related work by authors in [13] on the incorporation of STATCOM in OPF, it was stated that the derivatives associated with STATCOM were, respectively, added to their corresponding positions in the gradient vector and Hessian matrix during the solution procedure.
Power flow models of STATCOM were used in this work to present an easy and efficient procedure involved in the incorporation of STATCOM into an existing Newton-based OPF MATLAB program codes [14]. The existing MATLAB codes considered the minimization of the generator fuel costs while maintaining satisfactory power system constraints. To achieve this, the STATCOM in OPF algorithm is treated as a generator bus without real power and objective function. Since it doesn't have real power and objective function, it is the reactive power equation of the STATCOM that is treated in the OPF algorithm the same way as the reactive power equation for a generator bus. In this work, an existing OPF program [14] was modified to accommodate the STATCOM models. The modified program was validated using a SVCupgraded 5-bus system presented in [3]. After the validation, it was further tested on 30-bus and 57bus IEEE test systems.

II. Method
This section explains the procedure involved in the easy incorporation of STATCOM in PF and OPF algorithms.

II.1. Power Flow Model of STATCOM
The STATCOM equivalent model as shown in Fig. 1 consists of one voltage source converter (VSC) and the associated shunt-connected transformer. Fig. 1. STATCOM equivalent circuit [3], [7] The power flow equations relating to Fig. 1 are given as [3]; At bus k, where XVR is the reactance of the STATCOM's shuntconnected transformer Vk and VvR are, respectively, the voltage magnitudes at bus k and STATCOM's source converter θk and θvR are respectively the voltage angles at bus k and STATCOM's source converter

II.2. Power Flow Problem Definition
The power flow solution is set to determine the steady state voltage magnitude and angle of power systems network which are used to determine various bus power injection and line power flow. At bus i, the power flow problem is usually formulated as power flow balance equations given in (5) and (6). These equations specify that the algebraic sum of power (real and reactive) at a given bus is equal to zero. These equations are termed 'mismatch power equations'. Solution to these equations provides the steady state information of the power system. Since these equations are non-linear, solving them require iterative procedure such as Newton-Raphson. This method of solving PF problem has been comprehensively explained in [1], [3] and many other works. The method involves linearizing of equations (5) and (6) as shown in equation (7). Voltage magnitude V and angle δ are updated every iteration using equation (9).
Where J is the Jacobian matrix and it contains the first derivatives of equations (5) and (6) as given in equation (8). ∆P and ∆Q are the mismatch of power flow equations (5) and (6). ∆V and ∆δ are the errors in bus voltage magnitude and angle.

II.3. Inclusion of STATCOM into PF
In previous works [3], [7], [8], equations (1) to (4) are used to alter the Jacobian matrix to allow for the STATCOM variables. These alterations are now used to develop a separate algorithm that was used to modify the power flow algorithm whenever STATCOM is introduced. It should be noted that, a critical study of equations (1) to (4) shows that these equations are like the usual power flow equations of each bus. The question that now arises is that, why go through the rigor of developing a separate algorithm to alter the Jacobian matrix due to the inclusion of STATCOM parameters? In this work, incorporating STATCOM only involves making its source converter a voltage regulated bus whose real power is zero and the voltage magnitude (VVR) of the source converter is adjustable till it gives the required voltage at the connecting bus. It is important to note that, the reactance of the STATCOM's shunt-connected transformer represents the reactance of the line that connects the source converter to the bus whose voltage is to be controlled. To increase the voltage of the connecting bus, VVR is made higher than the existing voltage magnitude of the connecting bus and to reduce the voltage, VVR is made to be lower. For example, if a STATCOM is to be incorporated into a 5-bus system to control the voltage magnitude at bus k, the source converter and the shunt-connected transformer of the STATCOM will, respectively, be represented as bus 6 and the reactance of the line connecting the source converter to bus k. Bus 6 will be treated as a dummy generator bus in the algorithm with zero real power injection and an adjustable voltage magnitude. The injected or absorbed reactive power by the STATCOM is determined by the reactive power flow to bus k from bus 6 or otherwise. A flow chart that further explains the easy procedure involved in the inclusion of STATCOM in the PF algorithm is shown in Fig. 2. Edit the bus and line data to include the power flow data of the system to be solved

II.4. Optimal Power Flow Problem Definition
The optimal power flow can be formulated as a general constraints optimization problem as follows [10,15].
where z is the vector of power flow variable. For example, bus voltage magnitude (V) and angle (δ), real power generation (Pg) and so on, f(z) is the objective function to be optimized, g(z) represents the power mismatch equations (5) and (6) and h(z) consists of state and control variable limits.
Elements of x and y are, respectively, the known and unknown variables for PF analysis.
To solve the problem presented in equation (10), there is need to convert the constrained problem to an unconstrained one with the introduction of a Lagrangian function given in equation (12). It is important to note that the objective function f(z) considered in this study is the fuel cost. The Lagrangian function is then differentiated with respect to z and λ and the resulting equations equated to zero as given in equation (13). Equation (13) contains various non-linear equations that require iterative solution method. This equation is also referred to as gradient vector. To use Newton's approach, Equation (13) is linearized to give equation (14). At the end of each iteration, the variables are updated according to equation (16). It should be noted that, to avoid mathematical complexity, solving the Lagrangian function does not initially involve the inequality constraints of equation (10c). If limits violations occur, enforcement is usually handled either by penalty or multiplier method [3].
where λ and μ are multiplier vectors for equality and inequality constraints.
where [H] is the Hessian matrix which contains the second partial derivatives of the augmented Lagrangian function as shown in Equation (15).
is the change or error in control and state variables for each iteration.
Further details of the Newton's procedure of solving OPF can be accessed in the works of [3,10,13]. Based on these works, an accessible computer program was developed and an extension of this program was made to accommodate the inclusion of STATCOM.

II.5. Inclusion of STATCOM into OPF
The power flow mismatch equations at bus k and source converter of the STATCOM are modelled in the Lagrangian function as an equality constraint given by the following equation: where Pk, Qk and QVR are as given in equations (1) to (4), Pdk and Qdk are the active and reactive power demands at bus k, Pgk and Qgk are the scheduled active and reactive power generation at bus k; and λpk, λqk, and λqVR are Lagrange multipliers at bus k and the source converter. QgVR is the injected or absorbed reactive power by the shunt source converter.
Since it can be assumed that the active power exchange between the AC system and the STATCOM can be neglected, PVR in equation (3) can be neglected in equation (12) [3]. As mentioned earlier, the PF equations (1) to (4) are the same as that for any other bus. In OPF formulation, the STATCOM's source converter is also considered as a dummy bus in the algorithm. With this consideration, the inclusion of STATCOM into the existing Newton-based OPF program does not introduce any variables which the existing program had not catered for (i.e. bus voltage magnitude and angle).
The first requirement considered for the inclusion is that the source converter was represented in the OPF algorithm as a dummy generator bus. This was done by handling the reactive power equation (4) of the source converter the same way the reactive power equation of the generator bus was handled [10]. This is by placing a large value in the diagonal of the Hessian matrix that corespond to λqVR.
The form of the penalty function for the reactive power constraint at the source converter is [3]; Equations (19) and (20) were respectively added to the element associated to λqVR in the gradient vector and diagonal element of the Hessian matrix [3].
Secondly, the associated shunt-connected transformer with a reactance of XVR was represented in the algorithm as the line reactance between bus k and the source converter.
The source converter voltage magnitude VVR also has upper and lower limits and it is handled in the algorithm the same way other voltage magnitude limits are handled. A flow chart that further explains the procedure involved in the inclusion of STATCOM in the OPF algorithm is shown in Fig.  3.

III. Results and Discussions
The procedure presented above has been incorporated into an existing PF and OPF program and was tested on 5-bus, 30-bus and 57-bus IEEE networks. The 5-bus was used for validation of the procedure since a similar work [3] used same system. After a successful validation, the procedure was tested on the 30-bus and 57-bus IEEE test networks.
For PF analysis, the voltage of the STATCOM's source converter is adjusted to give a satisfactory voltage level at the connecting bus k.
In the case of OPF, the objective function to be minimized is the active power generation cost. The STATCOM is optimally used to improve the voltage magnitude of the connecting bus k, which in turn improves the voltage profile of the entire system. The STATCOM's shunt-connected transformer impedance XVR used for all the test systems is 0.1 pu.

IV. Results for 5-Bus Test System
This system was first used to test the performance of the inclusion of STATCOM in PF and OPF. The PF and OPF data for the network are contained in [3]. Open existing OPF program file [14] Edit the bus and line data to include the power flow data of the system to be solved

IV.1. STATCOM-based Power Flow Results for 5bus
For the PF solution, the work being used for validation [3], placed STATCOM on bus 3 (Lake) to maintain the bus voltage magnitude at 1 pu. In this proposed procedure, STATCOM' source converter was made a voltage regulated bus on the data section of the program by making it bus 6 and the reactance of the line connecting buses 3 and 6 was made the reactance of the shunt connected transformer which is 0.1 pu . Since this system was for validation purpose, the solution presented by [3] showed that a VVR of 1.025 pu was able to maintain the voltage at Lake at 1 pu. In this work, for proper comparison, the voltage magnitude on bus 6 (i.e. VVR) was set at 1.025 pu. Table 1 shows the comparison of some parameters. This table shows that the proposed approach to incorporating STATCOM in the PF analysis is closely comparable with the one available in open literature. The reactive flow from bus 6 to 3 is 20.49 MVAR. This value is also similar to the one generated by STATCOM (i.e. 20.5 MVAR) as presented in [3]. With the results obtained, it is obvious that, the inclusion of STATCOM can be represented with a dummy voltage controlled bus. After a satisfactory performance of the proposed approach on the 5-bus system, the approach was tested on the IEEE 30-bus and 57-bus networks.

IV.2. STATCOM-based Optimal Power Flow Results for 5-bus
One STATCOM was placed on bus 4 (Main) to allow the voltage magnitude at the bus to vary within 1.1 pu and 0.9 pu. The results for the inclusion of STATCOM in this work was compared with the one presented in [3] for SVC-upgraded 5bus system. SVC-upgraded system was considered because there is no Newton-based STATCOMupgraded system to compare with and it has similar function to STATCOM.  Table 2 compares the results obtained with the SVC-upgraded system. The upper and lower limits of the voltage magnitude of the STATCOM's source converter considered are respectively 1.1 pu and 0.90 pu. Table 2 shows that the results obtained were comparable with the one considered in [3]. The STATCOM parameters associated with the injected reactive power at bus 4 (Main) are VVR= 1.096 pu and δ VR = -3.963 o . A reactive injection of 12.07 MVAR was obtained to improve the voltage magnitude of Main from the base case value of 1.0779 pu to 1.085 pu. It should be noted that the STATCOM reactive power injection was the reactive power flow from source converter to bus 4.

V. Results for 30-Bus IEEE test system
This system consists of 30 buses and 41 transmission lines which connect six thermal generating stations to various load points. The PF and OPF data for this network is available in [1]. After a satisfactory validation of the program on the 5-bus test system, the proposed procedure was further applied to the 30-bus IEEE test system.

. STATCOM-based Power Flow Results for 30bus
Two STATCOMs whose voltage magnitudes (VVR) were set at 1.05 pu were used on this system on buses 15 and 30. With the inclusion of these devices, the total number of buses in the system now becomes 32. The transmission line data also increases by two (i.e. 16 to 31 (for STATCOM 1) and 30 to 32 (for STATCOM 2)). STATCOM is expected to improve the voltage profile of the system. The base case values obtained for the voltage magnitude of the buses are 0.9881 pu and 0.9702 for buses 16 and 30, respectively. To discuss the effects of STATCOM on this network, it is important to review the PF results (i.e. base case results) without STATCOM.
The base case PF results of the system show that the total real and reactive generations are 278.31 MW and 201.56 MVAR, respectively. The total real and reactive losses are 14.91 MW and 99.66 MVAR, respectively. With the inclusion of STATCOM, the PF results show that the total real and reactive generation are 277.77 MW and 194.04 MVAR, respectively. There is no significant difference in the real power generation when compared to the base case value, but for reactive generation, a decrement of 3.73% was recorded.
The real and reactive losses with STATCOM are 14.37 MW and 92.14 MVAR, respectively. When the recorded loses are compared to the base case values, there is no significant change in the real loss but there exist 7.55% decrement for the reactive loss. A comparison of the voltage profile of the system with and without the two STATCOMs is shown in Fig. 4. It is obvious that the voltage of the system was greatly improved as buses 15 and 30 now have voltage magnitude of 1.027 pu and 1.041 pu, respectively. The δVR for the two STATCOMs are -22.20 o and -37.48 o , respectively. The increased voltages at both buses greatly improved the voltage profile of the entire system. The injected reactive power from the STATCOMs at buses 15 and 30 (i.e. reactive power flow into the two buses from buses 31 and 32) are 24.03 MVAR and 9.38 MVAR, respectively.

V.2. STATCOM-based Optimal Power Flow Results for 30-bus
The base case OPF solution of this network converges to a total real and reactive generation of 293.22 MW and 133.79 MVAR, respectively. The active and reactive power losses of the system are 9.81 MW and 42.43 MVAR, respectively. The total fuel cost of all thermal plants is 803.35 $/h. The lower and upper limits of the voltage magnitude were set at 0.9 pu and 1.1 pu respectively.
For this system, two STATCOMs were placed at buses 15 and 30 as it was done in the case of PF. The base case voltage magnitudes at these buses (without STATCOM) are 1.002 pu and 0.960 pu, respectively. For the STATCOM-upgraded system, the upper and lower limits on voltage magnitude on all buses were also set at 0.9 pu and 1.1 pu. The OPF results of the STATCOM-upgraded system show that the total real and reactive generation are 293.13 MW and 134.18 MVAR, respectively. The total fuel cost recorded is 803.04 $/h. The real and reactive losses recorded are 9.73 MW and 41.62 MVAR, respectively. There were no significant differences in the fuel cost, generations and losses recorded when compared to the ones for base case.
A Comparison of the bus voltages with and without STATCOM is shown in Fig. 5

VI. Results for 57-Bus IEEE test system
This system consists of 57 buses and 80 transmission lines which connect seven thermal generating stations to various load points. The PF and OPF data for this network is available in [16].

VI.1. STATCOM-based Power Flow Results for 57bus
Three STATCOMs whose voltage magnitudes (VVR) were set at 1.0 pu were used on this system on buses 16, 31 and 57. With the inclusion of these devices, the total number of buses in the system now becomes 60 and the transmission line data also increases by three (i.e. 16  With the inclusion of the STATCOMs, the PF results show that the total real and reactive generation are 1270.67 MW and 359.943 MVAR, respectively. The reductions in the real and reactive power when the STATCOMs were included are minimal (less than 1%). The real and reactive losses are 19.87 MW and 23.54 MVAR, respectively. These values are, respectively, 2.68% and 7.58% decrement from the base case losses. A comparison of the voltage profile of the system with and without the three STATCOMs is shown in Fig. 6. It is obvious that the voltage of the system was greatly improved as buses 31 and 57 now have voltage magnitude of 0.9871 pu and 0.9905 pu, respectively. The voltage magnitude of bus 16 is reduced to 1.0273 pu. The increased voltage at bus 31 greatly improved the voltages of buses that are directly connected to it. The δVR of the STATCOMs connected to buses 16, 31 and 57 are -4.40 o , -14.90 o and -10.67 o , respectively. The injected reactive power from the STATCOMs at buses 31 and 57 (i.e. reactive power flow into the two buses from buses 59 and 60) are 12.70 MVAR and 9.44 MVAR, respectively. As against the reactive power injection experienced at buses 31 and 57, there was reactive power absorption of 28.02 MVAR at bus 16 to reduce the voltage magnitude. Reactive injection is most times needed to increase voltage magnitude while reactive power absorption is required to reduce high voltage magnitude.

VI.2. STATCOM-based Optimal Power Flow Results
The base case OPF solution of this network converges to a total real and reactive generation of 1270.12 MW and 287.71 MVAR, respectively. The active and reactive power losses of the system are 19.32 MW and 83.24 MVAR, respectively. The total fuel cost of all thermal plants is 41,840.60 $/h. The lower and upper limits of the voltage magnitude were set at 0.9 pu and 1.1 pu respectively. For the OPF, three STATCOMs were also placed at buses 16, 31 and 57 as reported earlier. The base case voltage magnitudes at these buses are 1.063 pu, 0.90 pu and 0.9683 pu, respectively.
For the STATCOM-upgraded system, the upper and lower limits on voltage magnitude on all buses were also set at 0.9 pu and 1.1 pu except for bus 16 whose upper limit was set at 1.04 pu. This was done with a view to knowing the appropriate STATCOM voltage setting that can make the voltage magnitude of the bus to be less than or equal to 1.04 pu. The OPF results of the STATCOM-upgraded system show that the total fuel cost of generation is 41,786.50 $/h with a total real and reactive generation of 1268.86 MW and 274.83 MVAR, respectively. While the STATCOM-upgraded system real power generation and fuel cost are insignificantly lesser than the one presented for the base case, a reduction of about 4.5% was recorded for the reactive power. The real and reactive losses recorded are 18.07 MW and 78.07 MVAR, respectively. These values are, respectively, 6.47% and 6.21% reductions from the base case values. A Comparison of the bus voltages with and without STATCOM is shown in Fig. 7. It is clear from the figure that the voltage profile of the system improves significantly. The voltage magnitudes at buses 16, 31 and 57 for the STATCOM-upgraded system are 1.039 pu, 0.9796 pu and 1.0144 pu, respectively. The injected reactive power from the STATCOMs at buses 31 and 57 are 8.85 MVAR and 10.61 MVAR, respectively. In contrast to reactive injection at buses 31 and 57, there was reactive power absorption of 9.24 MVAR at bus 16 to reduce the voltage magnitude. Further check of the results for this network showed that the STATCOMs affected the bus marginal cost. A comparison of the bus marginal cost with and without STATCOM is shown in Fig.  8. This figure shows that, the introduction of STATCOM did not only improve the voltage profile, but improves the bus marginal cost. It is important to state that, the bus marginal cost is useful for energy pricing at different busses. The higher its value, the higher the cost of energy supply to such bus. The highest improvement recorded was on bus 31 with a 21.5% reduction from the base case value of 61.54 $/MWh to 48.31 $/MWh after the inclusion of STATCOM.

VII. Conclusion
An easy and efficient way of incorporating STATCOM into an existing Newton-based PF and OPF algorithms have been presented. For both algorithms, STATCOM's voltage source converter has been treated as a generator bus while the reactance of the shunt-transformer was treated as the reactance of the line connecting the generator bus to any bus of choice. For the PF problem, it was achieved by mere assigning a voltage magnitude value (VVR) for the source converter with zero real power injection. For the OPF problem, it was done by augmenting the gradient vector and Hessian matrix with the derivatives of a penalty function. The amount of reactive power injection or absorption at the connecting bus is the reactive power flow between STATCOM's source converter and the connecting bus. The algorithms were validated with a 5-bus network and further tests were done on 30-bus and 57-bus IEEE networks. From the results obtained, the proposed procedures have shown to be capable of solving PF and OPF problem of a STATCOM-upgraded power network very reliably.