Optimal Siting and Sizing of Battery Energy Storage Systems for Distribution Network of Distribution System Operators

: In this work, optimal siting and sizing of a battery energy storage system (BESS) in a distribution network with renewable energy sources (RESs) of distribution network operators (DNO) are presented to reduce the e ﬀ ect of RES ﬂuctuations for power generation reliability and quality. The optimal siting and sizing of the BESS are found by minimizing the costs caused by the voltage deviations, power losses, and peak demands in the distribution network for improving the performance of the distribution network. The simulation results of the BESS installation were evaluated in the IEEE 33-bus distribution network. Genetic algorithm (GA) and particle swarm optimization (PSO) were adopted to solve this optimization problem, and the results obtained from these two algorithms were compared. After the BESS installation in the distribution network, the voltage deviations, power losses, and peak demands were reduced when compared to those of the case without BESS installation.


Introduction
Nowadays, renewable energy sources (RESs) have been widely connected to distribution networks according to the advantage of electricity generation from RESs, which is clean energy, to respond to the high increasing demand in electrical power. However, RESs also consist of a major drawback, which is a fluctuation of power generation, due to the uncertainty of natural sources that cannot be controlled, causing an imbalance between the supply and demand of electrical power. As a result, electrical power flows in a reverse way and power loss occurs in distribution networks [1][2][3][4], especially the connection of privately-owned RESs to the distribution network systems of distribution network operators (DNO). Owners of RES companies usually sell electrical energy to the distribution networks based on electricity generation depending on the natural sources at that time. In particular, photovoltaics (PVs) can generate electricity only during the daytime, which is an example of the above-mentioned problem.
The important factors for a distribution network is the reliability of the power system and that the power quality meets the standards. Therefore, energy storage systems (ESSs) have an important role and have been used in distribution networks with the connected RESs to overcome the drawbacks of RES. Additionally, the ESS can balance the electrical power supply and demands [5], improve voltage deviation [6,7], reduce power loss [8][9][10][11], reduce peak demand by storing electrical energy during an 1.
The optimal siting and sizing of a BESS in distribution networks with the connected RESs can be provided when the objective function is to minimize the costs incurred in distribution networks that comprise of the costs of voltage deviation, power loss, and peak demand.

2.
A performance comparison between the genetic algorithm (GA) and particle swarm optimization (PSO) was undertaken to verify the simulation results and choose the appropriate algorithm.

Battery Energy Storage Systems Formulation
ESS technology can store electrical energy in several forms. For instance, electrical energy can be stored in the mechanical form such as pumped hydro, compressed air and flywheel; in the electromagnetic form such as a supercapacitor; in the thermal form such as steam accumulator, molten salt storage, and liquid nitrogen engine; and in the electrochemical form such as flow battery, rechargeable battery, and ultra-battery. The selection of each ESS technology depends on the purpose and physical suitability. In this work, the BESS was chosen to be installed in the distribution network with RESs, and the operation of the BESS was simulated by using the Fourier series.

Battery Energy Storage Systems (BESSs)
Various types of BESSs such as lead-acid, UltraBattery, NaS, Li-ion, Ni-Cd, and vanadium redox batteries have been widely used for storing electrical energy [28][29][30][31]. Li-ion batteries are more popularly used to store electrical energy in many countries such as Germany [32]. Additionally, the price of Li-ion batteries has tended to decrease due to the development of their use in electric vehicles (EVs) [33]. The important characteristics of Li-ion batteries are their high capacity and energy per volume, fast charge and discharge, and low self-discharge rate. From the characteristics of the Li-ion battery above-mentioned, it requires less installation space, has a rapid response to supply or store the electrical energy, and has low energy loss rate from self-discharging. Therefore, this work applied a Li-ion battery as the BESS.
Several factors affecting the lifespan of a Li-ion battery that should be considered include the temperature, number of duty cycles of the battery, and depth of discharge (DOD). Therefore, for a long life Li-ion battery, good heat dissipation is required where the optimum temperature for the Li-ion battery is around 15-35 • C. Frequent charging and discharging should be avoided, and the a suitable value of DOD is 80% of the total capacity of the battery. Charging or discharging rates should not be too high because the higher charging or discharging rates cause a higher battery temperature, which results in the short lifespan of the battery [34]. In addition, the imbalance charging of each battery cell of the BESS due to the initial unequal state of charge (SOC), which is defined by the battery's present amount of charge divided by its rated charge capacity, may cause some damage to the BESS, a capacity reduction of the BESS, and the deterioration of the BESS. However, this can be avoided by using battery charge equalization systems (BCEs) [35].

Battery Energy Storage System Simulation
The BESS simulation presented in this work considered the rates of charge or discharge of the BESS at equal intervals within the considered period of 24 h. These 24 h can be equally divided such as 1 h, 30 min, or 15 min, which can obtain the rate of charge or discharge of BESS at m values including 24, 48, and 96, respectively. Therefore, the rates of charge and discharge in the considered period (C iT ) can be formulated as the following equation.
To find the values of E B (t) at each time t, the Fourier series is applied to express the state of energy (SOE) in the total considered intervals. The state of energy of the BESS can be obtained by substituting the Fourier coefficient (C iF ) from Equation (2) into Equation (3) to find the values of E B (t).
where a 0 , a n , b n , n, and T are the constant Fourier coefficient, Fourier cosine coefficients, Fourier sine coefficients, the number of Fourier coefficients (set to 8 [14]), and total period, respectively. The constant Fourier coefficient (a 0 ) does not affect the charge or discharge power of BESS due to its constant value. It can be added after calculating the Fourier coefficients (C iF ) to ensure that the SOE of BESS is not negative or lower than the minimum depth of discharge (DOD min ).
To compute the rate of charge and discharge from the SOE of BESS (E B (t)) at each time t, Equations (4)-(6) are calculated. Suppose P B (t) is the charge rate or discharge rate at time t. The positive value of P B (t) means the BESS is charging while a negative value means the BESS is discharging.
where η c = η d = √ η bat , η bat = 0.9 (the total efficiency of the BESS), P B , ∆t are battery charging efficiency, battery discharging efficiency, battery round trip cycling efficiency, battery power (MW), and sampling time interval, respectively.
The optimal size of the BESS can be found by Equation (7).
where DOD max = 0.8 is the maximum depth of discharge value; and E max B and E min B are the maximum and minimum battery energy values, respectively. The unit of the energy capacity of the BESS depends on the unit of E max B and E min B . Generally, each round of battery discharge where the energy discharging is equal to the battery capacity is called one operation cycle of a battery. However, to simply calculate the battery cycle, the summation of both charging and discharging energies for all considered time intervals are included, and its average value is instead computed by dividing by 2 (charging and discharging) as in Equation (8) [14]. The lifespan of the BESS can then be evaluated from Equation (9) [14].
where Cycles is the daily cycles of BESS; CycleLife = 3221 is the nominal cycles life of the Li-ion battery [34]; D = 365 is the number of operating days of BESS; and Lifespan is the lifespan of the BESS (years).

Problem Formulation
The installation of the BESS in distribution networks with RESs can improve the efficiency, reliability, and power quality of the distribution networks. The considered objective functions to be minimized include voltage deviation, power loss, and peak demand for providing the optimal siting and sizing of thee BESS under the constraints of distribution networks.

Objective Functions
The major objective function of this work was to minimize several costs incurred in distribution networks (C system ) consisting of voltage regulation cost (C VR ), power loss cost (C Loss ), and peak demand cost (C P ) in terms of infrastructure development deferrals. Equation (10) represents the objective function and several costs can be found by Equations (11)- (14).
where N, V i , V ref , M, LineLoss, P max , γ VR , γ loss , and γ P are total bus number, voltage magnitude (per unit) at the ith bus, reference voltage which is equal to 1 p.u., total branch number, active power loss in each branch, maximum active power at slack bus over the considered period, rate of voltage regulation cost, rate of power loss cost, and rate of peak demand cost (γ VR = 0.142 $/p.u. [15], γ loss = 0.284 $/kWh [14], γ P = 200 $/kWh/year [14]), respectively.

Constraints
(1) Voltage Constraint: Voltage of each bus must be limited within the lower and upper limit throughout the consideration period set at ±5% of the reference voltage as the expressed equation.
where V lower and V upper are the lower bound and upper bound of voltage at ith bus, respectively, and V t i is the voltage magnitude at ith bus in time t.
(2) Battery Constraint: The power and capacity of the battery are bounded to ensure that the battery operation does not exceed the boundary limits during charging or discharging, which can be presented as the equation below.
where P B−min , P B−max are the minimum and maximum power of BESS, respectively. P t cha , P t dis are the power charge rate and power discharge rate of BESS at time t, respectively. E B−min , E B−max are the minimum and maximum capacity of BESS, respectively.

Methodology
The optimal siting and sizing of the BESS in distribution networks with RESs are presented in this work. The simulation of distribution networks was conducted in MATLAB and MATPOWER was also adopted. For the optimization process, genetic algorithm (GA) and particle swarm optimization (PSO) were both applied to find the minimum value of the objective function for finding the optimal siting and sizing of BESS and the performance of these algorithms were compared.

Test System
The distribution network used to evaluate the optimal siting and sizing of the BESS was the IEEE 33-bus distribution network shown in Figure 1, and the detailed data can be obtained from [14]. The values of load power at each bus can be obtained from the voltage magnitude at each bus (in per unit) without any RES connection according to Equations (18) and (19).
where P L−i , Q L−i are the active power and reactive power at the ith bus, respectively. P 0i , Q 0i are the initial active power and reactive power at the ith bus, respectively, a p + b p + c p = 1, a q + b q + c q = 1, base voltage (V base ) = 12.66 kV, base power (MVA base ) = 10 MVA. The two types of RESs, wind turbines (WTs) and photovoltaics (PVs), were connected in the distribution network. Two WTs (1 MW) were each located at buses 18 and 24, three PVs (400 kVA) each were installed at buses 5, 21, and 31, and four PVs (500 kVA) each were installed at buses 8, 12, 28, and 33. In this test system, the parameters were set as a p = a q = 0.4, b p = b q = 0.3, and c p = c q = 0.3. Peak active and reactive powers of the test system were 3.556 MW and 2.191 MVar, respectively. The detailed data of load magnitude and the output generations of WTs and PVs can be found in [14,21].

Genetic Algorithm (GA)
Genetic algorithm is inspired and operated by mimicking Charles Darwin's evolution method. First, the initial populations are randomly generated, which are binary numbers. Each population has equal binary numbers to the decision variables (nVar) multiplied by the bit number (nBit) assigned for each decision variable. The binary numbers for each population are then converted to decimal numbers. Following this, the decimal numbers are compared with the range of each decision variable (lb, ub) to obtain the real values for each decision variable and then substituting them to find the objective function. After that, three main steps comprising of population selection, cross over, and mutation are considered. In the first step, two populations are randomly selected from the parents' generation, and the cross over is operated between the selected populations in step two where the number of cross over is according to the cross over percentage (pc). In the last step, the mutation is proceeded based on the mutation rate (mu), and binary numbers are converted to decimal numbers to evaluate the objective function. The best fitness value is updated until the max iteration (iter max ) is reached [36].

Particle Swarm Optimization (PSO)
Particle swarm optimization is inspired by the behavior of bird flocking and fish schooling [36]. Initially, the particles are generated with random positions and zero velocity, and the objective function is then evaluated. In the next step, the best positions of each particle, which is called the personal best position (P Pbest (i)), are updated and the best position among all particles, which is called the global best position, is updated (P Gbest ). The velocity and position of each particle can be updated according to the P Pbest (i) and the P Gbest by the following equations.
where V P(i) is the velocity of the ith particle; P(i) is the current position of the ith particle; P Pbest (i) is the personal best position of the ith particle; P Gbest is the global best position among all particles; P(i) new is the updated position of the ith particle, w = 0.9 − (((0.9 − 0.4) * it)/iter max ); it is the itth iteration; c 1 = c 2 = 2 and r 1 , r 2 are random numbers randomly generated between 0 and 1.

Application of the Optimal Siting and Sizing of the Battery Energy Storage System (BESS)
The application of the optimal siting and sizing of BESS in this work consisted of the following steps.

1.
Define the input data comprising of V rated , R L , X L , PV, WT, and MVA base to simulate the considered distribution network in MATPOWER [37,38], and impose candidate buses to find the best location of the BESS installation.

2.
Initialize parameters of the algorithm (GA or PSO) and Fourier coefficients, where lb and ub of the Fourier coefficients are proportionally reduced with the rate 1/n 2 [39] (n is the number of Fourier coefficients).

3.
Choose one candidate bus as the location of the BESS installation.

4.
Operate the algorithm (as in Section 4.2 for GA or Section 4.3 for PSO) to solve the optimization problem.

5.
Conduct power flow where the BESS is installed at one candidate bus. 6.
Evaluate the objective function and update the best solution. 7.
If the maximum iteration is reached, go to step 8; otherwise, go to step 4. 8.
Obtain optimal Fourier coefficients where the BESS is installed at the chosen candidate bus from step 3. 9.
If the candidate bus is the last candidate, go to step 10; otherwise, go to step 3. 10. Obtain the optimal siting of the BESS installation, which is the candidate bus providing the minimum value of the objective function.

Provide the information of the BESS by substituting the obtained Fourier coefficients in
Equations (1)- (9).
The flowchart of the optimal siting and sizing of the BESS method is shown in Figure 2.

System Performance Evaluation
To evaluate the system performance after the BESS installation based on the objective function, voltage deviation, power loss, and peak demand were investigated. The details are as follows.

Voltage Deviation Index (VDI)
To evaluate the voltage profile improvement, the VDI was applied to represent the voltage deviation of each case. The VDI compared the voltage level of each bus (V bi in p.u.) with the reference voltage (V ref = 1 p.u.) and is presented in percent (%VDI). The VDI can be calculated by the expressed equations.
where %VDI i is the VDI of the ith bus, and %VDI is the total VDI of the distribution network.

Power losses
Power losses including real, reactive, and apparent power losses of the distribution network were compared in the cases with BESS and without BESS. The following equations are computed.
where P L , Q L , and S L are the active power loss, reactive power loss, and apparent power loss, respectively. l is the number of branches. T is the total period. M is the total number of branches.

Peak Demand Comparison
In this research, the direction of the active power flow at the slack bus of the distribution network was investigated. If the active power flow is positive, the power flows into the distribution network while the negative active power flow represents the power flow flowing out from the distribution network.

Simulation Results
This work aimed to find the optimal siting and sizing of the BESS for a distribution network by minimizing the costs incurred in the distribution network, consisting of voltage regulation costs, costs due to power losses, and peak demand costs within 24 h. The simulation was operated in MATLAB interfaced with MATPOWER 7.0, and the computer specification was an Intel ® Core ™ i3-6100U 2.30 GHz, RAM 8 GB, Windows 10 Pro 64-bit Operating System. GA and PSO were applied to solve the optimization problems, and their performance was compared. The parameters of the algorithms were as follows: population = 60, maximum iterations = 1000, crossover percentage = 50%, and mutation rate = 0.02. The simulation results are provided in the following subsections.

Comparison of the Optimal Siting and Sizing of the BESS Installation
The BESS was chosen to be installed at one bus from the 2nd to 33rd bus to find the best location of the BESS installation providing the minimum objective function value. After the BESS installation simulation, three locations providing the minimum objective function values of the GA and PSO are shown in Table 1. It can be seen that the best location of the BESS installation of both GA and PSO was the 6th bus. The power of the BESS of GA was more than that of PSO of about 0.01 MW while the energy capacity of GA was less than that of PSO at around 0.75 MWh. The lifetime of the BESS of each algorithm was equal to 8.8 years. In addition to obtaining the optimal siting and sizing of the BESS, the appropriate operation of the BESS is also important to consider. From Figure 3a, the state of energy (SOE) of the BESS indicating the stored energy in the BESS for 24 h is illustrated. The power of the BESS is shown in Figure 3b, presenting the charging rate or discharging rate of the BESS at each hour. It was noticeable that from 1 a.m. to 8 a.m., the energy of thee BESS gradually decreased because the BESS was in a discharging state at a low rate, and energy was at the minimum capacity from 8 a.m. to 9 a.m. From 9 a.m. to 6 p.m., the BESS changed status from discharging state to charging state, and during this time, the BESS had a maximum charging rate that was equal to 1.99 MW at 2 p.m. for GA and 1.98 MW at 1 p.m. for PSO. The BESS changed status again from 6 p.m. to 12 p.m. where a maximum discharging rate occurred at 10 p.m. for both GA and PSO that was equal to 1.67 MW for GA and 1.73 MW for PSO.

Comparison of Voltage Deviation and Power Losses before and after the BESS Installation
After the BESS installation at the 6th bus, it was found that the value of %VDI was maximum at the 33rd bus for the base case (without BESS), GA, and PSO at 6.50%, 4.23%, and 4.22%, respectively. The %VDI values of the overall distribution network for all three cases are expressed in Table 2. The BESS installation by using PSO gave the minimum %VDI value, which means that PSO could better improve the voltage profile in the distribution network than those of the base case and GA. In Figure 4, the voltage profiles at the 33rd bus for 24 h for all three cases are presented to show how the voltage profile was improved when the BESS was installed by comparing the performance of GA and PSO to the base case. It was observed that the voltage profile of the distribution network was below the lower limit for the base case while it was improved to be within the constraint after the installation of the BESS for both GA and PSO. For the power losses shown in Table 2, it was noticed that power losses could be significantly reduced after the BESS installation compared to the base case. It could also be noticed that the BESS installation by GA provided the minimum values of active power and apparent power while the reactive power loss obtained from GA was equal to that of PSO. However, the power losses obtained from GA and PSO after the BESS installation were slightly different.

Comparison of Peak Demand
In this work, the peak demand was considered in terms of the active power flowing at the slack bus. The higher peak demand represents the higher power flow in the transmission line, so the transmission line of the distribution network needs to be able to support the high power flow in the transmission line. However, if the peak demand can be reduced, the power flow in the transmission line is also decreased. This results in a longer time to improve the transmission line for supporting the higher peak demand in the future. Figure 5 compares the peak demand provided by the base case and presents how the peak demand can be improved after installing a BESS by using GA and PSO. It can be seen in Figure 5 that power flowed in both directions (into and out from the network) for the base case. The maximum active power that was equal to 2.71 MW at 10 p.m. flows into the network, and the maximum active power which was equal to −1.05 MW at 1 p.m. flowed out from the network. After the BESS installation, the active power flow had only one direction (only positive value), which flowed into the distribution network for all 24 h for both GA and PSO. The maximum active power provided by GA was 1.10 MW at 10 a.m. and 1.04 MW at 7 p.m. for PSO, which is depicted in Figure 5. Thus, the BESS installation by using PSO could reduce the peak demand more than that of the GA.

The Efficiency Comparison between GA and PSO for the Objective Function Optimization
The result comparison of the efficiency for providing the minimum value of the objective function between GA and PSO are shown as the iteration curves in Figure 6. It was observed that during the 0-400 iterations, GA could more quickly find the less objective function value than PSO, but the values were slightly different. After that, the objective value of GA almost remained constant while the objective value of PSO continued decreasing until the 800th iteration before facing a very small decrease until the maximum iteration. At the maximum iteration, PSO could obtain a superior objective value to that of GA, as evident in Table 3. When comparing the number of iterations and the operation time of each algorithm used for the optimization process, it was found that PSO took less time than that of GA, as presented in Table 3. Thus, regarding the overall efficiency for providing the minimum value of the objective function for the considered problem, PSO is more appropriate than GA in terms of both objective value and operation time.  After the simulation of the BESS installation in the IEEE 33-bus distribution network with RES by using GA and PSO, the optimal siting of the BESS installation was the 6th bus obtained by both GA and PSO. The size of the BESS was 1.99 MW power and 14.23 MWh capacity provided by GA and 1.98 MW power and 14.98 MWh capacity provided by PSO. It could be observed that the size of the electric power and electric power capacity of the BESS provided by both algorithms had similar values. Thus, the optimal siting and sizing of the BESS for the distribution networks could be chosen by considering the minimum objective value that PSO can find as a better objective value than that of GA. For the BESS operation, it was noticeable that charging and discharging statuses given by GA and PSO for all 24 h were similar, and the electric powers of charging or discharging provided by GA and PSO were slightly different in each time duration.
After the BESS installation by using GA or PSO, it was found that the voltage level in the system could be improved to be in the range of the constraint (±5%), and the voltage deviation was enhanced compared to the base case. Additionally, power losses including active, reactive, and apparent power losses were significantly decreased when compared with the base case. In terms of the peak demand by considering power flow at the slack bus, it could be seen that after the installation of BESS, the power only flowed into the distribution network (one direction) while the power flowed into and out from the network for the base case. This is because the charging and discharging operations of the BESS could balance between the electricity generation and demand. Therefore, the investment in the distribution network expansion to support the increasing electricity demands in the future can be retarded by using the BESS installation.
To compare the efficiency of GA and PSO to solve the problem, the minimum objective function value and operation time were evaluated. From the simulation results, it was found that PSO could provide better objective value than that of GA. PSO also spent less optimization operation time than that of GA to provide the better final solution at the maximum iteration. Therefore, PSO is more appropriate than GA for solving the problem in this work.

Conclusions
The optimal siting and sizing of BESS in the distribution network with RESs was presented. The objective function considered to be minimized is the total costs incurred in the distribution network consisting of the costs of voltage deviations, power losses, and peak demands. The BESS installation was operated in an IEEE 33-bus distribution network by using the GA and PSO algorithm for optimizing the objective function, and the results received from both algorithms were compared to verify the accuracy. The results provided by both GA and PSO showed that the BESS installation could improve the efficiency of the distribution network in terms of cost minimization, the reduction of voltage deviations, power losses, and peak demand. It can also well support the RES connection that has a fluctuation in electricity generations. It was also found that PSO is more efficient than GA in terms of the objective function optimization for this problem.