**1. Introduction**

Due to its availability and the good conversion factor, solar energy technology has advanced at an exponential rate in the last few years [1]. As a renewable energy source, generation from solar energy eliminates pollution caused by traditional energy industries by lowering air nocive emissions [2]. Moreover, electricity generation from this resource is quite viable for a variety of uses. In particular, the rapid development of solar energy instruments gives a complete kit of tools that can be directly applied into the field of Electric Vehicles (EV) [3,4]. Several studies have suggested that photovoltaic cells can be used to cover EVs' surfaces to store a significant amount of electricity in the storage system [5,6]. This would increase EVs' autonomy, which will in turn increase the use of EVs. Some additional benefits are also associated to solar-powered Electric Vehicles [7,8]. First, the load peaks may be reduced so that the grid management is easier. Second, a decrement of the costs of charging the EVs would also be perceived by the drivers.

In [9], researchers provided some statistics that prove that there is a huge free space to place photovoltaic (PV) cells in the car. As pointed out, these components can be used to help feed the car with electricity. It is possible to have 6 kW of electrical power in some buses or trucks with this kind of installation [10].

**Citation:** Kraiem, H.; Aymen, F.; Yahya, L.; Triviño, A.; Alharthi, M.; Ghoneim, S.S.M. A Comparison between Particle Swarm and Grey Wolf Optimization Algorithms for Improving the Battery Autonomy in a Photovoltaic System. *Appl. Sci.* **2021**, *11*, 7732. https://doi.org/10.3390/ app11167732

Academic Editors: Marcos Tostado-Véliz and Rodolfo Dufo-López

Received: 18 July 2021 Accepted: 20 August 2021 Published: 22 August 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

In order to benefit from this technology, the solar cells must be installed in a particular location on the vehicle to enhance the average autonomy of the vehicle. In the previously cited references, it is stated that the Audi car model can get around 600 W from solar equipment. If the EV model is pure electric, the PV cells can help to feed the vehicle with 1% of the total electric power when it is moving. In addition, the energy can be obtained while the EV is parked. It is proved that the PV solution is interesting for heavy trucks because there is more vacant area that can be used to generate renewable electricity. The PV system can provide 2% of their consumption when moving along a long road. However, the statistics are different in the city, as there are many shading areas where the efficiency of the PV system may be affected. The way to estimate the energy return is challenging since it depends on the vehicle's relative situation compared to the sun's light and the presence of road obstructions. Because the car can quickly change from one type of shading scenario to another, obtaining the maximum amount of energy in all these conditions is quite tough. This is even more complex if we take into account that the efficiency of PV energy production mainly depends on the dynamic conditions associated to solar energy. The most relevant features are radiation, temperature, and the state of the PV field surface (dirt, deterioration). These factors directly influence its photon absorption and therefore affect the productivity of PV panels. In addition, the phenomenon of partial shading is one of the problems that impair the proper functioning of a PV plant. Partial shading is a non-uniform distribution of illumination on photovoltaic modules, which is due to several reasons. Indeed, there are two types of shading [11,12] The distant shade corresponds to the disappearance of the sun behind the horizon line. Alternatively, close shading is often due to unavoidable obstacles such as power lines, trees, neighboring buildings or dirt.

This undesirable phenomenon affects the conversion efficiency and the ability to extract the maximum available power from the PV field by generating multiple local maxima in the PV curves. In addition, shading also disrupts the operation of PV cells, causing two problems. The first problem is the mismatch, which is due to the fact that the total current in a PV field is limited by the current of the shaded module (low power) if the current *Isc* (the current flowing through the photovoltaic cell in short-circuit) of the shaded module is greater than the *Isc* of the uniformly lit modules. The second problem is the onset of hot spot. This problem occurs when the *Isc* current of the shaded module is less than the *Isc* of the uniformly illuminated modules, so that the shaded module behaves like an energy receiver extracting energy from the other PV modules. This effect can be noticed in the PV curve of a shaded PV panel, depicted in Figure 1. In partially shaded conditions, when the PV system does not receive uniform irradiation, the P-V characteristics become more complex, with multiple local peak displayed and a single global peak. These points are referred to as Maximum Power Points (MPP).

**Figure 1.** Typical curve of a shaded PV panel.

In addition to the deformation of the I-V curve, shading may lead to the heating of this module by dissipation of this energy. If the operating point of the shaded module reaches the breakdown voltage, the module will be destroyed by the avalanche effect [13,14].

Thus, it is crucial to find an optimal operating voltage to extract the maximum amount of PV power when designing the PV system while avoiding the aforementioned problems. A Maximum Power Point Tracking (MPPT) management tool is a required control loop that helps to get the most power out of a PV system. The basic performance of this algorithm is to adjust the duty cycle of the power converter connecting the PV modules to the DC-link. Concerning this tracking technique, various methods were carried out and help improve the energetic performances of the system. The traditional process relies on the incremental method's principle (IC) [15,16]. It is based on the principle of the zero derivative of the output power *P* of the PV panel, with respect to its output voltage V at the point maximum MPP power. In the maximum point, it is positive on the left and negative on the right, so the algorithm tries to find the voltage where this condition holds [17].

The Perturb and Observe (P&O) approach was the focus of further studies [18,19]. Because of its simplicity and convenience of use, it is frequently implemented. The primary benefit of this method is its direct torque design and lesser rate of monitored parameters. However, it has a significant flaw in terms of chattering on the supplied power form.

Classic MPPT methods such as P&O and IC are based on moving the next operating point (OP) in the direction of increasing PV power. However, when partial shading is present, the P–V curve is no longer monastically increasing, as shown in Figure 1. Thus, these conventional methods can only achieve a local MPP and may not reach the global maximum [20,21]. Therefore, it is necessary to develop an appropriate MPPT algorithm that can get to the global maximum power regardless of the state of illumination on the modules.

To overcome this limitation, other strategies based on intelligent optimization, such as the fuzzy logic technique or the neural network method, have been designed in the same sector [22,23]. The two techniques lead to higher profitability, but their main issue is the database required to adapt these algorithms to PV systems. Optimization algorithms were also used to help resolve this issue of partial shading of the photovoltaic system [24,25]. In particular, the evolutionary algorithms aim to have an adaptable MPPT tracking method, based on the animal behavior to find food [26,27].

There is a variety of swarm algorithms, which have been applied in multiple systems such as in [28–31]. Among them, Particle Swarm Optimization (PSO) [25] and Grey Wolf Optimization (GWO) [32] have shown their reliability to solve real optimization problems where the objective function is not linear. In particular, the works in [17,33] only considered these two algorithms to configure a DC/DC power converter. The review presented in [34] show that PSO algorithms are still investigated to tune the power converters of microgrids. Moreover, the study elaborated by Mirjalili in [32] presents a comparison between multiple swarm algorithms. As a conclusion, they state that the better results were found for the PSO and the GWO algorithms. Indeed, the two algorithms are inspired by natural competence to reach high speed and precision. Based on these previous works, in this paper we evaluate their relative feasibility and performance of employing the swarm algorithms to configure the power converter of the PV panels in order to cope with different shading conditions.

These two algorithms have already been applied and evaluated separately in PV systems. Particle Swarm Optimization algorithm can help to calculate the duty cycle of the power converter in the PV connection dynamically. Several works tested this solution for this application, as in [35] where the authors proved that this solution could be efficient if it is running offline. On the other side, the Grey Wolf Optimization (GWO) algorithm appeared as a useful solution for extracting energy from the PV system with maximum efficiency [36]. However, the two algorithms have several parameters and constants, which must be fixed initially to start the algorithms correctly.

The contribution of the paper is to apply and evaluate these two optimization algorithms for the same PV system, considering different partial shading conditions. The PV

system model considered in this work is based on a commercial PV panel. So we can compare both performances to study their suitability in realistic implementations. The evaluation of each of these algorithms is based on the precision and the speed for tracking the global MPP with different partial shading conditions. Specifically, we have studied the two swarm-intelligence based algorithms for four shading conditions in a four-module PV system.

This research paper is organized to initially present an introduction section, which describes the objective of the paper and explains the state-of-the-art in this application field. In the second section, the PV system is modeled with the necessary equations that regroup all the parameters and constants that define this physical system. In the third section, the two optimization algorithms are explained. Their flowcharts are exposed and the principle running of each one is described for the MPPT algorithm. In the next section, the simulation conditions and the obtained results are shown for each irradiance case. In the end, a conclusion section is formatted for resuming the paper and giving some perspectives of this work.

### **2. Model of the PV System**

In this section, we first describe the model for a solar PV cell. Then, we integrate it into the model of a PV system.
