# An Evolutionary-Based MPPT Algorithm for Photovoltaic Systems under Dynamic Partial Shading
## 4 Test Case Simulations and Results  
The test case simulations have been designed to verify the performance of the proposed PSO-based MPPT algorithm in different dynamic shading conditions and with different settings. The results obtained with the proposed PSO-based MPPT algorithm are compared with those generated by the use of widely used MPPT algorithms in the same conditions of dynamical shading. The performance of the proposed PSO-based MPPT algorithm as a function of the number of particles (population size) is investigated. The following MPPT algorithms have been simulated for each shading scenario:  
1. Perturb and Observe (P&O--A);
2. Variable Step Perturb and Observe (P&O--B);
3. Three Point Weight Comparison (P&O--C);
4. Incremental Conductance (IC);
5. Constant Voltage (CV);
6. Open Voltage (OV);
7. Short Current Pulse (SC);
8. PSO-based MPPT algorithm with 3 particles (PSO--3p);
9. PSO-based MPPT algorithm with 4 particles (PSO--4p);
10. PSO-based MPPT algorithm with 5 particles (PSO--5p). For each shading object defined above and for each MPPT algorithm, two minutes of operation of the off grid PV system are simulated. The irradiance and cell temperature are constant during the whole simulation, equal to 800 W/m\({}^{2}\) and 48 \({}^{\circ}\)C, respectively. Since MPPT algorithms regulate the PV generator both for irradiance changes and in case of dynamic partial shading, therefore constant irradiance is necessary to evaluate the behavior of the controller in the event of dynamic partial shading. Moreover, constant irradiance represents the environmental condition during a short time interval of a sunny day. The commonly used thermal model for predicting the temperature of PV cells in a PV module is based on the assumption that the difference between the cell and ambient temperature is proportional with the irradiance, thus constant irradiance corresponds to constant cell temperature. Partial shading on PV cells persists only for a few seconds: it is assumed that the cell temperature variation due to the passage of the moving object can be neglected. The schedule of each partial shading simulation is organized as follows:  
* At the beginning of the simulation (conventional time stamp \(t\) = 0 s), the PV module is unshaded and the MPP algorithm is in steady state. * The dynamical shading produced by the object moving in forward direction starts 10 s after the beginning of the simulation (conventional time stamp \(t\) = 10 s). The dynamical partial shading condition ends as soon as the moving object's rear-end leaves the PV module. Dynamic partial shading lasts for 31.7 s in case of 2 \(\times\) 1 shading objects, for 35.7 s in case of 3 \(\times\) 1 shading objects and for 39.7 s in case of 4 \(\times\) 1 shading objects;
* The dynamical shading produced by the object moving in backward direction starts at the conventional time stamp \(t\) = 70 s. As in the case of forward motion, the dynamical partial shading lasts from 31.7 s to 39.7 s, depending on the length of shading objects. * The simulation ends at the conventional time stamp \(t\) = 120 s.  
Simulations have been performed by using a Matlab script that implements the calculation of the position of the moving object and the resulting shaded area of each cell, the electric model of the PV system, and the MPPT algorithm. The two minutes of operation of the off-grid PV system have been discretized using a sampling time of 50 ms. For each time sample:  
1. the position of the shading object and the resulting unshaded area of each cell of the PV module are calculated;
2. the I-V curves of each PV cell and the I-V curve of the PV module are calculated and the electrical circuit is solved, namely \(V_{PV}(n)\) and \(I_{PV}(n)\) are calculated and \(P_{PV}(n)\) is derived;
3. one cycle of the MPPT algorithm is performed and the duty cycle is changed accordingly. In order to compare the results of 120 simulation runs (10 MPPT algorithms and 12 shading scenarios) an appropriate _Efficiency_ parameter of the MPPT algorithm has been defined and calculated.