3.3.5. Power Quality Constraints

These power quality constraints are imposed to ensure the quality of power integrated into the distribution system. Different power quality indices such as total harmonic distortion (THD), total demand distortion (TDD), displacement power factor (DPF), oscillation power factor (OsPF) and transmission efficiency power factor (TEPF) could be used for power quality evaluation. A single power quality index that represents these indices could be formulated to evaluate the power quality of the distribution systems.


The voltage magnitude constraints of the system can be reformulated and extended to impose constraints on the voltage harmonics of the distribution system during the integration of BESS/PVDG systems.

$$THD\_{\overline{v}} = \frac{\sqrt{\sum\_{h=2}^{\infty} V\_h^2}}{V\_1} \tag{3}$$

$$V\_{h(\min)} \le V\_h \le V\_{h(\max)}; \ h = 1, \dots, N \tag{4}$$

Similarly, the phase angle constraints could be formulated considering some parameters and assumptions that relate phase angle to active power (current) and can be extended to distribution networks if current harmonics are expected to be curtailed.

$$THD\_I = \frac{\sqrt{\sum\_{h=2}^{\infty} I\_h^2}}{I\_1} \tag{5}$$

$$
\theta\_{h(\min)} \le \theta\_h \le \theta\_{h(\max)} \; ; \; h = 1 \; \dots \; N \tag{6}
$$

#### *3.4. Modelling the Uncertainty of BESS/PVDGs*

Modelling the uncertainties of BESS/PVDG units, including BESS and solar PV units, and the uncertainties of loads are very important to obtaining accurate solutions for a BESS/PVDG optimal allocation problem. The uncertain parameters that can be modelled in the planning of an electric power system for accounting the uncertainties in the distribution system are also presented in Figure 3. However, several previous research works place the uncertainties of these resources into consideration in their formulation models. Some of the uncertainties that are being considered and modelled in BESS/PVDG optimization studies include uncertainties of solar irradiance, wind speed, PV modules, wind and solar DG units, uncertainties of fuel, generated power, electricity market price, uncertainty of BESS and uncertainty of loads [1,4,14].

**Figure 3.** Framework for optimizing BESS/PVDG into distribution networks.
