# A Novel Real-Time PV Error Handling Exploiting Evolutionary-Based Optimization
## 4 Results
### Genetic Algorithm Tests
#### 4.2.1 Population Size and Number of Generations  
The selection of the population size is a crucial process for the GA because it directly influences the convergence of the algorithm [38]. As a result, population size has an impact on the GA's ability to reach the optimal solution [39]. According to the findings in the literature, a small population mars the quality of chromosomes, and a large population size (i.e., more than 100) is only a computational waste [40]. Nonetheless, to determine the appropriate population and the number of generations (iteration times), tests were carried out, as shown in Table 5. The crossover probability was set to 0.75, and the mutation probability was set to 0.01, as suggested in the literature [41]. It could be suggested that the experiments indicate that a population size of 60 is efficient for the GA. Furthermore, a small generation number will maintain the quality of the solutions and keep the execution time rather low.  
Some experiments have been conducted to measure the computational difficulty of the algorithm and to associate some of the genetic hyperparameters (population size and generations) with the execution time while keeping crossover and mutation probabilities intact. According to Table 5, and observing how the execution time varies as the population and generations increase, it can be observed that the execution time is linearly proportional to the size of the population. Moreover, the slope of the straight lines in Figure 9 indicates that the execution time is also linearly proportional to the number of generations. Combining the impact of those two hyperparameters on the execution time and considering  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Generation** & **Population** & **Execution Time (s)** & **Convergence** \\ \hline \multirow{4}{*}{10} & 10 & 0.052 & 8/10 \\ \cline{2-4}  & 20 & 0.110 & 10/10 \\ \cline{2-4}  & 40 & 0.229 & 10/10 \\ \hline \multirow{4}{*}{20} & 10 & 0.112 & 9/10 \\ \cline{2-4}  & 20 & 0.229 & 10/10 \\ \cline{2-4}  & 40 & 0.477 & 10/10 \\ \hline \multirow{4}{*}{40} & 10 & 0.237 & 10/10 \\ \cline{2-4}  & 20 & 0.484 & 10/10 \\ \cline{2-4}  & 40 & 0.971 & 10/10 \\ \hline \multirow{4}{*}{80} & 10 & 0.479 & 10/10 \\ \cline{2-4}  & 20 & 0.951 & 10/10 \\ \cline{2-4}  & 40 & 1.928 & 10/10 \\ \hline \hline \end{tabular}
\end{table}
Table 5: GA performance tests on the population and the generation size.  
that the genetic algorithm is heuristic and crossover/mutation operators occur at nearly the same time, the algorithm has a complexity of \(O(n^{2})\).  
As depicted in Figure 9, there is an observable relationship between the population size and the execution time of the GA. Furthermore, there is also a proportional relationship between execution time, generation size, and population size. Regarding the tests developed, the aforementioned relationships are estimated by the following:  
\[y_{1} =0.0484x-0.0095\] \[y_{2} =0.0245x-0.0065\] \[y_{3} =0.0122x-0.012\] \[y_{4} =0.0059x-0.0075,\]  
where \(x\) is the population size and \(y\) is the execution time in seconds, where \(y_{1},y_{2},y_{3},y_{4}\) correspond to generation sizes 10, 20, 30, 40, respectively.