## Methodology
### The Practical HAM Derivation Approach for Fluctuating Power PV Systems  
As in Section 2.3, the conventional HAM derivation approach is based on the harmonic sensitivity tests performed on a PE device with constant operating power, which is infeasible to be applied to a PV system that operates under real-grid conditions. As it is affected by the solar irradiation and weather conditions, the daily operating power of a practical grid-tied PV system normally varies from 10% \(P_{metal}\) to 100% \(P_{metal}\)[11]. As the HAMs exhibit strong linear correlations at adjacent powers, the voltage and current waveforms captured at the PoC of a grid-tied PV system operating during a typical day can be applied for the HAM derivation. Specifically, as in Figure 11, the voltage and current waveforms of a grid-tied PV system are recorded with predefined sampling frequency, length and interval. After the one-day measurements are captured, they are firstly sorted from highest power to lowest power, and then divided into different sets according to the equally distributed power ranges. For the measurement sets within each power range, they are applied for the HAM derivation and self-tuning. The final outputs are the HAMs at different powers. The practical HAM derivation process based on the infield measurements within each power range is further explained in the following section. As explained in Section 2.2, PV systems mainly generate odd harmonics; hence, only odd harmonics will be considered for the HAM derivation. Additionally, only harmonic orders upper to 19 th are considered, as any higher harmonic order has negligible magnitude. According to (1), the calculation of \(\overline{Y}_{h,H}\) (\(h\), \(H\) = 1, 3, 5,..., 19) requires at least 10 measurement sets captured at the same power and the formed voltage matrix has to be non-singular, as in (12). \[ \begin{bmatrix}\overline{Y}_{1,1}&\overline{Y}_{1,3}&\cdots&\overline{Y}_{1, 19}\\ \overline{Y}_{3,1}&\overline{Y}_{3,3}&\cdots&\overline{Y}_{3,19}\\ \vdots&\vdots&\ddots&\vdots\\ \overline{Y}_{19,1}&\overline{Y}_{19,3}&\cdots&\overline{Y}_{19,19}\end{bmatrix}  = \begin{bmatrix}\overline{I}_{1}^{1}&\overline{I}_{1}^{2}&\cdots&\overline{I }_{1}^{10}\\ \overline{I}_{3}^{1}&\overline{I}_{3}^{2}&\cdots&\overline{I}_{3}^{10}\\ \vdots&\vdots&\ddots&\vdots\\ \overline{I}_{19}^{1}&\overline{I}_{19}^{2}&\cdots&\overline{I}_{19}^{10}\\ \end{bmatrix}\begin{bmatrix}\overline{V}_{1}^{1}&\overline{V}_{1}^{2}& \cdots&\overline{V}_{1}^{10}\\ \overline{V}_{3}^{1}&\overline{V}_{3}^{2}&\cdots&\overline{V}_{3}^{10}\\ \vdots&\vdots&\ddots&\vdots\\ \overline{V}_{19}^{1}&\overline{V}_{19}^{2}&\cdots&\overline{V}_{19}^{10}\\ \end{bmatrix}  \tag{12}\]  
According to the findings in Section 2.3, HAMs at adjacent powers exhibit strong linear correlations with a Pearson correlation coefficient close to one; it is assumed that within each power range, HAM at power \(P_{k}\) can be represented as HAM at \(P_{nf}\) multiplied by a scaling factor \(k_{g}\), i.e., \(\text{HAM}_{\text{Pk}}=k_{g}\times\text{HAM}_{\text{Pref}}\). In this way, the measured current spectrums with powers different to \(P_{nf}\) can all be scaled to their corresponding values at  
Figure 10: The Pearson correlation coefficients of HAMs for single-phase PV-A and PV-B at different powers: (a) PV-A; (b) PV-B. \(P_{ref}\), which will then be applied to (12) for calculating the initial HAM\({}_{\text{pref}}\). Afterwards, the parameter values of HAM\({}_{\text{pref}}\) will be self-tuned until the lowest THD errors are achieved for all the measurements within the specified power range.