Power Loss Minimization using Optimal Power Flow based on Firefly Algorithm

Conventional methods are commonly used to solve optimal power flow problems in power system networks. However, conventional methods are not suitable for solving large and non-linear optimal power flow problems as they are influenced by initialization values and more likely be trapped in local optimum. Hence, heuristic optimization methods such as Firefly Algorithm have been widely implemented to overcome the limitations of the conventional methods. These methods often use random strategy that can provide better solutions to avoid being trapped in the local optimum while achieving global optimum. In this study, the load flow analysis was performed using the conventional method of Newton-Raphson technique to calculate the real power loss. Next, Firefly Algorithm was implemented to optimize the control variables for minimizing the real power loss of the transmission system. Generator bus voltage magnitudes, transformer tap settings and generator output active power were taken as the control variables to be optimized. The effectiveness of the proposed Firefly Algorithm was then tested on the IEEE 14-bus and 30-bus system using MATLAB software. The simulated results were then analyzed and compared with Particle Swarm Optimization’s results based on the consistency and execution time. Implementation of the Firefly Algorithm has successfully produced minimum real power loss with faster computational time as compared to Particle Swarm Optimization. For the IEEE 14-bus system, the active power loss for the Firefly Algorithm is 6.6222 MW and the calculation time is 18.2372 seconds. Therefore, the application of optimal power flow based on Firefly Algorithm is a reliable technique, in which the optimal settings with respect to power transmission loss can be determined effectively. Keywords—Optimal power flow; firefly algorithm; real power loss; control variables


I. INTRODUCTION
Optimal power flow (OPF) is a non-linear and complex optimization technique in the operation of electrical power systems. OPF has been classified into conventional and intelligence as defined in [1]. Conventional methods are based on gradients and influenced by initial guess values such as voltage magnitude. This method requires a solution for a new linear system in each iteration [2].
In recent years, intelligence methods have been developed to overcome the limitations and short comings of the conventional methods. Intelligence methods such as Genetic Algorithm [1,3], Ant-Lion Optimization Techniques [4,5], Hybrid Firefly and Particle Swarm Optimization [6], Particle Swarm Optimization [7] and American Buffalo Algorithm [8] have been proposed to reduce active power loss in transmission system. In addition, the Firefly Mating Algorithm as in [9] has also been used to reduce active and reactive power loss in the transmission system. Firefly algorithm also has been suggested to tackle the economic dispatch problem [10]. Besides, the modified Firefly Algorithm has also been used to maintain various system constraints within operating limits while lowering the total cost of system generation [11].
Firefly Algorithm (FA) which acts as a nature-inspired algorithm has been used previously to solve various nonlinear design problems. It is based on the behavior of herds such as fish, bird schooling and insects in the environment [12]. The Firefly Algorithm has three ideal rules [8]. First is that all fireflies are of different genders, where one firefly will be attracted to brighter ones. The second rule is that the brightness of fireflies will decrease if the distance between them increases. This is caused by the absorption of light when it passes through the medium. However, if there is no lighter firefly nearby, the fireflies will move randomly. Thirdly, the brightness of a firefly is determined by the objective function. Compared with some other heuristic algorithm, FA is more suitable in solving optimization problems of various objectives and be able to find a better global optimal solution [13,14]. The next major advantage of this method is the ability to learn, fast computation time and suitable to solve the problem of nonlinear and convex optimal power flow [6,15].
In this study, Firefly Algorithm was integrated with the Newton-Raphson load flow formulation to determine the optimal settings of the control variables such as generator bus voltage magnitudes, transformer tap settings and generator output active power. To demonstrate the effectiveness of the proposed method, the IEEE 14-bus and 30-bus systems were modelled in MATLAB software and utilized as the test systems. Further validations on the effectiveness of the method were conducted by comparing its consistency and computational time with Particle Swarm Optimization method. The implementation of the Firefly Algorithm-based power flow is expected to produce a minimum amount of active power loss while improving the voltage profile, subjected to the system operational constraints. www.ijacsa.thesai.org

A. Firefly Algorithm
Fireflies produce natural light to attract others. Firefly Algorithm is mathematically modeled based on hunting behavior. There are two important factors in the formulation of Firefly Algorithm, which are light intensity and attractiveness. The intensity of light varies according to the inverse square law as in (1).
where ( ) is the intensity of light at the distance of r and I S is the intensity at its source. The attraction of a firefly is proportional to the light intensity detected by the neighbouring fireflies, therefore the attractiveness function can be defined as stated in (2).
where is the light absorption coefficient, is the attractiveness for r = 0, r is the Cartesian distance between two fireflies which defined in (3).
where is the location of firefly i, is the k th component of the spatial coordinate of i-th fireflies. The movement of firefly i attracted to the brighter firefly j is defined by (4).
, - where the first term on the left side is the initial position of firefly i, second term is the attraction of j th fireflies while the third term introduces random movement, and the rand is a random number generator uniformly distributed between zero and one.

B. Formulation of the Optimal Power Flow
The purpose of solving the optimal power flow problem is to optimize an objective function by adjusting power system control variables with respect to the operating limits of the system. The non-linear constrained optimization problem can be formulated mathematically as follows [16]: Minimize: Subject to: The vector of dependent variables, consists of slack bus power , load bus voltage , generator reactive power and transmission line loading , which can be written as: While the vector of control variables consists of generator voltage , real power output except at slack bus , transformer tap setting which can be stated as: where NG, NL, NT, nl are the number of generators, number of load buses, number of regulating transformers and number of transmission lines respectively.

C. Objective Function
In this paper, the objective function is to optimize the total real power loss in transmission lines, which is expressed as follows [17]: The above objective function is optimized while satisfying the equality and inequality constraints, where, P loss is real power loss in system, Vi is the voltage magnitude at the bus i, NL is the total number of transmission lines, δi is the voltage angle at the bus i.

D. Equality Constraints
The equality constraints are derived from the active power balance equations, which are described by power flow equation shown below [18].
where, i is 1,2,3,……N bus-1 P Gi is the real power generation at bus i, P Di is the real power demand at bus i, N B is the total number of buses, is the angle of bus admittance element i, j.

E. Inequality Constraints
Inequality constraints include line power flow and limit of the control variables.
Continuous voltage control variables: (12) Continuous active power control variables: (13) Transformer tap-setting constraints: (14) (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 12, No. 9, 2021 360 | P a g e www.ijacsa.thesai.org The solution procedures as in Fig. 1 for the Firefly Algorithm are summarized as follows: 1) Input data such as bus data and line data.
2) Performs load flow analysis using Newton-Raphson method to calculate the amount of power loss.
3) The parameters βo, γ and α are set. Maximum iteration is set as t = 100. 4) Generate the original population of the fireflies as {xi},(i=1,2,... n) randomly representing a solution to an optimization problem with the objective function f(x). 5) If the initial fireflies are within the limits, proceed to Step 6. Otherwise, go back to Step 2.
6) Calculate the fitness function (brightness) for each firefly.
7) The attraction between the fireflies is calculated by Equation (2).
8) The firefly i move towards firefly j, the distance is calculated by Equation (3). 9) Update the ranking of fireflies by Equation (4). 10) Find the current best global for fireflies. 11) If the t /< maximum iteration, Step 4 to 10 are repeated. Otherwise, continue to Step 12.
12) Print the output of active power loss.
Once the control variables are generated, the proposed algorithm uses the control variable as an initialization to run the load flow program based on the Newton-Raphson method. Objective functions are then evaluated for each population to ensure constraints are met. Then, the control variables are updated and the objective function for the updated firefly position is revalued.
The position of updated fireflies is organized and combined with the previous population and is designated as the best firefly. The best value of fireflies with minimum objective functions is noted as the best firefly position for each iteration. The iteration process will come to an end when the control variable has been set to its ideal value based on the fitness function's minimal value.

III. RESULT AND DISCUSSION
The proposed FA based method is analyzed based on the IEEE 14-bus and 30-bus systems. The Firefly Algorithm was developed and simulated by using MATLAB software. The control variables were adjusted within their lower and upper bounds. The ranges of control variables are shown in Table I. In this study, three types of control variables were used in the Firefly Algorithm optimization method to minimize the amount of active power loss. Next, three different cases were analyzed based on combinations of different control variable settings.
The first case study involved variable settings of active power output, while the second case study involved variable settings of active power output and voltage generator. The third case study involved all settings of the control variables of active power output, generator voltage and transformer tap.

A. Minimization of Real Power Loss
The reduction of real power loss in transmission line is the desired objective function. The proposed algorithm was simulated, and the optimal value of the real power loss was then calculated. In this study, case 3 which consists of three control variables output active power generated, generator voltage and transformer tap settings were within the operating limits. Case 3 was analyzed to obtain the optimal values of the control variables and total active power loss.    Table III shows the optimal control variables of the IEEE 30-bus system. The total active power loss for the original case for the 30-bus IEEE system is 5.8632 MW. The implementation of FA shows a lower total active power loss of 3.3420 MW, equivalent to a 43.00% reduction from the original value, while the implementation of PSO recorded a reduction of only 37.48%.

B. Bus Voltage Profile
The bus voltage profile indicates the stability of a system during operation. To validate the performance of the Firefly Algorithm in improving the voltage profile, the magnitudes of bus voltages for the IEEE 14-bus and 30-bus systems were analyzed and shown in Fig. 2 and Fig. 3 respectively. All three case studies and the base case were considered in this analysis. Fig. 2 and Fig. 3 illustrate that case 3 for both IEEE test systems resulted in better voltage profiles compared to the base case, case 1 and case 2. www.ijacsa.thesai.org

C. Total Active Power Loss
Statistical analysis was also performed to further investigate the effectiveness of the proposed FA and PSO method based on the IEEE 14-bus and 30-bus systems. The statistical result of the average, minimum, maximum objective values and standard deviations obtained from the 20 independent trials are illustrated in table. From Table IV and  Table V, it is clearly shown that the statistical results of the average, minimum, maximum and standard deviation values of the active power losses obtained using FA are better than PSO.
For the IEEE 14-bus system, the standard deviation for case 1, case 2 and case 3 are 0.000, 0.004 and 0.008 respectively. The average active power loss for case 3 are 6.627 MW and 7.040 MW for FA and PSO method. For the IEEE 30-bus system, the standard deviation for case 1, case 2 and case 3 are 0.000, 0.040 and 0.045 respectively. The average active power loss of case 3 for FA and PSO are 3.395 MW and 3.675 MW respectively. The standard deviation values shown in Table 4 and Table 5 indicate that the results distribution of FA method was more concentrated in a smaller range than the PSO.

D. Consistency
Case 3 was analyzed for validating the consistency of the both the FA and PSO methods in solving the optimal power flow problem. For the IEEE 14-bus system, FA shows consistent value of the active power loss of 6.62 MW. Fig. 4 and Fig. 5 show that the result uniformity of the proposed FA is better compared with PSO method.

E. Computation Time
Comparison of the computational times taken by each method to find the optimal solution for the power flow problem prove that the FA consume the least time. For IEEE 14-bus system, for case 3, Table VI shows that FA spent an average of 18.085 seconds while PSO spent 25.515 seconds to find the best solution. For the IEEE 30-bus system, Table VII shows that FA and PSO spent about 21.944 seconds and 31.562 seconds respectively. Therefore, FA method has been proven to perform better in reaching the best solutions.

F. Convergence Curve
If n ≥ m, while m is the number of local optima in an optimization problem, the algorithm can be converged for any large number of fireflies. The starting position of fireflies is evenly dispersed around the whole searching space. When the method iterates, the fireflies converge towards all the local optimal. The global optima are found by correlating the best answers from all these optima. Therefore, FA can locate both the global and local optima in an efficient manner. Fig. 6 and Fig. 7 show the convergence curves for case 1, case 2 and case 3 of FA for the IEEE 14-bus and 30-bus systems respectively.

IV. CONCLUSION
This study has successfully achieved the stated objective. The objective function of real power loss based on operational constraints of the IEEE 14-bus and 30-bus transmission systems has been successfully formulated. The simulated results based on the test systems for optimal power flow control indicate that Firefly Algorithm can find a welldistributed optimal solution. In addition, the implementation of the Firefly Algorithm optimization has successfully produced a minimum amount of active power loss with faster computational time. The active power loss obtained for the IEEE 14-bus and 30-bus system is 6.6222 MW and 3.3420 MW respectively. The results have shown good performance based on the consistency and computation time compared with the Particle Swarm Optimization. In conclusion, this study has proven that Firefly Algorithm is an ideal optimization method to reduce real power loss, subjected to the system operating constraints and control variable settings. Future research can be improved by simulating the OPF control using multi-objectives optimization, rather than a single-objective optimization as discussed in this paper.