A. Solar PV Cell Model

A PV module consists of several solar cells connected in series and in parallel to achieve the desired voltage and current levels. A solar panel cell is essentially a p-n semiconductor junction. When exposed to light, a direct current is generated. For simplicity, the single diode model of Figure 2 is used in this document [37]. This model offers a good compromise between simplicity and precision with the basic structure.

**Figure 2.** Simplified equivalent circuit of solar cell.

The equivalent circuit of the general model consists of a photo current (*Iph*), a diode, a parallel resistance (*Rp*) expressing a leakage current, and a series resistance (*Rs*) due to the contacts between the semiconductors and the metal parts. This equivalent circuit is depicted in Figure 2.

In Figure 2, we apply Kirchhoff's law. The current will be obtained by the following Equation:

$$I = I\_{\rm pl} - I\_D - I\_p \tag{1}$$

where *Iph* the current generated by light or photocurrent and *Ip* the current flowing in the parallel resistor, which can be computed as:

$$I\_p = \frac{V + R\_s I}{R\_p} \tag{2}$$

*ID* is the current of the diode, which is proportional to the saturation current. The following equation expresses the value of this magnitude

$$I\_D = I\_{sd} \left( \exp\left(\frac{q.(V + R\_5.I)}{n.K.T}\right) - 1\right) \tag{3}$$

being *Isd* the reverse saturation current in amperes (A), *q* the electron charge (1.6 × 10-19 C), *K* the Boltzmann constant (1.38 × 10-23 J/K), *T* the cell temperature in Kelvin (K) and *n* the ideal factor.

We replace the voltage-current characteristic equation of a solar cell in Equation (1). So we derive that:

$$I = I\_{\rm ph} - I\_{\rm sd} \left( \exp\left(\frac{q.(V + R\_s.I)}{n.K.T}\right) - 1\right) - \frac{V + R\_s I}{R\_p} \tag{4}$$

The photocurrent depends mainly on the solar radiation and the operating temperature of the cell, which is described by the following Equation:

$$I\_{\rm pl} = \left[ I\_{\rm sc} + K\_i \left( T - T\_{\rm ref} \right) \right] \frac{G}{G\_{\rm ref}} \tag{5}$$

where:

*Isc*: is the short-circuit current of the cell at 25 ◦C and 1000 W/m2

*Ki*: the temperature coefficient of the cell short-circuit current,

*Tref*: is the reference temperature of the cell, in Kelvin (K) (=25 ◦C + 273),

*G*: is the solar radiation in watt/square meter (W/m2),

*Gref*: is the reference insolation of the cell (=1000 W/m2),

On the other hand, the cell saturation current varies with the temperature of the cell, which is described as follows:

$$I\_{sd} = I\_{rs} \left(\frac{T}{T\_{ref}}\right)^3 .exp\left(\frac{q.E\_\text{g}\left(\frac{1}{T\_{ref}} - \frac{1}{T}\right)}{K.n}\right) \tag{6}$$

being:

*Irs*: the reverse saturation current of the PV cell

*Eg*: is the gap energy of the semiconductor used in the PV cell in electron-volt (eV) *n*: is the ideal factor, which depends on the PV technology listed in Table 1.



The reverse saturation current is given by the following Equation (7):

$$I\_{rs} = \frac{I\_{\text{sc}}}{\exp\left(\frac{q\_\cdot V\_\text{oc}}{N\_\bullet \cdot n.K.T}\right) - 1} \tag{7}$$

### B. Solar PV Module Model

A typical PV cell produces less than 2 W at about 0.5 V so that cells must be connected in series-parallel on a module to produce enough power [38]. A PV array, like presented in Figure 3, is a group of several PV modules electrically connected in series (*Ns* cells) and in parallel (*Np* columns) to generate the required current and voltage.

**Figure 3.** A general model of a Photovoltaic Module.

The voltage-current characteristic equation of a PV module becomes as follows:

$$I = N\_{\rm p.} I\_{\rm ph} - N\_{\rm p.} I\_{\rm sd} \left[ \exp\left(\frac{q\left(\frac{V p \upsilon}{N\_s} + \frac{I.R\_s}{N\_p}\right)}{K.T.n}\right) - 1\right] - \frac{\left(\frac{N\_{\rm p.} V p \upsilon}{N\_s} + I.R\_s\right)}{R\_p} \tag{8}$$

The following Table 2 gives the parameters of the PV module used in this work.


**Table 2.** Characteristics of PV Module "Tata Power Solar Systems TP250MBZ".

Figure 4 shows the proposed block diagram of the PV system. In this model. We include the intelligent MPPT algorithm (based on GWO and PSO), which will be described in Sections 3 and 4. The proposed algorithms aim to compensate for the limitations of conventional maximization algorithms, which cannot find the overall maximum, especially during a partial shading phenomenon. Regardless of the partial shading profile, it can find the maximum power point on the power-voltage characteristic (*Ppv*) of a photovoltaic system. This characteristic is usually referred to as *Ppv* =f(*Vpv*). The algorithm is applied to the semiconductor switch of the boost converter installed to connect the PV panels to the DC-link. Specifically, the duty cycle of this device is adjusted according to the output of the Intelligent MPPT algorithm. In our implementation, *Vout* is the voltage that will be used for feeding the battery with the required power for its charge.

**Figure 4.** Block diagram of a PV system using an intelligent MPPT algorithm.

### **3. Optimization Algorithms**

This paper focuses on two swarm-intelligence based algorithms. Specifically, they are the Particle Swarm Optimization and the Grey-Wolf Optimization algorithms. They have been selected for this PV system due to its demonstrated capability to adjust power converters.

### A. The PSO algorithm

This algorithm was one of the solutions that was used for resolving a huge mathematical optimization problem. It is classified as an evolutionary metaheuristic that belongs to the larger class of evolutionary algorithms.

It was exposed by Russel Eberhart (electrical engineer) and James Kennedy (sociopsychologist) in 1995 [39]. It was originally inspired by the social behavior of animals evolving in swarms, such as schools of fish and flight groups of birds. We can see highly complex movement dynamics in these organisms, despite the fact that each individual has minimal intelligence and only local knowledge of his place in the swarm. [40]. Therefore, local information and the memory of each individual are used to decide their displacement. Simple rules, such as "stay close to another candidate", "go in the same direction, "or" to go at the same speed, "are sufficient to maintain the cohesion of the swarm and allow the implementation of complex adaptative collective behaviors [26].

The particle swarm is a population of simple agents called particles. Each particle is considered as a solution to the problem, where it has a position and a speed. In addition, each particle has a memory allowing it to remember its best performance and the best performance achieved by "neighboring" particles (informants). In addition, each particle has a group of informants, historically called its neighborhood [41,42]. A swarm of particles, which are potential solutions to the optimization problem, will look for the global optimum with their movements.

The following three components that influence the movement of a particle are:


The strategy for moving a particle is shown in Figure 5, where the three previous trends are illustrated.

**Figure 5.** Displacement of a particle in the PSO algorithm.

In an *N*-dimensional search space, particle *i* of the swarm is modeled by its position vector <sup>→</sup> *<sup>x</sup> <sup>i</sup>* <sup>=</sup> (*xi*1, *xi*2,..., *xiN*) and by its speed vector <sup>→</sup> *v <sup>i</sup>* = (*vi*1, *vi*2,..., *viN*). The value of the objective function determines the quality of its position at this point. The particle keeps in memory the best position through which it has ever passed, which we denote by <sup>→</sup> *Pbest*\_*i*(*pbest*\_*i*1, *pbest*\_*i*2,..., *pbest*\_*iN*). The best position reached by the particles of the

swarm is denoted by <sup>→</sup> *Gbest* = (*gbest*\_1, *gbest*\_2,..., *gbest*\_*N*).

At the start of the algorithm, the swarm particles are randomly initialized in the search space of the problem. Then, at each iteration, each particle moves, linearly combining the three components mentioned above. Indeed, at iteration *t* + 1, the speed vector and the position vector are calculated from Equations (9) and (10), respectively, as follows:

$$
\omega v\_{i,j}^{t+1} = \omega v\_{i,j}^t + c\_1 r\_{1,t}^t \left[ p\_{\text{best}\_{i,j}^t} - \boldsymbol{\chi}\_{i,j}^t \right] + c\_2 r\_{2i,j}^t \left[ g\_{\text{best}\_j^t} - \boldsymbol{\chi}\_{i,j}^t \right] \tag{9}
$$

$$\mathbf{x}\_{i,j}^{t+1} = \mathbf{x}\_{i,j}^{t} + v\_{i,j}^{t+1} \quad j \in \{1, 2, \dots, N\} \tag{10}$$

where ω is a constant, called the coefficient of inertia; c1 and c2 are two constants, called acceleration coefficients; r1 and r2 are two random numbers drawn uniformly in the interval [0 1], at each iteration *t* and for each dimension *j*.

The three components mentioned above (i.e., inertia, cognitive and social) are represented in Equation (9) by the following terms:

*ωv<sup>t</sup> <sup>i</sup>*,*<sup>j</sup>* corresponds to the inertia component of the displacement, where the parameter ω controls the influence of the direction of displacement on the future movement.

*c*1*r<sup>t</sup>* 1,*t pbest<sup>t</sup> <sup>i</sup>*,*<sup>j</sup>* − *<sup>x</sup><sup>t</sup> i*,*j* corresponds to the cognitive component of the displacement, where the parameter c1 controls the cognitive behavior of the particle.

*c*2*r<sup>t</sup>* 2*i*,*j gbest<sup>t</sup> <sup>j</sup>* − *<sup>x</sup><sup>t</sup> i*,*j* corresponds to the social component of the displacement, where the parameter c2 controls the social aptitude of the particle.

Once the particles have moved, the new positions are evaluated. The two vectors *Pbest*\_*<sup>i</sup>* and *Gbest* are updated, at iteration *t* + 1, according to the two Equations (11) and (12). This procedure is presented in Algorithm 1, where *M* is the number of particles in the swarm.

$$
\stackrel{\rightarrow}{P}\_{\text{best\\_}}(t+1) = \begin{cases}
\stackrel{\rightarrow}{P}\_{\text{best\\_}}(t)\_{\text{\\_}} \text{if} f\left(\stackrel{\rightarrow}{\mathbf{x}}\_{i}(t+1)\right) \ge \stackrel{\rightarrow}{P}\_{\text{best\\_}}(t) \\
\stackrel{\rightarrow}{\mathbf{x}}\_{i}(t+1)\_{\text{\\_}} \text{if} f\left(\stackrel{\rightarrow}{\mathbf{x}}\_{i}(t+1)\right) < \stackrel{\rightarrow}{P}\_{\text{best\\_}}(t)
\end{cases} \tag{11}
$$

$$\stackrel{\rightarrow}{G}\_{\text{best}}(t+1) = \arg\min\_{P\_{\text{best}},j} f\left(\stackrel{\rightarrow}{P}\_{\text{best},j}(t+1)\right), \; 1 \le i \le M \tag{12}$$

The corresponding flowchart that describes this organization can be found in Figure 6 and explained as follows:

### **Algorithm 1.** The procedure of corresponding flowchart


**Figure 6.** Hierarchical levels of grey wolves and their tasks.

### B. The GWO Algorithm

Similarly to the particle swarm Optimization algorithm, one of the new algorithms, which are based on the metaheuristic principle is the Grey Wolf Optimization GWO algorithm. The researcher, Mirjalili, was one of the first researchers who developed this algorithm and exposed its running principle in 2014 [32,43]. To obtain the optimum solution of the problem to be optimized, the algorithm principle uses social authority, which is represented by the behaviour of the wolves when surrounding a victim. During the operation of hunting for the victim, this algorithm simulates the hierarchical supremacy of grey wolves until their movements end. It works in a similar way to population-based algorithms in which it simulates the natural behavior of grey wolves foraging for food in their social lives. Four types of grey wolf groups can be used to compose hierarchical commands. Figure 6 shows this hierarchy, with the following three levels:


The hunting process of the wolf pack involves three main steps: chasing, surrounding the prey, and attacking the prey. The algorithm starts with a given number of grey wolves with their positions generated arbitrarily.

The following equations determine the encircling behavior of each group of the pack:

$$\stackrel{\rightarrow}{D} = \left| \stackrel{\rightarrow}{C} \stackrel{\rightarrow}{X}\_p(t) - \stackrel{\rightarrow}{X}(t) \right| \tag{13}$$

$$
\stackrel{\rightarrow}{X}(t+1) = \left| \stackrel{\rightarrow}{X}\_p(t) - \stackrel{\rightarrow}{A}\stackrel{\rightarrow}{D} \right| \tag{14}
$$

where <sup>→</sup> *<sup>X</sup>*(*t*) is the vector position of the grey wolf, <sup>→</sup> *Xp*(*t*) is the vector prey position and <sup>→</sup> *A* and <sup>→</sup> *C* are the vectors gives by the following Equations:

$$\begin{cases} \stackrel{\rightarrow}{A} = 2.\stackrel{\rightarrow}{a}\stackrel{\rightarrow}{r}\_1 - \stackrel{\rightarrow}{a} \\ \stackrel{\rightarrow}{C} = 2.\stackrel{\rightarrow}{r}\_2 \end{cases} \text{ with } \colon \ a = 2.\left(1 - \frac{t}{T\_{\text{max}}}\right) \tag{15}$$

being *t* the current iteration, *Tmax* the total number of iterations and *r*<sup>1</sup> and *r*<sup>2</sup> are random vectors chosen in the interval [0,1].

The prey position *Xp (t + 1)* update is calculated by averaging the positions of grey wolves α, β and Δ (three temporarily optimal solutions). The following average function is used for this purpose

$$
\stackrel{\rightarrow}{X}\_{P}(t+1) = \frac{\stackrel{\rightarrow}{X}\_{1}(t) + \stackrel{\rightarrow}{X}\_{2}(t) + \stackrel{\rightarrow}{X}\_{3}(t)}{3} \tag{16}
$$

where:

$$\begin{Bmatrix} \stackrel{\rightarrow}{X}\_{1}(t) = \stackrel{\rightarrow}{X}\_{\mathfrak{a}}(t) - \stackrel{\rightarrow}{A}\_{1}\stackrel{\rightarrow}{D}\_{\mathfrak{a}} \\ \stackrel{\rightarrow}{X}\_{2}(t) = \stackrel{\rightarrow}{X}\_{\mathfrak{f}}(t) - \stackrel{\leftarrow}{A}\_{2}\stackrel{\rightarrow}{D}\_{\mathfrak{f}} \end{Bmatrix} \text{ and } \begin{Bmatrix} \stackrel{\rightarrow}{D}\_{\mathfrak{a}} = \stackrel{\rightarrow}{\mathbb{C}}\_{1}\stackrel{\rightarrow}{X}\_{\mathfrak{a}}(t) - \stackrel{\rightarrow}{\mathcal{X}}(t) \\ \stackrel{\rightarrow}{D}\_{\mathfrak{f}} = \stackrel{\rightarrow}{\mathcal{C}}\_{2}\stackrel{\rightarrow}{X}\_{\mathfrak{f}}(t) - \stackrel{\rightarrow}{\mathcal{X}}(t) \\ \stackrel{\rightarrow}{D}\_{\mathfrak{A}}(t) = \stackrel{\rightarrow}{X}\_{\mathfrak{A}}(t) - \stackrel{\rightarrow}{A}\_{3}\stackrel{\rightarrow}{D}\_{\mathfrak{A}} \end{Bmatrix}$$

Equation (13) represents the distance from the current position, which should be minimized as much as possible so that the next position represented by Equation (14) gets closer and closer to the position of the prey. This will imply that the algorithm will get to the correct solution of the problem *XP(t)*.

The parameter "*a*" used in this algorithm decreases linearly in the interval [2,0] for the successive iterations using Equation (15). Thus, it will model the behavior of the wolves when approaching the victim (exploration phase). For this phase, if the condition |A|< 1 is verified, the wolves attack the victim.

The alpha group are said to have the best possible knowledge of the location of prey. Once the position of the prey is determined, the hunt will be guided by the alpha group followed by the beta and delta wolves. The latter two groups participate in the hunt occasionally. The rest of the group is limited to take care of the injured wolves of the pack. When the prey stops moving, the wolves attack and finish the hunt [43].

The flowchart of this algorithm is illustrated in Figure 7.

**Figure 7.** PSO and GWO algorithms flowchart.

### C. The PSO and GWO MPPT controllers

To apply the previous evolutionary algorithms, we need to define the functions and parameters for the proposed problem. The objective is to maximize the energy extraction from the PV cells installed on EVs, even when there are shadowing areas involved in the scenario to consider.

For the PSO algorithm, the function to optimize is expressed in Equation (17).

$$\max(Ppv) = f\left(x\_{i,j\prime}^t \ v\_{i,j}^{t+1}\right) \tag{17}$$

In the GWO, each wolf position corresponds to the duty cycle factor applied on the MPPT. Thus, the *Gmax* represents the global best position of all of the wolves and *Pmax* is the corresponding best position of the corresponding wolf. If no partial shading exists, the global best wolf best position and the local wolf best position will be the same. However, for the partial shading case, there is several (*Pmax*) wolf best positions, and the global best position (*Gmax*) will be related to the max of the best wolf position *Gmax = max (Pmax)*.

The proposed GWO algorithm aims to compensate for the limitations of conventional maximization algorithms, which cannot find the overall maximum, especially during a partial shading phenomenon. Regardless of the partial shading profile, this algorithm can find the maximum power point on the power-voltage characteristic of a photovoltaic system. Towards this goal, the objective function for this algorithm is defined as it is in Equation (18).

$$\max(Ppv) = f(\alpha, \otimes, \Delta, \omega) \tag{18}$$

The proposed MPPT algorithm is based on the application of GWO to control the duty cycle. The expected consequence is that this will turn into decreasing the steady-state oscillations presented by the conventional MPP tracking algorithms. Consequently, the power loss due to oscillation is reduced, which increases the photovoltaic system efficiency.

For the implementation of GWO MPPT algorithm, duty cycle *d* is defined as a grey wolf. Therefore, the Equation (14) can be rewritten as follows:

$$d\_i(k+1) = d\_i(k) - A.d\tag{19}$$

The fitness function of the GWO algorithm is formulated to have the objective of function 20. It is for the two optimization algorithms.

$$P\left(d\_j^k\right) > P\left(d\_j^{k-1}\right) \tag{20}$$

where P represents the PV power, *d* is the duty cycle of the boost converter, *j* is the current grey wolves number, and *k* is the iteration number.

The flowchart and the parameters of the PSO and GWO MPPT algorithms are detailed in Figure 7 and Table 3, respectively.


**Table 3.** Parameter of the PSO and GWO MPPT algorithms.

The choice of these parameters was fixed after several online simulation tests, where the goal is to find the best combination in terms of the algorithm running speed and the best performances. Specifically, we have varied the number of particles/wolves and the maximum number of iterations. The first test had the configuration of 150 iterations and 10 particles. The corresponding simulation time was evaluated to 30 min when using an I5 laptop with 8-GB as RAM memory. The resulting performances were found perfect. The second configuration was fixed to 50 iteration and 8 particles, and then the corresponding simulation time was evaluated to 24 min, but the resulting energetic performances were not so good. There were some problems with the stability of the output power.

Many other tests (more than 5 combinations) were also applied, and the best combination was found as it is indicated in Table 3. For the selected configuration, the simulation time was 26 min, and we get a good performance in terms of extracted power and stability.

### **4. Implementation and Simulation Results**

The algorithms previously studied are applied to a PV system composed of 4 photovoltaic modules. They are connected in a combination of serial and parallel cells and the

characteristics are given in Table 2. Considering the size of the PV modules, this system could be implemented in electric vehicle application or even an isolated grid for feeding some isolating area using a solar energy. Some recharge stations can also benefit from this solution and the proposed method can improve energy yield.

The simulation bloc can be illustrated as it is Figure 8, all the PV cells are connected to the DC bus, which can give information about the global voltage and current, in relation to the solar radiation factor. Then the MPPT algorithm can extract the maximum of power using the PSO or the GWO algorithm. A DC converter is used for having information about the outputted power delivered to the load.

**Figure 8.** Overall system design in the simulation phase.

Indeed, to compare the efficiency of MPPT PSO and GWO we considered four simulation tests so that a wide variety of conditions are modelled, Table 4, gives the maximum power, voltage and current parameters for each shading condition. During the first test, Figure 9a, the irradiation was kept constant and uniform for the four modules (1000 W/m2). The second test is characterized by partial shading on two of the four modules of around 40%, represented in Figure 9b. It corresponds to the following lighting distribution on the four modules (600 W/m2, 600 W/m2, 1000 W/m2, 1000 W/m2). The third test (in Figure 9c) resembles the second one, but the partial shading on the two modules is varied in the order of 50% on the first and 20% for the second (500 W/m2, 800 W/m2, 1000 W/m2, 1000 W/m2). Three modules operate under partial shade during the fourth Test, in Figure 9d. This corresponds to the following lighting distribution (200 W/m2, 300 W/m2, 700 W/m2, 1000 W/m2)

**Table 4.** PV characteristics study for a different type of shading.


**Figure 9.** PV characteristics under different levels of partial shading.

Figures 10–13 show the main electrical measurements of the PV tested for different shadowing conditions. For these results, we have used the Matlab simulation tool.

A. Uniform irradiation

**Figure 10.** PV characteristics under uniform irradiation: 0% partial shading.

B. The first case of partial shading

**Figure 11.** PV characteristics under partial shading: (600 W/m 2, 600 W/m 2, 1000 W/m 2, 1000 W/m 2).

C. Second case of partial shading.

**Figure 12.** PV characteristics under partial shading: (500 W/m2, 800 W/m2, 1000 W/m2, 1000 W/m2).
