ACTIVE POWER LOSS REDUCTION BY FIREFLY ALGORITHM

This paper proposes a swarm intelligence algorithm, called Firefly Mating Algorithm (FMA) for solving optimal reactive power problem. FMA uses genetic algorithm as the core of the algorithm. The main feature of the algorithm is a novel mating pair selection method which is inspired by the following two mating behaviours of fireflies in nature: (i) the mutual attraction between males and females causes them to mate and (ii) fireflies of both sexes are of the multiple-mating type, mating with multiple opposite sex partners. A female continues mating until her spermatheca becomes full, and, in the same vein, a male can provide sperms for several females until his sperm reservoir is depleted. In order to evaluate the efficiency of the proposed algorithm; it has been tested on IEEE 57 bus system and simulation results reveals about the best performance of the proposed algorithm in reducing the real power loss


Introduction
Reactive power optimization places an important role in optimal operation of power systems. Various numerical methods like the gradient method [1,2], Newton method [3] and linear programming [4][5][6][7] have been implemented to solve the optimal reactive power dispatch problem. Both the gradient and Newton methods have the intricacy in managing inequality constraints. The problem of voltage stability and collapse play a key role in power system planning and operation [8] Evolutionary algorithms such as genetic algorithm have been already projected to solve the reactive power flow problem [9][10][11]. Evolutionary algorithm is a heuristic methodology used for minimization problems by utilizing nonlinear and non-differentiable continuous space functions. In [12], Hybrid differential evolution algorithm is projected to increase the voltage stability index. In [13] Biogeography Based algorithm is projected to solve the reactive power dispatch problem. In [14], a fuzzy based method is used to solve the optimal reactive power scheduling method. In [15], an improved evolutionary programming is used to elucidate the optimal reactive power dispatch problem. In [16], the optimal reactive power flow Http://www.granthaalayah.com ©International Journal of Research -GRANTHAALAYAH [156] problem is solved by integrating a genetic algorithm with a nonlinear interior point method. In [17], a pattern algorithm is used to solve ac-dc optimal reactive power flow model with the generator capability limits. In [18][19][20] proposes a two-step approach to calculate Reactive power reserves with respect to operating constraints and voltage stability. This paper proposes a swarm intelligence algorithm, called Firefly Mating Algorithm (FMA), for solving optimal reactive power problem. FMA uses genetic algorithm as the core of the algorithm. The main feature of the algorithm is a novel mating pair selection method which is inspired by the following 2 mating behaviours of fireflies in nature: (i) the mutual attraction between males and females causes them to mate and (ii) fireflies of both sexes are of the multiple-mating type, mating with multiple opposite sex partners. A female continues mating until her spermatheca becomes full, and, in the same vein, a male can provide sperms for several females until his sperm reservoir is depleted. In order to evaluate the efficiency of the proposed algorithm; it has been tested on IEEE 57 bus system and simulation results reveals about the best performance of the proposed algorithm in reducing the real power loss.

Problem Formulation
The objective of the optimal reactive power problem is to minimize one or more objective functions while satisfying a number of constraints such as load flow, generator bus voltages, load bus voltages, switchable reactive power compensations, reactive power generation, transformer tap setting and transmission line flow.

Minimization of Real Power Loss
It is aimed in this objective that minimizing of the real power loss (Ploss) in transmission lines of a power system. This is mathematically stated as follows.
Where n is the number of transmission lines, g k is the conductance of branch k, V i and V j are voltage magnitude at bus i and bus j, and θ ij is the voltage angle difference between bus i and bus j.

Minimization of Voltage Deviation
It is aimed in this objective that minimizing of the Deviations in voltage magnitudes (VD) at load buses. This is mathematically stated as follows.
Where n l is the number of load busses and V k is the voltage magnitude at bus k.

System Constraints
In the minimization process of objective functions, some problem constraints which one is equality and others are inequality had to be met. Objective functions are subjected to these constraints shown below.
Load flow equality constraints: where, nb is the number of buses, P G and Q G are the real and reactive power of the generator, P D and Q D are the real and reactive load of the generator, and G ij and B ij are the mutual conductance and susceptance between bus i and bus j.
Generator bus voltage (V Gi ) inequality constraint: Load bus voltage (V Li ) inequality constraint: Switchable reactive power compensations (Q Ci ) inequality constraint: Reactive power generation (Q Gi ) inequality constraint: Transformers tap setting (T i ) inequality constraint: Transmission line flow (S Li ) inequality constraint: Where, nc, ng and nt are numbers of the switchable reactive power sources, generators and transformers.

Firefly Algorithm
This section describes the original firefly algorithm. Firefly algorithm (FA) is a reliable and efficient metaheuristic algorithm capable of solving many real-world problems such as scheduling, optimization problems in dynamic environments, and economic load dispatch problem. This algorithm is influenced by the flashing behaviour of fireflies to attract one another. It is constructed based on three rules [21]: (i) All fireflies are unisex so that one firefly is attracted to all other fireflies. (ii) The attractiveness of a firefly is proportional to its brightness. For any two fireflies, the dimmer one is attracted by (and thus moves towards) the brighter one. However, if there are no fireflies brighter than a given firefly, that firefly will move randomly.
(iii) The brightness of a firefly decreases as the distance from it increases. This is because light is absorbed when it passes through the medium. Therefore, the brightness (also attractiveness) of the firefly seen by the firefly is defined in (11).
where is a light absorption coefficient of the medium, is the Euclidean distance between the firefly and the firefly , (0) is the brightness of the firefly at =0, and and are the locations of the fireflies and , respectively. If the firefly is the brighter one, the value of its attractiveness regulates the movement of the firefly according to the following equation: Where is a randomization parameter and rand is a uniform random number in the range [−0.5, 0.5]. The function of the second term in (13) is to move the firefly towards the firefly . The function of the third term in (13) is to move the solution away from a local optimum when such incident takes place.

Genetic Algorithm
Genetic algorithm (GA) is an optimization technique inspired by the process of natural selection. GA starts with an initial population which consists of a number of randomly generated chromosomes. A new population is created from the current one by means of 3 genetic operators: selection, crossover, and mutation. The selection operator stochastically chooses chromosomes to be included in the mating pool; the ones with higher fitness values are more likely to be chosen. Crossover operator selectively chooses some genes from the chromosomes of the parents and combines them into the offspring. Mutation operator randomly changes some genes of the offspring. This evolution process is repeatedly performed until any of the stopping criteria is met. The commonly used stopping criteria are as follows: (i) a predefined number of iterations is reached, (ii) the best solution does not improve for a predefined number of iterations, and (iii) a large percentage of the chromosomes in the population is the same.

Firefly Mating Algorithm
There are over 2,000 species of fireflies around the world, but most of them are found in the tropical zone. They live under the water when they are larvae and on the ground and in the air when they are adults. Fireflies are social animals. They stay in a swarm on tree branches and lay eggs on the ground around the trees. The fascinating thing when observing fireflies is their light flash. The light emitted from their abdomens is a cold light through chemical reactions within their bodies. Fireflies emit flashing light for communication, luring preys, repelling predators, and attracting mates. Note that this research only focuses on the mating behaviour of the firefly; therefore, the detailed relation of the flashing light signal to the mate selection process is further discussed in the next paragraph. In the mating season, female fireflies release pheromones into the air to signal their readiness to mate. The pheromones are carried away in the direction controlled by the wind [22]. Male fireflies follow the pheromone trail and approach the females from a downwind direction [22]. More males are attracted to females who release more pheromones. Males then fly around the trees that the females perch on and flash courtship signal to attract females [23]. Females are more attracted to brighter males and response to those males by flashing their own lights. Then many rounds of mating take place during the night [24]. Males mate until they run out of sperm in their sperm reservoir while females can hold only a certain amount of sperms in their spermatheca. Sperms from fitter males are more likely to be chosen to fertilize a female's eggs; this is due to the following two explanations: (i) females have ways to discard low-quality sperms, including destroying them by their internally produced chemicals [25,26]; (ii) one male's seminal fluid can incapacitate rival males' sperm within the female reproductive tract [25][26][27][28]. It is nature's way of selective breeding.
FMA incorporates a new mating feature, inspired by the mating behaviour of fireflies in nature, into GA. FMA consists of three main processes: (i) a male selects a female according to the level of her released pheromone that he senses which changes according to wind speed and direction; (ii) a female selects a male according the light intensity of his flash; and (iii) a male or a female mates repeatedly until he runs out of sperms or her spermatheca is full, producing more able offspring for the next generation. This algorithm proceeds from the first step to the last in the 6 following steps.

Initialization
An initial population of fireflies is randomly generated; half are assigned as males and the other half are females. Each firefly consists of genes (which is equal to the number of variables in the problem). Additionally, the sizes of each female's spermatheca and each male's sperm reservoir, which are real numbers between 0 and 1, are randomly generated. Lastly, the fitness value of each firefly is calculated.

Selection of Mating Pairs
This step features a new method for determining the mating pairs. Unlike in the GA where mating pairs are selected by using a roulette wheel selection technique, our proposed algorithm introduces a new selection method based on a process of firefly mate selection. First, male fireflies are drawn to a female's location by following the pheromone that the female releases. Second, the female selects males based on their brightness. Finally, mating pairs are formed based on the mutual attraction of each pair. By introducing this concept to the algorithm, it provides a way to overcome the problem of getting stuck in local optima, as is often the case with the roulette wheel selection technique.

Determination of Female Sex Appeal
Female sex appeal is directly proportional to the amount of pheromone released by the female. The pheromone released by the female firefly diffuses downwind and reaches each male firefly in unequal amounts depending on 2 factors: (i) the distance and (ii) the speed and direction of the wind. In this subsection, therefore, the male fireflies determine the concentration level of each female's pheromone reaching them. A highly fit female that is farther away from a male can get selected by the male if her highly concentrated pheromone gets carried along by a high speed wind towards the male. The concentration level of the female 's pheromone reaching the male , , is calculated by using, Where is the fitness value of a female firefly , ⃗ ⃗ is the wind vector which is randomly generated in each iteration, and ⃗⃗⃗ . is the difference vector between the position vector of a male and that of the female.

Determination of Male Sex Appeal
In this subsection, the female fireflies determine the appeal of each male in their vicinity. Similar to the original FA, the appeal of a male firefly is directly proportional to his brightness. Thus, by imitating (11), the appeal of the male firefly seen by the female firefly is calculated according to the following equation: Where is the appeal of the male firefly seen by the female firefly , is a constant in the range [0, 1], is the Euclidean distance between the male and the female (calculated according to (12)), and is the fitness value of the male firefly .

Calculation of the Mutual Attraction
According to the degree of mutual attraction, a number of males and females are paired together as potential parents. A pair whose mutual attraction value is the highest among all pairs is selected as the first mating pair. The mutual attraction between the female firefly and the male firefly , MA , is defined as After each mating, the numbers of sperms in the male's sperm reservoir and in the female's spermatheca are updated. The update procedure is described in the next subsection. Next, the pair with the next highest value is selected if its male member still has some sperms left in the sperm reservoir and the female's sperm bucket has not become full yet.

Update Procedure for Male's Sperm Reservoir and Female's Spermatheca
At the beginning, the number of sperms in each male's sperm reservoir and the size of each female's spermatheca are randomly initialized within the range [0, 1]. When pair of male and female mates, sperms is transferred from the male's sperm reservoir to the female's spermatheca, and the number of sperms in the male's sperm reservoir is reduced. For each mating, the number of sperms a male gives to the female he chose depends on her fitness. The number of sperms that a male can transfer to the female he chose is calculated by the following equation: Where is the number of sperms transferred to the female at the time of mating, is the number of sperms in the sperm reservoir, and is the fitness value of a female firefly . It stands to reason that a fitter female should get more sperms because, then, she would produce more offspring that are fitter than those produced by other females. After mating, the number of sperms in each male's sperm reservoir and the space of each female's spermatheca are checked. Once a male runs out of sperm or a female's spermatheca is full, he/she will be disqualified from mating in the next round. Equations (18) and (19) are used to update the number of sperms in a male's sperm reservoir and a female's spermatheca, respectively.
Mating goes on until there is no qualified firefly left to form the mating pair.

Crossover Operation
When a male and female mates, some of their genes are crossed over to form two new offspring. One of the two following cases is applied with a specific crossover procedure as follows.
Case 1. If the parents have never been mated before, the 2-point crossover operator is used to create the offspring. The 2-point crossover operator starts from randomly selecting a start position and an end position in the parent chromosomes to be crossed over, and then the genes between these two positions are crossed over and placed in the same position in the chromosomes of the two offspring, each having the original genes from each parent before the crossover. Case 2. If either of the parents has been mated before, the -point crossover operator is used to create the offspring. The -point crossover operator starts from randomly selecting /2 pairs of back-to-back start and end positions, then crossing over the genes from the parents between each pair of start and end position. The rest of the genes are retained.

Mutation Operation
After an incipient offspring is produced from mating, some of its genes are randomly changed (mutated) to new values within the range of the variables. The mutation is performed in order to promote diversity of the population and to help avoid getting stuck in local optima.

Selection of the Population for the Next Generation
After all offspring are mutated, the best fireflies out of the combined population of parents and offspring are selected to replace the old population of parents; in effect, only the more effective fireflies are selected to be the population of the next generation. The selection is done by sorting members by their fitness values and then selecting only the members with the higher fitness values that make up the total number of members of the initial population.

Termination
After the selection of a new population for the next generation, the current iteration is completed. The algorithm then moves on to perform the next iteration until the specified maximum number of iterations is reached or the best solution does not improve for a predefined number of iterations.

Simulation Results
Proposed firefly mating algorithm (FMA) has been tested in standard IEEE-57 bus power system. The reactive power compensation buses are 18, 25 and 53. Bus 2, 3, 6, 8, 9 and 12 are PV buses and bus 1 is selected as slack-bus. The system variable limits are given in Table 1. The preliminary conditions for the IEEE-57 bus power system are given as follows: P load = 12.016 p.u. Q load = 3.018 p.u. The total initial generations and power losses are obtained as follows: ∑ = 12.5510 p.u. ∑ = 3.3202 p.u. P loss = 0.25710 p.u. Q loss = -1.2018 p.u.

Conclusion
In this paper, Firefly Mating Algorithm (FMA) successfully solved optimal reactive power problem. The main feature of the algorithm is a novel mating pair selection method which is inspired by the following two mating behaviours of fireflies in nature: (i) the mutual attraction between males and females causes them to mate and (ii) fireflies of both sexes are of the multiple-mating type, mating with multiple opposite sex partners. A female continues mating until her spermatheca becomes full, and, in the same vein, a male can provide sperms for several females until his sperm reservoir is depleted. In order to evaluate the efficiency of the proposed algorithm; it has been tested on IEEE 57 bus system and simulation results reveals about the best performance of the proposed algorithm in reducing the real power loss.