## 1. Introduction

### 1.1. On the use of harmony search algorithm in optimal placement of FACTS devices to improve power systems

With the increasing electric power demand, power systems can face to stressed conditions, the operation of power system becomes more complex, and power system will become less secure. Moreover, because of restructuring, the problem of power system security has become a matter of concern in deregulated power industry. Better utilization of available power system capacities by Flexible AC Transmission Systems (FACTS) devices has become a major concern in power systems too.

FACTS devices can control power transmission parameters such as series impedance, voltage, and phase angle by their fast control characteristics and continuous compensating capability. They can reduce flow of heavily loaded lines, resulting in low system losses, improved both transient and small signal stability of network, reduced cost of production, and fulfillment of contractual requirement by controlling the power flow in the network. They can enable lines to flow the power near its nominal rating and maintain its voltage at desired level and thus, enhance power system security in contingencies [1-6]. For a meshed network, an optimal allocation of FACTS devices allows to control its power flows and thus, to improve the system loadability and security [1].

The effect of FACTS devices on power system security, reliability and loadability has been studied according to proper control objectives [4-14]. Researchers have tried to find suitable location for FACTS devices to improve power system security and loadability [13-16]. The optimal allocation of these devices in deregulated power systems has been presented in [17-18]. Heuristic approaches and intelligent algorithms to find suitable location of FACTS devices and some other applications have been used in [15-21].

In this chapter, a novel heuristic method is presented based on Harmony Search Algorithm (HSA) to find optimal location of multi-type FACTS devices to enhance power system security and reduce power system losses considering investment cost of these devices. The proposed method is tested on IEEE 30-bus system and then, the results are presented.

## 2. Model of FACTS devices

### 2.1. FACTS devices

In this chapter, we select three different FACTS devices to place in the suitable locations to improve security margins of power systems. They are TCSC (Thyristor Controlled Series Capacitor), SVC (Static VAR Compensator), and UPFC (Unified Power Flow Controller) that are shown in Fig. 1.

Power flow through the transmission line i-j namely

TCSC can change line reactance, and SVC can control the bus voltage. UPFC is the most versatile member of FACTS devices family and controls all power transmission parameters (i.e., line impedance, bus voltage, and phase angles). FACTS devices can control and optimize power flow by changing power system parameters. Therefore, optimal device and allocation of FACTS devices can result in suitable utilization of power systems.

### 2.2. Mathematical model of FACTS devices

In this chapter, steady-state model of FACTS devices are developed for power flow studies. TCSC is simply modeled to modify just the reactance of transmission lines. SVC and UPFC are modeled using the power injection models. Therefore, SVC is modeled as shunt element of transmission line, and UPFC as decoupled model. A power flow program has been developed in MATLAB by incorporating the mathematical models of FACTS devices.

#### 2.2.1. TCSC

TCSC compensates the reactance of the transmission line. This changes the line flow due to change in series reactance. In this chapter, TCSC is modeled by changing transmission line reactance as follows:

where,

#### 2.2.2. SVC

SVC can be used for both inductive and capacitive compensation. In this chapter, SVC is modeled as an ideal reactive power injection at bus

#### 2.2.3. UPFC

Two types of UPFC models have been studied in the literature; one is the coupled model [28], and the other the decoupled type[29-31]. In the first, UPFC is modeled with series combination of a voltage source and impedance in the transmission line. In the decoupled model, UPFC is modeled with two separated buses. The first model is more complex than the second one because the modification of the Jacobian matrix is inevitable. In conventional power flow algorithms, we can easily implement the decoupled model. In this chapter, the decoupled model has been used to model the UPFC as in Fig. 2.

UPFC controls power flow of the transmission lines. To present UPFC in load flow studies, the variables

Although UPFC can control the power flow but, it cannot generate the real power. Therefore, we have:

Reactive power output of UPFC,

## 3. Security index

The security index for contingency analysis of power systems can be expressed as in the following [32-33]:

Here we have:

## 4. The proposed algorithm

### 4.1. Harmony search algorithm

Harmony Search Algorithm (HSA) has recently been developed in an analogy with music improvisation process, where music players improvise the pitches of their instruments to obtain better harmony [34]. The steps in the procedure of harmony search are as follows [35]:

**Step 1**: Initialize the problem and algorithm parameters

**Step 2**: Initialize the harmony memory

**Step 3**: Improvise a new harmony

**Step 4**: Update the harmony memory

**Step 5**: Check the stopping criterion

The next following five subsections describe these steps.

In step 1, the optimization problem is specified as follows:

where, *f(x)* is the objective function, *g(x)* the inequality constraint function, and *h(x)* the equality constraint function. *x* is the set of each decision variable *X* is the set of the possible range of values for each decision variable; that is

In step 2, the HM matrix is filled with as many randomly generated solution vectors as the HMS in the following:

A new harmony vector,

For example, an HMCR of 0.85 indicates that the HS algorithm will choose the decision variable value from historically stored values in the HM with 85% probability or from the entire possible range with (100–85) % probability. Every component obtained by the memory consideration is examined to determine whether it should be pitch-adjusted. This operation uses the PAR parameter, which is the rate of pitch adjustment as follows:

The value of (1-PAR) sets the rate of doing nothing. If the pitch adjustment decision for

where, *b*_{w} is an arbitrary distance bandwidth and rand () is a random number between 0 and 1.

In step 3, HM consideration, pitch adjustment or random selection in turn is applied to each variable of the new harmony vector.

If the new harmony vector

If the stopping criterion (maximum number of improvisations) is satisfied, the computation terminates. Otherwise, steps 3, and 4 are repeated.

### 4.2. Cost of FACTS devices

Using database of [32], cost function for SVC, TCSC, and UPFC shown in Fig. 3 are modeled as follows:

For TCSC:

For SVC:

For UPFC:

Here,

### 4.3. Objective function

The goal of the optimization algorithm is to place FACTS devices in order to enhance power system security-level considering cost function of FACTS devices. These devices should be placed to prevent congestion in transmission lines and transformers, and to maintain bus voltages close to their reference values. Security index introduced in section III has been used in objective function considering cost function of FACTS devices and power system losses. Fitness function

The coefficient

## 5. Simulation results

Simulation studies are carried out for different scenarios in the IEEE 30-bus power system. Five different cases have been considered:

Case 1: power system normal operation (without installation of FACTS devices),

Case 2: one TCSC is installed,

Case 3: one SVC is installed,

Case 4: one UPFC is installed, and

Case 5: Multi-type (TCSC, SVC, and UPFC) FACTS devices are installed.

The first case is the normal operation of network without using any FACTS device. In the second, third, and fourth cases, installation of only one device has been considered. Each device is placed in an optimal location obtained by HSA. Multi-type FACTS devices installation is considered in the 5^{th} scenario. In this case, three different kinds of FACTS devices have been considered to be placed in optimal locations to enhance power system security.

The performance index evolutions of implemented methods are shown in Fig.4, and Fig.5. The average, and maximum performance indices are shown in Fig.4. Tables 1, and 2 show optimal locations of devices for different cases. These results illustrate that the installation of one device in the network could not lead to improved security of power system and reduction in power system losses simultaneously, and that multi-type FACTS devices should be placed in optimal locations to improve security margins and reduce losses in the network.

## 6. Harmonic optimization in multi-level inverters using harmony search algorithm

### 6.1. Introduction

Nowadays, dc-to-ac inverters are widely used in industry. All applications are mainly divided into two general groups; 1- Electric drives for all ac motors when dc supply is used, and 2- in systems including high voltage direct current (HVDC) transmission systems, custom power and flexible ac transmission systems (FACTS) devices, flexible distributed generation (FDG), and interconnection of distributed generation (DG) units to a grid. Several switching algorithm such as pulse width modulation (PWM), sinusoidal pulse width modulation (SPWM), space-vector modulation (SVM), selective harmonic eliminated pulse width modulation (SHEPWM), or programmed-waveform pulse width modulation (PWPWM) are applied extensively to control and determine switching angles to achieve the desired output voltage. In the recent decade, a new kind of inverter named multi-level inverter has been introduced. In various publications, this inverter has been used in place of the common inverters to indicate its advantages in different applications. Being multi-level, it can be used in high-power and high-voltage applications. In order to reach the desired fundamental component of voltage, all of various switching methods produce harmonics and hence, it is of interest to select the best method to achieve minimum harmonics and total harmonic distortion (THD). It is suggested to use optimized harmonic stepped waveform (OHSW) to eliminate low order harmonics by determining proper angles, and then removing the rest of the harmonics via filters. In addition, this technique lowers switching frequency down to the fundamental frequency and consequently, power losses and cost are reduced.

Traditionally, there are two states for DC sources in multi-level inverters: 1- Equal DC sources, 2- Non-equal DC sources. Several algorithms have been suggested for the above purposes. In [37] Newton-Raphson method has been used to solve equations. Newton-Raphson method is fast and exact for those modulation indices (*M*) that can satisfy equations, but it cannot obtain the best answer for other indices. Also, [38] has used the mathematical theory of resultants to find the switching angles such that all corresponding low-order harmonics are completely canceled out sequentially for both equal and non-equal DC sources separately. However, by increasing levels of multi-level converters, equation set tends to a high-order polynomial, which narrows its feasible solution space. In addition, this method cannot suggest any answer to minimize harmonics of some particular modulation indices where there is no acceptable solution for the equation set. Genetic algorithm (GA) method has been presented in [39] to solve the same problem with any number of levels for both eliminating and minimizing the harmonics, but it is not fast and exact enough. This method has also been used in [40] to eliminate the mentioned harmonics for non-equal DC sources. Moreover, all optimal solutions have used main equations in fitness function. This means that the fundamental component cannot be satisfied exactly.

Here, a harmony search (HS) algorithm approach will be presented that can solve the problem with a simpler formulation and with any number of levels without extensive derivation of analytical expressions. It is also faster and more precise than GA.

## 7. Cascade H-bridges

The cascaded multi-level inverter is one of the several multi-level configurations. It is formed by connecting several single-phase, H-bridge converters in series as shown in Fig. 1a for a 13-level inverter. Each converter generates a square-wave voltage waveform with different duty ratios. Together, these form the output voltage waveform, as shown in Fig. 1b. A three-phase configuration can be obtained by connecting three of these converters in

## 8. Problem statement

Fig. 6b shows a 13-level inverter, where *i*^{th} inverter *S* is the number of DC sources that is equal to the number of switching angles (in this study S=6). The number of levels *L*, is calculated as

where,

There are two approaches to adjust the switching angles:

Minimizing the THD that is not common, because some low order harmonics may remain.

Canceling the lower order harmonics and removing the remained harmonics with a filter.

The second approach is preferred. For motor drive applications, it is necessary to eliminate low order harmonics from 5 to 17. Hence, in this section, a 13-level inverter is chosen to eliminate low-order harmonics from 5 to 17. It is not needed to delete triple harmonics because they will be eliminated in three-phase circuits. Thus, for a 13-level inverter, Eq. (17) changes into (18).

Here,

It is necessary to determine six switching angles, namely

## 9. Genetic algorithm

In order to optimize the THD, genetic algorithm (GA) that is based on natural evolution and population is implemented. This algorithm is usually applied to reach a near global optimum solution. In each iteration of GA (referred as generation), a new set of strings (i.e. chromosomes) with improved fitness is produced using genetic operators (i.e. selection, crossover and mutation).

Chromosome structure of a GA is shown in table 1 that involves

The method of tournament selection is used for selections in a GA [41-42]. This method chooses each parent by choosing

Crossover allows the genes from different parents to be combined in children by exchanging materials between two parents. Crossover function randomly selects a gene at the same coordinate from one of the two parents and assigns it to the child. For each chromosome, a random number is selected. If this number is between 0.01 and 0.3 [42], the two parents are combined; else chromosome is transferred with no crossover.

GA creates mutation-children by randomly changing the genes of individual parents. In this section, GA adds a random vector from a Gaussian distribution to the parents. For each chromosome, random number is selected. If this number is between 0.01 and 0.1 [42], mutation process is applied; else chromosome is transferred with no mutation.

## 10. Harmony search algorithm

Harmony Search Algorithm (HSA) has been implemented based on the algorithm described in section 4 of the first part of this chapter [34-35].

## 11. Simulation results

Harmony Search algorithm has been used to solve the optimization problem. The objective function has been chosen as follows:

where, *h*_{1}*=1,*
*h*_{2}*=5* … and *h*_{6}*=*17, are orders of the first six viable harmonics at the output of a three-phase multi-level inverter, respectively. The parameters of the harmony search algorithm have been chosen as: *HMS*=10, *HMCR*=0.9, *PAR*=0.6, and *b*_{w} =0.01. The optimal solution vector is obtained after 1000 iterations as: [10.757, 16.35, 26.973, 39.068, 59.409, 59.409]. With these switching angles, the output voltage waveform and its spectrum will be obtained as shown in Fig. 2. The values of the objective function and the total harmonic distortion (THD) has been obtained as:

## 12. Conclusion

In the first part of the presented chapter, we presented a novel approach for optimal placement of multi-type FACTS devices based on harmony search algorithm. Simulations of IEEE 30-bus test system for different scenarios demonstrate that the placement of multi-type FACTS devices leads to improvement in security, and reduction in losses of power systems.

In the second part, the harmony search algorithm was proposed for harmonic optimization in multi-level inverters. Harmony search algorithm has more flexibility than conventional methods. This method can obtain optimum switching angles for a wide range of modulation indices. This advantage is of importance, especially when the number of switching angles goes up, where equation set may not have any solution, or when it is solvable only for a short range of modulation indices. Moreover, the implementation of the harmony search algorithm is very straightforward compared to the conventional methods like Newton-Raphson, where it is necessary to calculate the Jacobean matrix. In addition, one of the most attractive features of intelligent algorithms is their independency from case studies. Actually, intelligent algorithm can be imposed to a variety of different problems without any need for extensive manipulations. For example, the harmony search algorithm and GA algorithms are able to find optimum switching angles in order to cancel out low-order harmonics, and if it is not possible to completely remove them, they can suggest optimum switching angles so that, low-order harmonics will be reduced as much as possible. Furthermore, with a little manipulation in the defined objective function, one can use HSA and GA as a tool for THD optimization. Also, the results indicate that, harmony search algorithm has many benefits over GA such as simplicity in the implementation, precision, and speed in global convergence.