Evaluation of FACTS Contributions Using Branch Flow Model and Newton–Raphson Algorithm

: Flexible alternating current transmission systems (FACTSs) have been widely incorporated in electric power systems in order to control system parameters. This paper proposes the modeling of four FACTS devices, using the Branch Flow Model (BF) as an optimization problem to reduce the complexity of the Newton–Raphson (NR) load ﬂow code with FACTS devices. The devices are represented as variable impedances, as a function of a ﬁring angle, and as voltage source converters (VSCs) located on the buses and transmission lines. This proposed model solves the problem associated with the selection of appropriate initial conditions of the parameters of each device that guarantee convergence. The model is validated by evaluating its percentage deviation with respect to the NR method, using the standard test systems, IEEE 5-bus, IEEE 14-bus, IEEE 30-bus, and IEEE 57-bus systems.


Introduction
The economic growth of a country is closely related to the development of its electrical system.The continuous expansion of electrical systems generates an increase in the complexity of planning, operation, and maintenance.One of the main problems is the lack of optimization in the use of existing transmission networks due to thermal and stability limits that can compromise the security of the electrical system and interrupt the transport of electrical energy [1].In the last decades, social, environmental, and regulatory constraints have worsened, creating a barrier to the construction of new transmission and generation infrastructures, leading to the search for new solutions to optimize the use of existing assets.Power electronics represent the best alternative to replace electromechanical technologies due to their high maintenance costs and slow response times during operation [2].
The term Flexible Alternating Current Transmission System (FACTS) was introduced in the 1990s [3,4].Years later, it was formally defined as FACTS, i.e., power electronics with the ability to control system parameters, such as power flow, transmission line impedances, voltage magnitude, and bus phase angle, due to the technology available to support high currents and high voltage levels [5].FACTS devices play an important role in power systems, as they provide flexibility to the system, improving system stability by dynamically controlling energy transfer and reducing the probability of system oscillations and collapse [6][7][8].In general, FACTS devices increase the system's transmission capacity and reduce congestion levels, translating into a reduction in active power losses, improved voltage profile, improved power quality, and increased system reliability, as well as more precise and flexible control when integrating renewable energies [9,10].The strategic location of FACTS devices in a power system during the operation stage is essential, since they improve the behavior of the system variables in areas close to where they were installed [11,12].The compelling advantages offered by FACTS technology have been the primary driving force behind its adoption in electrical systems for decades, which is why its development has advanced at great speed due to widespread acceptance by the industry [13].
According to [2], FACTS can be classified into four generations.The main characteristic of the first-generation devices is the control of the system variables using fast switching thyristors; these devices are connected to the system in series or parallel arrangement.The operation and connection mode of the static varistor compensator (SVC) are detailed in [14].Experiences in countries such as China and Canada have demonstrated its application in 500 and 735 kV [13].Likewise, the Thyristor Controlled Series Compensator (TCSC) [15] is installed at 500 kV levels in China and Brazil [13].In the case of second-generation devices, the control is performed by switching transistors, with the Static Synchronous Compensator (STATCOM) and the Static Synchronous Series Compensator (SSSC) being the most prominent of their generation.The connection mode and operating principle of the STATCOM [16] and SSSC [17] are analogous to those of the first generation.Such FACTS equipment was installed in India and Australia at voltage levels of 500 kV [13].The Unified Power Flow Controller (UPFC) [18] belongs to the third-generation devices that allow for integral control of the variables in a transmission line; it is achieved by combining the SSSC and STATCOM devices connected in series and shunt, respectively, for the same transmission line.There are experiences in countries such as USA and China at 345 and 500 kV levels [13].In the fourth-generation devices are the Interline Power Flow Controller (IPFC) [19] and the Generalized Power Flow Controller (GUPFC) [20], which could perform compensation in series and shunt, but in different transmission lines.
The steady-state power flow algorithm calculates the magnitude and phase angles of bus voltages, active and reactive power flows, and other variables of interest [21].Including FACTS devices in the power flow analysis as part of the technical-economic evaluation during the planning stage provides a solid basis for long-term investment decisions, generating financial benefits and contributing to the optimization of the operation [8].From the above, it is feasible to evaluate the performance of FACTS technologies to meet new operational requirements and make them more efficient.
There are multiple research articles [22][23][24][25] that implement FACTS controllers as part of the NR load flow algorithm; however, this implementation increases the complexity of the programming code due to some reasons that we can mention [6,15].As a first reason, the incorporation of the FACTS controller requires the definition of new transmission lines and/or reference buses.As a second reason, the drift and/or series impedances of the FACTS must be considered in the original admittance matrix; also, the size of the Jacobian matrix must be redefined to include the FACTS control variables, and new codes must be developed for their calculation.As a third reason, the powers contributed by the FACTS must be considered in the balance and/or mismatch of powers in each bus.Finally, FACTS are modeled as variable impedances or voltage source converters (VSCs) that have, as a very critical condition, the selection of the initial values for a fast convergence [15].
This paper proposes a simple and efficient modeling of four FACTS controllers, using the Branch Flow Model (BF) as an alternative to the NR load flow algorithm.The first device, SVC, represented as a shunt reactive power injection, uses the thyristor firing angle as a control variable to regulate the reactive power input and adjust to the desired bus voltage.The second device, TCSC, represented as a series variable impedance, also employs the firing angle of the thyristors as a control variable to modify the value and direction of the required active power flow through the transmission line.The third device, STATCOM, represented as reactive power injection in shunt, uses the modulus and angle of the VSC as control variables to regulate the reactive power input and adjust to the desired bus voltage.Finally, SSSC, represented as two loads injected in the extreme bars of the transmission line where it is installed, also uses the VSC module and angle as control variables to modify the value and direction of the required active power flow.This proposed model overcomes the problem associated with the selection of the appropriate initial values of the control variables of each FACTS device: it guarantees the convergence of the load flow and requires low computational time.For its validation, the standard test systems, IEEE 5 busbars, IEEE 14 busbars, IEEE 30 busbars, and IEEE 57 busbars, were used.
This work is structured as follows.Section 1 provides a concise literature review on FACTS devices, similar studies, their importance in power flow analysis, and inputs or contributions.Section 2 develops the Branch Flow Model as an optimization problem, the mathematical models for each FACTS device expressed as constraints for the optimization problem and as Newton-Raphson (NR) equations for the modified power flow.Subsequently, Section 3 presents the results of the implemented models where the percentage deviations are evaluated to validate the model and computational performance in terms of the mean processing time (MPT).Section 4 discusses the aspects not considered in the present research work and proposes future work in the same line of study.Finally, Section 5 presents the conclusions and main contributions of this work.

NR and OPF with FACTS Devices
The mathematical model of OPF was first formulated in the 1960s by J. Carpentier [26,27].OPF is commonly characterized as a minimization problem with an objective function that can be linear or nonlinear subject to equality and inequality constraints.
It is common to define OPF as the determination of state variables that can be dependent or independent within their stated bounds that, at the same time, optimize their objective function by satisfying their sets of equality and inequality constraints [28].Thus, the AC power flow models of the different FACTS devices connected in the power system are described in steady state and positive sequence, and the transmission line is represented by its equivalent model π, which is suitable for lines less than 240 km long [29].

AC Power Flow Model
The Branch Flow Model [30] is used to describe the AC power flow.Figure 1 [31] represents a generic model of branches composed of three buses (n, k, m) and two branches of a transmission line (nk, km).Based on the presented system and analyzing the km branch, there is a voltage drop due to the series impedance. where V k and → V m are the voltages at bus k and m, respectively; → I km is the current in the direction from bus k to bus m; R km and X km are the resistance and reactance, respectively, corresponding to branch km; and j is the imaginary unit.The current flow can be obtained from the apparent power calculation.
where P km and Q km are the active and reactive power flow from bus k to bus m, respectively; and * is the conjugate operator of the complex numbers.Developing and substituting Equation ( 2) into (1), we have.
Energies 2024, 17, 918 sented by its equivalent model π, which is suitable for lines less than 240 km long [29].

AC Power Flow Model
The Branch Flow Model [30] is used to describe the AC power flow.Figure 1 [31] represents a generic model of branches composed of three buses (, , ) and two branches of a transmission line (, ).Based on the presented system and analyzing the  branch, there is a voltage drop due to the series impedance.
where  ⃗  and  ⃗  are the voltages at bus  and , respectively;   is the current in the direction from bus  to bus  ;   and   are the resistance and reactance, Developing (3) in rectangular coordinates gives the following: where θ km is the angular difference between bus k and m.Summing the squares of ( 4) and (5), we obtain the following: where Z km is the impedance of the branch km.The squared current flow can be determined by (7).
Equation ( 6) describes the application of Kirchhoff voltage and is a numerically robust and, at the same time, scalable method for strongly radial systems [32], where voltage phase angles are unnecessary, as in the case of distribution systems.On the other hand, in strongly meshed systems, as in the case of transmission systems, phase angles are essential and have an important role [31], so (4) or (5) should be considered within the model.In the analysis of this paper, (5), (6), and (7) are considered together with the power balance equations, where the direction of the current active and reactive power flow is from k to m.A forwarding power, P km + R km I 2 km , is established from bus k and, for the case of bus m, as − P km + R km I 2 km , finally, the term R km I 2 km represents the losses in the branch.For the OPF problem, the active and reactive power balance is introduced as equality constraints concerning bus k, as is given in (8) and (9).
where P g k and Q g k are the active and reactive power generated at bus k, respectively; P d k and Q d k are the active and reactive power demanded at bus k, respectively; G sh k and B sh k is the conductance and susceptance of the static compensation device at bus k, respectively; B shl km is the capacitive susceptance of the km branch; and Ω k is the set of buses neighboring at bus k.For the active power balance, shown in (8), the following terms are described: 1.
The negative term G sh k V 2 k represents the active power drained as losses from the shunt element.

2.
The sum of the terms P km + R km I 2 km represents the power flows, including losses, going out of bus k to the neighboring bus m connected through branch km.
For the reactive power balance (case shown in (9)), the following terms are described:

3.
The term B sh k V 2 k represents the reactive power of the uncontrolled shunt element.4.
B sh k must be positive when injecting power in capacitive behavior, and B sh k must be negative when absorbing power in inductive behavior.

5.
The sum of terms Q nk + B shl nk V 2 k denotes the power flows reaching bus k from its neighboring bus n connected through branch nk, including half of the power input represented at the arriving end due to the capacitive effect of the transmission line.

6.
The sum of the terms Q km − B shl km V 2 k + X km I 2 km represents the power flows leaving bus k towards the neighboring bus m connected by branch km, which includes half of the power input represented at the output end due to the capacitive effect of the transmission line plus the losses from this.
In this model, transformers are considered to be transmission lines with only longitudinal losses: the transverse losses due to the capacitive effect are zero.Equations ( 5)-( 9) must be included in the formulation of the OPF problem, and it is necessary to define a reference or slack bus in which the variables V and θ must be fixed with the prespecified values.In the case of the PV bus, the specified voltage magnitude and active power must also be fixed.
Variables that are not specified are defined within their bounds, which should be introduced in the model as inequality constraints.According to the type of application of the OPF problem, the objective function can be defined in different ways.The most common is minimizing the cost of active power generation, reactive power injection, load shedding, losses, and others [28].

SVC-Firing Angle Model
Figure 2 [33] describes the structure of the SVC, which is used to represent its mathematical model and include it in the power flow formulation.The SVC simulates the behavior of a variable shunt reactance, X SVC , which, from an operational point of view, automatically adjusts to changes in the operating condition of the system.The variable reactance is controlled through the firing angle of the thyristor, α SVC , which, due to its high switching speed, can perform a fast reactive power injection or absorption to control the voltage regulation at the connection point to the system [34].
Energies 2024, 17, x FOR PEER REVIEW 4.   ℎ must be positive when injecting power in capacitive behavior, and   ℎ m negative when absorbing power in inductive behavior.5.The sum of terms   +   ℎ   2 denotes the power flows reaching bus  f neighboring bus  connected through branch , including half of the powe represented at the arriving end due to the capacitive effect of the transmissio 6.The sum of the terms   −   ℎ   2 +     2 represents the power flows bus  towards the neighboring bus  connected by branch , which in half of the power input represented at the output end due to the capacitive e the transmission line plus the losses from this.
In this model, transformers are considered to be transmission lines with only tudinal losses: the transverse losses due to the capacitive effect are zero.Equations must be included in the formulation of the OPF problem, and it is necessary to d reference or slack bus in which the variables V and θ must be fixed with the presp values.In the case of the PV bus, the specified voltage magnitude and active powe also be fixed.
Variables that are not specified are defined within their bounds, which sho introduced in the model as inequality constraints.According to the type of applica the OPF problem, the objective function can be defined in different ways.The mo mon is minimizing the cost of active power generation, reactive power injectio shedding, losses, and others [28].

SVC-Firing Angle Model
Figure 2 [33] describes the structure of the SVC, which is used to represent it ematical model and include it in the power flow formulation.The SVC simulates havior of a variable shunt reactance,   , which, from an operational point of vi tomatically adjusts to changes in the operating condition of the system.The variab tance is controlled through the firing angle of the thyristor,   , which, due to i switching speed, can perform a fast reactive power injection or absorption to con voltage regulation at the connection point to the system [34].The controlled variable, equivalent reactance, is derived from Figure 2 and cal as shown in (10).
where   and   are the capacitive and inductive reactance of the of the device.T trolled reactive power for voltage regulation is as follows: The controlled variable, equivalent reactance, is derived from Figure 2 and calculated as shown in (10).
where X C and X L are the capacitive and inductive reactance of the of the device.The controlled reactive power for voltage regulation is as follows: Energies 2024, 17, 918 6 of 19

Newton-Raphson Algorithm with SVC
This device can be represented as a reactive power injection into the connection bus.The reactive contribution shown in (11) should be linearized and included in the Jacobian matrix by the reactive power balance of the algorithm [35], as in (12).
To set the SVC, in each iteration of NR, the thyristor angle is updated by (13).

OPF with SVC
The SVCs are introduced into the OPF problem as a set of variables and equality constraints.Expression ( 11) is represented as an additional equality constraint in which the reactive power, Q svc k , and the firing angle, α SVC , are dependent and independent variables, respectively.The controlled reactive power, capacitive Q svc k > 0, or inductive Q svc k < 0 behavior only modifies the reactive power balance in Expression ( 9), as is given by ( 14).

TCSC-Firing Angle Model
Figure 3 [33] outlines a TCSC structure that supports the description of the TCSC mathematical model.This device can electrically compensate for the length of the transmission line by varying its serial impedance through the thyristor firing angle, α tcsc , allowing for the rapid regulation of active power to a specified value.An important application is to flow as much active power as possible from the generation areas to the load areas without overloading the transmission lines.In addition, from the transient-regime point of view, it increases the stability margin of the system and allows damping power oscillations due to its fast response [15].
To set the SVC, in each iteration of NR, the thyristor angle is updated by (13).

OPF with SVC
The SVCs are introduced into the OPF problem as a set of variables and equality constraints.Expression ( 11) is represented as an additional equality constraint in which the reactive power,    , and the firing angle,   , are dependent and independent variables, respectively.The controlled reactive power, capacitive    > 0 , or inductive    < 0 behavior only modifies the reactive power balance in Expression ( 9), as is given by (14).

TCSC-Firing Angle Model
Figure 3 [33] outlines a TCSC structure that supports the description of the TCSC mathematical model.This device can electrically compensate for the length of the transmission line by varying its serial impedance through the thyristor firing angle,   , allowing for the rapid regulation of active power to a specified value.An important application is to flow as much active power as possible from the generation areas to the load areas without overloading the transmission lines.In addition, from the transient-regime point of view, it increases the stability margin of the system and allows damping power oscillations due to its fast response [15].The equivalent series impedance of the TCSC shown in Figure 3 is given by ( 15)- (19).
) The equivalent series impedance of the TCSC shown in Figure 3 is given by ( 15)-( 19).
where X C and X L are the capacitive and inductive reactance of the of the device.

Newton-Raphson Algorithm with TCSC
The input of each TCSC device adds a dummy bus to the original system and defines an additional branch with variable impedance in series with an existing transmission line [35].In this way, the size of the Jacobian matrix is increased by three rows and three columns for each device, according to (20).
where P α tcsc km is the active power flow controlled by the device in the km branch.To set the TCSC, in each iteration of NR, the thyristor angle is updated by (21).

.2. OPF with TCSC
The thyristor angle, α tcsc , and controllable reactance, X TCSC , represent, respectively, the independent and dependent variables for this device.In this case, Expression ( 15) is an equality constraint associated with the variable reactance of the TCSC, while involving a readjustment in the nodal reactive power balance, as in (22).
An increase in the impedance of a circuit produces a higher voltage drop between its ends and higher losses, so Kirchoff's voltage law for entangled networks in OPF must be modified by (23) and (24).

STATCOM
Figure 4a [35] illustrates the working principle of STATCOM and the formulation of its mathematical model.A simpler model to implement is composed of a controlled voltage source, magnitude, and angle, in series with a coupling transformer reactance that connects it in parallel with the transmission network [2].It can inject or absorb reactive power by including a reactive current through the controlled source for voltage regulation at the bus where it is connected.It is also possible to absorb the active power of the system and store it by controlling the angular opening between the source and the network; however, its main use is voltage regulation, which is determined by the difference of voltage modules between the source and the system [13].The voltage source is controlled through the variable's voltage magnitude and phase angle in their defined ranges specified in (25).
where   and   are the magnitude and phase angle of the STATCOM voltage source, respectively.

Newton-Raphson Algorithm with STATCOM
To perform the voltage control, the bus with the installed device is modified to a PVtype bus.Each STATCOM requires the definition of a dummy shunt-connected bus that emulates the controlled voltage source capable of injecting or absorbing reactive power, via the coupling transformer, into the bus, where voltage regulation is required [35].The power flow expressions, ( 26) and ( 27), are obtained using Figure 4b [35].
where    and    are the active and reactive power injected or absorbed by the STAT-COM, respectively; and   is its coupling transformer admittance.The number of rows and columns of the Jacobian matrix should be increased by two for each device, as in (28).5, STATCOM is represented as a voltage source with the ability to take independent control of power injections into the connection bus,   , expressed by a set of variables and equality constraints [36].The active power,    , and reactive power,    , are defined as dependent variables; and the phase angle,   , of the controlled source and its scaling factor,   , are the independent variables.The voltage source is controlled through the variable's voltage magnitude and phase angle in their defined ranges specified in (25).
where V ssc and δ ssc are the magnitude and phase angle of the STATCOM voltage source, respectively.

Newton-Raphson Algorithm with STATCOM
To perform the voltage control, the bus with the installed device is modified to a PV-type bus.Each STATCOM requires the definition of a dummy shunt-connected bus that emulates the controlled voltage source capable of injecting or absorbing reactive power, via the coupling transformer, into the bus, where voltage regulation is required [35].The power flow expressions, ( 26) and ( 27), are obtained using Figure 4b [35].
where P ssc k and Q ssc k are the active and reactive power injected or absorbed by the STATCOM, respectively; and Y ssc is its coupling transformer admittance.The number of rows and columns of the Jacobian matrix should be increased by two for each device, as in (28).

OPF with STATCOM
According to Figure 5, STATCOM is represented as a voltage source with the ability to take independent control of power injections into the connection bus, V k , expressed by a set of variables and equality constraints [36].The active power, P ssc k , and reactive power, Q ssc k , are defined as dependent variables; and the phase angle, δ ssc , of the controlled source and its scaling factor, m ssc , are the independent variables.The voltage source is controlled through the variable's voltage magnitude and phase angle in their defined ranges specified in (25).
⃗  =   (cos   +  sin   ) (25) where   and   are the magnitude and phase angle of the STATCOM voltage source, respectively.

Newton-Raphson Algorithm with STATCOM
To perform the voltage control, the bus with the installed device is modified to a PVtype bus.Each STATCOM requires the definition of a dummy shunt-connected bus that emulates the controlled voltage source capable of injecting or absorbing reactive power, via the coupling transformer, into the bus, where voltage regulation is required [35].The power flow expressions, ( 26) and ( 27), are obtained using Figure 4b [35].
where    and    are the active and reactive power injected or absorbed by the STAT-COM, respectively; and   is its coupling transformer admittance.The number of rows and columns of the Jacobian matrix should be increased by two for each device, as in (28).5, STATCOM is represented as a voltage source with the ability to take independent control of power injections into the connection bus,   , expressed by a set of variables and equality constraints [36].The active power,    , and reactive power,    , are defined as dependent variables; and the phase angle,   , of the controlled source and its scaling factor,   , are the independent variables.The voltages phasors are then defined by ( 29)-(31).
In addition, power injections must be included in the power balance, as given in ( 34) and (35).

SSSC
In Figure 6 [37], the SSSC is represented as a voltage source, allowing it to describe its operating principle and formulate its mathematical model.This device, like the STATCOM, is composed of an independent voltage source, a coupling transformer, and a storage system [38].The voltage source injects a voltage in quadrature with the current through the coupling transformer, which delays or advances it by 90 degrees to simulate an inductive or capacitive reactance, respectively, in series with the transmission line [39].The active power control is performed by the injected voltage magnitude, which directly influences the reactance value, allowing us to maximize the power transmitted through the line or reduce the overload in it; likewise, it can perform series compensation regardless of the current value in the transmission line [17].The voltages phasors are then defined by ( 29)-(31).
In addition, power injections must be included in the power balance, as given in ( 34) and (35).

SSSC
In Figure 6 [37], the SSSC is represented as a voltage source, allowing it to describe its operating principle and formulate its mathematical model.This device, like the STAT-COM, is composed of an independent voltage source, a coupling transformer, and a storage system [38].The voltage source injects a voltage in quadrature with the current through the coupling transformer, which delays or advances it by 90 degrees to simulate an inductive or capacitive reactance, respectively, in series with the transmission line [39].The active power control is performed by the injected voltage magnitude, which directly influences the reactance value, allowing us to maximize the power transmitted through the line or reduce the overload in it; likewise, it can perform series compensation regardless of the current value in the transmission line [17].In (36) is expressed the phase of the controlled voltage source.

𝐸 ⃗ 𝑠𝑠𝑠𝑐 = 𝑚 𝑠𝑠𝑠𝑐 𝑉 𝑘
⃗⃗⃗⃗ ∠  (36) It is important to mention that, in the case of SSSC, the NR formulation is not upgraded, because the programming structure of the SSSC is the same as the TCSC device in the modified NR algorithm.

OPF with SSSC
As STATCOM, this device is modeled as power injections into the local bus and the remote bus of the transmission line where it is installed.To be incorporated into the OPF problem, variables and equality constraints are defined.The controlled voltage source given by Expression ( 36) is represented by the independent variables, phase angle (  ) In (36) is expressed the phase of the controlled voltage source.
It is important to mention that, in the case of SSSC, the NR formulation is not upgraded, because the programming structure of the SSSC is the same as the TCSC device in the modified NR algorithm.

OPF with SSSC
As STATCOM, this device is modeled as power injections into the local bus and the remote bus of the transmission line where it is installed.To be incorporated into the OPF problem, variables and equality constraints are defined.The controlled voltage source given by Expression ( 36) is represented by the independent variables, phase angle (δ sssc ) and scale factor (m sssc ), while active power (P sssc k ,P sssc m ) and reactive power (Q sssc k ,Q sssc m ) at the local and remote bus are dependent variables.
Expressions ( 37)-( 38) represent the local bus equality constraints, while Expressions ( 39)-( 40) represent the remote bus equality constraints.The power balance at the local and remote bus considering the power injections is expressed in ( 41) and (42), respectively.

Numerical Results
The AC power flow is solved for the 5-bus [33], IEEE 14-bus, IEEE 30-bus, and IEEE 57-bus [40] test systems commonly used for the power flow analysis.Table 1 presents a summary of the information from these test systems that are used to compare the results of the implemented OPF based on the Branch Flow Model and modified NR algorithm, both with FACTS devices.In this work, the algorithms were implemented in the MATLAB R2020a and PYTHON 3.9 environments.The simulation studies were performed on a 2.60 GHz Intel© Core™ i7-9750H, 16 GB RAM Windows 11 Home 64-bit notebook computer.In MATLAB, the modified NR algorithm was implemented with voltage control and generator limits with the following characteristics: convergence tolerance, ε, of 1 × 10 −12 p.u.; a maximum number of 100 iterations; and a base power of 100 MVA.On the other hand, PYTHON, the OPF based on the Branch Flow Model was coded, whose quadratic objective function minimizes the losses in the system; the equality constraints are the nodal power balances in each bus; and finally, the inequality constraints represent the operational limits of the assets of the system.Its solution is obtained through the external solver "IPOPT".
To evaluate the deviations of the results of the Branch Flow Model with respect to the NR method, the following formulations were defined: where ε loss P and ε loss Q are the percentage deviations between their active and reactive power losses, respectively, for the analyzed system; ε V is the percentage deviation of the voltage magnitudes; ε θ is the percentage deviation of the voltage angles; ε i→j P and ε j→i P are the percentage deviations between the active and reactive power flows out of bus i and into bus j; ε i→j Q and ε j→i Q are the percentage deviations between the active and reactive power flows, respectively, out of bus j and into bus i; S NR ij is the maximum capacity of the transmission line; and ε MPT is the percentage error between their processing times to their convexity.In addition, the upper indices, NR and OPF, corresponding to each variable, refer to the Newton-Raphson method and the Branch Flow Model.

Base Case
The implemented algorithms initially provide the power flow analysis results for the IEEE 57-bus base case summarized in Table 1. Figure 7 shows the voltage magnitude profiles obtained by the two models; their percentage deviations are less than 0.1%.Figure 8 shows that the percentage deviations in each variable are small with respect to those obtained by the NR method, and it is observed that the percentage deviations are less than 0.4% for the active and reactive power losses in the branches and the energy flow deviations in the branches.The values of active power losses for the Branch Flow Model and the NR method were 27.845 MW in each one.2 summarizes the four test systems, showing mainly the voltage ma and phase angles at the buses with generation.In addition, the active power los MPT of each algorithm, and the percentage deviations between them are shown.T imum error in the loss calculation is 0.001% for the 57-bus system.The solution o in the OPF based on the Branch Flow Model is faster by 21.998% with respect to t taken by the NR method.In general, for the four test systems and as a partial con   2 summarizes the four test systems, showing mainly the voltage ma and phase angles at the buses with generation.In addition, the active power los MPT of each algorithm, and the percentage deviations between them are shown.Th imum error in the loss calculation is 0.001% for the 57-bus system.The solution o in the OPF based on the Branch Flow Model is faster by 21.998% with respect to t taken by the NR method.In general, for the four test systems and as a partial con Table 2 summarizes the four test systems, showing mainly the voltage magnitude and phase angles at the buses with generation.In addition, the active power losses, the MPT of each algorithm, and the percentage deviations between them are shown.The maximum error in the loss calculation is 0.001% for the 57-bus system.The solution obtained in the OPF based on the Branch Flow Model is faster by 21.998% with respect to the time taken by the NR method.In general, for the four test systems and as a partial conclusion, the implemented model presents minimum percentage deviations with respect to the NR method, so it is proposed to extend the analysis for the power flow, which shows good results that fit the NR algorithm and allow us to verify the participation of FACTS devices in the electrical power system.

Case with SVC
The IEEE 30-bus test system was chosen as a reference to compare the results and evaluate the percentage deviations of bus voltages, active and reactive power losses, and active and reactive power flows in the branches between the NR method and the Branch Flow Model considering the FACTS devices.Figure 9 shows the single line diagram of the IEEE 30-bus test system with the location of the FACTS devices.SVC and STATCOM are connected to buses, while TCSC and SSSC are installed in branches.
Two SVC devices were installed at buses #7 and #14. Figure 10 shows the voltage magnitude profiles obtained by the two models for the scenarios with and without FACTS devices, where the percentage deviations at each bus are less than 0.1%, and it is also observed how the SVC reduces the voltage limit band.Table 3 summarizes the results of the four test systems, showing mainly the active power losses, the MPT, and the percentage deviations between the NR method and the Branch Flow Model.The solution obtained with the OPF based on the Branch Flow Model is faster in each of the four test systems by up to 47.645% with respect to the Newton-Raphson method.For the case of the percentage deviation, the active losses do not exceed 0.12%.Two SVC devices were installed at buses #7 and #14. Figure 10 shows the magnitude profiles obtained by the two models for the scenarios with and withou devices, where the percentage deviations at each bus are less than 0.1%, and it is served how the SVC reduces the voltage limit band.Table 3 summarizes the resul four test systems, showing mainly the active power losses, the MPT, and the per deviations between the NR method and the Branch Flow Model.The solution o with the OPF based on the Branch Flow Model is faster in each of the four test sys up to 47.645% with respect to the Newton-Raphson method.For the case of the per deviation, the active losses do not exceed 0.12%.Two SVC devices were installed at buses #7 and #14. Figure 10 shows the voltage magnitude profiles obtained by the two models for the scenarios with and without FACTS devices, where the percentage deviations at each bus are less than 0.1%, and it is also observed how the SVC reduces the voltage limit band.Table 3 summarizes the results of the four test systems, showing mainly the active power losses, the MPT, and the percentage deviations between the NR method and the Branch Flow Model.The solution obtained with the OPF based on the Branch Flow Model is faster in each of the four test systems by up to 47.645% with respect to the Newton-Raphson method.For the case of the percentage deviation, the active losses do not exceed 0.12%.

Case with STATCOM
As mentioned above, the STATCOM has the capability to inject or absorb active and reactive power; however, to additionally perform a comparison of results with the SVC, two STATCOMs were installed at bus #7 and #14, and the active power control was also disabled, as it was set to a value of zero.Unlike the SVC, this device does not require an initial tripping angle condition to perform voltage regulation.Figure 11 shows the voltage magnitude profiles obtained by the two models, for the scenarios with and without FACTS devices, where the percentage deviations in each bus are less than 0.15%, and it is also observed how the STATCOM reduces the voltage limit band.Table 4 summarizes the results of the four test systems, showing mainly the active power losses, the MPT, and the percentage deviations between the NR method and the Branch Flow Model.The solution obtained with the OPF based on the Branch Flow Model is faster in each of the four test systems by up to 41.131% with respect to the Newton-Raphson method.In the case of the percentage deviation, the active losses do not exceed 0.12%.

Case with STATCOM
As mentioned above, the STATCOM has the capability to inject or absorb active and reactive power; however, to additionally perform a comparison of results with the SVC two STATCOMs were installed at bus #7 and #14, and the active power control was also disabled, as it was set to a value of zero.Unlike the SVC, this device does not require an initial tripping angle condition to perform voltage regulation.Figure 11 shows the voltage magnitude profiles obtained by the two models, for the scenarios with and withou FACTS devices, where the percentage deviations in each bus are less than 0.15%, and it is also observed how the STATCOM reduces the voltage limit band.Table 4 summarizes the results of the four test systems, showing mainly the active power losses, the MPT, and the percentage deviations between the NR method and the Branch Flow Model.The solution obtained with the OPF based on the Branch Flow Model is faster in each of the four tes systems by up to 41.131% with respect to the Newton-Raphson method.In the case of the percentage deviation, the active losses do not exceed 0.12%.

Case with TCSC
Two TCSC devices were installed on the transmission lines or branches connecting buses 12-15 and 27-30.Figure 12 shows the voltage magnitude profiles obtained by the two models, for the scenarios with and without FACTS devices, in which the percentage deviations at each bus are less than 0.11%, also showing that the regulation of the active power flow performed by the TCSCs does not generate changes in the voltage magnitudes.Table 5 summarizes the results of the four test systems, showing mainly the active power losses, the MPT, and the percentage deviations between the NR method and the Branch Flow Model.The solution obtained with the OPF based on the Branch Flow Model is faster in each of the four test systems by up to 14.883% with respect to the Newton-Raphson method.In the case of the percentage deviation, the active losses do not exceed 0.08%.

Case with TCSC
Two TCSC devices were installed on the transmission lines or branches connecting buses 12-15 and 27-30.Figure 12 shows the voltage magnitude profiles obtained by the two models, for the scenarios with and without FACTS devices, in which the percentage deviations at each bus are less than 0.11%, also showing that the regulation of the active power flow performed by the TCSCs does not generate changes in the voltage magnitudes.Table 5 summarizes the results of the four test systems, showing mainly the active power losses, the MPT, and the percentage deviations between the NR method and the Branch Flow Model.The solution obtained with the OPF based on the Branch Flow Mode is faster in each of the four test systems by up to 14.883% with respect to the Newton-Raphson method.In the case of the percentage deviation, the active losses do not exceed 0.08%.

Case with SSSC
As mentioned above, the SSSC has the capability to regulate the active and reactive power flow; however, to further compare results with the TCSC, two SSSCs were installed between buses 12-15 and 27-30.Unlike the TCSC, this device does not require an initia tripping angle condition to perform the regulation of the active power flow.Figure 13 shows the voltage magnitude profiles obtained by the two models, for the scenarios with and without FACTS devices, where the percentage deviations in each bus are less than 0.13%, and it is also observed that the active power flow regulation performed by the SSSCs generate only voltage changes of no more than 0.8%.Table 6 summarizes the results of the four test systems, showing mainly the active power losses, the MPT, and the per centage deviations between the NR method and the Branch Flow Model.The solution obtained with the OPF based on the Branch Flow Model is faster in each of the four tes

Case with SSSC
As mentioned above, the SSSC has the capability to regulate the active and reactive power flow; however, to further compare results with the TCSC, two SSSCs were installed between buses 12-15 and 27-30.Unlike the TCSC, this device does not require an initial tripping angle condition to perform the regulation of the active power flow.Figure 13 shows the voltage magnitude profiles obtained by the two models, for the scenarios with and without FACTS devices, where the percentage deviations in each bus are less than 0.13%, and it is also observed that the active power flow regulation performed by the SSSCs generate only voltage changes of no more than 0.8%.Table 6 summarizes the results of the four test systems, showing mainly the active power losses, the MPT, and the percentage deviations between the NR method and the Branch Flow Model.The solution obtained with the OPF based on the Branch Flow Model is faster in each of the four test systems by up to 21.031% with respect to the Newton-Raphson method.In the case of the percentage deviation, the active losses do not exceed 0.08%.

Discussion
In this work, phase shifting transformers were not taken into account, and the transformer tap position was not considered as a variable.On the other hand, the location of the different FACTS devices was established randomly in the test systems, and for each simulation in the IEEE systems, only one type of device was considered, and not the participation of two or more.According to the results presented, it is mainly highlighted that the percentage deviations of the proposed model in terms of active power losses in each type of FACTS controller and test system are not higher than 0.08%.On the other hand with respect to the convergence time, it turns out to be faster by no less than 20% on average compared to the NR load flow; however, as the number of bars in the system increases, the greater the time required for computational processing of the systems, and even so, the model proposed in this work turns out to have a better performance.It is important to highlight, among its advantages, the guarantee of a convergence point, with out the need to carefully define the initial values of the control variables of the FACTS devices, in addition to the flexibility in terms of the conditions of the optimization problem, as in the case of the objective function that can be modified to optimize different operation scenarios in the planning of the electrical system.
As a future work, it is proposed to solve the economic dispatch problem, using the Branch Flow Model, considering FACTS devices, in addition to proposing algorithms for the optimal location of devices in an electrical system.

Discussion
In this work, phase shifting transformers were not taken into account, and the transformer tap position was not considered as a variable.On the other hand, the location of the different FACTS devices was established randomly in the test systems, and for each simulation in the IEEE systems, only one type of device was considered, and not the participation of two or more.According to the results presented, it is mainly highlighted that the percentage deviations of the proposed model in terms of active power losses in each type of FACTS controller and test system are not higher than 0.08%.On the other hand, with respect to the convergence time, it turns out to be faster by no less than 20% on average compared to the NR load flow; however, as the number of bars in the system increases, the greater the time required for computational processing of the systems, and even so, the model proposed in this work turns out to have a better performance.It is important to highlight, among its advantages, the guarantee of a convergence point, without the need to carefully define the initial values of the control variables of the FACTS devices, in addition to the flexibility in terms of the conditions of the optimization problem, as in the case of the objective function that can be modified to optimize different operation scenarios in the planning of the electrical system.
As a future work, it is proposed to solve the economic dispatch problem, using the Branch Flow Model, considering FACTS devices, in addition to proposing algorithms for the optimal location of devices in an electrical system.

Conclusions
In this work, the modeling of SVC, TCSC, STATCOM, and SSSC, using the BF model as an alternative to the NR load flow, was presented.In both alternatives, the reactive power generation limits, the voltage control in the PV busbars, the reactive power capacity of the static shunt compensators and the fixed transformation ratio of the power transformers were considered.In the NR load flow, the initial values of the control variables of each FACTS device were selected quite carefully to ensure the convergence of the algorithm and to reduce the computational time of the algorithm.In the BF model optimization problem, the minimization of active power losses in the system was established as an objective function, and for this purpose, the generation of fixed active power in each generator was defined; unlike the NR load flow, random values of the FACTS control variables were selected because it does not depend on the initial conditions.
The results were validated with the standard test systems IEEE 5 bus, IEEE 14 bus, IEEE 30 bus, and IEEE 57 bus, and it is affirmed that the proposed model has a good capability to reduce the convergence computational time and to eliminate the complexity of lines of code in the modeling of FACTS controllers, unlike the NR load flow algorithm.

Figure 1 .
Figure 1.Generic model of a branch in a transmission network.

Figure 1 .
Figure 1.Generic model of a branch in a transmission network.

Figure 2 .
Figure 2. Simplified connection diagram of an SVC.

Figure 2 .
Figure 2. Simplified connection diagram of an SVC.

Figure 5 .
Figure 5. Setting up the STATCOM as a voltage source.

Figure 5 .
Figure 5. Setting up the STATCOM as a voltage source.Figure 5. Setting up the STATCOM as a voltage source.

Figure 5 .
Figure 5. Setting up the STATCOM as a voltage source.Figure 5. Setting up the STATCOM as a voltage source.

Figure 6 .
Figure 6.Setting up the SSSC as a voltage source.

Figure 6 .
Figure 6.Setting up the SSSC as a voltage source.

Energies 2024 ,Figure 7 .
Figure 7. NR and Branch Flow Model voltage magnitude profiles in 57-bus system.

Figure 8 .
Figure 8. Percentage of loss deviations and active and reactive power flows in a 57-bus sys

Figure 7 .Figure 7 .
Figure 7. NR and Branch Flow Model voltage magnitude profiles in 57-bus system.

Figure 8 .
Figure 8. Percentage of loss deviations and active and reactive power flows in a 57-bus sys

Figure 8 .
Figure 8. Percentage of loss deviations and active and reactive power flows in a 57-bus system.

Figure 10 .
Figure 10.Voltage magnitude profiles of NR and Branch Flow Models with SVC devices in a 30-bus system.

Figure 10 .
Figure 10.Voltage magnitude profiles of NR and Branch Flow Models with SVC devices in a 30-bus system.

Figure 11 .
Figure 11.Voltage magnitude profiles of NR and Branch Flow Models with STATCOM devices in a 30-bus system.

Figure 11 .
Figure 11.Voltage magnitude profiles of NR and Branch Flow Models with STATCOM devices in a 30-bus system.

Figure 12 .
Figure 12.Voltage magnitude profiles of NR and Branch Flow Models with TCSC devices in a 30 bus system.

Figure 12 .
Figure 12.Voltage magnitude profiles of NR and Branch Flow Models with TCSC devices in a 30-bus system.

Figure 13 .
Figure 13.Voltage magnitude profiles of NR and Branch Flow Models with SSSC devices in a 30 bus system.

Figure 13 .
Figure 13.Voltage magnitude profiles of NR and Branch Flow Models with SSSC devices in a 30-bus system.

Table 1 .
Overview of test systems.

Table 3 .
Comparison between NR and Branch Flow Model with SVC.

Table 3 .
Comparison between NR and Branch Flow Model with SVC.

Table 4 .
Comparison between NR and Branch Flow Model with STATCOM.

Table 4 .
Comparison between NR and Branch Flow Model with STATCOM.

Table 5 .
Comparison between NR and Branch Flow Model with TCSC.

Table 5 .
Comparison between NR and Branch Flow Model with TCSC.

Table 6 .
Comparison between NR and Branch Flow Model with SSSC.

Table 6 .
Comparison between NR and Branch Flow Model with SSSC.