3.1.2. Theory

Figure 6 indicates when some objects dipped into the same liquid and every one attempts to achieve the state of equilibrium. The speed at which each immersed object reaches to the state of equilibrium varies due to its different density and volume. Any object will be in the state of equilibrium when the buoyant force *Fb* is equivalent to the weight (*Wo*) of this object:

$$F\_b = \mathcal{W}\_{o\nu} \tag{38}$$

$$
\rho\_b \upsilon\_b a\_b = \rho\_O \upsilon\_O a\_O \tag{39}
$$

where *ρb* and *ρo* are the density of the liquid and the dipped object, respectively, *vb* and *vo* are the volume of the liquid and the dipped object, respectively, and *ao* and *ab* are the gravity or acceleration of the liquid and the dipped object, respectively. This previous equation can be reorganized as the following:

$$a\_o = \frac{\rho\_b v\_b a\_b}{\rho\_o v\_o} \tag{40}$$

**Figure 6.** Some objects dipped in the same liquid [45].

In the case of presence of another force acting on the object, such as colliding with another adjacent object (*r*), then the state of equilibrium will be:

$$F\_b = \mathcal{W}\_{o\_\ell} \tag{41}$$

$$\mathbf{W}\_b - \mathbf{W}\_r = \mathbf{W}\_{\sigma\prime} \tag{42}$$

$$
\rho\_b \upsilon\_b a\_b - \rho\_r \upsilon\_r a\_r = \rho\_0 \upsilon\_0 a\_0 \tag{43}
$$

### *3.2. Archimedes Optimization Algorithm*

AOA is an algorithm that depends on a population. In this algorithm, the individuals of the population are the dipped objects. Resembling other metaheuristic algorithms that depend on population, AOA likewise initiates search procedure with preliminary population of objects, called candidate solutions, with arbitrary densities, accelerations, and volumes. At this phase, every object is likewise started with its arbitrary situation in liquid. Afterward, assessing the fitness of preliminary population, AOA works in repetitions until the end limit is achieved. After each repetition, AOA modernizes the volume and density for each object. The object's acceleration is modernized based on the state of collision with any other nearby object. Modernizing, density, acceleration and volume define the object's new location. In the following sub-section, the mathematical expression steps for AOA are explained.

### Steps of AOA Algorithm

The mathematical construction for the algorithm of AOA is presented in this subsection. Theoretically, AOA is deemed as a universal algorithm where it involves both exploitation and exploration procedures. The pseudocode of the AOA is indicated in Algorithm 1; it includes the preliminary population of objects, population assessment, and modernizing parameters. Mathematically, the stages of the suggested AOA are indicated as follows:

1 **Preparation** Set the locations of overall objects using (44):

$$lO\_i = lb\_i + rand \text{ (i, }Dim \text{)} \times (ub\_i - lb\_i)\_\prime \text{ } i = \mathbf{1}\_r \mathbf{2}\_\prime \dots \dots \mathbf{N} \tag{44}$$

where *Oi* refers to the ith object from the population that have *N* (search agents) objects. *ubi* and *lbi* are the higher and lower limits of the search scope, respectively. Dim represents the dimension variables.

Set the initial value of density (*den*) and volume (*vo*) for every ith object according to Equations (45) and (46).

$$den\_i = rand(i, Min) \tag{45}$$

$$vol\_i = rand(i, Min) \tag{46}$$

where rand refers to a random number within [0,1]. Finally, set the initial value of ith object acceleration (*acc*) using (47):

$$acc\_{i} = lb\_{i} + rand(i,Dim) \times (ub\_{i} - lb\_{i}) \tag{47}$$

In this step, assess preliminary population and nominate the object that has the best fitness value. Specify, the best location (*xbest*), the best density (*denbest*), the best volume (*vbest*)), and the best acceleration (*accbest*).

2 **Modernize volumes and densities** The volume and the density for every object *i* at the repetition *(t + 1*) is modernized according to (48) and (49):

$$vol\_i^{t+1} = vol\_i^t + rand \times (vol\_{bset} - vol\_i^t) \tag{48}$$

$$den\_{i}^{t+1} = den\_{i}^{t} + rand \times (den\_{bset} - den\_{i}^{t})\tag{49}$$

where *volbset* is the volume correlated to the best object that has been obtained so far, and *rand* is a random number that is distributed uniformly.

3 In the AOA algorithm, the population objects (search agents) are searching for the best promising area in all of the search space by the exploration phase and then searching for the best location (best object) in this promising area by the exploitation phase. *TF* is a factor that is changing with iteration to transfer the algorithm from the exploration phase to the exploitation phase through the simulation time, and can be evaluated as follows:

$$TF = \exp(\frac{t - t\_{\max}}{t\_{\max}}) \tag{50}$$

where the *TF* factor rises progressively with increasing time till up to 1; *tmax* and *t* are the maximum repetitions number and repetition number, respectively. Likewise, density decreasing factor d also supports the proposed AOA on universal to local inspection. It reduces with increasing time according to (51):

$$d^{t+1} = \exp(\frac{t\_{\max} - t}{t\_{\max}}) - (\frac{t}{t\_{\max}}) \tag{51}$$

where *dt* **+ 1** reduces with increasing time that provides the capability to converge in the previously specified promising zone. To guarantee a balance between the exploration and the exploitation in the proposed AOA, this variable must be handled appropriately. The text continues here.

4 Exploration step (colliding among objects happens). If *TF* ≤ 0.5, colliding among objects happens, an arbitrary material (*mr*) must be nominated and the acceleration of for repetition *t* + 1 according to (52) must be modernized:

$$acc\_{i}^{t+1} = \frac{den\_{mr} + vol\_{mr} \times acc\_{mr}}{den\_{i}^{t+1} \times vol\_{i}^{t+1}}\tag{52}$$

where *acci*, *deni*, and *voli* are the acceleration, the density, and the volume of the object *I*, whereas *accmr*, *volmr* and *denmr* are the acceleration, the volume, and the density of arbitrary material. It is significant to indicate that *TF* ≤ 0.5 guarantees exploration through one third of repetitions. Using a value other than 0.5 will affect the behavior of changing from exploration to exploitation steps.

5 Exploitation step (no colliding among objects). If *TF* > 0.5, there is no colliding among objects, modernize the acceleration of the object for repetition **(***t* **+ 1**) according to (53):

$$acc\_{i}^{t+1} = \frac{den\_{best} + vol\_{best} \times acc\_{best}}{den\_{i}^{t+1} \times vol\_{i}^{t+1}}\tag{53}$$

where *accbest* refers to the best object acceleration.

6 Normalize the object acceleration. Normalize the object acceleration to compute the percentage of variation according to (54):

$$acc\_{i \to norm}^{t+1} = \mathfrak{u} \times \frac{acc\_i^{t+1} - acc\_{min}}{acc\_{max} - acc\_{min}} + l \tag{54}$$

where *l* and *u* represent the scope of normalization and put it at 0.1 and 0.9, respectively. The *acct* **+ 1** *i* − *norm* calculates the percentage of the period that every agent will alteration. The value of acceleration will be great when the object is away from the global optimum, which means that the object will be in the exploration stage; other than that, it will be in the exploitation stage. This clarifies how the inspection modifies from the exploration stage to the exploitation stage. In an ordinary case, the factor of acceleration initiates with high value and reduces with increasing time. This aids search agents to move away from local solutions and at the same time transfer towards the global best solution. However, it is significant to state that there may still a small number of search agents that require extra time to stay in the exploration stage than in the normal case. Therefore, the proposed AOA attains the equilibrium between the exploration stage and the exploitation stage.

7 Modernize location If *TF* ≤ 0.5 (exploration stage), the *ith* object's location for following repetition *t* + 1 according to (55)

$$\mathbf{x}\_{i}^{t+1} = \mathbf{x}\_{i}^{t} + \mathbf{C}\_{1} \times rand \times acc\_{i}^{t+1} \mathbf{1}\_{n \text{norm}} \times d \times (\mathbf{x}\_{rand} - \mathbf{x}\_{i}^{t+1}) \tag{55}$$

where *C***1** referes to a constant that equals 2. Other than that, when *TF* > 0.5(exploitation stage), the objects modernize their locations according to (56).

$$\mathbf{x}\_{i}^{t+1} = \mathbf{x}\_{best}^{t} + F \times \mathbf{C}\_{2} \times rand \times acc\_{i}^{t+1} \mathbf{1}\_{norm} \times d \times (T \times \mathbf{x}\_{best} - \mathbf{x}\_{i}^{t}) \tag{56}$$

where *C***2** referes to a constant that equals 6. T rises with increasing time and it is proportional to transfer factor and it is determined according to *T=C3 × TF*. Additionally, it rises with increasing time through the scope [**C3** × 0.3, 1] and it possesses a particular percentage from the best location, at first. It begins with small percentage which causes a huge difference between the best location and the present location; consequently, the random

walk step-size will be big. As the search continues, this percentage will rise progressively to reduce the difference between the best location and the present location. This results in an appropriate equilibrium between the exploration and the exploitation. *F* is the flag to vary the motion direction according to (57):

$$F = \begin{cases} \begin{array}{c} +1 \text{ if } P \le 0.5\\ -1 \text{ if } P > 0.5 \end{array} \end{cases} \tag{57}$$

where **P=2** *× rand − C***4**.

8 Assessment Assess every object exploiting function f and recollect the best solution found yet. Designate *xbest*, *volbest*, *denbest*, and *accbest*.

### **4. Simulation Results and Dissections**

The IEEE 69-bus radial distribution system (RDS) includes 69 buses with a reactive load of 2694.6 kVAr and an active load of 3801.5 kW as shown in Figure 7 [47]. The results are obtained under base values of 12.66 kV and 10 MVA. The used parameters and the system constraints are given in Table 1. This paper studies the optimal allocation of PV alone or with BES in residential, industrial, and commercial system loads.

### *4.1. Residential Load*

In this case, the overall reactive and real load demand during 24 h are 34.43 MVAr and 48.57 MW, respectively. Without integration PV and BES in RDS, the total reactive and real loss during 24 h are 0.85 MVAr and 1.87 MW, respectively. Installing one PV alone in RDS at bus 61 reduces the system loss to 1.39 MW. Additionally, installing two PV alone in RDS at buses 61 and 17 reduces the system loss to 1.35 MW. The total energies of one and two PV alone in RDS during the day are illustrated in Figures 8 and 9. Table 2 illustrates the locations and sizes of PV, the total energy of PV, and the injection energy from PV to the grid. Therefore, installing three PV alone reduces the system loss to 1.34 MW at buses 61, 18, and 11. From Figure 10, the total energy of three PV alone is 15.64 MWh.

From Table 3, simultaneous integration of PV and BES gives better results than integration of PV alone in RDS. Installing one BESS and PV in RDS decreases the system loss to 0.71 MW at bus 61. The energies of PV and BESS during the day by incorporating one PV with BESS in RDS are illustrated in Figures 11 and 12. Installing two and three PV with BES in RDS decrease the system loss to 0.61 MW and 0.59 MW, respectively. The energies of PV and BESS during the day by incorporating two PV with BESS in RDS are illustrated in Figures 13 and 14. Additionally, energies of PV and BESS during the day by incorporating three PV with BESS in RDS are illustrated in Figures 15 and 16. Table 3 illustrates the locations and sizes of PV and BESS, the total energy of PV, the injection energy from PV to the grid, the charging energy from PV to BESS, and the discharging energy from BESS to the grid.

**Figure 7.** IEEE 69-bus RDS.

**Figure 8.** PV output during the day by installing one PV alone in residential system load.

**Figure 9.** PV output during the day by installing two PV alone in residential system load.

**Figure 10.** PV output during the day by installing three PV alone in residential system load.

**Table 3.** The obtained results with and without installing PV with BES in residential system loads.

**Figure 11.** PV output during the day by installing one PV with BES in residential system load.

**Figure 12.** BES output during the day by installing one PV with BES in residential system load.

**Figure 13.** PV output during the day by installing two PV with BES in residential system load.

**Figure 14.** BES output during the day by installing two PV with BES in residential system load.

**Figure 15.** PV output during the day by installing three PV with BES in residential system load.

**Figure 16.** BES output during the day by installing three PV with BES in residential system load.

### *4.2. Industrial Load*

In this case, the overall reactive and real load demand during 24 h are 35.64 MVAr and 50.29 MW, respectively. Without integrating PV and BES in RDS, the total active and reactive power loss during 24 h are 1.89 MW and 0.86 MVAr, respectively. The total system losses are decreased to 1.55 MW, 1.52 MW, and 1.52 MW by integrating one, two, and three PV alone in RDS, respectively. Table 4 presents the locations and sizes of PV, the total energy of PV, the injection energy from PV to the grid and the system power loss. From Figures 17 and 18, the total energies of one and two PV alone during the day are 9.56 MWh and 11.80 MWh, respectively. Additionally, the total energy of three PV alone during the day is 13.35 MWh as shown in Figure 19.

**Table 4.** The obtained results with and without installing PV alone in industrial system loads.

**Figure 17.** PV output during the day by installing one PV alone in industrial system load.

**Figure 18.** PV output during the day by installing two PV alone in industrial system load.

**Figure 19.** PV output during the day by installing three PV alone in industrial system load.

The optimal allocation of one PV with BES in RDS at bus 61 decreases the system loss to 0.72 MW. The total energies of PV and BESS during the day by incorporating one PV with BESS are presented in Figures 20 and 21. The system losses are decreased to 0.62 MW and 0.60 MW by integrating two and three PV with BES in RDS, respectively. Figures 22 and 23 illustrate the energies of PV and BESS during the day by installing two PV with BESS in RDS. Additionally, Figures 24 and 25 illustrate the energies of PV and BESS during the day by installing three PV with BESS in RDS. The total injection energies from PV to BESS and to the grid are presented in Table 5. Additionally, the charging and discharging energies of BESS are presented in Table 5 and Figure 25.

**Figure 20.** PV output during the day by installing one PV with BES in industrial system load.

**Figure 21.** BES output during the day by installing one PV with BES in industrial system load.

**Figure 22.** PV output during the day by installing two PV with BES in industrial system load.

**Figure 23.** BES output during the day by installing two PV with BES in industrial system load.

**Figure 24.** PV output during the day by installing two PV with BES in industrial system load.

**Figure 25.** BES output during the day by installing three PV with BES in industrial system load.

**Table 5.** The obtained results with and without installing PV with BES in industrial system loads.

### *4.3. Commercial Load*

In this case, the overall reactive and real load demand during 24 h are 37.82 MVAr and 53.35 MW, respectively. Without integrating BESS and PV in RDS, the overall reactive and real loss during 24 h are 0.99 MVAr and 2.17 MW, respectively. The system power loss is reduced to 1.12 MW with installing one PV alone at bus 61. The optimal placement and sizing of two PV alone at buses 61 and 17 decreases the system loss to 1.04 MW as shown in Table 6. Additionally, the optimal sizing of three PV alone at buses 61, 18, and 11 with total energy of 22.81 MWh decreases the system loss to 1.02 MW. From Figures 26 and 27, the total energies of one and two PV and three PV alone during the day are presented in Figure 26, Figure 27, and Figure 28, respectively.

**Table 6.** The obtained results with and without installing PV alone in commercial system loads.

**Figure 26.** PV output during the day by installing one PV alone in commercial system load.

**Figure 27.** PV output during the day by installing two PV alone in commercial system load.

**Figure 28.** PV output during the day by installing three PV alone in commercial system load.

Installing one, two, and three PV with BES decreases the system losses to 0.83 MW, 0.71 MW, and 0.69 MW, respectively, as shown in Table 7. The total energy of PV and the charging and discharging energies of BES by integrating one PV with BES in RDS are illustrated in Figures 29 and 30. Figures 31 and 32 show the energies of two PV and the charging and discharging energies of BESS during the day, respectively. By incorporating three PV with BESS, the injection energies from PV to BESS and the grid during the day are shown in Figure 33, and the charging and discharging energies of BESS are shown in Figure 34. The results proved which the presented algorithm is an efficient to obtain the best global results when compared with modified HGSO algorithm and HGSO algorithm. This comparative study is illustrated in Table 8.

**Table 7.** The obtained results with and without installing PV with BES in commercial system loads.

**Figure 29.** PV output during the day by installing one PV with BES in commercial system load.

**Figure 30.** BES output during the day by installing one PV with BES in commercial system load.

**Figure 31.** PV output during the day by installing two PV with BES in commercial system load.

**Figure 32.** BES output during the day by installing two PV with BES in commercial system load.

**Figure 33.** PV output during the day by installing three PV with BES in commercial system load.

**Figure 34.** BES output during the day by installing three PV with BES in commercial system load.

**Table 8.** Comparison results between AOA, Modified HGSO, and HGSO algorithms in commercial system load.

### **5. Conclusions**

In this paper, an application for a recent optimization algorithm called the Archimedes optimization algorithm (AOA) has been proposed for reducing energy losses and to capture the size of incorporating battery energy storage system (BESS) and photovoltaic (PV) energy system in RDS. In this paper, all non-dispatchable PV energy systems have been transformed into a dispatchable energy resource with BESS integration with PV. AOA has been evolved for sizing several PV and BESS considering the changing demand over time and the probability generation. The proposed algorithm has been applied on the IEEE 69-bus distribution network with various daily demand configurations such as residential, industrial, and commercial loads demand. The obtained results demonstrate that the model can boost high penetration of the PV energy system accompanied with effective usage of BESS energy resources, which shows the strength of the presented algorithm for evaluating the best sizing of numerous PV and BESS with a significant reduction in energy losses. In addition, the AOA gives better results compared with other well-known optimization algorithms.

**Author Contributions:** Conceptualization, H.A.-M. and S.K.; data curation, M.T.-V. and E.E.E.; formal analysis, M.M.H.; methodology, M.T.-V. and E.E.E.; software, H.A.-M. and S.K.; supervision, M.M.H. and E.E.E.; validation, H.A.-M. and S.K.; visualization, M.T.-V.; writing—original draft, H.A.-M. and S.K.; writing—review and editing, M.T.-V., M.M.H. and E.E.E. All authors together organized and refined the manuscript in the present form. All authors have read and agreed to the published version of the manuscript.

**Funding:** This work was supported by Taif University Researchers Supporting Project number (TURSP-2020/86): Taif University, Taif, Saudi Arabia.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Conflicts of Interest:** The authors declare no conflict of interest.