## 1 Introduction  
The smart grid concept involves the inclusion of renewable sources of electric generation and the use of devices for control and communication, leading to a more efficient and reliable electric supply for final users [1]. Among all renewable energies, solar photovoltaic (PV) is the one with the highest growth, reaching an installed worldwide capacity of 402 GW in 2017 [2]. Notwithstanding, there are some challenges and disadvantages associated with photovoltaic generation, for instance, the generated power is unpredictable because it is highly dependent on environmental factors like the incident solar irradiance and the temperature [3, 4]. Additionally, it has been reported that the inclusion of PV generation is associated with harmonic contamination [5, 6], because it is necessary to use power inverters for converting the DC signals delivered by the PV panels into AC signals, which can be used by the final users. It is necessary to note that even small variations in the background conditions may lead to a severe harmonic contamination, making the constant detection of these variations essential [7]. From the smart grid point of view, these are major issues, as the variability makes the generation process unreliable, and the harmonic content compromises the quality of the power supply. In this sense, several methodologies have been reported for the proper measurement and identification of harmonics. These methodologies use signal processing techniques like discrete Fourier transform (DFT) [8], chirp-z transform [9], phasor measurement units [10], Kalman filter based techniques [11], and discrete wavelet transform [12]. Although these methodologies offer a solution, they do not provide information regarding the source of the harmonic currents. Moreover, they cannot provide a model for describing or estimating the behavior of the harmonic content under different operating conditions. In terms of PV generation, there are works focused on the prediction of the power delivered by a PV system [13]. All these methodologies aim to develop models for describing the PV system's production using deterministic or probabilistic techniques [14; 15]. However, methods for irradiance and power forecasting based on artificial intelligence have recently gained popularity, being support vector machines [16], support vector regression [17], and artificial neural networks (ANN) [18; 19; 20] the most common techniques used for this purpose. These methodologies can predict the behavior of any variable on a daily or hourly basis. Nevertheless, these works only perform an estimation of the generated power, and do not deliver information regarding the quality of the generation. Additionally, the use of other metaheuristic methodologies (a set of procedures that do not follow a formal mathematical model but a series of empirical rules applied to the search of an optimal value), like genetic algorithms (GA), has not been studied. This technique can be used for obtaining a mathematical model that describes the behavior of electrical variables in PV generation. Furthermore, the use of GA could help to achieve a parameterized model, in a multioptimization scheme, which describes the behavior of any variable in the PV process even when this behavior presents nonlinear characteristics. Moreover, the electrical performance cannot be described using only one parameter, and the GA allows one to obtain several parameters in the same operation. Some works have included these metaheuristic techniques for solving problems in which the performance in the PV generation needs to be improved. For instance, maximum power point tracking (MPPT) is a problem in which classical techniques meet difficulties when partial shading conditions (PSC) provide the PV system with a nonmonotonic characteristic of the power-voltage curve [21; 22; 23]. Therefore, solutions based on particle swarm optimization (PSO), ant colony optimization (ACO), and simulated annealing (SA) have been proposed.