Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices: A Matlab-Based Flexible Approach

*Jose Miguel García-Guzman, Néstor González-Cabrera, Luis Alberto Contreras-Aguilar, Jose Merced Lozano-García and Alejandro Pizano-Martinez*

## **Abstract**

This book chapter presents a flexible approach to incorporate mathematical models of FACTS devices into the Power Flow (PF) and the Optimal Power Flow (OPF) analysis tools, as well as into the standard OPF Market-Clearing (OPF-MC) procedure. The proposed approach uses the Matlab Optimization Toolbox because it allows to easily: (a) implement a given optimization model, (b) include different objective functions using distinct equality and inequality constraints and (c) modify and reuse an optimization model that has been previously implemented. The conventional OPF model is the main core of the proposed approach, which is easily implemented and adapted to include the mathematical models of FACTS devices. The resulting implementation of the OPF model featuring FACTS devices can be easily modified and adjusted to obtain the implementation of both the PF and the OPF-MC models which includes such devices. It should be mentioned that with the flexible approach proposed here, the complexity as well as the implementation time of optimized models featuring embedded FACTS devices is significantly reduced, since it is not necessary to define the expressions associated with the hessian matrix and the gradient vector. The flexibility and reliability of the proposed approach are demonstrated by means of several study cases using test as well as real power systems.

**Keywords:** FACTS devices, Matlab-based flexible approach, optimal power flow (OPF), steady-state operation, power systems

## **1. Introduction**

The efficient operation and economics of electric power systems have always occupied an important place in the electric power industry [1]. Here, it is worth mentioning that highly desirable operative conditions cannot be successfully achieved by means of using the old electromechanically controlled devices, such as the mechanical phase shifter. These old devices execute control actions through mechanical actuators, and thus provide a poor high-speed control. Some of the consequences of this lack of speed and reliable control are associated with stability

problems. Also, the power flow deviates through secondary transmission lines that are not the intended ones. In addition to the above mentioned issues, there are instability issues when the transmission resources are closely used to their thermal and economic limits. Not to mention, the high or low voltages resulting from such a poor high-speed control, in addition to many other issues [2]. Those poor operating conditions have given place for the need to develop faster controllers and a more efficient power system management. Fortunately, the fast development of power electronics based on new and powerful semiconductor devices has given rise to novel technologies such as FACTS controllers that greatly improve the operating conditions of power systems [3].

mentioned procedures. Therefore, this proposal facilitates carrying out research in order to assess the effectiveness of FACTS devices for improving the steady-state performance of power systems. Arguably, the use of high-level programming languages and optimization toolboxes such as the ones provided by Matlab could reduce the computational efficiency of any approach that is implemented using such tools. However, for research purposes, the computational efficiency of the proposed approach is quite reasonable, since the solution of the distinct optimization models related to medium scale power systems is commonly obtained in a time lapse that varies from a few seconds to a maximum of 10 minutes. In addition, when the main objective is to investigate the effectiveness of FACTS devices for improving the steady-state performance of power systems, the computational efficiency

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices…*

This book chapter is organized as follows. Since the conventional OPF model is the core of this approach, its formulation is given in Section 2, as well as the steadystate models of the traditional power system components. These models are then considered in Section 3 to assemble the conventional OPF model. The Section 4 shows the incorporation of the FACTS models into the conventional OPF model. This last model can be straightforwardly extended in order to obtain the computational implementation of the PF and, the standard OPF market-clearing models in Sections 5 and 6, respectively. The applicability of the proposed approach for the steady-state operation of power systems using embedded FACTS devices is assessed by means of numerical examples in Section 7. Last but not least, the conclusions of

The optimal power flow formulation is a non-linear optimization problem which consists in minimizing an objective function subject to a finite set of equality and

where *f* (*y*) is the objective function to be minimized, *h*(*y*) and *g*(*y*) are a finite set of functions corresponding to the equality and inequality constraints, respectively. Whilst *y*, represents the full set of variables of the power system with a lower

The OPF formulation is given in polar coordinates taking in consideration the model of each power system component. The most common components of a power system are: generators, loads, fixed shunt compensation elements, transmission lines and transformers; whose steady-state models are given in [4]. These models are adopted in the flexible approach proposed in the present book chapter.

This section describes the flexible approach to implement the conventional OPF model as a computer program, which is developed based on structured programming

*Minimize f y*ð Þ (1) *Subject to h y*ð Þ¼ 0 (2)

gð Þ*y* ≤ 0 (3) *y*min ≤ *y*≤*y*max (4)

max. It must be mentioned that the set y contains of

requirement can be further relaxed.

*DOI: http://dx.doi.org/10.5772/intechopen.93519*

this chapter book are stated in Section 8.

min and an upper limit *y*

limit *y*

**353**

**2. The optimal power flow general-formulation**

both the state variables as well as the control variables.

**3. Flexible approach to implement the OPF model**

inequality constraints. Mathematically, the OPF model is given by

From a steady-state operation perspective, the control capabilities of FACTS devices allow to adjust the active and reactive power flows at their output terminals, as well as to achieve the local control of reactive power and voltages at the connected nodes [4]. In order to investigate the effectiveness of these control capabilities for alleviating a large variety of problems associated with the steadystate performance of power systems, the existing tools for the steady-state condition assessment have been upgraded to incorporate steady-state models of FACTS controllers. The Power Flow, the Optimal Power Flow and the OPF Market-Clearing procedures are the common tools used to assess the steady-state operation and market-clearing conditions of power systems. Accordingly, the upgrade of those three tools has received great attention. For instance, references [4–12, 4, 13–19, 20–24] are representative samples of the several publications where models of FACTS controllers are incorporated into the Power Flow, the Optimal Power Flow and the market-clearing procedures, respectively.

Certainly, the evolution of FACTS controllers is going to be progressive as function of time [2]. With the further development of technologies based on power electronics, the economic viability of these controllers will improve in such a way that more and more FACTS devices are expected to be designed and used in future applications [13]. In this sense, it is expected that modern power systems are going to be electronically controlled rather than mechanically controlled [2]. Consequently, to study the usefulness of new FACTS devices for improving the steady-state performance of power systems as well as to speed up research efforts, it would be needed the upgrade of the existing steady-state analysis tools in order to incorporate the corresponding mathematical models of such devices.

Bearing in mind the aforementioned prospective on FACTS controllers, in this book chapter is proposed a Matlab-based flexible approach that incorporates mathematical models of FACTS devices into: the power flow and the optimal power flow analysis tools; as well as into the standard OPF market-clearing procedure [25]. The flexibility of the proposed approach is achieved by taking advantage of both: (a) the tractability of the nonlinear continuous optimization theory to consider different objective functions that can be properly constrained and (b) the simplicity of the Matlab Optimization Toolbox to implement and solve an optimization model, as well as its ability to modify and reuse an optimization model that has already been implemented [26]. In order to show the flexibility of the proposed approach, first consider that the OPF model is the main core of this proposal, then the strategy to code the objective function, the equality and inequality constraints of the conventional OPF model are given in detail. Second, the implemented conventional OPF model is enlarged to include the steady-state models of FACTS controllers. Lastly, the resulting OPF implementation is modified and reused, to straightforwardly obtain the computational implementation of both the Power Flow and the standard OPF market-clearing models that use embedded FACTS controllers.

In this way, the proposed book chapter can reduce the computational implementation load of the FACTS model devices into one of the three previously

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices… DOI: http://dx.doi.org/10.5772/intechopen.93519*

mentioned procedures. Therefore, this proposal facilitates carrying out research in order to assess the effectiveness of FACTS devices for improving the steady-state performance of power systems. Arguably, the use of high-level programming languages and optimization toolboxes such as the ones provided by Matlab could reduce the computational efficiency of any approach that is implemented using such tools. However, for research purposes, the computational efficiency of the proposed approach is quite reasonable, since the solution of the distinct optimization models related to medium scale power systems is commonly obtained in a time lapse that varies from a few seconds to a maximum of 10 minutes. In addition, when the main objective is to investigate the effectiveness of FACTS devices for improving the steady-state performance of power systems, the computational efficiency requirement can be further relaxed.

This book chapter is organized as follows. Since the conventional OPF model is the core of this approach, its formulation is given in Section 2, as well as the steadystate models of the traditional power system components. These models are then considered in Section 3 to assemble the conventional OPF model. The Section 4 shows the incorporation of the FACTS models into the conventional OPF model. This last model can be straightforwardly extended in order to obtain the computational implementation of the PF and, the standard OPF market-clearing models in Sections 5 and 6, respectively. The applicability of the proposed approach for the steady-state operation of power systems using embedded FACTS devices is assessed by means of numerical examples in Section 7. Last but not least, the conclusions of this chapter book are stated in Section 8.

## **2. The optimal power flow general-formulation**

The optimal power flow formulation is a non-linear optimization problem which consists in minimizing an objective function subject to a finite set of equality and inequality constraints. Mathematically, the OPF model is given by

$$\text{Minimize}\,f(\mathbf{y})\tag{1}$$

$$\text{Subject to } h(\mathbf{y}) = \mathbf{0} \tag{2}$$

$$\mathbf{g}(y) \le \mathbf{0} \tag{3}$$

$$\mathbf{y}^{\min} \le \mathbf{y} \le \mathbf{y}^{\max} \tag{4}$$

where *f* (*y*) is the objective function to be minimized, *h*(*y*) and *g*(*y*) are a finite set of functions corresponding to the equality and inequality constraints, respectively. Whilst *y*, represents the full set of variables of the power system with a lower limit *y* min and an upper limit *y* max. It must be mentioned that the set y contains of both the state variables as well as the control variables.

The OPF formulation is given in polar coordinates taking in consideration the model of each power system component. The most common components of a power system are: generators, loads, fixed shunt compensation elements, transmission lines and transformers; whose steady-state models are given in [4]. These models are adopted in the flexible approach proposed in the present book chapter.

### **3. Flexible approach to implement the OPF model**

This section describes the flexible approach to implement the conventional OPF model as a computer program, which is developed based on structured programming

problems. Also, the power flow deviates through secondary transmission lines that are not the intended ones. In addition to the above mentioned issues, there are instability issues when the transmission resources are closely used to their thermal and economic limits. Not to mention, the high or low voltages resulting from such a poor high-speed control, in addition to many other issues [2]. Those poor operating conditions have given place for the need to develop faster controllers and a more efficient power system management. Fortunately, the fast development of power electronics based on new and powerful semiconductor devices has given rise to novel technologies such as FACTS controllers that greatly improve the operating

From a steady-state operation perspective, the control capabilities of FACTS devices allow to adjust the active and reactive power flows at their output terminals,

Certainly, the evolution of FACTS controllers is going to be progressive as function of time [2]. With the further development of technologies based on power electronics, the economic viability of these controllers will improve in such a way that more and more FACTS devices are expected to be designed and used in future applications [13]. In this sense, it is expected that modern power systems are going to be electronically controlled rather than mechanically controlled [2]. Consequently, to study the usefulness of new FACTS devices for improving the steady-state performance of power systems as well as to speed up research efforts, it would be needed the upgrade of the existing steady-state analysis tools in order to

Bearing in mind the aforementioned prospective on FACTS controllers, in this book chapter is proposed a Matlab-based flexible approach that incorporates mathematical models of FACTS devices into: the power flow and the optimal power flow analysis tools; as well as into the standard OPF market-clearing procedure [25]. The flexibility of the proposed approach is achieved by taking advantage of both: (a) the tractability of the nonlinear continuous optimization theory to consider different objective functions that can be properly constrained and (b) the simplicity of the Matlab Optimization Toolbox to implement and solve an optimization model, as well as its ability to modify and reuse an optimization model that has already been implemented [26]. In order to show the flexibility of the proposed approach, first consider that the OPF model is the main core of this proposal, then the strategy to code the objective function, the equality and inequality constraints of the conventional OPF model are given in detail. Second, the implemented conventional OPF model is enlarged to include the steady-state models of FACTS controllers. Lastly, the resulting OPF implementation is modified and reused, to straightforwardly obtain the computational implementation of both the Power Flow and the standard

incorporate the corresponding mathematical models of such devices.

OPF market-clearing models that use embedded FACTS controllers.

**352**

In this way, the proposed book chapter can reduce the computational implementation load of the FACTS model devices into one of the three previously

as well as to achieve the local control of reactive power and voltages at the connected nodes [4]. In order to investigate the effectiveness of these control capabilities for alleviating a large variety of problems associated with the steadystate performance of power systems, the existing tools for the steady-state condition assessment have been upgraded to incorporate steady-state models of FACTS controllers. The Power Flow, the Optimal Power Flow and the OPF Market-Clearing procedures are the common tools used to assess the steady-state operation and market-clearing conditions of power systems. Accordingly, the upgrade of those three tools has received great attention. For instance, references [4–12, 4, 13–19, 20–24] are representative samples of the several publications where models of FACTS controllers are incorporated into the Power Flow, the Optimal Power Flow

conditions of power systems [3].

*Renewable Energy - Technologies and Applications*

and the market-clearing procedures, respectively.

along with the use of the **fmincon** optimization function of Matlab [26]. This proposal allows to obtain a computational implementation of the OPF model with the following remarkable features: (a) It considerably simplifies the computational complexity of the implementation of a conventional OPF, (b) it is very flexible when considering diverse physical laws and operating conditions, (c) it allows for the integration of FACTS models and (d) it has the tractability of easily being adapted to study electric power systems by means of different steady-state analyses. For example, it can be straightforwardly adapted to solve the conventional power flow problem and to carry out the analysis of electric power markets. In this way, steady-state analyses of distinct power systems featuring different electric components can be carried out by doing very few changes to the composition of the set of steady-state variables as well as the set of constraints and the objective function of the proposed implementation of the OPF model. The aforementioned features are further exploited in Sections 5, 6 and 7 in order to take into consideration: FACTS devices, the conventional power flow problem and the standard OPF market-clearing procedure, respectively.

The next command line syntax of the **fmincon** function, including input and output arguments, is shown below [26]. Observe that the first line of code corresponds to the input arguments, whilst the second one corresponds to the output arguments.

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices…*

In **Figure 1** and the syntax, the input argument**fun** is the handle of the M-function file containing the objective function to be optimized. **X0** represents the initial conditions of the state vector *X* of the optimization model, which is given by (5). For the purpose of this work, this state vector (**X0**) stores the initial conditions of the steadystate variables of the power system. By the way, the lower and upper bounds of **X0** are assigned to the arguments **lb** and **up**, respectively. The size of **lb** and **up** must be equal to the size of the vector **X0**. Next, the **nonlcon** input argument is the handle of the Mfunction file containing the nonlinear inequality as well as the equality constraints. In the same venue, the argument **options** is a structure where the user can define optional parameters for the optimization process, such as: the optimization algorithm, the convergence tolerance, the maximum amount of iterations, the tolerance on the constraint violation and the termination tolerance on the function value, among many other parameters. It is worth mentioning that the **options** structure has the parameter **LargeScale** that allows for a choice on which algorithm to use. If that parameter is set to **on**, then the gradient of the objective function as well as the constraints must be provided by the user. It must be highlighted, however, that in this work, the **LargeScale** parameter is set to **off** with the aim of simplifying and making more flexible the proposed computational implementation. Last but not least, the input arguments **A**, **b**, **Aeq** and **beq** are associated with the coefficients of the linear inequality and equality constraints. In this proposal, however, the OPF model only considers nonlinear equality and inequality constraints and, therefore, the above

Next, the output arguments are briefly described to provide more clarity on the

A detailed way to define the set of steady-state variables, the objective function and the constraints sets of the OPF model is given below. Also, the explicit OPF formulation is given in polar coordinates in accordance to the model of each power

Within the proposed implementation, the set of the steady-state variables of the OPF model is treated as a vector containing such variables in the order shown in (5).

approach proposed here. First, **X\*** stores the optimal value of the optimization model variables as they are assessed by the **fmincon** function. Second, the **fval** output returns the value of the objective function given by the optimal solution **X\***. Third, the output **argument** is a structure that contains information about the results of the optimization. Forth, **lambda** is an argument storing the value of the Lagrange multipliers at **X\***. Fifth, the arguments **hessian** and **grad** store the value of the Hessian matrix and the gradient vector of the objective function at **X\***, respectively. Last but not least, **exitflag** is an integer identifying the termination condition of the optimization algorithm; that is, if (a) exitflag > 0: the algorithm reached the optimal solution **X\***, if (b) exitflag = 0: either the maximum amount of function evaluations or iterations specified by the user was exceeded, thus the optimal solution has not been reached and if (c) exitflag < 0: the algorithm did not reach the

x = fmincon(fun,x0,A,b,Aeq,beq,lb.,ub,nonlcon,options) [x,fval,exitflag,output,lambda,grad,hessian] = fmincon(\_\_\_)

*DOI: http://dx.doi.org/10.5772/intechopen.93519*

mentioned input arguments are considered as empty arrays.

optimal solution, therefore, there is an unfeasible solution.

**3.2 Flexible implementation of the OPF model**

*3.2.1 Steady-state variables*

**355**

system component, as it is described in the following subsections.

## **3.1 The fmincon function of the Matlab optimization toolbox**

The **fmincon** function of the Matlab Optimization Toolbox is used to solve the general OPF model which is a constrained nonlinear optimization or programming problem. That Matlab function attempts to find out the constrained minimum of a scalar objective function of several variables, starting with an initial estimation of the constrained minimal point. Here it is worth mentioning that the **fmincon** function is designed to solve problems where the objective and constraint functions are both continuous as well as their first derivatives. In order to obtain the optimal solution of the optimization problem at hand, the **fmincon** users can choose one of the following optimization options: the trust-region-reflective method, the active-set method, the interior-point method and the sequential quadratic programming approach [26]. **Figure 1** shows a schematic representation of the main input and output arguments of this function. It must be pointed out that, depending on to the requirements of the specific optimization problem, some empty input arguments must be provided.

#### *Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices… DOI: http://dx.doi.org/10.5772/intechopen.93519*

The next command line syntax of the **fmincon** function, including input and output arguments, is shown below [26]. Observe that the first line of code corresponds to the input arguments, whilst the second one corresponds to the output arguments.

```
x = fmincon(fun,x0,A,b,Aeq,beq,lb.,ub,nonlcon,options)
[x,fval,exitflag,output,lambda,grad,hessian] = fmincon(___)
```
In **Figure 1** and the syntax, the input argument**fun** is the handle of the M-function file containing the objective function to be optimized. **X0** represents the initial conditions of the state vector *X* of the optimization model, which is given by (5). For the purpose of this work, this state vector (**X0**) stores the initial conditions of the steadystate variables of the power system. By the way, the lower and upper bounds of **X0** are assigned to the arguments **lb** and **up**, respectively. The size of **lb** and **up** must be equal to the size of the vector **X0**. Next, the **nonlcon** input argument is the handle of the Mfunction file containing the nonlinear inequality as well as the equality constraints. In the same venue, the argument **options** is a structure where the user can define optional parameters for the optimization process, such as: the optimization algorithm, the convergence tolerance, the maximum amount of iterations, the tolerance on the constraint violation and the termination tolerance on the function value, among many other parameters. It is worth mentioning that the **options** structure has the parameter **LargeScale** that allows for a choice on which algorithm to use. If that parameter is set to **on**, then the gradient of the objective function as well as the constraints must be provided by the user. It must be highlighted, however, that in this work, the **LargeScale** parameter is set to **off** with the aim of simplifying and making more flexible the proposed computational implementation. Last but not least, the input arguments **A**, **b**, **Aeq** and **beq** are associated with the coefficients of the linear inequality and equality constraints. In this proposal, however, the OPF model only considers nonlinear equality and inequality constraints and, therefore, the above mentioned input arguments are considered as empty arrays.

Next, the output arguments are briefly described to provide more clarity on the approach proposed here. First, **X\*** stores the optimal value of the optimization model variables as they are assessed by the **fmincon** function. Second, the **fval** output returns the value of the objective function given by the optimal solution **X\***. Third, the output **argument** is a structure that contains information about the results of the optimization. Forth, **lambda** is an argument storing the value of the Lagrange multipliers at **X\***. Fifth, the arguments **hessian** and **grad** store the value of the Hessian matrix and the gradient vector of the objective function at **X\***, respectively. Last but not least, **exitflag** is an integer identifying the termination condition of the optimization algorithm; that is, if (a) exitflag > 0: the algorithm reached the optimal solution **X\***, if (b) exitflag = 0: either the maximum amount of function evaluations or iterations specified by the user was exceeded, thus the optimal solution has not been reached and if (c) exitflag < 0: the algorithm did not reach the optimal solution, therefore, there is an unfeasible solution.

A detailed way to define the set of steady-state variables, the objective function and the constraints sets of the OPF model is given below. Also, the explicit OPF formulation is given in polar coordinates in accordance to the model of each power system component, as it is described in the following subsections.

#### **3.2 Flexible implementation of the OPF model**

#### *3.2.1 Steady-state variables*

Within the proposed implementation, the set of the steady-state variables of the OPF model is treated as a vector containing such variables in the order shown in (5).

along with the use of the **fmincon** optimization function of Matlab [26]. This proposal allows to obtain a computational implementation of the OPF model with the following remarkable features: (a) It considerably simplifies the computational complexity of the implementation of a conventional OPF, (b) it is very flexible when considering diverse physical laws and operating conditions, (c) it allows for the integration of FACTS models and (d) it has the tractability of easily being adapted to study electric power systems by means of different steady-state analyses. For example, it can be straightforwardly adapted to solve the conventional power flow problem and to carry out the analysis of electric power markets. In this way, steady-state analyses of distinct power systems featuring different electric components can be carried out by doing very few changes to the composition of the set of steady-state variables as well as the set of constraints and the objective function of the proposed implementation of the OPF model. The aforementioned features are further exploited in Sections 5, 6 and 7 in order to take into consideration: FACTS devices, the conventional power flow

problem and the standard OPF market-clearing procedure, respectively.

The **fmincon** function of the Matlab Optimization Toolbox is used to solve the general OPF model which is a constrained nonlinear optimization or programming problem. That Matlab function attempts to find out the constrained minimum of a scalar objective function of several variables, starting with an initial estimation of the constrained minimal point. Here it is worth mentioning that the **fmincon** function is designed to solve problems where the objective and constraint functions are both continuous as well as their first derivatives. In order to obtain the optimal solution of the optimization problem at hand, the **fmincon** users can choose one of the following optimization options: the trust-region-reflective method, the active-set method, the interior-point method and the sequential quadratic programming approach [26]. **Figure 1** shows a schematic representation of the main input and output arguments of this function. It must be pointed out that, depending on to the requirements of the specific optimization problem, some empty input arguments must be provided.

**3.1 The fmincon function of the Matlab optimization toolbox**

*Renewable Energy - Technologies and Applications*

*Schematic representation of the main input and output arguments of fmincon function.*

**Figure 1.**

**354**

That vector is called the vector of steady-state variables, denoted by *X*. Note that T denotes the transpose of the vector *X*.

$$X = \begin{bmatrix} \theta\_1 \dots \theta\_{nb} & V\_1 \dots V\_{nb} & P\_{\text{g1}} \dots P\_{\text{g\text{ng}}} \end{bmatrix}^T \tag{5}$$

objective function (6) can be modified or even changed by a new function. This characteristic provides great flexibility to the proposal, including the possibility for

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices…*

The equality constraints of the OPF analysis are given by the balance energy equations for the power system. These restrictions must be unconditionally met because they establish the active and reactive power balance under steady-state conditions for all the nodes of the power system. If at least one constraint is not satisfied, then the solution of the OPF problem is not feasible. That set of equality

> 9 >>>>=

*i* ¼ 1, 2, … , *nb k* ¼ 1, 2, … , *nb* ∣ *k* ∉ *ng*

(7)

(8)

*inj,j* and

>>>>;

*inj,j* represent the active and reactive injected-power at node *i* and *k*, respectively. Note that the injection point is the *j-th* network element. Also note that the activepower and reactive-power (denoted by *Pgj* and *Qgj*, respectively) are provided by the controllable complex power sources located at the *j-th* generation node (*j=i*, *k*). Last but not least, the complex power consumption is due to the active-power load

In the proposed flexible implementation, the set of equality constraints is written in an M-function file with the name **constraints\_OPF**. This set of constrains is

*Pl*,1 ⋮ *Pl*,*nb Ql*,1

*Pinj*,1 ⋮ *Pinj*,*nb Qinj*,1

⋮

*Qinj*,*nb*

0

�

⋮

*Ql*,*nb*

*θsn*

�

In the above expression, *sn* is the subscript associated with the slack node, whilst *Xsn* stores the value of phase of the slack node in the corresponding component of the state vector *X*. Note that *θsn* is the value of the phase at which the angle of the slack node is fixed. It must be pointed out that in (7) and (8), the value of the reactive power *Qgi* must always be zero for the *i-th* generation node. This is because the level of reactive power generation depends on the state variables of the power system. Henceforth, *Qgi* lacks a scheduled value in the optimization model OPF. Furthermore, the constraint of reactive power balance is satisfied only at nongeneration nodes. Then such constraint should be handled as a functional inequality constraint for generation nodes in order to establish the reactive power balance in such nodes, as it is explained below. Note that the way in which the vector of

handling several objective functions at the same time.

*DOI: http://dx.doi.org/10.5772/intechopen.93519*

*Pgi* � *Pli* � <sup>P</sup>

*Qgk* � *Qlk* � <sup>P</sup>

*nb j*∈*i Pinj*,*<sup>j</sup> <sup>i</sup>* ¼ 0

> *nb j*∈*k*

*Qinj*,*<sup>j</sup> <sup>k</sup>* ¼ 0

*Pg*,1 ⋮ *Pg*,*nb Qg*,1

⋮

*Qg*,*nb*

*Xsn*

where *i* and *k* are the nodes in which the energy balance is satisfied. *Pi*

*3.2.3 Equality constraints*

constraints is given by

8 >>>><

>>>>:

*Plj* and the reactive-power load *Qlk*.

*Ce*<sup>1</sup> ⋮ *Cenb Cenb*þ<sup>1</sup> ⋮

¼

*Ce*2*nb*

*Ce*2*nb*þ<sup>1</sup>

*h y*ð Þ¼

*Qk*

**357**

given by (8).

In (5), the number of nodes and generators of the power system are represented by *nb* and *ng*, respectively. *θ<sup>i</sup>* and *Vi* represent the angle (grades) and magnitude (pu) of the phasor voltage in each node *i* of the power system, and *Pgi* is the power of the generator *i*. Note that the size of the steady-state vector is (2nb + ng, 1). It should be mentioned that in the implementation, the vector *X* also corresponds to the vector of the initial conditions of the state variables **X0**, which is also called by the **fmincon** function during the optimization process. That function returns the optimal value of the steady-state variables, which is stored in the vector *X*, that is, the result is rewritten in *X*. In this way, when the optimization process is finished, *X* is then the vector of the optimal solution represented by **X\***.

The vector **X0**, which represents the initial conditions of the state variables of the power system in the OPF model, is defined as follows: the magnitude and angle of the voltage in each node of the power system are initialized at 0 grades and 1.0 pu, respectively, whilst *Pg*<sup>0</sup> is the initial condition of active power at the generation nodes. It is worth mentioning that *Pg*<sup>0</sup> is set to the values of the active power obtained from the analysis of the Optimal Generation Dispatch (OGD), which in turn, neglects the losses in the transmission elements. Last but not least, observe that the initial conditions of the active power generation help to reduce the number of iterations associated with the OPF optimization process. The syntax of the vector *X* containing the state variables is the following:


#### *3.2.2 Objective function*

The objective function considered in the OPF model corresponds to the total generation cost of active power, which is a nonlinear function given by

$$f(\mathbf{y}) = \sum\_{i=1}^{ng} a\_i + b\_i \left(\mathbf{P}\_{\mathbb{g}^i}\right) + c\_i \left(\mathbf{P}\_{\mathbb{g}^i}\right)^2 \tag{6}$$

where the cost curve coefficients of each generator *i* are represented by ai, bi and ci. *ng* is the number of generation nodes including the slack node. *Pgi* is the individual generation power level. Observe that the objective function in (6) is coded into an M-function file with the name **objfun\_OPF**. This last file is also called by the **fmincon** function through the input argument **fun**, using the syntax @(X) objfun\_OPF(X). The general Matlab syntax for the objective function given by Eq. (6) is the following:

```
function f = objfun_OPF(___)
f=0;
for k=1:ng
   f=f+ai(k,1)+bi(k,1)*Pgi(k,1)+ci(k,1)*Pgi(k,1)^2;
end
```
It is worth mentioning that in the above M-function file is possible to: include, modify, define or write the objective function as it is desired. Therefore, the

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices… DOI: http://dx.doi.org/10.5772/intechopen.93519*

objective function (6) can be modified or even changed by a new function. This characteristic provides great flexibility to the proposal, including the possibility for handling several objective functions at the same time.

#### *3.2.3 Equality constraints*

That vector is called the vector of steady-state variables, denoted by *X*. Note that T

*X* ¼ *θ*<sup>1</sup> … *θnb V*<sup>1</sup> … *Vnb Pg*<sup>1</sup> … *Pgng*

is then the vector of the optimal solution represented by **X\***.

X(2\*nb+1:2\*nb+ng,1)=Pg; %Active power generation

*f y*ð Þ¼ <sup>X</sup> *ng*

f=f+ai(k,1)+bi(k,1)\*Pgi(k,1)+ci(k,1)\*Pgi(k,1)^2;

*X* containing the state variables is the following:

*3.2.2 Objective function*

Eq. (6) is the following:

f=0; for k=1:ng

end

**356**

function f = **objfun\_OPF**(\_\_\_)

In (5), the number of nodes and generators of the power system are represented by *nb* and *ng*, respectively. *θ<sup>i</sup>* and *Vi* represent the angle (grades) and magnitude (pu) of the phasor voltage in each node *i* of the power system, and *Pgi* is the power of the generator *i*. Note that the size of the steady-state vector is (2nb + ng, 1). It should be mentioned that in the implementation, the vector *X* also corresponds to the vector of the initial conditions of the state variables **X0**, which is also called by the **fmincon** function during the optimization process. That function returns the optimal value of the steady-state variables, which is stored in the vector *X*, that is, the result is rewritten in *X*. In this way, when the optimization process is finished, *X*

The vector **X0**, which represents the initial conditions of the state variables of the power system in the OPF model, is defined as follows: the magnitude and angle of the voltage in each node of the power system are initialized at 0 grades and 1.0 pu, respectively, whilst *Pg*<sup>0</sup> is the initial condition of active power at the generation nodes. It is worth mentioning that *Pg*<sup>0</sup> is set to the values of the active power obtained from the analysis of the Optimal Generation Dispatch (OGD), which in turn, neglects the losses in the transmission elements. Last but not least, observe that the initial conditions of the active power generation help to reduce the number of iterations associated with the OPF optimization process. The syntax of the vector

X(1:nb,1)= V\_angle; %Phase angle of nodal voltage in radians X(nb+1:2\*nb,1)=V\_mag; %Magnitude of nodal voltage in pu

The objective function considered in the OPF model corresponds to the total

*ai* þ *bi Pgi*

where the cost curve coefficients of each generator *i* are represented by ai, bi and ci. *ng* is the number of generation nodes including the slack node. *Pgi* is the individual generation power level. Observe that the objective function in (6) is coded into an M-function file with the name **objfun\_OPF**. This last file is also called by the **fmincon** function through the input argument **fun**, using the syntax @(X) objfun\_OPF(X). The general Matlab syntax for the objective function given by

It is worth mentioning that in the above M-function file is possible to: include,

modify, define or write the objective function as it is desired. Therefore, the

� � <sup>þ</sup> *ci Pgi*

� �<sup>2</sup> (6)

generation cost of active power, which is a nonlinear function given by

*i*¼1

� �*<sup>T</sup>* (5)

denotes the transpose of the vector *X*.

*Renewable Energy - Technologies and Applications*

The equality constraints of the OPF analysis are given by the balance energy equations for the power system. These restrictions must be unconditionally met because they establish the active and reactive power balance under steady-state conditions for all the nodes of the power system. If at least one constraint is not satisfied, then the solution of the OPF problem is not feasible. That set of equality constraints is given by

$$h(\mathbf{y}) = \begin{cases} P\_{\mathrm{g}i} - P\_{\mathrm{li}} - \sum\_{j \in \mathcal{i}}^{nb} P\_{\mathrm{i}}^{inj\mathrm{j}} = \mathbf{0} \\\\ \mathbf{Q}\_{\mathrm{g}k} - \mathbf{Q}\_{\mathrm{ll}} - \sum\_{j \in \mathcal{k}}^{nb} \mathbf{Q}\_{\mathrm{k}}^{inj\mathrm{j}} = \mathbf{0} \end{cases} \quad i = \mathbf{1}, 2, \dots, nb$$

where *i* and *k* are the nodes in which the energy balance is satisfied. *Pi inj,j* and *Qk inj,j* represent the active and reactive injected-power at node *i* and *k*, respectively. Note that the injection point is the *j-th* network element. Also note that the activepower and reactive-power (denoted by *Pgj* and *Qgj*, respectively) are provided by the controllable complex power sources located at the *j-th* generation node (*j=i*, *k*). Last but not least, the complex power consumption is due to the active-power load *Plj* and the reactive-power load *Qlk*.

In the proposed flexible implementation, the set of equality constraints is written in an M-function file with the name **constraints\_OPF**. This set of constrains is given by (8).

$$\begin{bmatrix} \mathcal{C}e\_{1} \\ \vdots \\ \mathcal{C}e\_{nb} \\ \mathcal{C}e\_{nb+1} \\ \vdots \\ \mathcal{C}e\_{2nb} \\ \vdots \\ \mathcal{C}e\_{2nb+1} \end{bmatrix} = \begin{bmatrix} P\_{\mathcal{S},1} \\ \vdots \\ P\_{\mathcal{S},nb} \\ \mathcal{Q}\_{\mathcal{S},1} \\ \vdots \\ \mathcal{Q}\_{\mathcal{S},nb} \\ \vdots \\ \mathcal{Q}\_{\mathcal{S},nb} \end{bmatrix} - \begin{bmatrix} P\_{l,1} \\ \vdots \\ P\_{l,nb} \\ \vdots \\ Q\_{l,1} \\ \vdots \\ Q\_{l,nb} \\ \mathcal{Q}\_{\mathcal{U},nb} \end{bmatrix} - \begin{bmatrix} P\_{inj,1} \\ \vdots \\ P\_{inj,nb} \\ \vdots \\ \mathcal{Q}\_{\mathcal{U},n} \\ \vdots \\ \mathcal{Q}\_{\mathcal{U},n} \end{bmatrix} \tag{8}$$

In the above expression, *sn* is the subscript associated with the slack node, whilst *Xsn* stores the value of phase of the slack node in the corresponding component of the state vector *X*. Note that *θsn* is the value of the phase at which the angle of the slack node is fixed. It must be pointed out that in (7) and (8), the value of the reactive power *Qgi* must always be zero for the *i-th* generation node. This is because the level of reactive power generation depends on the state variables of the power system. Henceforth, *Qgi* lacks a scheduled value in the optimization model OPF. Furthermore, the constraint of reactive power balance is satisfied only at nongeneration nodes. Then such constraint should be handled as a functional inequality constraint for generation nodes in order to establish the reactive power balance in such nodes, as it is explained below. Note that the way in which the vector of

equality constraints (*Ce*) is written, provides the flexibility to add more constraints of this type. This in turn allows extending the OPF model to other similar models for the steady-state operation assessment of power systems. The general command line syntax for the vector of equality constraints, *Ce,* is the following:

The level of reactive power generation is not a scheduled value because it is a

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices…*

max n o *<sup>i</sup>* <sup>¼</sup> 1, 2, … , *ng* (12)

� � � *BijCos <sup>θ</sup><sup>i</sup>* � *<sup>θ</sup> <sup>j</sup>* � � � � (13)

*Qgi* � *Qg*,*<sup>v</sup>* ¼ 0 (14)

*Q*min *g*,1 ⋮ *Q*min *g*,*ng* �*Q*max *g*,1

(15)

⋮

�*Q*max *g*,*ng*

function of the system variables. Therefore, the limits of the power (*Qgi*) are modeled in the OPF problem as a functional inequality constraint as follows:

min ≤ *Qgi* ≤ *Qgi*

The reactive power generation level *Qgi* in (12) is given by the following

*<sup>i</sup> Bii* þ *ViV <sup>j</sup> GijSin θ<sup>i</sup>* � *θ <sup>j</sup>*

In accordance with (13), the balance of reactive power at the *i-th* generation node is achieved only when the level of that power is inside its own bounds. If the level of the reactive power generation of a given generator is out of its upper or lower limit, then the corresponding inequality constraint (9) must be added to the active set in (12), becoming an equality constraint that helps in resetting the

It should be noted that in the OPF model, the above expression avoids the violation of the limits of the reactive power generation. Also it allows to maintain the balance of reactive power at the generation nodes. Next observe that the functional inequality constraints are written in the same file of the equality constraints,

> �*Qg*,1 ⋮ �*Qg*,*ng Qg*,1

þ

⋮

*Qg*,*ng*

As mentioned above, the input argument **nonlcon** is the handle of the Mfunction file containing both the nonlinear equality and the functional inequality constraints. Therefore, the two sets of constraints are written in an M-function file whose name is **constraints\_OPF**. The **fmincon** function calls this M-function file through the input argument **nonlcon**, using the syntax @(X)Constraints\_OPF(X). In addition to the M-functions: **objfun\_OPF** and **constraints OPF**; the **fmincon** function also calls the vectors: **lb** and, **ub**; which contain the lower and upper limits

The general Matlab syntax for the inequality constraints given by Eq. (15) is the

g y� � <sup>¼</sup> *Qgi*

� *<sup>V</sup>*<sup>2</sup>

function:

*Qgi* <sup>¼</sup> *Qli* <sup>þ</sup><sup>X</sup>

as it is shown below.

following:

**359**

*j*∈*i*

*DOI: http://dx.doi.org/10.5772/intechopen.93519*

reactive power *Qgi* at the violated limit *Qg,v*.

*Ci*<sup>1</sup> ⋮ *Cing Cing*þ<sup>1</sup> ⋮

¼

%Reactive power generation limits in generation nodes ci(1:ngen,1) = -Qgi + Qgi\_min; %-Qg+Qlow<=0 ci(ngen+1:2\*ngen,1) = Qgi - Qg\_max; % Qg-Qsup<=0

of the state variables. The general syntax for the above is the following:

*Ci*2*ng*

function [ci,ce] = **constraints\_OPF**(\_\_\_)

function [ci,ce] = **constraints\_OPF**(\_\_\_) % Nodal active power balance equality constraints (Pg-Pd\_Pinj=0) %i=1,2,...,nb Ce(1:nb,1) = Pg\_i(\_\_\_) - Pl\_i(\_\_\_) - Pinj\_i(\_\_\_); % Nodal reactive power balance equality constraints (Qg-Qd\_Qinj=0) %k=1,2,...,nb-ngen Ce(nb+1:2\*nb,1) = Qg\_k(\_\_\_) - Ql\_k(\_\_\_)- Qinj\_k(\_\_\_); %Set fix the slack node angle Ce(2\*nb+1,1) = VP(sn) - V(sn,2);

It is important to note that in the above syntax, Pg\_i, Pl\_i and Pinj\_i are implemented as M-function files. The same is valid for the code line that corresponds to the reactive power.

## *3.2.4 Inequality constraints*

The physical and operational limits are mathematically modeled as inequality constraints. This is because these limits help to constrain the range of the practical steady-state operation of the power-system components. For a better handling of the inequality constraints, these are classified into two types: inequality constraints on variables and functional inequality constraints. The limits on the magnitude of the substation-voltage and the generation of active-power are represented by the inequality constraints given by (9).

$$Y = \left\{ \begin{array}{c} \theta\_n^{\min} \le \theta\_n \le \theta\_n^{\max} \\\\ P\_{\mathcal{g}^i} \le P\_{\mathcal{g}^i} \le P\_{\mathcal{g}^i} \end{array} \right\}\_{n} i = 1, 2, \dots, n \text{g} \\\\ \begin{array}{c} i = 1, 2, \dots, n \text{g} \\\\ n = 1, 2, \dots, n \text{b} \end{array} \tag{9}$$

In (9), the superscripts min and max represent the lower and upper bounds of the respective variable. As mentioned before, the lower bound is assigned to the input argument **lb**, and the upper bound is assigned to the input argument **up**; both arguments are called by **fmincon** function during the optimization process. The assignment of such limits to the respective previously mentioned input-arguments is shown in (10). The superscript T, on **lb** and **up** indicates the transposition of the respective vector.

$$\mathbf{lb} = \begin{bmatrix} \theta\_1^{\min} \dots \theta\_{nb}^{\min} & V\_1^{\min} \dots V\_{nb}^{\min} & P\_{\mathbf{g}1}^{\min} \dots P\_{\mathbf{g}\mathbf{g}}^{\min} \end{bmatrix}^T \tag{10}$$

$$\mathbf{u}\mathbf{p} = \begin{bmatrix} \theta\_1^{\max} \dots \theta\_{nb}^{\max} & V\_1^{\max} \dots V\_{nb}^{\max} & P\_{\mathbf{g}1}^{\max} \dots P\_{\mathbf{g}\mathbf{g}}^{\max} \end{bmatrix}^T \tag{11}$$

Clearly, the size of the vectors **lb** and **up** is equal to the size of the vector of the steady-state variables, *X*. As mentioned before, storing the inequality constraintvectors into an M-file enables the convenient modification of such vectors by adding or removing constraints that are associated with other models of steadystate operation of power systems. This is shown in subsequent sections.

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices… DOI: http://dx.doi.org/10.5772/intechopen.93519*

The level of reactive power generation is not a scheduled value because it is a function of the system variables. Therefore, the limits of the power (*Qgi*) are modeled in the OPF problem as a functional inequality constraint as follows:

$$\mathbf{g(y)} = \left\{ \mathbf{Q\_{gi}}^{\text{min}} \le \mathbf{Q\_{gi}} \le \mathbf{Q\_{gi}}^{\text{max}} \right\} \text{ } i = \mathbf{1}, \mathbf{2}, \dots, n\mathbf{g} \tag{12}$$

The reactive power generation level *Qgi* in (12) is given by the following function:

$$Q\_{\rm gi} = Q\_{\rm li} + \sum\_{j \in i} -V\_i^2 B\_{\rm ii} + V\_i V\_j \left[ G\_{\rm ij} \text{Sim}\left(\theta\_i - \theta\_j\right) - B\_{\rm ij} \text{Co}\left(\theta\_i - \theta\_j\right) \right] \tag{13}$$

In accordance with (13), the balance of reactive power at the *i-th* generation node is achieved only when the level of that power is inside its own bounds. If the level of the reactive power generation of a given generator is out of its upper or lower limit, then the corresponding inequality constraint (9) must be added to the active set in (12), becoming an equality constraint that helps in resetting the reactive power *Qgi* at the violated limit *Qg,v*.

$$Q\_{\rm g} - Q\_{\rm g,v} = \mathbf{0} \tag{14}$$

It should be noted that in the OPF model, the above expression avoids the violation of the limits of the reactive power generation. Also it allows to maintain the balance of reactive power at the generation nodes. Next observe that the functional inequality constraints are written in the same file of the equality constraints, as it is shown below.

$$\begin{bmatrix} \mathbf{C}i\_1 \\ \vdots \\ \mathbf{C}i\_{\text{ng}} \\ \mathbf{C}i\_{\text{ng}+1} \\ \vdots \\ \mathbf{C}i\_{2\text{ng}} \end{bmatrix} = \begin{bmatrix} -\mathbf{Q}\_{\text{g,1}} \\ \vdots \\ -\mathbf{Q}\_{\text{g,\text{ng}}} \\ \mathbf{Q}\_{\text{g,1}} \\ \vdots \\ \mathbf{C}i\_{\text{g,\text{ng}}} \end{bmatrix} + \begin{bmatrix} \mathbf{Q}\_{\text{g,1}}^{\text{min}} \\ \vdots \\ \mathbf{Q}\_{\text{g,\text{ng}}}^{\text{min}} \\ -\mathbf{Q}\_{\text{g,1}}^{\text{max}} \\ \vdots \\ -\mathbf{Q}\_{\text{g,\text{ng}}}^{\text{max}} \end{bmatrix} \tag{15}$$

The general Matlab syntax for the inequality constraints given by Eq. (15) is the following:

```
function [ci,ce] = constraints_OPF(___)
```
%Reactive power generation limits in generation nodes ci(1:ngen,1) = -Qgi + Qgi\_min; %-Qg+Qlow<=0 ci(ngen+1:2\*ngen,1) = Qgi - Qg\_max; % Qg-Qsup<=0

As mentioned above, the input argument **nonlcon** is the handle of the Mfunction file containing both the nonlinear equality and the functional inequality constraints. Therefore, the two sets of constraints are written in an M-function file whose name is **constraints\_OPF**. The **fmincon** function calls this M-function file through the input argument **nonlcon**, using the syntax @(X)Constraints\_OPF(X).

In addition to the M-functions: **objfun\_OPF** and **constraints OPF**; the **fmincon** function also calls the vectors: **lb** and, **ub**; which contain the lower and upper limits of the state variables. The general syntax for the above is the following:

equality constraints (*Ce*) is written, provides the flexibility to add more constraints of this type. This in turn allows extending the OPF model to other similar models for the steady-state operation assessment of power systems. The general command

line syntax for the vector of equality constraints, *Ce,* is the following:

% Nodal active power balance equality constraints (Pg-Pd\_Pinj=0)

% Nodal reactive power balance equality constraints (Qg-Qd\_Qinj=0)

It is important to note that in the above syntax, Pg\_i, Pl\_i and Pinj\_i are implemented as M-function files. The same is valid for the code line that

The physical and operational limits are mathematically modeled as inequality constraints. This is because these limits help to constrain the range of the practical steady-state operation of the power-system components. For a better handling of the inequality constraints, these are classified into two types: inequality constraints on variables and functional inequality constraints. The limits on the magnitude of the substation-voltage and the generation of active-power are represented by the

max

9 >>=

*i* ¼ 1, 2, … , *ng*

*<sup>n</sup>* <sup>¼</sup> 1, 2, … , *nb* (9)

(10)

(11)

>>;

max

In (9), the superscripts min and max represent the lower and upper bounds of the respective variable. As mentioned before, the lower bound is assigned to the input argument **lb**, and the upper bound is assigned to the input argument **up**; both arguments are called by **fmincon** function during the optimization process. The assignment of such limits to the respective previously mentioned input-arguments is shown in (10). The superscript T, on **lb** and **up** indicates the transposition of the

max

<sup>1</sup> … *V*min

<sup>1</sup> … *V*max

Clearly, the size of the vectors **lb** and **up** is equal to the size of the vector of the steady-state variables, *X*. As mentioned before, storing the inequality constraintvectors into an M-file enables the convenient modification of such vectors by adding or removing constraints that are associated with other models of steady-

h i*<sup>T</sup>*

h i*<sup>T</sup>*

*nb P*min

*nb P*max

*<sup>g</sup>*<sup>1</sup> … *P*min *gng*

*<sup>g</sup>*<sup>1</sup> … *P*max *gng*

function [ci,ce] = **constraints\_OPF**(\_\_\_)

*Renewable Energy - Technologies and Applications*

Ce(1:nb,1) = Pg\_i(\_\_\_) - Pl\_i(\_\_\_) - Pinj\_i(\_\_\_);

Ce(nb+1:2\*nb,1) = Qg\_k(\_\_\_) - Ql\_k(\_\_\_)- Qinj\_k(\_\_\_);

%i=1,2,...,nb

%k=1,2,...,nb-ngen

*3.2.4 Inequality constraints*

respective vector.

**358**

%Set fix the slack node angle Ce(2\*nb+1,1) = VP(sn) - V(sn,2);

corresponds to the reactive power.

inequality constraints given by (9).

*Y* ¼

*θn*

*Pgi*

8 >><

>>:

lb <sup>¼</sup> *<sup>θ</sup>*min

up <sup>¼</sup> *<sup>θ</sup>*max

<sup>1</sup> … *θ*min

<sup>1</sup> … *θ*max

*nb V*min

*nb V*max

state operation of power systems. This is shown in subsequent sections.

*Vn*

min ≤ *θ<sup>n</sup>* ≤ *θ<sup>n</sup>*

min ≤ *Pgi* ≤*Pgi*

min ≤*Vn* ≤*Vn*

function [VP,fval,output,exitflag,lambda,grad]=OPF(\_\_\_).

[X,fval,exitflag,output,lambda,grad,hessian] = fmincon(\_\_\_); [X] = **fmincon**(@(X) **objfun\_OPF**(\_\_), X, [], [], [], [], **lb**, **ub**,... @(X) **constraints\_OPF**(\_\_),options);

The way in which the above M-files are written in Matlab facilitates the modification of the constraints, the objective function and the vector of state variables, providing flexibility to the proposed implementation. Furthermore, the development of this proposed methodology is based on structured programming, which increases its flexibility by allowing the inclusion of other electrical devices and/or different steady-state models for operational assessment of distinct power systems with minor code modifications.

**4.1 State variables of the FACTS devices**

*DOI: http://dx.doi.org/10.5772/intechopen.93519*

%Set of state variables added by i-th FACTS device

**4.2 Power flow injections and the control equations of FACTS devices**

The power balance in all nodes of a power system must be unconditionally satisfied. Therefore, the incorporation of the model of a FACTS device into the optimization model implies to consider the injection of active and reactive power provided by such device. Thus, the set of equality constraints (7) is extended to include the power flow injections provided by FACTS devices as follows:

> *Pinj*,FACTS *<sup>i</sup>* ¼ 0

> > *Qinj*,FACTS *<sup>i</sup>* ¼ 0

*inj,FACTS* represent the active and reactive

*hctrl*ð Þ¼ *<sup>y</sup> Fi* � *Fspec* � � (17)

9 >>>>=

>>>>;

(16)

VP(2\*nb+ngen+1:2\*nb+ngen+nvar,1)=FACTS\_i;

*Pgi* � *Pli* � <sup>P</sup>

*Qgk* � *Qlk* � <sup>P</sup>

flow injections corresponding to the FACTS devices.

*inj,FACTS* and *Qi*

*nb j*∈*i Pinj*,*<sup>j</sup> <sup>i</sup>* � <sup>P</sup> *nb FACTS* ∈*i*

> *nb j*∈*k*

*Qinj*,*<sup>j</sup>*

*<sup>k</sup>* � <sup>P</sup> *nb FACTS*∈*i*

power flow injections provided by FACTS devices. In the structure of the proposed flexible approach, shown in **Figure 2**, the power-flow injections are included in an M-function file whose name is P\_injected. This last file is called by the M-function file **Constraints\_OPF**, according to (8). Note that the size as well as the syntax of the vector, *Ce,* are not modified by the inclusion of the active and reactive power-

In addition to the extended power-balance equality constraints set, given by (16), the inclusion of FACTS devices into the optimization model implies to include their respective control equations as elements of the following set of additional

where *F* is the parameter to be controlled by the i-th FACTS controller with the specified target value *Fspec*. Observe that such control parameter can either be the

*h y*ð Þ¼

where the terms *Pi*

equality constraints given by

**361**

8 >>>><

>>>>:

The models of FACTS devices add one or more state variables to the OPF formulation; therefore, it is necessary to consider such variables in the proposed implementation. The state variables of FACTS devices are included in the set of steadystate variables (5), denoted by the state vector *X*. It is convenient to write these variables in the next position from *Pgi*, that is, in the position (2nb + ng + 1,1) of the vector *X*, in accordance to the structure of the proposed approach. When the model of a FACTS device is incorporated, it should be noted that the size of the vector *X* is increased from (2nb + ng, 1) to (2nb + ng + nvar, 1), where **nvar** is the number of state variables of each FACTS device. Similarly, the initial conditions of the state variables of FACTS devices are included in the vector **X0** in a position following the initial condition of *Pgi*. The operating limits of FACTS devices are handled as inequality constraints on the respective sate variables. Therefore, the lower and upper bounds of the state variables for these devices are written in the position (2nb + ng + 1, 1) of the vector **lb** and **up**, respectively. Note that, when considering the model of any FACTS device, the size of these last vectors is extended to equal the size of the state vector *X*. The syntax of the vector X which contains both the power system state variables and the state variables added by FACTS devices is the following:

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices…*

#### **3.3 Structured programming of the OPF model**

The proposed flexible approach is developed using structured programming because in this way it is possible to develop computer programs that can be easily understood. Also this kind of programming is very useful when it is necessary to modify or extend an existing program. This is the case of the proposal presented here, where the OPF model is extended to consider several optimization applications of power systems with embedded FACTS controllers.

In that figure, it can be observed that the structure of the proposed implementation contains a main program. This one starts reading the M-file of the power system data, which includes a convergence tolerance, the MVA-base and the data of the most common components of a power system in accordance to Section 3 of this book chapter. After reading the M-file, in the main program, the power system data are converted to pu in order to work in the same units all entire system components, but also to avoid optimization scaling problems. Next, the program calls the respective functions for calculating the conductance and the susceptance of the transmission lines, the transformers and the shunt compensators. Observe that these quantities are used for calculating the injections of active and reactive power. This calculation involves the equality constraints associated with the power balance at each node of the power system. After that, the OGD M-function file is executed to obtain the solution of the Optimal Generation Dispatch. It must be pointed out that in the OGD M-function file, the **fmincon** function calls the objective function and, the OGD constraints through the argument **nonlcon** using a similar syntax to the one mentioned in the previous subsection. Then, the main program runs the OPF M-function file to solve the Optimal Power Flow model, where the **fmincon** function calls the Mfunction files containing the objective function and the constraints of the OPF model. Last but not least, the program computes the power flows in the network and prints results of the OPF steady-state solution. The output yielded by the proposed flexible approach include: (a) generators rating and the OPF dispatch, (b) the operating point computed by the OPF, (c) the power flow and power losses in transmission lines, transformers, and loads connected in shunt, (d) the total losses of the active and reactive power and (e) the CPU time of the optimization process.

## **4. Including FACTS models into the proposed flexible approach**

Models of FACTS devices are easily integrated into the proposed flexible implementation by considering the following issues: the state variables and their limits; the injection of active and reactive power at the node where the controller is connected and the control equations or control modes of each FACTS device. Below, it is described in detail how the FACTS devices are integrated into the flexible approach.

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices… DOI: http://dx.doi.org/10.5772/intechopen.93519*

### **4.1 State variables of the FACTS devices**

function [VP,fval,output,exitflag,lambda,grad]=OPF(\_\_\_). [X,fval,exitflag,output,lambda,grad,hessian] = fmincon(\_\_\_); [X] = **fmincon**(@(X) **objfun\_OPF**(\_\_), X, [], [], [], [], **lb**, **ub**,... @(X)

The way in which the above M-files are written in Matlab facilitates the modification of the constraints, the objective function and the vector of state variables, providing flexibility to the proposed implementation. Furthermore, the development of this proposed methodology is based on structured programming, which increases its flexibility by allowing the inclusion of other electrical devices and/or different steady-state models for operational assessment of distinct power systems

The proposed flexible approach is developed using structured programming because in this way it is possible to develop computer programs that can be easily understood. Also this kind of programming is very useful when it is necessary to modify or extend an existing program. This is the case of the proposal presented here, where the OPF model is extended to consider several optimization applica-

In that figure, it can be observed that the structure of the proposed implementation contains a main program. This one starts reading the M-file of the power system data, which includes a convergence tolerance, the MVA-base and the data of the most common components of a power system in accordance to Section 3 of this book chapter. After reading the M-file, in the main program, the power system data are converted to pu in order to work in the same units all entire system components, but also to avoid optimization scaling problems. Next, the program calls the respective functions for calculating the conductance and the susceptance of the transmission lines, the transformers and the shunt compensators. Observe that these quantities are used for calculating the injections of active and reactive power. This calculation involves the equality constraints associated with the power balance at each node of the power system. After that, the OGD M-function file is executed to obtain the solution of the Optimal Generation Dispatch. It must be pointed out that in the OGD M-function file, the **fmincon** function calls the objective function and, the OGD constraints through the argument **nonlcon** using a similar syntax to the one mentioned in the previous subsection. Then, the main program runs the OPF M-function file to solve the Optimal Power Flow model, where the **fmincon** function calls the Mfunction files containing the objective function and the constraints of the OPF model. Last but not least, the program computes the power flows in the network and prints results of the OPF steady-state solution. The output yielded by the proposed flexible approach include: (a) generators rating and the OPF dispatch, (b) the operating point computed by the OPF, (c) the power flow and power losses in transmission lines, transformers, and loads connected in shunt, (d) the total losses of the active and

**constraints\_OPF**(\_\_),options);

*Renewable Energy - Technologies and Applications*

with minor code modifications.

**3.3 Structured programming of the OPF model**

tions of power systems with embedded FACTS controllers.

reactive power and (e) the CPU time of the optimization process.

**360**

**4. Including FACTS models into the proposed flexible approach**

Models of FACTS devices are easily integrated into the proposed flexible implementation by considering the following issues: the state variables and their limits; the injection of active and reactive power at the node where the controller is connected and the control equations or control modes of each FACTS device. Below, it is described in detail how the FACTS devices are integrated into the flexible approach.

The models of FACTS devices add one or more state variables to the OPF formulation; therefore, it is necessary to consider such variables in the proposed implementation. The state variables of FACTS devices are included in the set of steadystate variables (5), denoted by the state vector *X*. It is convenient to write these variables in the next position from *Pgi*, that is, in the position (2nb + ng + 1,1) of the vector *X*, in accordance to the structure of the proposed approach. When the model of a FACTS device is incorporated, it should be noted that the size of the vector *X* is increased from (2nb + ng, 1) to (2nb + ng + nvar, 1), where **nvar** is the number of state variables of each FACTS device. Similarly, the initial conditions of the state variables of FACTS devices are included in the vector **X0** in a position following the initial condition of *Pgi*. The operating limits of FACTS devices are handled as inequality constraints on the respective sate variables. Therefore, the lower and upper bounds of the state variables for these devices are written in the position (2nb + ng + 1, 1) of the vector **lb** and **up**, respectively. Note that, when considering the model of any FACTS device, the size of these last vectors is extended to equal the size of the state vector *X*. The syntax of the vector X which contains both the power system state variables and the state variables added by FACTS devices is the following:

%Set of state variables added by i-th FACTS device VP(2\*nb+ngen+1:2\*nb+ngen+nvar,1)=FACTS\_i;

#### **4.2 Power flow injections and the control equations of FACTS devices**

The power balance in all nodes of a power system must be unconditionally satisfied. Therefore, the incorporation of the model of a FACTS device into the optimization model implies to consider the injection of active and reactive power provided by such device. Thus, the set of equality constraints (7) is extended to include the power flow injections provided by FACTS devices as follows:

$$h(\mathbf{y}) = \left\{ \begin{aligned} &P\_{gi} - P\_{li} - \sum\_{j \in i}^{nb} P\_i^{injj} - \sum\_{\text{FACTS} \in i}^{nb} P\_i^{inj, \text{FACTS}} = \mathbf{0} \\ &Q\_{gk} - Q\_{lk} - \sum\_{j \in k}^{nb} Q\_k^{injj} - \sum\_{\text{FACTS} \in i}^{nb} Q\_i^{inj, \text{FACTS}} = \mathbf{0} \end{aligned} \right\} \tag{16}$$

where the terms *Pi inj,FACTS* and *Qi inj,FACTS* represent the active and reactive power flow injections provided by FACTS devices. In the structure of the proposed flexible approach, shown in **Figure 2**, the power-flow injections are included in an M-function file whose name is P\_injected. This last file is called by the M-function file **Constraints\_OPF**, according to (8). Note that the size as well as the syntax of the vector, *Ce,* are not modified by the inclusion of the active and reactive powerflow injections corresponding to the FACTS devices.

In addition to the extended power-balance equality constraints set, given by (16), the inclusion of FACTS devices into the optimization model implies to include their respective control equations as elements of the following set of additional equality constraints given by

$$h\_{\rm ctrl}(\mathcal{y}) = \left\{ F\_i - F\_{\rm spec} \right\} \tag{17}$$

where *F* is the parameter to be controlled by the i-th FACTS controller with the specified target value *Fspec*. Observe that such control parameter can either be the

implementation has been structured to connect and disconnect any FACTS device belonging to the power system. This is achieved by writing a 0 or 1 in the data file of the corresponding FACTS controller, where 0 is for disconnecting and 1 is for

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices…*

The conventional Power Flow analysis is aimed to determine the steady-state operation of an electric power system. This consists on computing the magnitude and angle of each voltage at all the nodes of the system. This is carried out in addition to determining the active and reactive power flow in the transmission elements of the power system. In this analysis, four quantities are associated with each node of the system which are the magnitude of the voltage, the angle of the phase and the active and reactive power-flow. Furthermore, the system nodes can be classified as: slack nodes, regulated or PV nodes and load or PQ nodes. The complex node voltage given in phase and magnitude can be specified at any slack node. Note that in the regulated nodes, the magnitude of the voltage and active power are known. Whilst the value of the active and reactive power is defined in

The power flow analysis is based on the power balance equations at each node of

the power system which are given by the set of equality constraints in (7). The proposed approach in this chapter book allows obtaining the solution to conventional Power Flow problems by performing small changes in the OPF formulation. This can be achieved by converting the OPF model into a conventional PF model. In the OPF analysis is not important to identify the node types, as it is in the case of a PF analysis. However, both analyzes are based on the power balance equations for all nodes of the power system. Thus, it is possible to include the PV nodes in the OPF model by setting the magnitude of the voltage as well as the active power to a given value, only at the nodes where a generator is connected. Similarly, the slack node can be included by setting the magnitude of the voltage and the angle of the phase to a given value. In this way, the solution of the conventional PF analysis is obtained from the OPF model. The aforementioned procedure is accomplished by including an additional set of equality constraints in the optimization model. This allows for the setting of the magnitude of the voltage as well as the active power to certain values at the generation nodes. It also allows for the setting of the magnitude of the voltage and the angle of the phase to the stablished values at the slack nodes. This additional set of equality constraints that aims to obtain the solution of the PF

*Vsn* � *<sup>V</sup>spec*

8 >>>>><

>>>>>:

*<sup>θ</sup>sn* � *<sup>θ</sup>spec*

*Pgi* � *Pspec*

*Vgk* � *<sup>V</sup>spec*

*sn* ¼ 0

9 >>>>>=

*i* ¼ 1, 2, … , *ng* ∣ *i* ∉ *sn k* ¼ 1, 2, … , *ng*

*Minimize f y*ð Þ (20)

(19)

>>>>>;

*sn* ¼ 0

*gi* ¼ 0

constrained nonlinear optimization which is formulated using the OPF model. Therefore, the general model of the conventional power flow analysis considered in

*gk* ¼ 0

In this way, the conventional Power Flow analysis is modeled as a problem of a

**5. Solution of the conventional power flow problem**

*DOI: http://dx.doi.org/10.5772/intechopen.93519*

connecting.

any load node.

problem is given by (19).

this work is given as follows:

**363**

*hOPF*�*PF*ð Þ¼ *y*

**Figure 2.** *Schematic representation of structured programming of the proposed flexible approach.*

active/reactive power flow through the transmission line or the magnitude of the voltage at a specific node of the power system in accordance to the type of the FACTS device connected to the network at such node. It is noteworthy that when a device is connected to the network, its corresponding constraint is activated in the set given by (17) in order to enable the respective control action of such device during the process of solving the optimization model. Otherwise, that is, when no FACTS devices are involved, the equality constraints of the control modes remain inactive.

Thus, in the proposed flexible implementation, the vector *Ce* of equality constraints is extended to include the additional set of equality constraints. Mathematically, (8) is augmented to contain the equation given by (18)

$$\left[\mathbf{C}\mathbf{e}\_{2nb+1+nF}\right] = \left[F\_i\right] - \left[F\_{\text{spec}}\right] \tag{18}$$

Adding control equations increases the size of the vector *Ce*, given by (8), to (2nb + 1 + nF,1), where *nF* equals the number of control modes of FACTS devices in the optimization model. It is noteworthy that when the model of the FACTS device has operation equations such as in the case of the VSC-HVDC system; these equations must be considered as equality constraints associated with the corresponding device operation. Also note that such constraints are included in the optimization model given by (17), in the same way as the control constraints were included in that model. Last but not least, the vector *Ce* must be extended to include the above equality constraints. The control modes of the FACTS devices are implemented in M-function files in order to facilitate their handling and to provide flexibility to the proposed implementation. The general syntax for including the additional set of equality constraints associated with the control equations corresponding to the FACTS devices is the following:

ce(2\*nb+2:2\*nb+1+nF,1)=Control\_FACTS(\_\_\_); %nF control modes

The previously mentioned procedure can be applied to integrate easily the model of any FACTS device into the proposed flexible approach. The proposed

implementation has been structured to connect and disconnect any FACTS device belonging to the power system. This is achieved by writing a 0 or 1 in the data file of the corresponding FACTS controller, where 0 is for disconnecting and 1 is for connecting.

## **5. Solution of the conventional power flow problem**

The conventional Power Flow analysis is aimed to determine the steady-state operation of an electric power system. This consists on computing the magnitude and angle of each voltage at all the nodes of the system. This is carried out in addition to determining the active and reactive power flow in the transmission elements of the power system. In this analysis, four quantities are associated with each node of the system which are the magnitude of the voltage, the angle of the phase and the active and reactive power-flow. Furthermore, the system nodes can be classified as: slack nodes, regulated or PV nodes and load or PQ nodes. The complex node voltage given in phase and magnitude can be specified at any slack node. Note that in the regulated nodes, the magnitude of the voltage and active power are known. Whilst the value of the active and reactive power is defined in any load node.

The power flow analysis is based on the power balance equations at each node of the power system which are given by the set of equality constraints in (7). The proposed approach in this chapter book allows obtaining the solution to conventional Power Flow problems by performing small changes in the OPF formulation. This can be achieved by converting the OPF model into a conventional PF model. In the OPF analysis is not important to identify the node types, as it is in the case of a PF analysis. However, both analyzes are based on the power balance equations for all nodes of the power system. Thus, it is possible to include the PV nodes in the OPF model by setting the magnitude of the voltage as well as the active power to a given value, only at the nodes where a generator is connected. Similarly, the slack node can be included by setting the magnitude of the voltage and the angle of the phase to a given value. In this way, the solution of the conventional PF analysis is obtained from the OPF model. The aforementioned procedure is accomplished by including an additional set of equality constraints in the optimization model. This allows for the setting of the magnitude of the voltage as well as the active power to certain values at the generation nodes. It also allows for the setting of the magnitude of the voltage and the angle of the phase to the stablished values at the slack nodes. This additional set of equality constraints that aims to obtain the solution of the PF problem is given by (19).

$$h\_{OPF-PF}(\mathbf{y}) = \begin{cases} V\_{m} - V\_{m}^{pac} = \mathbf{0} \\ \theta\_{m} - \theta\_{m}^{pac} = \mathbf{0} \\ P\_{gi} - P\_{gi}^{pec} = \mathbf{0} \\ V\_{gk} - V\_{gk}^{pec} = \mathbf{0} \end{cases} \quad i = \mathbf{1}, 2, \dots, n\mathbf{g} \mid i \notin \mathbf{m} \tag{19}$$

In this way, the conventional Power Flow analysis is modeled as a problem of a constrained nonlinear optimization which is formulated using the OPF model. Therefore, the general model of the conventional power flow analysis considered in this work is given as follows:

$$\text{Minimize}\,f(\mathbf{y})\tag{20}$$

active/reactive power flow through the transmission line or the magnitude of the voltage at a specific node of the power system in accordance to the type of the FACTS device connected to the network at such node. It is noteworthy that when a device is connected to the network, its corresponding constraint is activated in the set given by (17) in order to enable the respective control action of such device during the process of solving the optimization model. Otherwise, that is, when no FACTS devices are

Thus, in the proposed flexible implementation, the vector *Ce* of equality constraints is extended to include the additional set of equality constraints. Mathemat-

½ �¼ *Ce*2*nb*þ1þ*nF Fi* ½ �� *Fspec*

Adding control equations increases the size of the vector *Ce*, given by (8), to (2nb + 1 + nF,1), where *nF* equals the number of control modes of FACTS devices in the optimization model. It is noteworthy that when the model of the FACTS device has operation equations such as in the case of the VSC-HVDC system; these equations must be considered as equality constraints associated with the corresponding device operation. Also note that such constraints are included in the optimization model given by (17), in the same way as the control constraints were included in that model. Last but not least, the vector *Ce* must be extended to include the above equality constraints. The control modes of the FACTS devices are implemented in M-function files in order to facilitate their handling and to provide flexibility to the proposed implementation. The general syntax for including the additional set of equality constraints associated with the control equations corresponding to the

ce(2\*nb+2:2\*nb+1+nF,1)=Control\_FACTS(\_\_\_); %nF control modes

of any FACTS device into the proposed flexible approach. The proposed

The previously mentioned procedure can be applied to integrate easily the model

(18)

involved, the equality constraints of the control modes remain inactive.

*Schematic representation of structured programming of the proposed flexible approach.*

*Renewable Energy - Technologies and Applications*

ically, (8) is augmented to contain the equation given by (18)

FACTS devices is the following:

**362**

**Figure 2.**

$$\text{Subject to } h(\mathfrak{y}) = \mathbf{0} \tag{21}$$

$$\mathbf{g}(\mathbf{y}) \le \mathbf{0} \tag{22}$$

*h*min ≤*h y*ð Þ , *p* (28) *h y*ð Þ , *p* ≤*h*max (29) *p*min ≤*p* (30) *p* ≤*p*max (31)

*CSj PSj* � � (32)

where the dependent variables, such as the nodal voltage, are represented by *y*. Whilst the control variables, for example, the supply bids *PS* and power demand *PD*,

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices…*

The objective function of the OPF market-clearing model represents the social welfare associated with the power system. That function is given by the difference between: the sum of the accepted demand bids *PDi* times their corresponding bid prices *CDi* (in \$/MWhr) and the sum of the accepted production bids *PSj* times their corresponding bids prices *CSj* (in \$/MWhr). Mathematically, this objective function

*CDi*ð Þ� *PDi* <sup>X</sup>

In (32), the first and second term is also identified as *fD* and *fS*, respectively; *nl*

The set of equality constraints (33) represents the standard power flow

where the set *y =* (*θ*, *V*, *kG*) and *p =* (*PS*, *PD*). The variables *θ* and *V* are the complex-voltage phases and magnitudes at nodes of the power system, respectively. Whilst *kG* is a scalar variable used to account for the system losses by means of either a unique or a distributed slack node. It is important to note that *y* represents the set of dependent variables to be optimized. The generator and load powers are

where *PG0* and *PL0* stand for the generator and load parameters that are not part of the market trading, that is, these parameters represent the negotiation of energy between particulars in a specific big industry and/or Generation Companies (GENCOS). Whilst PS and PD are the amounts of energy that can be traded in the electricity market by GENCOS and Energy Services Company (ESCOS). Finally, the reactive loads are assumed to have constant power factors which are computed by

*ng*

*j*¼1

*g y*ð Þ¼ , *p g*ð*θ*,*V*, *kG*, *PS*, *PD*Þ ¼ 0 (33)

*PG* ¼ *PG*<sup>0</sup> þ *PS* (34) *PL* ¼ *PL*<sup>0</sup> þ *PD* (35)

*QL* ¼ *PL* tan *ϕ<sup>L</sup>* ð Þ (36)

are denoted by *p*. The functions *f*, *g* and *h* are defined below.

*<sup>f</sup>* <sup>¼</sup> <sup>X</sup> *nl*

*i*¼1

represents the total demand bids, and *ng* is the total production bids.

**6.1 Objective function**

*DOI: http://dx.doi.org/10.5772/intechopen.93519*

**6.2 Equality constraints**

is given by

equations

defined as follows:

using the following expression:

**365**

$$
\mathbf{y}^{\min} \le \mathbf{y} \le \mathbf{y}^{\max} \tag{23}
$$

$$h\_{\text{OPF}-\text{PF}}(\mathcal{y}) = \mathbf{0} \tag{24}$$

where the *hOPF-PF* is the set of equality constraints given by (19). This allows the inclusion of the node types in order to convert the OPF model into a conventional PF model.

Therefore in accordance to the conventional PF model given by (20)–(24), the proposed flexible approach solution to the Power Flow problem can be obtained by considering the full of the power flow model given by (6), (7), (9), (12), and (19). It is important to note that by including the above equality constraints, the resulting OPF implementation is modified and reused to straightforwardly obtain the computational implementation of the Power Flow analysis that considers embedded FACTS controllers. In this case, it must be considered the extended optimization model with FACTS devices given by (6), (9), (12), (16), (17) and (19).

In order to maintain the structure of the proposed implementation, the last set of equality constraints is written in the vector *Ce* of the M-function file named **Constraints\_OPF** as follows:

$$\begin{bmatrix} \mathbf{C}\mathbf{c}\_{2nb+nF+2} \\ \mathbf{C}\mathbf{c}\_{2nb+nF+3} \\ \mathbf{C}\mathbf{c}\_{2nb+nF+4} \\ \vdots \\ \mathbf{C}\mathbf{c}\_{2nb+nF+(nq-1)} \\ \mathbf{C}\mathbf{c}\_{2nb+nF+nq} \\ \vdots \\ \mathbf{C}\mathbf{c}\_{2nb+nF+2(nq-1)} \end{bmatrix} = \begin{bmatrix} \mathbf{V}\_{sn} \\ \theta\_{sn} \\ \mathbf{V}\_{g1} \\ \vdots \\ \mathbf{V}\_{gk}^{pcc} \\ \mathbf{V}\_{g1} \\ \vdots \\ \mathbf{P}\_{g1}^{pcc} \\ \mathbf{P}\_{g1}^{pcc} \end{bmatrix} - \begin{bmatrix} \mathbf{V}\_{sn}^{pcc} \\ \theta\_{sn}^{pcc} \\ \mathbf{V}\_{g1}^{pcc} \\ \vdots \\ \mathbf{V}\_{gk}^{pcc} \\ \mathbf{P}\_{g1}^{pcc} \\ \vdots \\ \mathbf{P}\_{g1}^{pcc} \end{bmatrix} \tag{25}$$

The syntax to include the constraints given by (19), which allows to obtain the solution of the Power Flow problem is the following:


It should be noted that in the conventional PF model given by (20)–(24), the PQ nodes are considered in the same manner as in the OPF model; whereby it is not necessary to include equality constraints to set any variables in such nodes.

## **6. Solution of the OPF market clearing**

The OPF market-clearing model to be solved for the Operator System Market is a non-linear constrained optimization problem, whose general formulation is given as follows [25]:

$$\text{Maximize } f(p) \tag{26}$$

$$\text{Subject to } \mathbf{g}(\mathbf{y}, \mathbf{p}) = \mathbf{0} \tag{27}$$

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices… DOI: http://dx.doi.org/10.5772/intechopen.93519*

$$h\_{\min} \le h(\mathcal{y}, p) \tag{28}$$

$$h(y, p) \le h\_{\text{max}} \tag{29}$$

$$p\_{\min} \le p \tag{30}$$

$$p \le p\_{\text{max}} \tag{31}$$

where the dependent variables, such as the nodal voltage, are represented by *y*. Whilst the control variables, for example, the supply bids *PS* and power demand *PD*, are denoted by *p*. The functions *f*, *g* and *h* are defined below.

#### **6.1 Objective function**

*Subject to h y*ð Þ¼ 0 (21)

where the *hOPF-PF* is the set of equality constraints given by (19). This allows the inclusion of the node types in order to convert the OPF model into a conventional

Therefore in accordance to the conventional PF model given by (20)–(24), the proposed flexible approach solution to the Power Flow problem can be obtained by considering the full of the power flow model given by (6), (7), (9), (12), and (19). It is important to note that by including the above equality constraints, the resulting OPF implementation is modified and reused to straightforwardly obtain the computational implementation of the Power Flow analysis that considers embedded FACTS controllers. In this case, it must be considered the extended optimization

In order to maintain the structure of the proposed implementation, the last set of

*Vsn θsn Vg*<sup>1</sup> ⋮ *Vgk Pg*<sup>1</sup> ⋮ *Pgi*

*Vspec sn θspec sn Vspec g*1 ⋮ *Vspec gk Pspec g*1 ⋮ *Pspec gi*

Maximize *f p*ð Þ (26) Subject to *g y*ð Þ¼ , *p* 0 (27)

(25)

�

model with FACTS devices given by (6), (9), (12), (16), (17) and (19).

*Ce*2*nb*þ*nF*þ<sup>2</sup> *Ce*2*nb*þ*nF*þ<sup>3</sup> *Ce*2*nb*þ*nF*þ<sup>4</sup> ⋮ *Ce*2*nb*þ*nF*þð Þ *ng*�<sup>1</sup> *Ce*2*nb*þ*nF*þ*ng* ⋮ *Ce*2*nb*þ*nF*þ2ð Þ *ng*�<sup>1</sup>

solution of the Power Flow problem is the following:

**6. Solution of the OPF market clearing**

as follows [25]:

**364**

*Renewable Energy - Technologies and Applications*

equality constraints is written in the vector *Ce* of the M-function file named

¼

The syntax to include the constraints given by (19), which allows to obtain the

Ce(2\*nb+nF+2:2\*nb+nF+2,1)=Vsn-Vsn\_spec; %Slack node. Ce(2\*nb+nF+3:2\*nb+nF+3,1)=Angle\_sn-Angle\_sn\_spec; %Slack node. Ce(2\*nb+nF+4:2\*nb+nF+ng-1,1)=Vgk-Vgk\_spec; %PV node. Ce(2\*nb+nF+ng:2\*nb+nF+2\*ng-2,1)=Pgi-Pgi\_spec; %PV node.

It should be noted that in the conventional PF model given by (20)–(24), the PQ nodes are considered in the same manner as in the OPF model; whereby it is not necessary to include equality constraints to set any variables in such nodes.

The OPF market-clearing model to be solved for the Operator System Market is a non-linear constrained optimization problem, whose general formulation is given

PF model.

**Constraints\_OPF** as follows:

gð Þ*y* ≤ 0 (22) *y*min ≤ *y*≤*y*max (23) *hOPF*�*PF*ð Þ¼ *y* 0 (24)

> The objective function of the OPF market-clearing model represents the social welfare associated with the power system. That function is given by the difference between: the sum of the accepted demand bids *PDi* times their corresponding bid prices *CDi* (in \$/MWhr) and the sum of the accepted production bids *PSj* times their corresponding bids prices *CSj* (in \$/MWhr). Mathematically, this objective function is given by

$$f = \sum\_{i=1}^{nl} \mathcal{C}\_{Di}(P\_{Di}) - \sum\_{j=1}^{ng} \mathcal{C}\_{\mathbb{S}^j\_{\mathbb{S}}}(P\_{\mathbb{S}^j\_{\mathbb{S}}}) \tag{32}$$

In (32), the first and second term is also identified as *fD* and *fS*, respectively; *nl* represents the total demand bids, and *ng* is the total production bids.

#### **6.2 Equality constraints**

The set of equality constraints (33) represents the standard power flow equations

$$\mathbf{g}(\mathbf{y}, \mathbf{p}) = \mathbf{g}(\theta, \mathbf{V}, \mathbf{k}\_{\rm G}, P\_{\rm S}, P\_{\rm D}) = \mathbf{0} \tag{33}$$

where the set *y =* (*θ*, *V*, *kG*) and *p =* (*PS*, *PD*). The variables *θ* and *V* are the complex-voltage phases and magnitudes at nodes of the power system, respectively. Whilst *kG* is a scalar variable used to account for the system losses by means of either a unique or a distributed slack node. It is important to note that *y* represents the set of dependent variables to be optimized. The generator and load powers are defined as follows:

$$P\_G = P\_{G0} + P\_S \tag{34}$$

$$P\_L = P\_{L0} + P\_D \tag{35}$$

where *PG0* and *PL0* stand for the generator and load parameters that are not part of the market trading, that is, these parameters represent the negotiation of energy between particulars in a specific big industry and/or Generation Companies (GENCOS). Whilst PS and PD are the amounts of energy that can be traded in the electricity market by GENCOS and Energy Services Company (ESCOS). Finally, the reactive loads are assumed to have constant power factors which are computed by using the following expression:

$$Q\_L = P\_L \tan\left(\phi\_L\right) \tag{36}$$

## **6.3 Inequality constraints**

In this formulation, the set of inequality constraints is practically the same as in the OPF model, except by the addition of a new constraint on the state variables, which represents the limits on the demand bids (*PDi*).

$$P\_{Di}^{\min} \le P\_{Di} \le P\_{Di}^{\max} \tag{37}$$

PLoad=X(2\*nb+ng+1:2\*nb+ng+nl,1);

*DOI: http://dx.doi.org/10.5772/intechopen.93519*

fd=fd+di(k,1)+ei(k,1)\*PLoad(k,1)+fi(k,1)\*PLoad(k,1)^2; %CDi(PDi)

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices…*

fs=fs+ai(k,1)+bi(k,1)\*Pgi(k,1)+ci(k,1)\*Pgi(k,1)^2; %CSj(PSGj)

Two numerical examples are tested (with the six-node power system and, an equivalent model of the Mexican Interconnected Power System - MIS.), to numerically illustrate the effectiveness and easy implementation of the proposed flexible approach to carry out the analysis of the OPF market-clearing, as well as the OPF and the conventional PF procedures. The numerical examples presented in this section were carried out in Matlab-R2018a, using a personal computer with a processor Intel Core i5-3210M CPU running at 2.50 GHz with a 6 GB of RAM.

In that way, the solution for the standard OPF market-clearing is obtained, in addition to solve both the OPF and the PF models. For both power systems, the numerical examples are designed as follows. First, the solution of standard OPF market-clearing model is obtained. Next from that solution, the value of the sum of the inelastic and the elastic loads is assigned to the corresponding load nodes in order to solve the OPF model. In other words, the Optimal Power Flow analysis is carried out by considering the value of the load obtained by OPF market-clearing study as an active load. Finally, the conventional PF analysis is executed by setting both the magnitude of the voltage and the active power generated at the PV nodes, to their corresponding values found by the OPF analysis. Similarly, within this last algorithm step, the voltage phases and magnitudes in the slack node are set to their corresponding values found by the OPF analysis. Here, it is worth mentioning that the value of the active load obtained in the market-clearing analysis is considered as a load. Also observe that the objective functions are the same in the three models

The test case of the six node power system reported in [25] is reproduced in this section in order to take the corresponding results as a reference to determine the solution of the OPF and conventional PF models. The test power system consists of three GENCOS and ESCOS, respectively, which are interconnected through 11 transmission lines, as shown in **Figure 3**. The complete simulation data set for this system is given in [23, 25]. For the test cases belonging to this test power system, the

. The steady-state solutions achieved by the proposal to: the standard OPF market-clearing, the OPF and the PF models are presented in **Table 1**. Here, it is worth mentioning that such solutions correspond to the case of not using FACTS

As expected, **Table 1** shows that the solution of the three procedures is practically the same. This is because the numerical examples were designed to obtain

f=0; fd=0; for k=1:PDi

end fs=0; for k=1:ng

end f=fs-fd;

**7. Numerical examples**

mentioned above.

devices.

**367**

**7.1 Testing the six nodes power system**

convergence tolerance is set to 1 <sup>10</sup><sup>9</sup>

where *PDi min* and *PDimax* are the lower and upper limits of the state variable that represents the demand bids.

The demand bids *PDi* is a steady-state variable in the OPF market-clearing model; thereby, in order to solve this model by using the proposed flexible approach is necessary to include *PDi* in the vector of steady-state variables *X*. It is convenient to write the variable *PDi* in the next component of vector *X*, just after the vector-entries that represent the state variables of the FACTS devices. This corresponds to the position (2nb + ng + nvar+nl,1) of the vector *X*. This is done in this way in order to maintain the original structure of the proposed approach. The limits of the demand bids are handled as inequality constraints on the state variables. Therefore, the lower and upper bounds of the state variable *PDi*, are written in the position (2nb + ng + nvar+nl, 1) of the vector **lb** and **up**, respectively.

The objective function given by (32) is coded into the M-function file: **objfun\_OPF**. It is worth mentioning that (32) is used instead of (6). Also it is very important to point out that in order to maximize the objective function, it is necessary to write such function in a negative form. This is because the **fmincon** function achieves a minimization by default. Note that *PL* and *QL* equations are coded in the M-function files: P\_Load and Q\_Load, respectively. These files are called by M-function file **Constraints\_OPF**, as it is shown in **Figure 2**. In this way, they are considered within the set of equality constraints that establishes the active and reactive power balance under steady-state conditions for all the nodes of the power system.

According to the aforementioned discussion, a simple command line is presented below, which allows for modifying the conventional OPF model in order to obtain the implementation of the OPF-MC model.

%%%%%%%%%% Vector of the state variables of the OPF-MC model %%% %%%%%

```
X(2*nb+ng+1:2*nb+ng+nl,1)=Pload; %Demand bids
%%%%%%%%%% Definition of tan(phi), MVAb=100 MVA %%%%%%%%%%
Pmax=Pmax/MVAb; % Pmax in pu
Qmax=Qmax/MVAb; % Qmax in pu
tan_phi=Qmax./Pmax; % Tan(phi)
%%%%%%%%%% Obtaining QL = PL*tan(phi) (Eq. 36) %%%%%%%%%%
function [QL]=Qload(__)
PLoad=X(2*nb+ng+1:2*nb+ng+nl,1);
QL=zeros(nb,1);
for k=1:nl % nl: total demand bids
  send=node(k,1); %Node where is connected the load
QL(send,1)=QL(send,1)+PLoad(k,1)*tan_phi(k,1);
end
```
%%%%%%%%%% Objetive function of the OPF Market-Clearing %%%%%% %%%%.

```
function f = objfun_OPF(___)
```
*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices… DOI: http://dx.doi.org/10.5772/intechopen.93519*

```
PLoad=X(2*nb+ng+1:2*nb+ng+nl,1);
f=0;
fd=0;
for k=1:PDi
 fd=fd+di(k,1)+ei(k,1)*PLoad(k,1)+fi(k,1)*PLoad(k,1)^2; %CDi(PDi)
 end
fs=0;
for k=1:ng
  fs=fs+ai(k,1)+bi(k,1)*Pgi(k,1)+ci(k,1)*Pgi(k,1)^2; %CSj(PSGj)
end
 f=fs-fd;
```
## **7. Numerical examples**

**6.3 Inequality constraints**

represents the demand bids.

where *PDi*

power system.

%%%%%

end

%%%%.

**366**

which represents the limits on the demand bids (*PDi*).

*Renewable Energy - Technologies and Applications*

*P*min

the position (2nb + ng + nvar+nl, 1) of the vector **lb** and **up**, respectively. The objective function given by (32) is coded into the M-function file: **objfun\_OPF**. It is worth mentioning that (32) is used instead of (6). Also it is very important to point out that in order to maximize the objective function, it is necessary to write such function in a negative form. This is because the **fmincon** function achieves a minimization by default. Note that *PL* and *QL* equations are coded in the M-function files: P\_Load and Q\_Load, respectively. These files are called by M-function file **Constraints\_OPF**, as it is shown in **Figure 2**. In this way, they are considered within the set of equality constraints that establishes the active and reactive power balance under steady-state conditions for all the nodes of the

According to the aforementioned discussion, a simple command line is presented below, which allows for modifying the conventional OPF model in order

%%%%%%%%%% Vector of the state variables of the OPF-MC model %%%

%%%%%%%%%% Definition of tan(phi), MVAb=100 MVA %%%%%%%%%%

%%%%%%%%%% Obtaining QL = PL\*tan(phi) (Eq. 36) %%%%%%%%%%

%%%%%%%%%% Objetive function of the OPF Market-Clearing %%%%%%

for k=1:nl % nl: total demand bids send=node(k,1); %Node where is connected the load

QL(send,1)=QL(send,1)+PLoad(k,1)\*tan\_phi(k,1);

to obtain the implementation of the OPF-MC model.

Qmax=Qmax/MVAb; % Qmax in pu tan\_phi=Qmax./Pmax; % Tan(phi)

PLoad=X(2\*nb+ng+1:2\*nb+ng+nl,1);

function [QL]=Qload(\_\_)

function f = objfun\_OPF(\_\_\_)

QL=zeros(nb,1);

X(2\*nb+ng+1:2\*nb+ng+nl,1)=Pload; %Demand bids

Pmax=Pmax/MVAb; % Pmax in pu

In this formulation, the set of inequality constraints is practically the same as in the OPF model, except by the addition of a new constraint on the state variables,

*Di* ≤*PDi* ≤*P*max

The demand bids *PDi* is a steady-state variable in the OPF market-clearing model; thereby, in order to solve this model by using the proposed flexible approach is necessary to include *PDi* in the vector of steady-state variables *X*. It is convenient to write the variable *PDi* in the next component of vector *X*, just after the vector-entries that represent the state variables of the FACTS devices. This corresponds to the position (2nb + ng + nvar+nl,1) of the vector *X*. This is done in this way in order to maintain the original structure of the proposed approach. The limits of the demand bids are handled as inequality constraints on the state variables. Therefore, the lower and upper bounds of the state variable *PDi*, are written in

*min* and *PDimax* are the lower and upper limits of the state variable that

*Di* (37)

Two numerical examples are tested (with the six-node power system and, an equivalent model of the Mexican Interconnected Power System - MIS.), to numerically illustrate the effectiveness and easy implementation of the proposed flexible approach to carry out the analysis of the OPF market-clearing, as well as the OPF and the conventional PF procedures. The numerical examples presented in this section were carried out in Matlab-R2018a, using a personal computer with a processor Intel Core i5-3210M CPU running at 2.50 GHz with a 6 GB of RAM.

In that way, the solution for the standard OPF market-clearing is obtained, in addition to solve both the OPF and the PF models. For both power systems, the numerical examples are designed as follows. First, the solution of standard OPF market-clearing model is obtained. Next from that solution, the value of the sum of the inelastic and the elastic loads is assigned to the corresponding load nodes in order to solve the OPF model. In other words, the Optimal Power Flow analysis is carried out by considering the value of the load obtained by OPF market-clearing study as an active load. Finally, the conventional PF analysis is executed by setting both the magnitude of the voltage and the active power generated at the PV nodes, to their corresponding values found by the OPF analysis. Similarly, within this last algorithm step, the voltage phases and magnitudes in the slack node are set to their corresponding values found by the OPF analysis. Here, it is worth mentioning that the value of the active load obtained in the market-clearing analysis is considered as a load. Also observe that the objective functions are the same in the three models mentioned above.

#### **7.1 Testing the six nodes power system**

The test case of the six node power system reported in [25] is reproduced in this section in order to take the corresponding results as a reference to determine the solution of the OPF and conventional PF models. The test power system consists of three GENCOS and ESCOS, respectively, which are interconnected through 11 transmission lines, as shown in **Figure 3**. The complete simulation data set for this system is given in [23, 25]. For the test cases belonging to this test power system, the convergence tolerance is set to 1 <sup>10</sup><sup>9</sup> .

The steady-state solutions achieved by the proposal to: the standard OPF market-clearing, the OPF and the PF models are presented in **Table 1**. Here, it is worth mentioning that such solutions correspond to the case of not using FACTS devices.

As expected, **Table 1** shows that the solution of the three procedures is practically the same. This is because the numerical examples were designed to obtain

examples, the state variables representing the thyristor's firing angle of the TCSC and the SVC devices. These angles are both initialized at 155° with a lower and an upper limit of 90 and 180°, respectively. The fixed values of the capacitive and inductive reactances of the controllers are *XC* = 0.9375% and *XL* = 0.1625%, respectively. These values are referred to a voltage base of 400 kV and a power base of 100 MVA. **Table 2** shows the corresponding steady-state solutions given by the three analyses for the case of a steady state operation using embedded FACTS devices. Clearly, the value of the objective function is increased, due to the TCSC sets the active power flow through a transmission line at higher value than in the base case. This control action causes a redistribution of power flow in the system, increasing the active power losses and the accepted demand bids. Regarding the control performed by the SVC, there is a decrease in the generation of reactive power as it is shown in **Table 2**. This is due to the reactive power losses are keep to a minimum limit in the power system by the SVC controller. This controller supplies reactive power in order to control the magnitude of the voltage at the substations. Therefore, such controller serves as a source of reactive power into the power grid. Although the integration of these FACTS devices into the power system increases the power generation cost and decreases the value of the social welfare net, it is very important to install them in the power system. This is because such devices can improve the steady-state operation of the power system, which by the way can be evaluated

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices…*

When the FACTS devices are embedded in the power system, the CPU time required for obtaining the solution of the OPF market-clearing model is 2.3 s. Whilst for the OPF and the PF models, the steady-state solution is determined in 2.2 and

**Parameter Steady-state solution with FACTS devices**

V1 (pu-deg) 1.070∟0.0° 1.071∟0.0° 1.071∟0.0° V2 (pu-deg) 1.065∟-0.6° 1.065∟-0.6° 1.065∟-0.6° V3 (pu-deg) 1.065∟-1.9° 1.064∟-1.9° 1.064∟-1.9° V4 (pu-deg) 0.997∟-4.1° 0.997∟-4.1° 0.997∟-4.1° V5 (pu-deg) 1.020∟-5.7° 1.020∟-5.7° 1.020∟-5.7° V6 (pu-deg) 1.019∟-5.0° 1.019∟-5.0° 1.019∟-5.0° V6a (pu-deg) 0.996∟-4.0° 0.996∟-4.0° 0.996∟-4.0° Pg1 (MW) 90.0<sup>a</sup> 0.0a 90 90 Pg2 (MW) 140.0<sup>a</sup> 25.0<sup>a</sup> 165 165 Pg3 (MW) 60.0<sup>a</sup> 20.0<sup>a</sup> 80 80 Qgtotal (MVar) 128.85 128.82 128.82 Objective f (\$/MWhr) *fD fS fS fS*

*Data of left column correspond to* PG0 *and data of right column are* PBID*, both in MW.*

*Steady-state solutions of the OPF market-clearing, the OPF and the PF procedures with embedded FACTS*

**OPF market-clearing Optimal power flow Power flow**

3,491.0 2,885.0 2,885.0 2,885.0

using the proposal presented here.

*DOI: http://dx.doi.org/10.5772/intechopen.93519*

1.6 s, respectively.

*a*

**Table 2.**

*devices.*

**369**

#### **Figure 3.**

*Six nodes power system.*


## **Table 1.**

*Steady-state solutions of: the OPF market-clearing, the OPF and the PF procedures without FACTS devices.*

those results. The active and reactive loads computed by the OPF market-clearing procedure for ESCO 1, 2 and 3 are: 115 MW-60 MVar, 110 MW-70 MVar and 99.767 MW-54.418 MVar, respectively. The CPU time for the case of the OPF market-clearing model is 2.3 s. Whilst for the case of the OPF and the PF models, such a time measure yields 2.1 and 1.5 s, respectively. Subsequently, the six nodes power system is modified to simultaneously include the TCSC and SVC controllers. The TCSC is commissioned to maintain the active power flow within the range of 5.62–7.0 MW across the transmission line connecting nodes 4 and 5. The first terminal of the TCSC controller is connected to node 4, whilst the second terminal is connected to a new substation called 6a. Note that the SVC is placed at node 5 to keep the magnitude of the voltage of this node at 1.02 pu. For the numerical

### *Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices… DOI: http://dx.doi.org/10.5772/intechopen.93519*

examples, the state variables representing the thyristor's firing angle of the TCSC and the SVC devices. These angles are both initialized at 155° with a lower and an upper limit of 90 and 180°, respectively. The fixed values of the capacitive and inductive reactances of the controllers are *XC* = 0.9375% and *XL* = 0.1625%, respectively. These values are referred to a voltage base of 400 kV and a power base of 100 MVA. **Table 2** shows the corresponding steady-state solutions given by the three analyses for the case of a steady state operation using embedded FACTS devices.

Clearly, the value of the objective function is increased, due to the TCSC sets the active power flow through a transmission line at higher value than in the base case. This control action causes a redistribution of power flow in the system, increasing the active power losses and the accepted demand bids. Regarding the control performed by the SVC, there is a decrease in the generation of reactive power as it is shown in **Table 2**. This is due to the reactive power losses are keep to a minimum limit in the power system by the SVC controller. This controller supplies reactive power in order to control the magnitude of the voltage at the substations. Therefore, such controller serves as a source of reactive power into the power grid. Although the integration of these FACTS devices into the power system increases the power generation cost and decreases the value of the social welfare net, it is very important to install them in the power system. This is because such devices can improve the steady-state operation of the power system, which by the way can be evaluated using the proposal presented here.

When the FACTS devices are embedded in the power system, the CPU time required for obtaining the solution of the OPF market-clearing model is 2.3 s. Whilst for the OPF and the PF models, the steady-state solution is determined in 2.2 and 1.6 s, respectively.


#### **Table 2.**

those results. The active and reactive loads computed by the OPF market-clearing procedure for ESCO 1, 2 and 3 are: 115 MW-60 MVar, 110 MW-70 MVar and 99.767 MW-54.418 MVar, respectively. The CPU time for the case of the OPF market-clearing model is 2.3 s. Whilst for the case of the OPF and the PF models, such a time measure yields 2.1 and 1.5 s, respectively. Subsequently, the six nodes power system is modified to simultaneously include the TCSC and SVC controllers. The TCSC is commissioned to maintain the active power flow within the range of 5.62–7.0 MW across the transmission line connecting nodes 4 and 5. The first terminal of the TCSC controller is connected to node 4, whilst the second terminal is connected to a new substation called 6a. Note that the SVC is placed at node 5 to keep the magnitude of the voltage of this node at 1.02 pu. For the numerical

*Steady-state solutions of: the OPF market-clearing, the OPF and the PF procedures without FACTS devices.*

*Data of left column correspond to* PG0 *and data of right column are* PBID*, both in MW.*

**Parameter Steady-state solution without FACTS**

V1 (pu-deg) 1.100∟0.0° 1.100∟0.0° 1.100∟0.0° V2 (pu-deg) 1.100∟-0.7° 1.100∟-0.7° 1.100∟-0.7° V3 (pu-deg) 1.100∟-2.0° 1.100∟-2.0° 1.100∟-2.0° V4 (pu-deg) 1.028∟-3.8° 1.028∟-3.8° 1.028∟-3.8° V5 (pu-deg) 1.017∟-5.0° 1.017∟-5.0° 1.017∟-5.0° V6 (pu-deg) 1.049∟-4.9° 1.049∟-4.9° 1.049∟-4.9° Pg1 (MW) 90.0<sup>a</sup> 0.0<sup>a</sup> 90.0 90.0 Pg2 (MW) 140.0<sup>a</sup> 25.0<sup>a</sup> 165.0 165.0 Pg3 (MW) 60.0a 20.0<sup>a</sup> 80.0 80.0 Qgtotal (MVar) 188.58 188.58 188.58 Objective *f* (\$/MWhr) *fD fS fS fS*

**OPF market-clearing Optimal power flow Power flow**

3482.8 2885.0 2885.0 2885.0

**Figure 3.**

*a*

**368**

**Table 1.**

*Six nodes power system.*

*Renewable Energy - Technologies and Applications*

*Steady-state solutions of the OPF market-clearing, the OPF and the PF procedures with embedded FACTS devices.*

## **7.2 The Mexican interconnected power system (MIS)**

The system considered in this numerical example is a reduced model of the Mexican Interconnected System. The MIS is represented by an equivalent model composed of: 190 nodes, 46 generators, 90 loads, and 265 transmission lines operating at voltage levels ranging from 115 to 400 kV [27].

The limits for the magnitude of the voltage for all nodes are set to 0.94 ≤ *Vi* ≤ 1.07 pu. Whilst the active and reactive power limits for all generators are set to: 200 ≤ *Pgi* ≤ 1000 MW and 250 ≤ *Qgi* ≤ 350 MVar, respectively. The cost functions of all generators are considered linear with a value of the linear coefficient between 0.0019 and 0.0020 \$/MWhr. The MIS consists of two areas identified as Area A and Area B, interconnected through a relatively weak double-circuit tie line, as it is shown in **Figure 4**. For the numerical examples with the Mexican Interconnected System, the convergence tolerance is set to 1 <sup>10</sup><sup>6</sup> .

The solution of the OPF market-clearing model for the base case, without FACTS controllers, gives: an accepted demand bid (*fD*) of 197,788.409 \$/MWhr; an accepted production bid (*fS*) of 35,584.143 \$/MWhr; the total active losses are 164.817 MW and a transferred active power from Area B to Area A of 195.34 MW. Whilst the solution of the Optimal Power Flow and the conventional Power Flow without FACTS devices gives: a generation cost of 35,632.303 \$/MWhr; the total active losses are 194.26 MW and a transferred active power between the two referred areas of 208.66 MW. First, the MIS is modified to integrate a PtP VSC-HVDC system. The first voltage source of PtP VSC-HVDC is connected to node 182, whilst the second voltage source is connected to a new substation called 182a. The PtP VSC-HVDC system is commissioned to increase the active power flow through the inter-area link to 300 MW and to set the magnitude of the voltages at nodes 182 and 182a at 1 pu. The controller coupling transformer impedances are set at 0.001 + j0.01 pu. The lower and upper limits of the magnitude of both voltage sources are 0.95 ≤ *VC1* ≤ 1.1 pu. The amplitude modulation index bounds and their initial conditions are: 0.5 ≤ *MCi* ≤ 1.0 and 0.9, respectively. The magnitude of DCvoltage bounds corresponding to both converters are: 2.0 ≤ *VDC* ≤ 4.5, where the

DC voltage is fixed at 3.0 pu. Whilst the DC link resistance is set to 0.0034 pu. The summary results of the OPF market-clearing, the Optimal Power Flow and, the conventional Power Flow, all of them including the PtP VSC-HVDC system

**Study Pgtotal (MW) Qgtotal (MVar) Plosses (MW) Objective** *f* **(\$/MWhr)** Market VSC-HVDC 9200.00<sup>a</sup> 1620.46 147.63 35,555.72<sup>b</sup>

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices…*

OPF VSC-HVDC 18,580.60 2400.29 222.59 35,681.16 PF VSC-HVDC 18,580.59 2400.05 222.60 35,681.13 Market PST 9200.00<sup>a</sup> 1441.07 141.72 35,544.95<sup>b</sup>

OPF PST 18,599.21 2411.97 241.21 35,707.37 PF PST 18,599.19 2411.56 241.21 35,707.33

9305.64<sup>a</sup> 197,788.41<sup>b</sup>

9299.72a 197,788.41<sup>b</sup>

Observe that instead of the VSC-HVDC, the Phase-Shifting Transformer (PST) is used to maintain the active power flow through the inter-area link at the same level in MW as in the above case. Also note that the primary and secondary winding impedances of the PST exhibit zero resistance. Then the primary and secondary inductive reactances are set to 0.0 and 0.05 pu, respectively. Next, the complex tap ratios are *Tv* = *Uv* = 1.0∠0°. Note that the control of the active power flow is carried out by means of a primary phase angle control. For implementing such control, the limits of the phase-shifter angle are set to 10°. Last but not least, the summary results of the three steady-state cases previously considered in this book chapter are

The above table shows that when the FACTS controllers are integrated into the power system, the value of the objective function increases in the case of the OPF and the PF studies, but it decreases in the OPF market-clearing case. This is caused by the variations of the active power losses in the transmission elements, which in turn are due to the control of the active power flow performed by the VSC-HVDC and PST devices through the inter-area link. In the cases of the market-clearing studies using: (i) the PST and (ii) the VSC-HVDC; 20 and, 22 generators hit their limits of *Pg*, respectively. Whereas for the OPF and the PF studies using: (i) the PST and (ii) the VSC-HVDC; 13 and, 10 generators hit their limits of *Pg*, respectively. Regarding the magnitudes of the nodal-voltages, 17 of them at powersubstations hit their limits when the analysis of the market-clearing is performed using the PST and VSC-HVDC. Whereas in the OPF and the PF analysis featuring both FACTS devices, a total of four magnitudes of the substation-voltages hit their limits. It should be mentioned that the variables that violated their limits were either fixed at their upper or lower limits in a proper manner by the flexible approach proposed here. The CPU times required to obtain the solution of the market VSC-HVDC, the market PST, the OPF VSC-HVDC, the OPF PST, the PF VSC-HVDC and the PF PST are: 1503, 978, 66, 64, 34 and 33 s, respectively. From the results of the numerical examples presented in this section, it can be inferred that the proposed implementation reliably carries out the steady-state operation

embedded within the MIS system, are presented in **Table 3**.

*In both market studies, 9200 MW is* PG0 *and the value of MW in the lower row is* PBID*. <sup>b</sup>*

*Summary results of the steady-state studies with the VSC-HVDC and PST devices.*

*The value of the upper row corresponds to* fS *and the lower row is* fD*.*

*DOI: http://dx.doi.org/10.5772/intechopen.93519*

*a*

**371**

**Table 3.**

shown in **Table 3**, where a PST controller has been included.

assessment of power systems using embedded FACTS devices.

**Figure 4.** *Representative diagram of the Mexican interconnected system.*

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices… DOI: http://dx.doi.org/10.5772/intechopen.93519*


*In both market studies, 9200 MW is* PG0 *and the value of MW in the lower row is* PBID*. <sup>b</sup> The value of the upper row corresponds to* fS *and the lower row is* fD*.*

#### **Table 3.**

**7.2 The Mexican interconnected power system (MIS)**

*Renewable Energy - Technologies and Applications*

ating at voltage levels ranging from 115 to 400 kV [27].

System, the convergence tolerance is set to 1 <sup>10</sup><sup>6</sup>

**Figure 4.**

**370**

*Representative diagram of the Mexican interconnected system.*

The system considered in this numerical example is a reduced model of the Mexican Interconnected System. The MIS is represented by an equivalent model composed of: 190 nodes, 46 generators, 90 loads, and 265 transmission lines oper-

pu. Whilst the active and reactive power limits for all generators are set to:

The limits for the magnitude of the voltage for all nodes are set to 0.94 ≤ *Vi* ≤ 1.07

.

200 ≤ *Pgi* ≤ 1000 MW and 250 ≤ *Qgi* ≤ 350 MVar, respectively. The cost functions of all generators are considered linear with a value of the linear coefficient between 0.0019 and 0.0020 \$/MWhr. The MIS consists of two areas identified as Area A and Area B, interconnected through a relatively weak double-circuit tie line, as it is shown in **Figure 4**. For the numerical examples with the Mexican Interconnected

The solution of the OPF market-clearing model for the base case, without FACTS controllers, gives: an accepted demand bid (*fD*) of 197,788.409 \$/MWhr; an accepted production bid (*fS*) of 35,584.143 \$/MWhr; the total active losses are 164.817 MW and a transferred active power from Area B to Area A of 195.34 MW. Whilst the solution of the Optimal Power Flow and the conventional Power Flow without FACTS devices gives: a generation cost of 35,632.303 \$/MWhr; the total active losses are 194.26 MW and a transferred active power between the two referred areas of 208.66 MW. First, the MIS is modified to integrate a PtP VSC-HVDC system. The first voltage source of PtP VSC-HVDC is connected to node 182, whilst the second voltage source is connected to a new substation called 182a. The PtP VSC-HVDC system is commissioned to increase the active power flow through the inter-area link to 300 MW and to set the magnitude of the voltages at nodes 182

and 182a at 1 pu. The controller coupling transformer impedances are set at 0.001 + j0.01 pu. The lower and upper limits of the magnitude of both voltage sources are 0.95 ≤ *VC1* ≤ 1.1 pu. The amplitude modulation index bounds and their initial conditions are: 0.5 ≤ *MCi* ≤ 1.0 and 0.9, respectively. The magnitude of DCvoltage bounds corresponding to both converters are: 2.0 ≤ *VDC* ≤ 4.5, where the

*Summary results of the steady-state studies with the VSC-HVDC and PST devices.*

DC voltage is fixed at 3.0 pu. Whilst the DC link resistance is set to 0.0034 pu. The summary results of the OPF market-clearing, the Optimal Power Flow and, the conventional Power Flow, all of them including the PtP VSC-HVDC system embedded within the MIS system, are presented in **Table 3**.

Observe that instead of the VSC-HVDC, the Phase-Shifting Transformer (PST) is used to maintain the active power flow through the inter-area link at the same level in MW as in the above case. Also note that the primary and secondary winding impedances of the PST exhibit zero resistance. Then the primary and secondary inductive reactances are set to 0.0 and 0.05 pu, respectively. Next, the complex tap ratios are *Tv* = *Uv* = 1.0∠0°. Note that the control of the active power flow is carried out by means of a primary phase angle control. For implementing such control, the limits of the phase-shifter angle are set to 10°. Last but not least, the summary results of the three steady-state cases previously considered in this book chapter are shown in **Table 3**, where a PST controller has been included.

The above table shows that when the FACTS controllers are integrated into the power system, the value of the objective function increases in the case of the OPF and the PF studies, but it decreases in the OPF market-clearing case. This is caused by the variations of the active power losses in the transmission elements, which in turn are due to the control of the active power flow performed by the VSC-HVDC and PST devices through the inter-area link. In the cases of the market-clearing studies using: (i) the PST and (ii) the VSC-HVDC; 20 and, 22 generators hit their limits of *Pg*, respectively. Whereas for the OPF and the PF studies using: (i) the PST and (ii) the VSC-HVDC; 13 and, 10 generators hit their limits of *Pg*, respectively.

Regarding the magnitudes of the nodal-voltages, 17 of them at powersubstations hit their limits when the analysis of the market-clearing is performed using the PST and VSC-HVDC. Whereas in the OPF and the PF analysis featuring both FACTS devices, a total of four magnitudes of the substation-voltages hit their limits. It should be mentioned that the variables that violated their limits were either fixed at their upper or lower limits in a proper manner by the flexible approach proposed here. The CPU times required to obtain the solution of the market VSC-HVDC, the market PST, the OPF VSC-HVDC, the OPF PST, the PF VSC-HVDC and the PF PST are: 1503, 978, 66, 64, 34 and 33 s, respectively. From the results of the numerical examples presented in this section, it can be inferred that the proposed implementation reliably carries out the steady-state operation assessment of power systems using embedded FACTS devices.

## **8. Conclusions**

A Matlab-based flexible approach to carry out the analysis of the steady-state operation of power systems using embedded FACTS controllers has been presented in this book chapter. The flexibility and reliability of this proposal has been demonstrated by means of several numerical examples. The referred numerical examples show that by using the proposed approach, it is possible to simulate the optimal operation of power systems in a simple way, because it avoids the implementation of complex programming algorithms typical of the majority of the optimization models that corresponds to power systems. For example, this is the case for the complexity related to the program code lines related to the hessian matrix as well as the gradient vector.

In this regard, it is also important to mention that the proposed flexible approach is easy to implement as a computer program in order to carry out the analysis of the optimal steady-state operation conditions corresponding to power systems featuring FACTS devices. This is because the proposed flexible approach greatly reduces the complexity as well as the implementation time of such optimization models.

Besides that, the flexibility of the proposed approach provides the possibility to modify and/or consider different objective functions as well as equality and inequality constraints. Therefore, in addition to solving the optimization models considered in this work, the steady-state model of any other FACTS device could also have been used. Not to mention that a large variety of steady-state optimization applications for power systems could also been readily implemented by using the flexible approach proposed here.

Last but not least, the computational efficiency of the proposal is quite reasonable at least for research and academic purposes, since most of the solutions to the optimization models related to medium scale power systems can be usually obtained within a few seconds to about 10–15 minutes. Furthermore, it is possible to infer that this proposed approach may lay a solid basis for researchers, teachers and students who seek to develop their own computational tool, whether it is for research, training or educational purposes.

**Author details**

(UNAM), Mexico

México

**373**

Jose Miguel García-Guzman<sup>1</sup>

Alejandro Pizano-Martinez<sup>4</sup>

Technology, Irapuato, México

Luis Alberto Contreras-Aguilar<sup>3</sup>

, Néstor González-Cabrera<sup>2</sup>

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices…*

*DOI: http://dx.doi.org/10.5772/intechopen.93519*

1 Department of Electromechanical Engineering, Irapuato Superior Institute of

2 Department of Electrical Energy, National Autonomous University of Mexico

3 Department of Electrical Engineering, University of Colima, Colima, México

4 Department of Electrical Engineering, University of Guanajuato, Salamanca,

© 2020 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/ by/3.0), which permits unrestricted use, distribution, and reproduction in any medium,

\*Address all correspondence to: nestorgc@fi-b.unam.mx

provided the original work is properly cited.

, Jose Merced Lozano-García<sup>4</sup> and

\*,

## **Conflict of interest**

The authors declare no conflict of interest.

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices… DOI: http://dx.doi.org/10.5772/intechopen.93519*

## **Author details**

**8. Conclusions**

*Renewable Energy - Technologies and Applications*

the gradient vector.

flexible approach proposed here.

**Conflict of interest**

**372**

research, training or educational purposes.

The authors declare no conflict of interest.

A Matlab-based flexible approach to carry out the analysis of the steady-state operation of power systems using embedded FACTS controllers has been presented in this book chapter. The flexibility and reliability of this proposal has been demonstrated by means of several numerical examples. The referred numerical examples show that by using the proposed approach, it is possible to simulate the optimal operation of power systems in a simple way, because it avoids the implementation of complex programming algorithms typical of the majority of the optimization models that corresponds to power systems. For example, this is the case for the complexity related to the program code lines related to the hessian matrix as well as

In this regard, it is also important to mention that the proposed flexible approach is easy to implement as a computer program in order to carry out the analysis of the optimal steady-state operation conditions corresponding to power systems featuring FACTS devices. This is because the proposed flexible approach greatly reduces the complexity as well as the implementation time of such optimization models. Besides that, the flexibility of the proposed approach provides the possibility to

Last but not least, the computational efficiency of the proposal is quite reasonable at least for research and academic purposes, since most of the solutions to the optimization models related to medium scale power systems can be usually

obtained within a few seconds to about 10–15 minutes. Furthermore, it is possible to infer that this proposed approach may lay a solid basis for researchers, teachers and students who seek to develop their own computational tool, whether it is for

modify and/or consider different objective functions as well as equality and inequality constraints. Therefore, in addition to solving the optimization models considered in this work, the steady-state model of any other FACTS device could also have been used. Not to mention that a large variety of steady-state optimization applications for power systems could also been readily implemented by using the

> Jose Miguel García-Guzman<sup>1</sup> , Néstor González-Cabrera<sup>2</sup> \*, Luis Alberto Contreras-Aguilar<sup>3</sup> , Jose Merced Lozano-García<sup>4</sup> and Alejandro Pizano-Martinez<sup>4</sup>

1 Department of Electromechanical Engineering, Irapuato Superior Institute of Technology, Irapuato, México

2 Department of Electrical Energy, National Autonomous University of Mexico (UNAM), Mexico

3 Department of Electrical Engineering, University of Colima, Colima, México

4 Department of Electrical Engineering, University of Guanajuato, Salamanca, México

\*Address all correspondence to: nestorgc@fi-b.unam.mx

© 2020 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/ by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

## **References**

[1] Wood AJ, Wollenberg BF, Sheble GB. Power Generation, Operation and Control. 3rd ed. New York, NY: John Wiley & Sons, Inc.; 2013. p. 656

[2] Hingorani NG. High power electronics and flexible AC transmission system. IEEE Power Engineering Review. 1988;**3**:4. DOI: 10.1109/ MPER.1988.590799

[3] Hingorani NG, Gyugyi L. Understanding FACTS Concepts and Technology of Flexible AC Transmission Systems. New York, NY: John Wiley & Sons, Inc.; 1999. p. 452

[4] Acha E, Fuerte-Esquivel CR, Ambriz-Perez H, Angeles-Camacho C. FACTS: Modelling and Simulation on Power Networks. New York, NY: John Wiley & Sons, Inc.; 2004. p. 420

[5] Fuerte-Esquivel CR, Acha E. Newton-Raphson algorithm for the reliable solution of large power networks with embedded FACTS devices. IET Proceedings - Generation Transmission and Distribution. 1996; **447**:454. DOI: 10.1049/ip-gtd:19960531

[6] Gotham DJ, Heydt GT. Power flow control and power flow studies for systems with FACTS devices. IEEE Transactions on Power Systems. 1998; **60**:65. DOI: 10.1109/59.651614

[7] Fuerte-Esquivel CR, Acha E, Ambriz-Perez H. A thyristor-controlled series compensator model for the power flow solution of practical power networks. IEEE Transactions on Power Systems. 2000;**58**:64. DOI: 10.1109/59.852101

[8] Zhang XP. Advanced modeling of the multicontrol functional static synchronous series compensator (SSSC) in Newton power flow. IEEE Transactions on Power Systems. 2003; **1410**:1416. DOI: 10.1109/ TPWRS.2003.818690

[9] Zhang XP. Multiterminal voltagesourced converter-based HVDC models for power flow analysis. IEEE Transactions on Power Systems. 2004; **1877**:1884. DOI: 10.1109/TPWRS.2004. 836250

Newton-Raphson OPF algorithm. IEEE Transactions on Power Systems. 2007;

*DOI: http://dx.doi.org/10.5772/intechopen.93519*

Systems. 2014;**2150**:2159. DOI: 10.1109/

[24] Sahraei-Ardakani M, Blumsack SA. Transfer capability improvement through market-based operation of

Transactions on Power Systems. 2016;

[25] Milano F, Cañizares CA, Conejo AJ. Sensitivity-based security-constrained OPF market clearing model. IEEE Transactions on Power Systems. 2005;

TPWRS.2014.2299533

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices…*

series FACTS devices. IEEE

**3702**:3714. DOI: 10.1109/ TPWRS.2015.2508720

**2051**:2060. DOI: 10.1109/ TPWRS.2005.856985

[26] The MathWorks, Inc. Matlab Optimization Toolbox: Users Guide Version 2. January 1999. Available from:

[27] Messina AR, Vittal V. Assessment of

nonlinearly coupled modes using higher order spectra. IEEE Transactions on Power Systems. 2005;**375**:383. DOI: 10.1109/TPWRS.2004.841240

http://www.mathworks.com

nonlinear interaction between

redispatching including FACTS devices. IET Generation Transmission and Distribution. 2008;**821**:833. DOI: 10.1049/iet-gtd:20080064

advanced STATCOM model for optimal power flows using Newton's method. IEEE Transactions on Power Systems.

[19] Sahraei-Ardakani M, Hedman KW. Computationally efficient adjustment of FACTS set points in DC optimal power flow with shift factor structure. IEEE Transactions on Power Systems. 2016;

[20] Lehmkoster C. Security constrained optimal power flow for an economical operation of FACTS-devices in liberalized energy markets. IEEE Transactions on Power Delivery. 2002; **603**:608. DOI: 10.1109/61.997946

[21] Palma-Behnke R, Vargas LS, Perez JR, Nunez JD, Torres RA. OPF with SVC and UPFC modeling for longitudinal systems. IEEE Transactions on Power Systems. 2004;**1742**:1753. DOI: 10.1109/TPWRS.2004.836260

[22] Gengyin L, Zhou M, Gao Y. Determination of total transfer

Malaysia: IEEE; 2005. pp. 1-6

**375**

capability incorporating FACTS devices in power markets. In: International Conference on Power Electronics and Drives Systems, IEEE; 28–31 November.

[23] Nasri A, Conejo AJ, Kazempour SJ, Ghandhari M. Minimizing wind power spillage using an OPF with FACTS devices. IEEE Transactions on Power

**1794**:1803. DOI: 10.1109/ TPWRS.2007.907535

[17] Zarate-Mihano R, Conejo AJ, Milano F. OPF-based security

[18] Kazemtabrizi B, Acha E. An

2014;**514**:525. DOI: 10.1109/ TPWRS.2013.2287914

**1733**:1740. DOI: 10.1109/ TPWRS.2016.2591503

[10] Bhowmick S, Das B, Kumar N. An indirect UPFC model to enhance reusability of Newton power-flow codes. IEEE Transactions on Power Delivery. 2008;**2079**:2088. DOI: 10.1109/TPWRD.2008.923105

[11] Bhowmick S, Das B, Kumar N. An advanced IPFC model to reuse Newton power flow codes. IEEE Transactions on Power Systems. 2009;**525**:532. DOI: 10.1109/TPWRS.2009.2016643

[12] Acha E, Kazemtabrizi B, Castro LM. A new VSC-HVDC model for power flows using the Newton-Raphson method. IEEE Transactions on Power Systems. 2013;**2602**:2612. DOI: 10.1109/ TPWRS.2012.2236109

[13] Ying X, Song YH, Sun YZ. Power flow control approach to power systems with embedded FACTS devices. IEEE Transactions on Power Systems. 2002; **943**:950. DOI: 10.1109/ TPWRS.2002.804919

[14] Orfanogianni T, Bacher R. Steady-state optimization in power systems with series FACTS devices. IEEE Transactions on Power Systems. 2003;**19**:26. DOI: 10.1109/ TPWRS.2002.807110

[15] Berizzi A, Delfanti M, Marannino P, Pasquadibisceglie MS, Silvestri A. Enhanced security-constrained OPF with FACTS devices. IEEE Transactions on Power Systems. 2005;**1597**:1605. DOI: 10.1109/TPWRS.2005.852125

[16] Pizano-Martinez A, Fuerte-Esquivel CR, Ambriz-Perez H, Acha E. Modeling of VSC-based HVDC systems for a

*Analysis of Optimal Steady-State Operation of Power Systems with Embedded FACTS Devices… DOI: http://dx.doi.org/10.5772/intechopen.93519*

Newton-Raphson OPF algorithm. IEEE Transactions on Power Systems. 2007; **1794**:1803. DOI: 10.1109/ TPWRS.2007.907535

**References**

[1] Wood AJ, Wollenberg BF, Sheble GB. Power Generation, Operation and Control. 3rd ed. New York, NY: John Wiley & Sons, Inc.; 2013. p. 656

*Renewable Energy - Technologies and Applications*

[9] Zhang XP. Multiterminal voltagesourced converter-based HVDC models

Transactions on Power Systems. 2004; **1877**:1884. DOI: 10.1109/TPWRS.2004.

[10] Bhowmick S, Das B, Kumar N. An indirect UPFC model to enhance reusability of Newton power-flow codes. IEEE Transactions on Power Delivery. 2008;**2079**:2088. DOI: 10.1109/TPWRD.2008.923105

[11] Bhowmick S, Das B, Kumar N. An advanced IPFC model to reuse Newton power flow codes. IEEE Transactions on Power Systems. 2009;**525**:532. DOI: 10.1109/TPWRS.2009.2016643

[12] Acha E, Kazemtabrizi B, Castro LM. A new VSC-HVDC model for power flows using the Newton-Raphson method. IEEE Transactions on Power Systems. 2013;**2602**:2612. DOI: 10.1109/

[13] Ying X, Song YH, Sun YZ. Power flow control approach to power systems with embedded FACTS devices. IEEE Transactions on Power Systems. 2002;

TPWRS.2012.2236109

**943**:950. DOI: 10.1109/ TPWRS.2002.804919

[14] Orfanogianni T, Bacher R. Steady-state optimization in power systems with series FACTS devices. IEEE Transactions on Power Systems.

2003;**19**:26. DOI: 10.1109/ TPWRS.2002.807110

[15] Berizzi A, Delfanti M, Marannino P, Pasquadibisceglie MS, Silvestri A. Enhanced security-constrained OPF with FACTS devices. IEEE Transactions on Power Systems. 2005;**1597**:1605. DOI: 10.1109/TPWRS.2005.852125

[16] Pizano-Martinez A, Fuerte-Esquivel CR, Ambriz-Perez H, Acha E. Modeling of VSC-based HVDC systems for a

for power flow analysis. IEEE

836250

electronics and flexible AC transmission system. IEEE Power Engineering Review. 1988;**3**:4. DOI: 10.1109/

[2] Hingorani NG. High power

[3] Hingorani NG, Gyugyi L.

Understanding FACTS Concepts and Technology of Flexible AC Transmission Systems. New York, NY: John Wiley &

[4] Acha E, Fuerte-Esquivel CR, Ambriz-Perez H, Angeles-Camacho C. FACTS: Modelling and Simulation on Power Networks. New York, NY: John Wiley & Sons, Inc.; 2004. p. 420

[5] Fuerte-Esquivel CR, Acha E. Newton-Raphson algorithm for the reliable solution of large power networks with embedded FACTS devices. IET Proceedings - Generation Transmission and Distribution. 1996; **447**:454. DOI: 10.1049/ip-gtd:19960531

[6] Gotham DJ, Heydt GT. Power flow control and power flow studies for systems with FACTS devices. IEEE Transactions on Power Systems. 1998;

[7] Fuerte-Esquivel CR, Acha E, Ambriz-Perez H. A thyristor-controlled series compensator model for the power flow solution of practical power networks. IEEE Transactions on Power Systems. 2000;**58**:64. DOI: 10.1109/59.852101

[8] Zhang XP. Advanced modeling of the multicontrol functional static synchronous series compensator (SSSC)

Transactions on Power Systems. 2003;

in Newton power flow. IEEE

**1410**:1416. DOI: 10.1109/ TPWRS.2003.818690

**374**

**60**:65. DOI: 10.1109/59.651614

MPER.1988.590799

Sons, Inc.; 1999. p. 452

[17] Zarate-Mihano R, Conejo AJ, Milano F. OPF-based security redispatching including FACTS devices. IET Generation Transmission and Distribution. 2008;**821**:833. DOI: 10.1049/iet-gtd:20080064

[18] Kazemtabrizi B, Acha E. An advanced STATCOM model for optimal power flows using Newton's method. IEEE Transactions on Power Systems. 2014;**514**:525. DOI: 10.1109/ TPWRS.2013.2287914

[19] Sahraei-Ardakani M, Hedman KW. Computationally efficient adjustment of FACTS set points in DC optimal power flow with shift factor structure. IEEE Transactions on Power Systems. 2016; **1733**:1740. DOI: 10.1109/ TPWRS.2016.2591503

[20] Lehmkoster C. Security constrained optimal power flow for an economical operation of FACTS-devices in liberalized energy markets. IEEE Transactions on Power Delivery. 2002; **603**:608. DOI: 10.1109/61.997946

[21] Palma-Behnke R, Vargas LS, Perez JR, Nunez JD, Torres RA. OPF with SVC and UPFC modeling for longitudinal systems. IEEE Transactions on Power Systems. 2004;**1742**:1753. DOI: 10.1109/TPWRS.2004.836260

[22] Gengyin L, Zhou M, Gao Y. Determination of total transfer capability incorporating FACTS devices in power markets. In: International Conference on Power Electronics and Drives Systems, IEEE; 28–31 November. Malaysia: IEEE; 2005. pp. 1-6

[23] Nasri A, Conejo AJ, Kazempour SJ, Ghandhari M. Minimizing wind power spillage using an OPF with FACTS devices. IEEE Transactions on Power

Systems. 2014;**2150**:2159. DOI: 10.1109/ TPWRS.2014.2299533

[24] Sahraei-Ardakani M, Blumsack SA. Transfer capability improvement through market-based operation of series FACTS devices. IEEE Transactions on Power Systems. 2016; **3702**:3714. DOI: 10.1109/ TPWRS.2015.2508720

[25] Milano F, Cañizares CA, Conejo AJ. Sensitivity-based security-constrained OPF market clearing model. IEEE Transactions on Power Systems. 2005; **2051**:2060. DOI: 10.1109/ TPWRS.2005.856985

[26] The MathWorks, Inc. Matlab Optimization Toolbox: Users Guide Version 2. January 1999. Available from: http://www.mathworks.com

[27] Messina AR, Vittal V. Assessment of nonlinear interaction between nonlinearly coupled modes using higher order spectra. IEEE Transactions on Power Systems. 2005;**375**:383. DOI: 10.1109/TPWRS.2004.841240

**Chapter 22**

Systems

**Abstract**

MATLAB code.

**1. Introduction**

**377**

polluting for the environment.

Distributed Sources Optimal Sites

*Mustafa Mosbah, Redha Djamel Mohammedi and Salem Arif*

The integration of renewable sources into the power system has now become an

unavoidable necessity for these technical and economic advantages and for the protection of the environment. In this chapter, a study is given for the integration of the Distributed Source (DS) in an optimal way and this by looking for the best location (sites) and the best power to be injected (size). The optimization technique used is based on genetic algorithms under technical and safety constraints, with the aim of minimizing active network losses and maximizing voltage stability. These objective functions are handled as a single and multi-objective problem. This study is applied on the standard IEEE 30 bus network under the

**Keywords:** distributed source, optimal site and size, active power losses,

investments and waste lands with long achievement times, which has led researchers to think about other solutions to face these problems [3].

Non-conventional or clean production is increasing rapidly around the world, thanks to it's advantages such as reduced environmental impact, small size and it is a renewable energy [1]. The traditional power system is characterized by the unidirectional of the power flow because the energy comes from centralized sources [2]. These sources are generally based on fossil resources that are exhaustible and

The transmission power system spreads on long distances, which leads to losses in the lines by Joule effect on the one hand, and on the other hand, it requires huge

Among these solutions is to have sources of electrical energy close to the consumers (local production). With the liberalization of the electricity market and the evolution of decentralized source (DS) technology in recent years, an increased trend towards their use has emerged. DS is defined as small producers based on renewable or conventional sources installed at different points in the power system, either at the transmission or distribution level [4]. The rate of DS integration tends

In spite of the various advantages of DS, its sources present disadvantages when they are inserted into the power system, such as frequency instability caused by the

voltage stability improvement, genetic algorithm

to increase progressively in several countries [5].

and Sizes Search in Large Power

## **Chapter 22**
