INTRODUCTION
Electric distribution systems are becoming large and complex leading to higher
system losses and poor voltage regulation. Studies indicate that almost 13%
of the total power generated is consumed as I^{2}R losses at the distribution
level (Ng et al., 2000). To reduce power losses
and to maintain a voltage profile within acceptable limits, capacitors are used
to provide reactive power compensation in distribution networks. Hence, shunt
capacitors are widely used in distribution systems to reduce power losses, improve
voltage profile and increase system capacity (Ibrik and
Mahmoud, 2002; AlOmari and Abdallah, 2008). However,
the benefits of compensation depend greatly on the placement and size of the
added capacitors. In general, the objective of the capacitor placement problem
is to determine the optimal size and location of the installed capacitors by
maximizing the saving due to the loss reduction through the proper installation
of shunt capacitors while minimizing shunt capacitor costs (Dura,
1968).
In the literature, many techniques have been reported for solving the optimal
capacitor placement problem in distribution systems in which these techniques
may be classified in the following categories: analytical, numerical programming,
heuristic and artificial intelligencebased techniques (Ng
et al., 2000). Among these techniques, the heuristic based techniques
have been widely applied in solving the optimal capacitor placement problem
(Huang, 2000; Das, 2002; Masoum
et al., 2004; Annaluru et al., 2004;
Prakash and Sydulu, 2007; AlHajri
et al., 2007; Srinivasa and Narasimham, 2008)
or instance, the immune based optimization technique is used for selecting proper
locations and ratings of capacitor banks (Huang, 2000)
and the genetic algorithm is applied to find the optimum locations and sizes
of fixed and switched capacitors at various load levels (Das,
2002). The genetic algorithm is considered as one of the first metaheuristic
techniques used for solving optimal capacitor placement problem but it has some
drawbacks such as divergence and local optima problems. Fuzzy logic has been
applied to solve the capacitor placement problem in which the constraints are
fuzzified and the alpha cuts are used to direct the search process to ensure
that the objective function is improved at each iteration process (Masoum
et al., 2004). Other heuristic based techniques include the application
of the ant colony algorithm for solving the capacitor placement and sizing problem
(Annaluru et al., 2004). In the implementation
of the ant colony optimization for the problem, capacitors should be in discrete
values and not in continuous values which are usually more accurate. A disadvantage
of the ant colony algorithm is that it has low speed because all paths must
be reviewed by the ants. The Particle Swarm Optimization (PSO) is then used
in combination with the loss sensitivity indices to minimize real power losses
and improve voltage profiles (Prakash and Sydulu, 2007).
A discrete PSO algorithm is applied to optimally locate and size a fixed singlephase
capacitor in a balanced radial distribution system (AlHajri
et al., 2007). For this case, the problem is considered as a nonlinear
integer optimization problem with both capacitor location and size having discrete
values and the NewtonRaphson power flow method is used to calculate the cost
function. Recently, the plant growth simulation algorithm is applied to solve
the optimal capacitor placement problem in a radial distribution system (Srinivasa
and Narasimham, 2008).
This study presents a relatively new heuristic technique using harmony search
algorithm for finding optimal placement and size of shunt capacitors in a radial
distribution system. The harmony search algorithm is a metaheuristic optimization
method that is inspired by musicians in improvising their instrument pitches
to find better harmony (Geem et al., 2001) and
it has several advantages in which it does not require initial value settings
for the decision variables and it can handle both discrete and continuous variables.
Since, algorithms already used in the field of optimization are based on naturally
occurring processes, harmony search can be conceptualized from a musical performance
process involving searching for a better harmony (Geem et
al., 2001). This algorithm has been successfully applied to solve optimal
placement of FACTS devices to improve power system security (Kazemi
et al., 2009). In this study, the harmony search algorithm is used
together with the backward/forward sweep power flow method (Teng,
2000) for determining the optimal placement and sizing of capacitors in
a radial distribution network. This power flow method is considered fast in
terms of computing speed as compared to the time consuming NewtonRaphson method.
The proposed harmony search algorithm is implemented on the 9bus and 34bus
test systems.
PROBLEM FORMULATION
The problem is to determine the best shunt capacitor size and location in a radial distribution system by minimizing the costs incurred by power loss and capacitor installation. To solve the optimal capacitor placement and sizing problem, the following objective function, F is considered.
Subject to:
where, P_{loss} is total power loss, n is number of candidate locations
for capacitor placement, K_{P} is the equivalent annual cost per unit
of power loss in $/(kWyear), K_{i}^{c} is the annual capacitor
installation cost and i = 1, 2,..., n are the indices of the buses selected
for compensation.
To solve the optimal capacitor placement and sizing problem for radial distribution
networks, a simpler power flow method called as the backward/forward sweep power
flow (Teng, 2000) is used for computing the power loss.
In this power flow method, the relationship between the bus current injections
and the branch currents is represented by the matrix [BIBC] which is given as:
where, [I] is the bus current injection vector and [B] is the branch current vector as shown in a simple radial distribution network of Fig. 1.
The relationship between the branch currents, [B] and bus voltages, [ΔV] is represented by the matrix [BCBV]. The matrices [BIBC] and [BCBV] are then multiplied to obtain the relationship between the voltage deviation, [ΔV] and the bus current injections [I], which is represented by the matrix [DLF] and given as:
[DLF] is also known as the voltage drop to bus current injection matrix.
The backward/forward sweep power flow method at the k iteration considers the following equations:
The total power loss is given by:

Fig. 1: 
Simple radial distribution network 
where, R_{i} is the resistance of branch i; P_{',i} and Q_{',i} are the total real and reactive powers at bus i, respectively and V_{i} is the voltage at bus i.
HARMONY SEARCH ALGORITHM
Recently, a metaheuristic optimization algorithm inspired by playing music
has been developed and it is called as the Harmony Search (HS) algorithm. It
is based on metaheuristic which combine rules and randomness to imitate natural
phenomena. HS algorithm is inspired by the operation of orchestra music to find
the best harmony between components which are involved in the operation process,
for optimal solution. As musical instruments can be played with some discrete
musical notes based on player experience or based on random processes in improvisation,
optimization design variables can be considered certain discrete values based
on computational intelligence and random processes (Lee
and Geem, 2005). Music players improve their experience based on aesthetics
standards while design variables in computer memory can be improved based on
objective function.
The performance of music seeks a best state or excellent harmony determined by aesthetic estimation, as the optimization process seeks a best state determined by objective function evaluations. The combination of pitches in the ensemble provides aesthetic estimation. Evaluation of the objective function is performed by comparing the values produced by decision variables, which corresponds to harmony which can be improved via repetition. In this analogy, the objective function values can be improved iteration by iteration. As the optimization process looks for finding a global solution that is determined by the objective function, musical performances follow to find pleasing harmony which is determined by the aesthetic standard.
Figure 2 shows a comparison of information between musical improvisation and engineering optimization. In music improvisation, each musician plays within possible pitches to make a harmony vector. If all the pitches create good harmony, the musician saved them in memory and increases good or better harmony for next time. Similarly, in the field of engineering optimization, at first each decision variable value is selected within the possible range and formed a solution vector. If all decision variable values lead to a good solution, each variable that has been experienced is saved in memory and it increases the possibility of good or better solutions for next time.
Among the advantages of the HS algorithm are that it can consider discontinuous
functions as well as continuous functions because it does not require differential
gradients; it does not require initial value setting for the variables; it is
free from divergence and may escape local optima (Lee and
Geem, 2005).
In the HS algorithm, it looks for Vector or the path of X which can reduce
the computational function cost or shorten the path. The computational procedures
of the HS algorithm which are implemented in steps are described as follows
(Lee and Geem, 2005):
Step 1: 
Initialization of the optimization problem 
Step 2: 
Initialization of the harmony memory (HM) 
Step 3: 
Improvisation a New Harmony from the HM set 
Step 4: 
Updating HM 
Step 5: 
Repeat steps 3 and 4 until the end criterion is satisfied 
A. Initialization of the optimization problem: Consider an optimization
problem which is described as:
Where:
F(x) 
: 
Objective function 
x 
: 
Set of each design variable (x_{i}) 
X_{i} 
: 
Set of the possible range of values for each design variable (Lx_{i}
<X_{i} <Ux_{i}) 
N 
: 
Number of design variables 

Fig. 2: 
Comparison between music improvisation and engineering optimization 
Here, the HS algorithm parameters are also specified in which the parameters
are the Harmony Memory Size (HMS) or the number of solution vectors in the harmony
memory; Harmony Memory Considering Rate (HMCR); Pitch Adjusting Rate (PAR);
number of decision variables (N); Number of Improvisations (NI) and the stopping
criterion.
B. Initialization of the harmony memory: The Harmony Memory (HM) matrix,
shown in Eq. 9, is filled with as many randomly generated
solution vectors as HMS and sorted by the values of the objective function,
f (x ).
C. Improvisation a new harmony from the HM set: A new harmony vector,
x' = (x_{1}', x_{2}',. ..,x_{n}' ), is generated based
on three rules, namely, random selection, memory consideration and pitch adjustment
(Lee and Geem, 2005). These rules are described as follows:
Random selection: When HS determines the value x_{i}' for the new harmony, x' = (x_{1}', x_{2}',. ..x_{n}' ), it randomly picks any value from the total value range with a probability of (1HMCR). Random selection is also used for previous memory initialization.
Memory consideration: When HS determines the value x_{i}', it randomly picks any value x_{i}^{j} from the HM with a probability of HMCR since j = {1, 2,…, HMS}.
Pitch adjustment: Every component of the new harmony vector x' = (x_{1}', x_{2}',. ..x_{n}' ), is examined to determine whether it should be pitchadjusted.
After the value x_{i}' is randomly picked from HM in the above memory consideration process, it can be further adjusted into neighboring values by adding certain amount to the value, with probability of PAR. This operation uses the PAR parameter, which is the rate of pitch adjustment as follows:
The value of (1PAR) sets the rate of doing nothing. If the pitch adjustment decision for x_{i}' is yes, x_{i}' is replaced as follows:
where, bw is the arbitrary distance bandwidth for a continuous design variable.
In this step, pitch adjustment or random selection is applied to each variable of the new harmony vector in turns.
D. Updating HM: If the new harmony vector x' = (x_{1}', x_{2}',.
..x_{n}' ) is better than the worst harmony in the HM, from the viewpoint
of the objective function value, the new harmony is entered in the HM and the
existing worst harmony is omitted from the HM (Kazemi et
al., 2009).
E. Checking stopping criterion: If the stopping criterion which is based on the maximum number of improvisations is satisfied, computation is terminated. Otherwise, steps C and D are repeated.
PROPOSED OPTIMAL CAPACITOR PLACEMENT METHOD
In the proposed optimal capacitor placement method, the HS algorithm is applied as an optimization technique to determine the optimal location of the capacitors at the buses and the backward/forward sweep power flow is applied for computing the power loss. The objective function of the optimization problem takes into account the savings due to the reduction of both power loss and capacitor installation costs. Thus, the optimal capacitor set {Q^{c}_{1,….}, Q^{c}_{i,….,} Q^{c}_{N}} leads to a maximum power loss reduction and cost saving.
The procedures for implementing the proposed optimal capacitor placement method
are described as follows:
Step 1: 
Input system parameters such as line and load data 
Step 2: 
Built the BIBC and BCBV matrices and compute the DLF matrix 
Step 3: 
Randomly add the capacitors for reactive power compensation
at the buses 
Step 4: 
Calculate the total power loss and total cost of each capacitor
set using Eq. 1 and 8, respectively.
Each capacitor set is considered as the harmony vectors. Initialize the
arrays of HM as in Eq. 9, randomly. The number of columns
in the HM is equal to number of buses in the test system. In this case,
the optimal parameters of the test system example are assumed as follows: 

• 
Lx_{i} = 0 kVar 

• 
Ux_{i} = 4050 kVar (as in Table 2) 

• 
HMS = 10 
Step 5: 
Improvise a new harmony using the three rules of random selection,
memory consideration and pitch adjustment. In this step, the optimal parameters
are assumed as follows: 

• 
HMCR = 90% 

• 
PAR = 40% 
Step 6: 
Calculate bus current injections and bus voltages using Eq.
4 and 5 
Step 7: 
Calculate the total power loss and total cost saving using
the backward/forward sweep power flow method 
Step 8: 
Check if the capacitor set (New Harmony) gives more cost saving
than the worst harmony in the HM. If Yes, the worst harmony is replaced
with the new harmony in the HM. Otherwise, go to step 5 
Step 9: 
Determine the optimal capacitor set (best harmony) which gives
maximum power loss reduction and maximum cost saving 
Figure 3 describes the procedures involved in solving the
optimal capacitor placement problem using the HS algorithm and the backward/forward
sweep power flow method in terms of a flowchart.

Fig. 3: 
The HS solution procedure for solving the capacitor placement
problem 
RESULTS
The HS algorithm for solving the capacitor placement problem is applied on the 9 and 34 bus radial distribution systems shown in Fig. 4 and 5, respectively. The load and feeder data for the 9 bus system are as shown in Table 1. The details of the sizes and costs of the capacitors are tabulated as shown in Table 2. Here, the capacitor values are assumed continuous. For the 34 bus test system, the load and line data are shown in Table 3.
A. Results of the 9 bus test system: Results of the 9 bus test system
in terms of capacitor sizes, capacitor locations, power loss and total costs
using the HS algorithm are compared with other optimization techniques using
Particle Swarm Optimization (PSO) (Prakash and Sydulu, 2007),
plant growth simulation algorithm (Srinivasa and Narasimham,
2008), fuzzy logic (Mekhamer et al., 2003),
fuzzy reasoning (Su and Tsai, 1996) and the concept
of ensuring losses reduction (Hamada et al., 2008),
as shown in Table 4. From the optimal capacitor placement
results identified by the HS algorithm, it is shown that the HS algorithm is
better than the other optimization techniques in which the power loss and total
cost is greatly reduced as compared to the other techniques. Figure
6 shows the bus voltage profile before and after capacitor placement using
the HS algorithm. From the figure, it is shown that the bus voltages are improved
after placing the capacitors of various sizes at all the buses using the HS
algorithm.

Fig. 4: 
The 9 bus test system 

Fig. 5: 
The 34 bus test system 
Table 1: 
Load and feeder data of the 9 bus test system 

Table 2: 
Yearly costs of fixed capacitors 

Table 3: 
Load and line data of the 34 bus system 

Table 4: 
Comparison of capacitor placement results of the 9 bus system 

B. Results of the 34 bus test system: Accordingly, Table
5 shows a comparison of the optimal capacitor placement results of the 34
bus system in which the results of the HS algorithm are compared with other
optimization techniques. Figure 7 shows the bus voltage profile
before and after capacitor placement using the HS algorithm for the 34 bus system.
The results in Table 5 show that the proposed HS algorithm
give the greatest reduction in terms of power loss and total costs as compared
to other optimization methods. It is also shown that almost all of the buses
have been selected for capacitor placement in the HS optimization method whereas
only few buses are selected for capacitor placement in the other optimization
methods.
Table 5: 
Comparison of capacitor placement results of the 34 bus system 


Fig. 6: 
Voltage profile improvement on the 9 bus system 
In Fig. 7, it is shown that the voltage magnitudes of the
34 bus system are close to 1 p.u. after placing the capacitors of various sizes
at almost all the buses using the HS algorithm.

Fig. 7: 
Voltage profile improvement on the 34 bus system 
CONCLUSION
The application of HS algorithm as a new metaheuristic optimization method
for determining the optimal location and size of shunt capacitors in a distribution
network has been presented. The backward/forward sweep power flow is also used
to obtain faster power flow solutions. The proposed HS algorithm has been validated
on the 9bus and also 34bus radial distribution systems and the obtained results
showed that the HS optimization method gives greater reduction in power loss
and total costs compared to the other optimization methods.