*3.4. Particle Swarm Optimization–Butterfly Optimization Algorithm for Maximum Power Point Tracking of Photovoltaic Arrays System*

The input variables are the current *I* and voltage *V* of PV arrays, and the duty cycle *D* is the particle of individuality. Simultaneously, the duty cycle *D* is the output variable, which is controlled by regulating the *MOSFET* switching behavior to achieve the desired on and off states. The flowchart of the PSO-BOA algorithm proposed in this paper is presented in Figure 8. The pseudo-code of the PSO-BOA algorithm in this paper is presented in Algorithm 2 [43].

**Figure 8.** Flowchart of MPPT for PV arrays system based on PSO-BOA algorithm.


When the termination condition is reached, the value of maximum power for the PV array is output; otherwise, the search continues. Additionally, during dynamic local shading, the output of the P-V characteristics also changes. To determine whether the algorithm needs to be restarted by detecting the degree of power change, this article defines the restart condition as shown in Equation (17).

$$
\Delta P = \frac{P\_m^k - P\_m}{P\_m} \tag{17}
$$

where *P<sup>k</sup> <sup>m</sup>* is the effective output power value after local shading changes; *Pm* is the maximum power output value before local shading changes.

#### **4. Simulation Results**

A comparative analysis is performed for the PSO-BOA, PSO, and BOA algorithms proposed in this study in order to assess their effectiveness for MPPT under four different irradiance conditions, namely, standard irradiance conditions, local shading conditions, abrupt alterations for irradiance conditions, and sudden variations for irradiance and temperature conditions. When analyzing scenarios with uniform irradiance, we compared the PSO-BOA algorithm with the P&O, PSO, and BOA algorithms. In this case, the P&O algorithm is configured with a perturbation step size of 0.005. The population size is set to 10, and maximum iteration count is set to 15 for all three algorithms. The basic parameters of these algorithms are presented in Table 3. This study utilizes a boost circuit for the PV array, which was controlled by MPPT, as depicted in Figure 9. In this study, the system uses a PV array comprising five PV panels in series. The parameters of the boost circuit are

designed as follows: *Cpv* = 500 μF, *L* = *0*.85 mH, *C* = 200 μF, *R* = 30 Ω, and the MOSFET frequency is set at 0.1 MHz.

**Table 3.** Parameters of three algorithms.

**Figure 9.** Structure of the MPPT system.
