*3.4. Implementation of TSA for Parameter Extraction*

Step 1. Initialize the population of search agents of the 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 (*a*). The range of these parameters are [0–10, 0.001–2, 0–2000, 0–50, 0–100].

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

Step 3. Update the position of the agents at every iteration using TSA. The algorithm is designed to work in the minimization mode; thus, the location of the particles that acquire minimum costs represents the optimized parameters of SDM with minimum RMSE.
