## 3 Numerical Results
### Comparison of the Q-Learning-Based and PSO-Based GMPPT Methods
\begin{table}
\begin{tabular}{c c c c c c} \hline  & **Convergence** & **Number of** & **P\({}_{GMPP}\) (W)** & **\(P_{PV}\) (W)** & **MPPT** \\  & **Time (s)** & **Search Steps** & **P\({}_{\text{GMPP}}\) (W)** & **P\({}_{PV}\) (W)** & **Efficiency (\%)** \\ \hline Shading pattern 1 & 11.6 & 185 & 83.2 & 83.1 & 99.9 \\ Shading pattern 2 & 11.5 & 184 & 67.0 & 66.9 & 99.9 \\ Shading pattern 3 & 11.6 & 185 & 75.2 & 75.1 & 99.9 \\ Shading pattern 4 & 11.5 & 185 & 71.1 & 71.0 & 99.9 \\ Shading pattern 5 & 11.5 & 186 & 79.1 & 79.0 & 99.9 \\ Shading pattern 6 & 11.5 & 185 & 80.7 & 80.4 & 99.6 \\ Shading pattern 7 & 11.3 & 184 & 69.5 & 69.2 & 99.6 \\ Shading pattern 8 & 11.4 & 185 & 75.9 & 75.8 & 99.9 \\ Shading pattern 9 & 11.6 & 187 & 76.9 & 76.8 & 99.9 \\ \hline \end{tabular}
\end{table} 
Table 6: The simulation results of the PSO-based GMPPT method for various shading patterns. \begin{table}
\begin{tabular}{c c c c c c} \hline  & **Convergence** & **Number of** & **P\({}_{GMPP}\) (W)** & **\(P_{PV}\) (W)** & **MPPT** \\  & **Time (s)** & **Search Steps** & **P\({}_{\text{GMPP}}\) (W)** & **P\({}_{PV}\) (W)** & **Efficiency (\%)** \\ \hline Shading pattern 1 & 29 & 464 & 83.2 & 82.0 & 98.6 \\ Shading pattern 2 & 32 & 512 & 67.0 & 66.2 & 98.8 \\ Shading pattern 3 & 28 & 448 & 75.2 & 73.0 & 97.1 \\ Shading pattern 4 & 17 & 272 & 71.1 & 70.9 & 99.7 \\ Shading pattern 5 & 2 & 32 & 79.1 & 78.7 & 99.5 \\ Shading pattern 6 & 1.5 & 24 & 80.7 & 80.3 & 99.5 \\ Shading pattern 7 & 2.2 & 35 & 69.5 & 68.5 & 98.6 \\ Shading pattern 8 & 0.73 & 12 & 75.9 & 75.4 & 99.3 \\ Shading pattern 9 & 0.25 & 4 & 76.9 & 76.6 & 99.6 \\ \hline \end{tabular}
\end{table} 
Table 5: The simulation results of the proposed Q-learning-based GMPPT method for various shading patterns. patterns 2-7) offered additional knowledge to the Q-learning agent. Therefore, the resulting MPPT efficiency had already been improved during application of shading patterns 8 and 9 and reached a value similar to that obtained by the PSO-based algorithm, but with significantly less search steps, as analyzed above. Figure 19a presents an example of the trajectory followed during the PV array output power maximization process, when the proposed Q-learning-based GMPPT method is applied for shading pattern 9. Figure 19b illustrates the initial positions of the particles comprising the PSO swarm (red dots), the positions of the particles during all intermediate swarm generations (black dots), as well as their final positions (blue dots) for the same shading pattern. It is observed that the PSO algorithm must visit a large number of alternative operating points of the PV array in order to be able to detect the position of the GMPP with an MPPT efficiency similar to that of the proposed Q-learning-based GMPPT algorithm (Tables 5 and 6). In contrast, the proposed Q-learning-based GMPPT technique significantly reduces the number of search steps (i.e., only four steps are required), even if an unknown partial shading pattern is applied, since prior knowledge acquired during its previous executions is retained and exploited in the future executions of the proposed GMPPT algorithm.