## 1 Introduction  
Electrical power systems consist of three subsystems: generation, transmission, and distribution [1]. Since the distribution systems are the part which is closest to consumers, it is considerably important to transmit electricity with quality and high reliability [2]. In recent years, the increase in the demand for electricity and the growth of electrical power systems have caused the need for both active and reactive power [3]. This demand is substantially supplied by the installation and integration of distributed generations/generators (DGs) and capacitor banks (CBs) into power systems [4]. DGs are generation units that provide active and/or reactive power to the power system, reduce power losses, and energy generation costs, and improve the voltage profile, power quality, and reliability. While DGs can be divided into two groups--conventional and renewable--according to the energy sources, they also can be divided into four groups--micro, small, medium, and large--according to capacity [5]. On the other hand, CBs are units that provide reactive power to power systems, reduce power losses, and increase bus voltages [6]. Although the use of DGs and CBs provides benefits to distribution systems, they can cause some problems. The use of large-scale DGs and CBs can affect the power flow direction, increase power losses, or reduce bus voltages [7]. Therefore, locating the optimal allocation of the DGs and CBs is vitally important. A significant number of optimization methods have been used to determine the optimum placement and sizing of the DGs and CBs [8]. The primary objective is generally to reduce total power loss as well as to enhance voltage stability or reliability. DGs and CBs are used separately in most of the studies, while they are used simultaneously in some studies [9]. Also, DGs are generally used in unity power factor (p.f), while the optimal p.f of DGs is rarely determined [10]. The researchers have suggested different algorithms to optimally place and size the DGs in the distribution systems in the last decade. The authors of [11] suggested a two-stage method to determine the suitable sitting and sizing of DGs for a reduction in total power loss and enhancement of the voltage profile. In [12], the Fireworks Algorithm (FWA) was employed for the placement of optimum DG units in different distribution systems. In [13], the Improved Raven Roosting Optimization (IRRO) algorithm was proposed to identify optimal DGs sitting and sizing; the suggested algorithm was compared with Particle Swarm Optimization (PSO), Grey Wolf Optimizer (GWO), Modified Teaching Learning Based Optimization (MTLBO), and Jaya Algorithm (JAYA). In [14], the Coyote Optimization Algorithm (COA) was used to solve the optimum placement and capacity of DG units' problem; this algorithm was developed to find better solutions and was called the Enhanced Coyote Optimization Algorithm (ECOA). In [15], the problem of optimum placement and capacity of DGs was solved using the Quasi-Oppositional Swine Influenza Model-Based Optimization with Quarantine (QOSIMBO-Q) algorithm, which is a developed version of the SIMBO-Q algorithm. In [16], an analytical approach (AA) that referenced active and reactive power losses was developed to find the placement and capacity of DGs and CBs in power systems under different loading conditions. In [17], the Student Psychology-Based Optimization (SPBO) algorithm was proposed for optimum allocation and capacity of DGs and compared with the Harris Hawks Optimization (HHO) algorithm. Capacitor banks (CBs) are generally utilized to supply reactive power compensation in power systems. Determining the location and capacity of CBs before they are placed in the power system is an important issue and there are many studies on this issue in the literature. In [18], the Gravitational Search Algorithm (GSA) was proposed for optimal capacitor placement, and the suggested algorithm was compared with the Interior Point (IP) algorithm and Simulated Annealing (SA).