*2.4. Harmonic Standards for Large-Scale BESS/PVDGs*

Power quality is a power system requirement stipulated in all the international standards governing the grid connection of BESS/PVDG systems. Table 1 shows the IEEE 1547 and IEC 61727 standards as related to the requirements for current harmonics of the grid-connected BESS/PVDG systems [42,54,55]. The total harmonic distortion (THD) of generated current should not exceed 5% limit.

**Table 1.** Current harmonics limits by IEEE 1547 and IEC 61727 standards [54].


During the conversion processes, the total harmonics produced by a BESS/PVDG system are in high quantity, despite that the inverters are parallel connected and multileveled [48,54]. This is a big issue when such inverter outputs are delivered into the distribution network. The current magnitude of many high-power inverters together with their harmonic contents can release large quantities of harmonics into a distribution system. This is because the magnitudes of current harmonics is proportional to the active output power of the BESS/PVDG system [7,31]. The loss of power in BESS/PVDG is mostly due to harmonics produced during the BESS/PVDG power conversions. In this sense, the proper location of BESS/PVDG units in the DN will result in network harmonic reduction due to harmonic cancellation effects. Power losses as a result of harmonics is seen as a very challenging issue worldwide due to technical damage and economic losses it causes. The economic losses related to harmonics have been geometrically growing at a high rate in recent years because of the high penetration of large-scale BESS/PVDGs into the distribution system. Consequently, re-evaluating the existing optimization models and algorithms used in the planning allocation of BESS/PVDGs to determine their effectiveness in curtailing the harmonics produced by the BESS/PVDGs is important, while taking cognizance of the huge amount of technical damage and economic losses occasioned by the harmonics.

#### **3. Framework for Optimizing BESS/PVDGs into Distribution Networks**

BESS/PVDG optimization is the methodological approach for obtaining optimal locations, sizes and times of BESS and PVDG units and installing them in a distribution network under network operating, investment and BESS/PVDG capacity constraints. The sizing and placement of BESS/PVDG units is a highly constrained, complex, nonlinear, mixed-integer and multi-objective optimization problem whose global optimum solution is very hard to find. The optimization of hybrid BESS/PVDGs involves considering contradicting objective functions such as maximising BESS/PVDG capacity and minimising power quality index; complex decision variables such as DG type, size, location and time; constraints such as network harmonic limits, DG voltage limit and power flow constraint; and the required conditions for modelling the uncertainties, especially the intermittency of the constituent distributed units (inaccurate mathematical model) [4,6,56]. Figure 1 provides the framework for optimizing BESS/PVDG into the distribution networks.

#### *3.1. Optimization Objectives*

The BESS/PVDG optimization objective functions can be either a single objective or multi-objective. The common single-objective functions used in the recent research works are minimisation of costs, energy losses, power losses, copper losses, emissions, voltage deviations, total harmonic distortions level (voltage and current); maximisation of benefits, profits, revenue of distribution system, DG capacity, reliability metric; enhancement of voltage profile, voltage stability; etc. The formulation of single-objective optimization problem can be from the perspectives of distribution system operator (DSO), the distribution energy resources developer, etc. [2,4,6,57]. A multi-objective function optimization problem requires the addition or combination of many single objectives that are conflicting and from which a single solution obtained may not be able to solve all the different objectives. The multi-objective function optimization involves simultaneous minimisation or maximisation of decision variables to obtain a single-objective formulation.

#### *3.2. Decision Variables for BESS/PVDG Optimization*

The decision variables are the unknown design variables that are determined during BESS/PVDG optimization procedures. The BESS/PVDG decision variables are formed from one or an amalgamation of size, location, number of DG, DG type, generated power of DG, installation year, real power and reactive power of DG or storage device, bus voltage angle and bus voltage magnitude [2,4,6]. The bus voltage angle and magnitude are the variables used for the decisions on the stability and power quality of the network.

#### *3.3. Constraints for BESS/PVDG Optimization*

Constraints are used in DG optimization problems to impose restrictions on some decision variables during the optimization of the objective function. Some of the commonly applied constraints in the formulation of DG allocation problems are as grouped [2,4,57].

#### 3.3.1. Investment Constraints

They are constraints enforced on investment variables. Investment constraints can take on continuous, discrete or binary values. For example, the inequality constraints imposed on budget limit, divestment and investment options.

#### 3.3.2. Safety Constraints

These are constraints to guarantee network and people's safety. Examples are the inequality constraints imposed for right of way in the installation of DG units, etc.

#### 3.3.3. Technical Constraints

These are the power generation, network power flow and reliability constraints. These guarantee constant and continuous generation, transmission and distribution of power to the consumers. Some of the technical constraints are:


### 3.3.4. Network Stability Constraints

Network stability constraints are imposed on the system to ensure power system stability. They are the constraints imposed on voltage drop, bus voltage magnitude, voltage angle, etc. The network stability constraints are formulated based on two network variables—voltage magnitude and voltage angle.

• The voltage magnitude constraints are imposed in the networks to ensure voltage stability. Inappropriate voltage magnitude could lead to voltage instabilities in power systems and cause damage to customers' devices, equipment and apparatuses.

$$\mathbf{V}\_{\mathbf{i}(\min)} \le \mathbf{V}\_{\mathbf{i}} \le \mathbf{V}\_{\mathbf{i}(\max)} \text{ OR } \Delta \mathbf{V}\_{\mathbf{i}(\min)} \le \Delta \mathbf{V}\_{\mathbf{i}} \le \Delta \mathbf{V}\_{\mathbf{i}(\max)}; \mathbf{i} = 1, 2, \dots \text{ n.} \tag{1}$$

The inequality constraint presented in (1) is imposed on all the network buses to enforce voltage stability of the network.

• The phase angle constraints are imposed on the network based on some stability conditions to ensure dynamic stability such as small signal stability of the network. Voltage angle limits are crucial to dynamic stability, as the voltage magnitude is related to voltage stability of the network. Failure to maintain appropriate voltage angle limits can cause enormous dynamic instabilities that can result in total power outage and other serious economic losses. However, almost all the works on distributed generation allocation expansion planning do not utilize voltage angle constraints in the formulation models.

$$
\theta\_{\text{min}} \le |\angle \text{V}\_{\text{i}} - \angle \text{V}\_{\text{j}}| \le \theta\_{\text{max}}; \text{OR } \theta\_{\text{min}} \le \theta\_{\text{ij}} \le \theta\_{\text{max}} \tag{2}
$$

This constraint (2) is imposed on all the network buses to enforce some stability criteria.
