Estimation of Modal Parameters for Inter-Area Oscillations Analysis by a Machine Learning Approach with O ﬄ ine Training

: An accurate monitoring of power system behavior is a hot-topic for modern grid operation. Low-frequency oscillations (LFO), such as inter-area electromechanical oscillations, are detrimental phenomena impairing the development of the grid itself and also the integration of renewable sources. An interesting countermeasure to prevent the occurrence of such oscillations is to continuously identify their characteristic electromechanical mode parameters, possibly realizing an online monitoring system. In this paper an attempt to develop an online modal parameters identiﬁcation system is done using machine learning techniques. An approach based on the development of a proper artiﬁcial neural network exploiting the frequency measurements coming from actual PMU devices is presented. The speciﬁcally developed o ﬄ ine training stage is fully detailed. The output results from the dynamic mode decomposition method are considered as reference in order to validate the machine learning approach. Some results are presented in order to validate the e ﬀ ectiveness of the proposed approach on data coming from recordings of real grid events. The main key points a ﬀ ecting the performance of the proposed technique are discussed by means of proper validation scenarios. This contribution is the ﬁrst step of a more extended project whose ﬁnal aim is the development of an artiﬁcial neural networks (ANN) architecture able to predict the system behavior (in a given time span) in terms of LFO modal parameters, and to classify the contingencies / disturbances based on an online training that has memory of the passed training samples.


Introduction
It is a matter of fact that the actual ever-demanding environmental policies are forcing the worldwide power grids to integrate a rising amount of renewable sources, thus leading the grids themselves to become more and more interconnected, complex, and also prone to be stressed in their ordinary functioning.
Modern power systems have the fundamental need to deliver the largest electrical power over long distances. However, such systems should also be able to take into account the presence of renewable sources, characterized by very low inertia, which constitutes an impairment in terms of system's stability since they introduce rapidly changing electrical dynamics.
However, it seems that, as of today, the major good point of measurement-based methods is that they are inherently data-driven. In effect, some works have already explored the possibility to use these techniques in the context of a wider and more complex machine learning framework based on the use of artificial neural networks (ANNs), such as [26][27][28][29][30], either for LFO identification or EDSs characterization. In the above mentioned papers, the measurement-based estimation techniques are combined with ANN-based methods in order to identify the LFO mode parameters in real-time, or to extract other useful power grid information (like the system operating conditions or the generator coherency). In other applications, the data extracted from the ANN are also used to control and to damp the LFO phenomena [28,31]. It must be remarked that a key point inside the listed approaches is the need to operate a dimensionality reduction of the huge amount of data coming from PMUs. This is due to the fact that the use of machine learning techniques for modal analysis requires an offline training of the ANNs that depends, in terms of time required, on the size of the network and the size of the input data. Plenty of dimensionality reduction techniques are present in literature that can be suitable for this scope. Some very popular are the principal component analysis (PCA) [32], the independent component analysis (ICA), the dynamic mode decomposition (DMD) [33,34], and their further extensions and modifications.
This work is part of a global on-going research project whose final aim is the development of an ANN architecture able to predict and classify LFO phenomena based on an online training approach that keeps memory of the passed training samples. The present contribution focuses on the development of the ANN architectures and their validation by an offline training. The online strategy and associated algorithm development is still under investigation.
Differently from other recent approaches, in this paper an ANN-based strategy for the online monitoring of inter-area LFO modal parameters is presented. The DMD technique is explored and used as a dimensionality reduction method. Section 2 summarizes the relevant features of the DMD technique applied to the PMUs measured data. In Section 3 the architecture of the proposed ANN and the issues related to its training are discussed. Section 4 is devoted to the discussion of the numerical results and their comparison with some measurement in order to validate the proposed approach. Finally, in Section 5, some conclusions are drawn by discussing the advantages and limitations of the proposed method and possible research directions.

Modal Decomposition of Frequency Oscillations in Electric Power Systems
As already stated, the identification of LFO phenomena in power grids has been performed in previous research works following several different valid approaches. A mainstream class of techniques accounts for the execution of a modal analysis of the data measured and collected by the PMUs (i.e., as [24,25]). In this works the instantaneous frequency measurements coming from some PMUs are processed using some modal estimation techniques in order to extract the characteristic parameters of the main electromechanical modes, such as frequency, damping ratio, and amplitude. With this information, it is possible to identify the characteristics of a certain number of modes and hence also the dominant one. As a subsequent identification step, it is also possible to verify the presence of a hazardous inter-area oscillation by looking at the frequency range of the dominant mode and the values of its damping ratio.
For the purposes of this paper, we use as modal estimation technique, the DMD method, since it is capable of both identifying the modal parameters of LFO and to operate a dimensionality reduction, thus enabling an efficient design and training of the ANN-based LFO identification strategy.
The dynamic mode decomposition method was first introduced by Schmid [33] as a numerical procedure capable to extract dynamical features from flow data. It has been later enhanced and refined [34][35][36] in order to be used as a modal analysis technique capable to extract the modal parameters of EDSs. The DMD theory is based on the collection of input data as a snapshot sequence of the following form: where x i is the i-th snapshot and X N 1 is a data matrix whose columns represent the collection of the different snapshots, from the first up to the N-th. If each snapshot x i is composed of M spatial samples, X N 1 is a M-by-N matrix. The DMD method [33] is essentially founded on the assumption that the snapshots are related to each other via a linear mapping, defining a linear dynamical system as in (2).
Equation (2) is supposed to be approximately invariant during the time period between the two snapshots. Based on this, any collection of snapshots X N 1 can be split into two subsets, x N } for which the following relationship holds: In (3) the term r denotes the vector of residuals accounting for the dynamic behaviors that cannot be completely described by the linear mapping. The eigenvalues of matrix A are referred to as "DMD eigenvalues" and the eigenvectors of A as "DMD modes." There are different algorithms suitable to implement the DMD method. In this work the one based on the singular value decomposition has been selected based on a similarity transformation and an eigenvalue decomposition (known as "DMD with SVD approach"). The principal steps to be followed in this case can be resumed according to [35]: (1) Arrange the input data snapshots X N 1 into two time series X N−1 The i-th DMD eigenvalue is λ i and the associated DMD mode is U v i . The DMD eigenvalues can be used to extract the modal parameters of the EDSs oscillatory behavior embedded inside the input data, enabling us to identify the nature of electromechanical LFOs based on a collection of measured data from PMUs.
A very interesting feature of the DMD estimation technique is that the dimension of the matrix S can be much lower than the original dynamic matrix A. Thus, even though the spatial sampling can be done on many PMU locations (e.g., M locations), the number of estimated modes can be much lower. This is a very important key point for the proposed approach because it allows to associate, for any arbitrary number of PMU measurement locations, a limited number of estimated electromechanical modes obtaining an efficient dimensionality reduction similar to what can be obtained by PCA-based techniques [26].
In all the cases analyzed in this paper, the input data to be fed to the DMD modal decomposition algorithm are constituted by a collection of measurements of the grid frequency taken by the Italian Transmission System Operator (TSO) TERNA at various PMU locations. The output of the DMD estimation method is constituted by the modal parameters of the LFO detected in the power grid.
It is worthy to note that, in the proposed approach, the extraction of the LFO modal parameters through the DMD estimation acts as a preliminary and necessary step to obtain a correct and efficient training set of data required by the ANN-based approach, as discussed in the next section.

Prediction of Low-Frequency Oscillations Modal Parameters by an Artificial Neural Network
The proposed ANN-based method to estimate the LFO modal parameters consists in the proper designing and training of an artificial neural network in order to be able to recognize the modal Energies 2020, 13, 6410 5 of 20 parameters associated to the LFO. This task is accomplished by considering the frequency measurements collected on the grid by a certain set of PMU devices. It must be remarked that the number of PMU measurement locations can be chosen arbitrarily; however, it must be set as a fixed parameter at the beginning of the procedure.
At a high-level description, as depicted in Figure 1, the raw frequency data coming from the PMU measurement system over a certain number of grid nodes should be preliminarily pre-processed in order to: • Filter out the noise coming from the PMU measurements; this can be done with a properly tuned digital filter (for instance a classical low-pass FIR filter or a Hilbert filter); • Detrend the data; • Divide the overall measured input data stream in a certain number of data frames (i.e., "data windows") suitable to be used for the training stage of the ANN and to feed the neural network during the online LFO modal parameters identification process.
Energies 2020, xx, x FOR PEER REVIEW 5 of 20 • Detrend the data; • Divide the overall measured input data stream in a certain number of data frames (i.e., "data windows") suitable to be used for the training stage of the ANN and to feed the neural network during the online LFO modal parameters identification process.
After the pre-processing stage, the filtered data are given as the input to the ANN by using the sequencing defined by the data windows, such that the ANN is fed by using a sliding window mechanism.
For each data window gathered from the input data stream the ANN provides, as output, the estimated values of the LFO modal parameters; the parameters considered in this work are frequency (fi), damping ratio (αi), and amplitude (ai) for each i-th electromechanical mode identified. As illustrated in Figure 1, the ANN will provide, for each data window defined by the PMU and presented as its input, a triplet of values for each identified mode. As already mentioned, the number of modes to be identified can be selected arbitrarily by the user but, once it has been chosen, it has to be maintained as a constant parameter all along the calculations. In this paper, the number of modes of interest, based on the heuristic TSO experience, is equal to four.

Architecture of the Artificial Neural Networks
Among the many types of available artificial neural network architectures, the present study has focused its attention on the regression/estimation capabilities offered by one of the simplest types of ANN: the feed forward (FF) architectures. The reason for this choice is based on the final aim of the overall research project (not yet addressed in the present work): the ANN should be fed in real-time by the data coming from the PMUs and its output (the estimation of the LFO parameters) should be obtained within the shortest processing time. With the increasing of the complexity of the ANN structure, the training stage becomes more and more time-consuming, preventing the development of a machine learning framework capable to re-train the employed ANNs in a sufficiently short time period. Furthermore, it is known that the increase in complexity of a ANN is not a sufficient condition for an increase of its accuracy. On the contrary, there is the actual possibility to obtain the negative effect of overfitting, which would play in the present applications a fairly detrimental role.
For the actual application to LFO, two main classes of ANN architectures are considered, as depicted in Figure 2: the feed forward (FFNN) class and the cascade feed forward (CFNN) class. Mode #n (f n , , a n ) a n Time Frequency 1st Data Window After the pre-processing stage, the filtered data are given as the input to the ANN by using the sequencing defined by the data windows, such that the ANN is fed by using a sliding window mechanism.
For each data window gathered from the input data stream the ANN provides, as output, the estimated values of the LFO modal parameters; the parameters considered in this work are frequency (f i ), damping ratio (α i ), and amplitude (a i ) for each i-th electromechanical mode identified.
As illustrated in Figure 1, the ANN will provide, for each data window defined by the PMU and presented as its input, a triplet of values for each identified mode. As already mentioned, the number of modes to be identified can be selected arbitrarily by the user but, once it has been chosen, it has to be maintained as a constant parameter all along the calculations. In this paper, the number of modes of interest, based on the heuristic TSO experience, is equal to four.

Architecture of the Artificial Neural Networks
Among the many types of available artificial neural network architectures, the present study has focused its attention on the regression/estimation capabilities offered by one of the simplest types of ANN: the feed forward (FF) architectures. The reason for this choice is based on the final aim of the Energies 2020, 13, 6410 6 of 20 overall research project (not yet addressed in the present work): the ANN should be fed in real-time by the data coming from the PMUs and its output (the estimation of the LFO parameters) should be obtained within the shortest processing time. With the increasing of the complexity of the ANN structure, the training stage becomes more and more time-consuming, preventing the development of a machine learning framework capable to re-train the employed ANNs in a sufficiently short time period. Furthermore, it is known that the increase in complexity of a ANN is not a sufficient condition for an increase of its accuracy. On the contrary, there is the actual possibility to obtain the negative effect of overfitting, which would play in the present applications a fairly detrimental role.
For the actual application to LFO, two main classes of ANN architectures are considered, as depicted in Figure  The motivation to explore two different kinds of ANN architectures is linked with the fact that, even though the FFNN class is already acceptable in order to get a baseline estimation performance, the CFNN class shows a faster learning rate. Therefore, it can be usefully compared with the FFNN class, in particular in terms of estimation accuracy. Table 1 summarizes the main design parameters (number of hidden layers, number of neurons for each layer, etc.,) for the proposed configurations that deserve to be investigated. Their values come from the experience and from a campaign of tests that are not described herein.  The motivation to explore two different kinds of ANN architectures is linked with the fact that, even though the FFNN class is already acceptable in order to get a baseline estimation performance, the CFNN class shows a faster learning rate. Therefore, it can be usefully compared with the FFNN class, in particular in terms of estimation accuracy. Table 1 summarizes the main design parameters (number of hidden layers, number of neurons for each layer, etc.,) for the proposed configurations that deserve to be investigated. Their values come from the experience and from a campaign of tests that are not described herein.

Training of the Artificial Neural Networks
As appropriate for supervised learning architectures, the developed ANN must be trained to provide suitable regression (i.e., in this case estimation) features. The basic scheme reported in Figure 3 illustrates how both types of ANN should be trained to be able to correctly identify the modal parameters of the LFO contained in the PMU measured data.
parameters of the LFO contained in the PMU measured data.
The development of the input/target training set pair for the ANN starts from the PMU dataset that is suitably divided based on the mentioned sliding windows.
The input training set are the pre-processed PMU data. The corresponding target set are the output of the DMD procedure when its input are the pre-processed PMU data.
Once both the ANN target values and inputs have been obtained, the ANN training algorithm can be started. However, for this specific application, a point of attention should be further considered: since the input data originates from real PMU measurements, it happens sometimes that the gathered values can assume special non-numeric values (e.g., NaN values) because of events directly linked to the data acquisition system. In addition, NaN values can be also be numerically generated in our scenario when applying the DMD procedure, specifically when the DMD estimation algorithm finds some modes with frequencies lying outside a predefined frequency range. As consequence of the presence on the NaN values it is mandatory, for the development of the present ANN-based LFO analysis technique, the proper handling of their occurrence in order to prevent that their presence alters the significance of the training set and could have a negative impact on the ANN-based performance. For this reason, during the training stage of the ANNs (both FFNN and CFFNN), a training data selection step is implemented. The NaN values are handled in the following manner: • When the NaN value comes from the original PMU input data (i.e., it is inside the ANN inputs), the related data sample is excluded from the sliding window to which it belongs; • When the NaN values come from the DMD estimation procedure (i.e., it is inside the ANN targets), the related target vector is treated as a "don't care" target, meaning that the network performance function is not updated during the training process for that specific target value.
The overall available PMU input data set is segmented in two parts: one used for training and one used as input for the estimation of the LFO ringing parameters. In turn, as usual for the supervised learning schemes, the training part is subdivided as 70% of samples used for training, 15% of them used for testing, and the remaining 15% used for validation.

(FFNN or CFNN)
Training Data Selection Training Algorithm The development of the input/target training set pair for the ANN starts from the PMU dataset that is suitably divided based on the mentioned sliding windows.
The input training set are the pre-processed PMU data. The corresponding target set are the output of the DMD procedure when its input are the pre-processed PMU data.
Once both the ANN target values and inputs have been obtained, the ANN training algorithm can be started. However, for this specific application, a point of attention should be further considered: since the input data originates from real PMU measurements, it happens sometimes that the gathered values can assume special non-numeric values (e.g., NaN values) because of events directly linked to the data acquisition system. In addition, NaN values can be also be numerically generated in our scenario when applying the DMD procedure, specifically when the DMD estimation algorithm finds some modes with frequencies lying outside a predefined frequency range.
As consequence of the presence on the NaN values it is mandatory, for the development of the present ANN-based LFO analysis technique, the proper handling of their occurrence in order to prevent that their presence alters the significance of the training set and could have a negative impact on the ANN-based performance. For this reason, during the training stage of the ANNs (both FFNN and CFFNN), a training data selection step is implemented. The NaN values are handled in the following manner: • When the NaN value comes from the original PMU input data (i.e., it is inside the ANN inputs), the related data sample is excluded from the sliding window to which it belongs; • When the NaN values come from the DMD estimation procedure (i.e., it is inside the ANN targets), the related target vector is treated as a "don't care" target, meaning that the network performance function is not updated during the training process for that specific target value.
The overall available PMU input data set is segmented in two parts: one used for training and one used as input for the estimation of the LFO ringing parameters. In turn, as usual for the supervised learning schemes, the training part is subdivided as 70% of samples used for training, 15% of them used for testing, and the remaining 15% used for validation.

Results and Validation
In this section some results obtained by using the proposed strategy of an ANN-based approach are presented in order to identify the LFO parameters characterizing oscillatory phenomena occurring in real power grid operation.

Validation Scenarios, Data Origin, and Details of the Considered Datasets
The overall data exploited to validate the effectiveness of the ANN approach for the estimation of the LFO modal parameters consists of three different datasets coming from real PMU measurements. Such data are collected by the Italian TSO TERNA from different electrical substations, and under different grid operating conditions. The three datasets can be described in the following way: All the data recordings have been obtained by using a sampling time of 100 ms and the corresponding samples have been collected into proper data files. According to what is already mentioned in Section 3, the datasets have been arranged for a proper windowing. Each data window is extracted from the original dataset considering a proper data frame length (this quantity is indicated as T DF in the following), such that each dataset is composed of a different number of data windows.
A high-level outlook of the three datasets employed for this study is given in Figure 4. The first two datasets (Figure 4a,b) are characterized by ringing phenomena of the frequency measurements, especially at certain PMU locations. The third dataset instead is similar to the recording of nominal (also named as "ambient") conditions where some spurious frequency deviations occur from time to time.

Results and Validation
In this section some results obtained by using the proposed strategy of an ANN-based approach are presented in order to identify the LFO parameters characterizing oscillatory phenomena occurring in real power grid operation.

Validation Scenarios, Data Origin, and Details of the Considered Datasets
The overall data exploited to validate the effectiveness of the ANN approach for the estimation of the LFO modal parameters consists of three different datasets coming from real PMU measurements. Such data are collected by the Italian TSO TERNA from different electrical substations, and under different grid operating conditions. The three datasets can be described in the following way: • Dataset 1 (in the following DS1): it contains the data coming from the measurements of an LFO oscillatory event (time range: 10 min), taken at 22 PMU measurement locations; • Dataset 2 (in the following DS2): it contains the data coming from the measurements of a second LFO oscillatory event (time range: 20 min), taken at 30 PMU measurement locations; • Dataset 3 (in the following DS3): it contains the measurement data collected from a 24 h recording of rated grid operation taken at 18 PMU locations.
All the data recordings have been obtained by using a sampling time of 100 ms and the corresponding samples have been collected into proper data files. According to what is already mentioned in Section 3, the datasets have been arranged for a proper windowing. Each data window is extracted from the original dataset considering a proper data frame length (this quantity is indicated as TDF in the following), such that each dataset is composed of a different number of data windows.
A high-level outlook of the three datasets employed for this study is given in Figure 4. The first two datasets (Figure 4a,b) are characterized by ringing phenomena of the frequency measurements, especially at certain PMU locations. The third dataset instead is similar to the recording of nominal (also named as "ambient") conditions where some spurious frequency deviations occur from time to time.
The duration of the data frame that is initially considered is equal to 20 s; this is the value that was found more relevant for this kind of analysis, based on the on-field experience acquired by the TSO.   Furthermore, each input data stream from the three datasets is pre-processed with a Hilbert filter having the parameters reported in Table 2, according to what is already mentioned in Section 3. The parameters listed in Table 2 specify the order of the filter, N, and the frequency edges of the transition bands of the filter, given by the parameters: f1, f2, f3, f4. The order of the filter is chosen depending on the length of the data frame. In order to assess the results obtained with the proposed ANN-based approach, a proper set of validation scenarios are proposed, where either the three considered datasets or the different architectures of the developed ANNs are systematically explored. An overview of these validation scenarios is reported in Table 3, where validation scenario VS#1 is considered for the assessment of the performance obtained by the ANN-based approach among the three different datasets. The other two validation scenarios VS#2 and VS#3 are considered to assess the performances of different ANN architectures over the same dataset, and to check the impact of the data frame length, respectively. The duration of the data frame that is initially considered is equal to 20 s; this is the value that was found more relevant for this kind of analysis, based on the on-field experience acquired by the TSO.
Furthermore, each input data stream from the three datasets is pre-processed with a Hilbert filter having the parameters reported in Table 2, according to what is already mentioned in Section 3. The parameters listed in Table 2 specify the order of the filter, N, and the frequency edges of the transition bands of the filter, given by the parameters: f 1 , f 2 , f 3 , f 4 . The order of the filter is chosen depending on the length of the data frame. In order to assess the results obtained with the proposed ANN-based approach, a proper set of validation scenarios are proposed, where either the three considered datasets or the different architectures of the developed ANNs are systematically explored. An overview of these validation scenarios is reported in Table 3, where validation scenario VS#1 is considered for the assessment of the performance obtained by the ANN-based approach among the three different datasets. The other two validation scenarios VS#2 and VS#3 are considered to assess the performances of different ANN architectures over the same dataset, and to check the impact of the data frame length, respectively.

Results of the LFO Modal Analysis and Impact of the Network Structure
As a first step, the capability of the ANN-based approach is evaluated to accurately extract the LFO parameters. Validation scenario VS#1 is considered for this scope. Figure 5 reports the comparison between the LFO parameters estimated by the ANN-based approach with respect to those obtained by applying the DMD method, as the reference technique. The plots are limited to the first two modes for the sake of simplicity, since they are the most relevant in terms of energy values.
Energies 2020, xx, x FOR PEER REVIEW 10 of 20

Results of the LFO Modal Analysis and Impact of the Network Structure
As a first step, the capability of the ANN-based approach is evaluated to accurately extract the LFO parameters. Validation scenario VS#1 is considered for this scope. Figure 5 reports the comparison between the LFO parameters estimated by the ANN-based approach with respect to those obtained by applying the DMD method, as the reference technique. The plots are limited to the first two modes for the sake of simplicity, since they are the most relevant in terms of energy values.  The LFO parameters estimated by both the DMD method and the ANN-based method are in good agreement, as can be seen from Figure 5. For the specific test case of DS#1 in Figure 5c, it is clear that the ANN is able to identify the principal contribution to the LFO phenomenon occurring in the grid, since it is in good agreement with the identification performed by the DMD technique. From Figure 5c, the principal mode is detected as the mode #2 (i.e., the one characterized by the greatest value of mode amplitude). Figure 5a shows as both the ANN and the DMD evaluate the modal frequency of the principal mode (mode #2) at around 0.15 Hz. This value is in agreement with what is already known from the theory about inter-area electromechanical oscillations, and from the consolidated know-how of the TSO for that specific grid event.
The ANN LFO parameter estimation accuracy continued within the validation scenario VS#1; Figure 6 reports the analysis of the parameters for the grid event captured in dataset DS2.
The proposed ANN-based approach is able to provide estimates of the LFO parameters having a good degree of confidence, if compared to those provided by the DMD method. This is confirmed especially if we look at the evaluations provided by the ANN for the inputs lying outside its training set, thus the estimates provided from the second half of each DS (specifically from window 30 up to window 60 in all the cases of Figure 6).
In this second test case the estimated mode amplitudes, provided by the ANN-based approach, indicate that mode #1 is the one contributing more to the LFO, which is an inter-area oscillation characterized by a frequency value around 0.3 Hz. Also, in this case the frequency value agrees with the theoretical background and with the data experienced by the TSO about this kind of inter-area oscillation phenomena.
This second test case deserves a specific focus: the ANN-based approach is capable to give a correct estimate of the LFO parameters also when the DMD method is not able to do so. This happens when NaN values (coming from the PMUs) are input to the DMD method. In correspondence of these special inputs there are no DMD outputs as shown in Figure 6a-c when purple markers are missing. The LFO parameters estimated by both the DMD method and the ANN-based method are in good agreement, as can be seen from Figure 5. For the specific test case of DS#1 in Figure 5c, it is clear that the ANN is able to identify the principal contribution to the LFO phenomenon occurring in the grid, since it is in good agreement with the identification performed by the DMD technique. From Figure 5c, the principal mode is detected as the mode #2 (i.e., the one characterized by the greatest value of mode amplitude). Figure 5a shows as both the ANN and the DMD evaluate the modal frequency of the principal mode (mode #2) at around 0.15 Hz. This value is in agreement with what is already known from the theory about inter-area electromechanical oscillations, and from the consolidated know-how of the TSO for that specific grid event.
The ANN LFO parameter estimation accuracy continued within the validation scenario VS#1; Figure 6 reports the analysis of the parameters for the grid event captured in dataset DS2.
The proposed ANN-based approach is able to provide estimates of the LFO parameters having a good degree of confidence, if compared to those provided by the DMD method. This is confirmed especially if we look at the evaluations provided by the ANN for the inputs lying outside its training set, thus the estimates provided from the second half of each DS (specifically from window 30 up to window 60 in all the cases of Figure 6).
In this second test case the estimated mode amplitudes, provided by the ANN-based approach, indicate that mode #1 is the one contributing more to the LFO, which is an inter-area oscillation characterized by a frequency value around 0.3 Hz. Also, in this case the frequency value agrees with the theoretical background and with the data experienced by the TSO about this kind of inter-area oscillation phenomena.
This second test case deserves a specific focus: the ANN-based approach is capable to give a correct estimate of the LFO parameters also when the DMD method is not able to do so. This happens when NaN values (coming from the PMUs) are input to the DMD method. In correspondence of these special inputs there are no DMD outputs as shown in Figure 6a-c when purple markers are missing. The last dataset to be explored in order to complete the analysis of validation scenario VS#1, is the one related to the 24 h recording of rated grid operations, namely DS3. In this particular test case the ANN has been trained on a data segment that is smaller than an half of the overall recording. This is due to the fact that, after several tests, the use of 50% or more of the data does not contribute to a better estimation. The training windows accounted for this scenario are only 50 out of 4381. The results are reported in Figure 7.
Figures from Figure 7a-c show the ANN and DMD results for all the 4381 windows. Although not easily distinguishable, they offer an overview of the overall trend of the ANN estimation and their comparison with the reference DMD. Figure 7d-f makes a focus on only 100 windows; also in this case the estimations provided by the ANN-based method closely follow those provided by the  The last dataset to be explored in order to complete the analysis of validation scenario VS#1, is the one related to the 24 h recording of rated grid operations, namely DS3. In this particular test case the ANN has been trained on a data segment that is smaller than an half of the overall recording. This is due to the fact that, after several tests, the use of 50% or more of the data does not contribute to a better estimation. The training windows accounted for this scenario are only 50 out of 4381. The results are reported in Figure 7.
Figures from Figure 7a-c show the ANN and DMD results for all the 4381 windows. Although not easily distinguishable, they offer an overview of the overall trend of the ANN estimation and their comparison with the reference DMD. Figure 7d-f makes a focus on only 100 windows; also in this case the estimations provided by the ANN-based method closely follow those provided by the DMD method. The agreement between ANN and DMD results is very good for mode #1, the mode with less energy (blue line vs. light blue markers) and acceptable for the dominant mode #2 (dashed red line vs. purple markers). One aspect that should be underlined is that, even though there is a close tracking of the main trend of the estimates produced by the ANN with that of the DMD procedure, there are small difference between the two outputs. It is worthy to note that the estimations generated by the ANN-based approach are characterized by a smoother variation of the mode parameters, close to what happens in the real phenomenon.
Energies 2020, xx, x FOR PEER REVIEW 13 of 20 DMD method. The agreement between ANN and DMD results is very good for mode #1, the mode with less energy (blue line vs. light blue markers) and acceptable for the dominant mode #2 (dashed red line vs. purple markers). One aspect that should be underlined is that, even though there is a close tracking of the main trend of the estimates produced by the ANN with that of the DMD procedure, there are small difference between the two outputs. It is worthy to note that the estimations generated by the ANN-based approach are characterized by a smoother variation of the mode parameters, close to what happens in the real phenomenon. Because of the highly variable nature of the results in Figure 7, a further good figure of merit to assess the agreement between the ANN-based approach and the reference DMD is the mean value. Because of the highly variable nature of the results in Figure 7, a further good figure of merit to assess the agreement between the ANN-based approach and the reference DMD is the mean value. Figure 8 shows the comparison of the ANN output for the dominant mode #2 (dashed red line) with the average value of the reference DMD output (purple thick line). The ANN estimates of the LFO mode #2 frequency and amplitude fit well the reference average (Figure 8a-c). The ANN estimates of the mode #2 damping factor (Figure 8b) is significantly off from the DMD average and, at this stage, no explanation is found.  The aim of the validation scenario VS#2 is to assess the performances, in terms of LFO parameters, of different ANN architectures. Figure 9 shows the comparisons among the reference DMD results for the two modes (mode #1 light blue markers, mode #2 purple markers) and the corresponding ANN output for the three different ANN configurations described in Section 3.1 and Table 3.
Energies 2020, xx, x FOR PEER REVIEW 15 of 20 corresponding ANN output for the three different ANN configurations described in Section 3.1 and Table 3. The aim of the validation scenario VS#2 is to assess the performances in the estimation of the LFO parameters of different ANN architectures. Figure 9 shows the comparisons among the reference DMD results for the two modes (mode #1 light blue markers-left column, mode #2 purple markersright column) and the corresponding ANN output for the three different ANN configurations described in Section 3.1 and Table 3. The visual inspection of the graph offers an immediate perception of the general agreement between the output results of the proposed ANN architectures and the DMD results with a better degree of accuracy for the mode #2. For a quantitative evaluation, The aim of the validation scenario VS#2 is to assess the performances in the estimation of the LFO parameters of different ANN architectures. Figure 9 shows the comparisons among the reference DMD results for the two modes (mode #1 light blue markers-left column, mode #2 purple markers-right column) and the corresponding ANN output for the three different ANN configurations described in Section 3.1 and Table 3. The visual inspection of the graph offers an immediate perception of the general agreement between the output results of the proposed ANN architectures and the DMD results with a better degree of accuracy for the mode #2. For a quantitative evaluation, the root-mean-square error (RMSE) between the reference DMD results and the results from each architecture and for each mode has been computed and reported in Table 4.

Impact of the Data Window Lenght
The last validation scenario VS#3 is dedicated to the assessment of the effects, on the output results, of using different lengths of data windows. In this section the proposed ANN-based approach is implemented using time windows of 30 s and 60 s of DS1. The results obtained are reported in Figure 10. Basically, the use of a time frame of 30s does not heavily affect the ability of the ANN to recognize the three LFO parameters and, as expected, they match quite reasonably with those produced by the DMD method. However, two side effects should be considered in this study. First, the ANN performance outside the training set is degraded as the time window increases. Since the number of data is constant, longer time windows means less training set to be used in the training stage. Second, also the DMD results are negatively affected by this increase of time length. Although the demonstrated capability of both ANN and DMD to identify the correct dominant mode (mode #2) frequency at around 0.15 Hz (Figure 10a), the computed amplitude of mode #2 tends to be very close to that of mode #1 (see Figure 10c). This makes more difficult to identify the dominant mode. When each data window becomes longer than 60 s (Figure 10d-f) or more, the accuracy decreases even further.
Energies 2020, xx, x FOR PEER REVIEW 16 of 20 the root-mean-square error (RMSE) between the reference DMD results and the results from each architecture and for each mode has been computed and reported in Table 4.

Impact of the Data Window Lenght
The last validation scenario VS#3 is dedicated to the assessment of the effects, on the output results, of using different lengths of data windows. In this section the proposed ANN-based approach is implemented using time windows of 30 s and 60 s of DS1. The results obtained are reported in Figure 10. Basically, the use of a time frame of 30s does not heavily affect the ability of the ANN to recognize the three LFO parameters and, as expected, they match quite reasonably with those produced by the DMD method. However, two side effects should be considered in this study. First, the ANN performance outside the training set is degraded as the time window increases. Since the number of data is constant, longer time windows means less training set to be used in the training stage. Second, also the DMD results are negatively affected by this increase of time length. Although the demonstrated capability of both ANN and DMD to identify the correct dominant mode (mode #2) frequency at around 0.15 Hz (Figure 10a), the computed amplitude of mode #2 tends to be very close to that of mode #1 (see Figure 10c). This makes more difficult to identify the dominant mode. When each data window becomes longer than 60 s (Figure 10d-f) or more, the accuracy decreases even further.

Conclusions
This paper is the first step of a more extended project whose final aim is the development of an ANN architecture able to predict the system behavior (in a given time span) in terms of LFO modal parameters, and to classify the contingencies/disturbances based on an online training that has the memory of the passed training samples.
This contribution presented an ANN-based approach to estimate the mode parameters of LFO phenomena. The proposed technique is based on the development, offline training, and use of a suitably developed ANN architecture. The input and training data are real grid PMU frequency measurements provided by the Italian TSO. The development of the ANN training set is done through a preliminary pre-processing stage and by adopting a target vector selection policy, that is necessary in order to eliminate the detrimental effects induced by the occurrence of missing information in the PMU data stream in the form of NaN values.
The proposed technique has been validated using three main validation scenarios, in order to study the effectiveness of the method to recognize the LFO parameters, evaluate the best ANN architecture to be used, and assess the impact of data frame length.
From the obtained results it follows that the proposed method is capable to estimate, with a good degree of confidence, the three main LFO parameters for test case scenarios related to three real gridrecorded events. In this context, it seems that the best architecture to be used is the cascade feedforward one, which offers the estimation with the lowest RMSE values.

Conclusions
This paper is the first step of a more extended project whose final aim is the development of an ANN architecture able to predict the system behavior (in a given time span) in terms of LFO modal parameters, and to classify the contingencies/disturbances based on an online training that has the memory of the passed training samples.
This contribution presented an ANN-based approach to estimate the mode parameters of LFO phenomena. The proposed technique is based on the development, offline training, and use of a suitably developed ANN architecture. The input and training data are real grid PMU frequency measurements provided by the Italian TSO. The development of the ANN training set is done through a preliminary pre-processing stage and by adopting a target vector selection policy, that is necessary in order to eliminate the detrimental effects induced by the occurrence of missing information in the PMU data stream in the form of NaN values.
The proposed technique has been validated using three main validation scenarios, in order to study the effectiveness of the method to recognize the LFO parameters, evaluate the best ANN architecture to be used, and assess the impact of data frame length.
From the obtained results it follows that the proposed method is capable to estimate, with a good degree of confidence, the three main LFO parameters for test case scenarios related to three real grid-recorded events. In this context, it seems that the best architecture to be used is the cascade feed-forward one, which offers the estimation with the lowest RMSE values.
In the perspective of the final target of the abovementioned project, the presented approach represents the proof of concept that the estimation and identification of LFO modal parameters from real PMUs measurement data streams can be reliably and efficiently performed by suitable ANN architectures, still trained offline, for each grid event under consideration. Overcoming this critical point is the actual object of the ongoing research efforts.