## 1 Introduction
In [19], DGs and CBs were installed separately and together by using the Bacterial Foraging Optimization Algorithm (BFOA) to minimize power losses. In [20], the Cuckoos Search Algorithm (CSA)--developed based on the breeding behavior of Cuckoos--was used for the allocation of static shunt capacitors in the distribution systems under different loading conditions. On the other hand, there are studies in which DGs and CBs are used together to provide active and reactive power support to power systems. In [21], a Genetic Algorithm (GA) was used to place DGs and CBs to reduce total power loss and enhance voltage profile. In [22], the Water Cycle Algorithm (WCA) was proposed for the optimal placement and sizes of DGs and CBs. It aimed to provide technical, economical, and environmental advantages by using various objective functions (increasing power losses, voltage deviation, energy cost, and gas emissions) with the proposed algorithm. In [23], the Backtracking Search Algorithm (BSA) was used to resolve the integration of DGs and CBs problem. The proposed algorithm results were compared with the GA/PSO, ICA/GA, and AA algorithms in the literature. The power factor is generally assumed to be unity when determining the optimum placement and capacity of DGs. In these circumstances, while only the active power demand of the distribution system is provided, compensation systems such as CBs are needed to provide the reactive power demand. The power factor can be adjusted dynamically by using inverter-based DGs and can inject both active and reactive power into the distribution system [24]. Thus, the total power loss and voltage profile of the distribution systems can be improved without CBs by using less equipment. For this reason, the determination of the optimum power factor of DGs is a very important issue and this issue has not been extensively analyzed in the literature. In this paper, a constrained optimization approach based on the Arithmetic Optimization Algorithm (AOA), a population-based meta-heuristic algorithm, is proposed to find the optimum placement and capacity of DGs and CBs. In addition to the placement and capacity, the optimum power factor of each DG is determined with this constrained optimization approach. AOA, proposed by [PERSON] et al. [25], has a fast convergence rate and presents high-quality solutions compared with the other mentioned optimization algorithms. This algorithm uses basic arithmetic operators (multiplication (M), division (D), subtraction (S), and addition (A)) to determine the optimum global solution. AOA consists of two main phases: exploration and exploitation. Division and multiplication operators are used in the exploration phase. These operators obtain highly distributed decisions or choices. However, they cannot approach the optimal solution smoothly because they have high dispersion. Subtraction and addition operators are used in the exploitation phase. These operators can smoothly approach the optimal solution because they have low dispersion. AOA has been used for various optimization problems such as reconfiguration of distribution systems or specifying the optimum size and location of DG [26], battery energy storage systems [27], electric vehicle charging stations [28], wind turbines, and photovoltaic systems [29]. To the best of the authors' knowledge, the simultaneous use of DGs and CBs has not been previously examined with the proposed algorithm. In addition, it is seen in the literature that the power factor is generally assumed to be unity in optimal allocation applications of DGs. The power factors of inverter-based DGs (e.g., solar systems or wind turbines) can be adjusted by the converters. Thus, both active power and reactive power can be provided in power systems without the need for CBs. As a result, the novelty of the paper is that the optimal placement and capacity of DGs and CBs are determined simultaneously with the proposed algorithm, and the need for CBs is eliminated by determining the optimal power factor in addition to the placement and capacity of DGs.