2.3.4. Implementation of WOAPSO for Parameter Extraction

Single-Diode Model

Initialize the population of search agents of fifth order dimension in the search space. The fifth order dimension represents the photovoltaic current (Ip), series resistance (Rs), shunt resistance (Rsh), diode saturation current (ISD) and diode ideality factor (a1). The range of these parameters are [0–1, 0.001–0.5, 0–100, 0.01–0.5, 1–2].

Regulate the fitness of all agents in the search space using Equation (3).

Update the position of the agents at every iteration using WOAPSO. The algorithm is designed to work in the minimization mode thus the location of particles that acquire minimum cost represents the optimized parameters of SDM with minimum RMSE.

**Figure 2.** Flowchart of proposed hybrid version of whale optimization and particle swarm optimization WOAPSO algorithm.

Double-Diode Model

Initialize population of search agents of seventh-order dimension in the search space. The seventh-order dimension represents the photovoltaic current (Ip), series resistance (Rs), shunt resistance (Rsh), diode saturation currents (ISD, ISD1), and diode ideality factor (a1, a2). The range of these parameters are [0–1, 0.001–0.5, 0–100, 0.01–0.5, 0.01–0.5, 1–2, 1–2].

Regulate the fitness of all agents in the search space using Equation (4).

Update the position of all agents at every iteration using WOAPSO. The algorithm is designed to work in the minimization mode. Thus, the location of particles having minimum cost represents the parameters of the double-diode model with minimum RMSE.
