Trend Analysis of Modal Identification based Real-time Power System Oscillations using l1 Trend Filtering

Over the past years, monitoring an electric power system's dynamic behavior using signal synchrophasors has become a real fact. This allows evaluating oscillatory stability in real-time, which provides important input to operators for early warning as part of the situational awareness. The analyzed signals come from phasor measurement units (PMUs), which allow the availability of synchrophasors with a rate of between 10 to 60 phasors per second [1]. The information from PMUs, together with some power system analysis applications, constitute a wide-area monitoring system (WAMS). ARTICLE INFO ABSTRACT


Introduction
Over the past years, monitoring an electric power system's dynamic behavior using signal synchrophasors has become a real fact. This allows evaluating oscillatory stability in real-time, which provides important input to operators for early warning as part of the situational awareness. The analyzed signals come from phasor measurement units (PMUs), which allow the availability of synchrophasors with a rate of between 10 to 60 phasors per second [1]. The information from PMUs, together with some power system analysis applications, constitute a wide-area monitoring system (WAMS). WAMS consists of different components such as dynamic databases, communication systems, and signal processing techniques. Based on this infrastructure, it is possible to observe and assess electric system dynamics operation in real-time by monitoring voltage, frequency, and power [2]. Given the data acquisition characteristic of PMUs, large amounts of data are currently available in control centers, which need to be analyzed. Therefore, the monitoring quality depends on the efficiency and precision of the WAMS applications at a high updating rate of one cycle and low time delay. As part of these applications, there commonly are modal identification algorithms that allow estimating the characteristics of oscillations such as amplitude, frequency, and damping of oscillatory modes present an electric system [3][4][5].
The quasi-stationary operation, related to small magnitude disturbances, such as load or generation variations, is characterized by the presence of oscillations in the rotor angle of generators due to the exchange of electrical energy with different power system elements. They are characterized by low-frequency oscillations in a frequency range of 0.1 to 3 Hz [1].
The signals of PMUs are obtained from generation or load buses. Consequently, these are remote signals that are delivered to a phasor data concentrator (PDC), located in the control center, via proper communication systems. A PDC device allows acquiring, filtering, processing, and storing phasor data from PMUs of the entire system, with its corresponding timestamp, to form a database. Depending on its location from where data is processed, it is possible to establish WAMS architecture, as follows: [2,6,7]  A centralized scheme in which data acquisition from PMUs, the implementation of analysis applications, and their visualization are carried out in the control center. It needs time synchronization to properly obtain data from PMUs.
 A decentralized architecture in which PDCs are located in designated areas of the system and accordingly the operation is locally monitored and supervised. This type of architecture requires adequate time synchronization to obtain data and exchange information between each area. It is possible to have adequate supervision of the power grid.
 A distributed scheme that constitutes a hybrid design between decentralized and centralized architectures. They have a master PDC (super PDC) that performs centralized control of data collection and actions of WAMS applications with each PDC (local) in the area of interest Moreover, some research has been developed over the use of these WAMS data. But most of them have focused on considering an appropriate behavior of different algorithms for a variety of applications, assuming that they will similarly respond, such as in simulation programs. Nevertheless, signals obtained from PMUs register the actual system operation where voltage, frequency, active power, and reactive power do not follow an ideal behavior, but they actually move in a permanent dynamic swing. Based on this fact, the different algorithms (such as the modal identification type) need to be adapted to the actual dynamic power system behavior.
Among the aforementioned analysis, it is possible to detect and locate disturbances in the system, as suggested, and determine poorly-damped oscillation modes as presented in [8]. These researches start from considering that WAMS information is clearly defined in period of disturbance, so it is obtained in a simulation software of the electrical system. As mentioned, this consideration is not appropriate.
Currently, several control centers worldwide have a WAMS, ordinarily based on commercial software. Thus, several applications to analyze the operation and stability of the power system are commonly available. In the case of the Ecuadorian electric power system (i.e., National Interconnected System), software developed by ELPROS company is installed, which acquired phasor data from PMUs and performs data analysis in real-time. This software has the following main applications [8]: Using applications, it is possible to collect each PMU data on a properly synchronized timescale that allows monitoring the system's oscillatory stability in real-time, with the primary function for identifying oscillation modes present in operation (application of the proprietary modal identification algorithm). As it is a commercial program, the different algorithms of applications only have a user manual [9], which limits its interpretability and explainability. This fact orients to establish the necessity of implementing additional signalprocessing techniques to complement the different analyses related to power grid conditions and events.
For instance, one of the most used signal-processing tools is the Fourier transform, as known as [10,11]. In [10], Fourier transform is used in real-time applications due to their fast actualization of data, permitting to keep data variability. In this case, the necessity of a signal trend analysis was determined for contingency or post-contingency periods of the power system.
For the case of modal estimation, since this kind of algorithm develops an optimization process, it is of particular interest to discriminate the trend of the estimation because this estimation is affected by the permanent dynamics of the power grid. In this context, the present paper proposes a novel methodology for analyzing the trend of the modal identification results. First, the results of the modal identification (i.e., amplitude in MW, frequency in Hz, and damping in % of the dominant oscillation modes) allow determining the level of oscillatory stability of each oscillation mode. These values are obtained using the modal identification algorithm. Afterward, a trend analysis must be performed in order to determine the most accurate results since they can vary from time to time, and therefore, other applications cannot use these intermittent results. In addition, these "intermediate results" may contain outliers or missing data (NaN) since PMUs, like any other device, present a degree of precision as analyzed in [10,11]. These characteristics determine the need to establish the proposed additional analysis to obtain confident information on oscillatory behavior. Hence, this paper proposes a process developed by applying 1 filter to calculate the wanted trend value. The main objective of this proposal is to help the operator to decide the best decisionmaking based on a more accurate interpretation of the actual oscillatory stability status.
The handling of a large amount of information from WAMS requires data mining techniques to handle high-dimensional data. It is also related to the management and analysis of high volumes of information that might be structured or not. With an adequate speed in the processing, multidisciplinary tasks require mathematical, statistical, and computer science concepts in an integrated way [8,12].
Following this precept, the 1 filter has been applied to financial and electronics data in [12,13] in order to establish the trend value of high-dimensional data. Based on its good performance for determining the trend of a large volume of data, 1 filter is adapted in this paper to allow monitoring the oscillatory trend behavior of an electric power system in real-time. For this aim, the 1 filter is implemented to analyze the modal identification results stored in historical records (offline).
Following those mentioned above, the present study looks to determine trends of variables (frequency and damping ratio) offline. For this, the stored historical data can be analyzed in specific time windows, different from the ones used by .
The rest of the paper is as follows. In section 2, the concept of filters for determining the trend of high-dimensional data is explained in detail. Section 3 contains the methodological proposal that allows monitoring of trends. The simulation studies and extracted results for evaluating the proposed trend analysis scheme feasibility are presented in section 4. Finally, in section 5 we show the conclusions of the work.

Theoretical Framework Modal Identification in Wide Area Monitoring Systems
Electric power systems commonly have several PMUs installed. Consequently, they are controlled via software that allows synchronized phasors data processing through a standard signal obtained from GPS. However, it requires handling high-dimensional data due to synchronized measurements with high accuracy. Accordingly, the information from PMUs properly processed in applications of WAMS has made it possible to monitor transient events in the power system [14].
Ordinarily, WAMS information is stored in the PDCs through a space-time structure that makes available time series of interest variables appropriately distributed according to the electric networks' topology. This data sequence allows the operators to monitor the system's operational status and events at a specific instant of time. Therefore, phasor measurements (e.g., active power) can be analyzed through different signal analysis techniques to determine their modal parameters (amplitude, frequency, and damping ratio), which allows knowing the oscillatory system behavior. In the case of an electric power system, it is essential to determine the parameters related to their oscillatory modes. For this aim, various modal identification techniques have been implemented, being the most commonly used: Prony analysis, Kalman filter, Wavelet transform, Empirical orthogonal functions, among others [1,14,15]. In addition, other algorithms developed for this purpose, such as the proprietary algorithm (which will be the one used for the present proposal) allows obtaining an analysis of variable attributes in time of modal analysis.

Evaluation of oscillations with
After a perturbation, an electric power system seeks to reach a new steady operating point. Accordingly, until reaching the new equilibrium point, ordinarily, power and frequency oscillations occur due to energy exchange between different generation units. The study of this oscillatory behavior is of particular interest for planning and operating issues. The power grid event simulation commonly applies the modal analysis technique, so this tool becomes the primary one for analyzing oscillatory stability. Consequently, it is possible to obtain the amplitude, damping ratio, and frequency of different oscillatory modes in the system. This tool is based on the eigen properties analysis of the linearized differential-algebraic equations that mathematically represent the power system expressed in state space.
On the other hand, WAMS applications use the information obtained from the system's actual operation, which allows recording actual dynamic events. These records include the different transients that affect its peak and drop, causes frequency variation, DC components, even if this is the minimum possible. Therefore, after proper data wrangling, this information can be used to determine oscillatory modes directly from measured variables of PMUs, via the application of mathematical algorithms named modal identification (a type of model-less analysis).
has a commercial proprietary algorithm to estimate existing modes in electric signals selected for this purpose, the active power registered by each of the PMUs is generally used. Therefore, it is possible to obtain parameters of dominant oscillatory modes directly from this algorithm without the necessity of performing the modal analysis of the mathematical model.
In [16] shows how some of the different sources of error in PMU signals are tackled. Data monitored by WAMS can lose its logical consistency through missing data, wrong timestamps, or incorrect identifiers. However, it is possible to ensure high precision of all system measures during transients of disturbance in the electrical system. In this context, a couple of questions arise: do PMUs have additional filters that allow measured data to avoid NaN or outliers when used in real-time algorithms such as the modal identifier? In addition, are there complementary algorithms to avoid misunderstanding results of the modal identification caused by errors of estimations? Unfortunately, there is a lack of this kind of analysis, and thus, there could exist appreciable variations in the calculation of modal parameters caused by errors in estimations done by the modal identification algorithm.
Notwithstanding what has been indicated, modal identification results, such as amplitude, damping ratio, and frequency of dominant oscillatory modes, contain relevant information of system dynamics. When adequately processed, they allow determining a fair oscillatory status. However, to ensure this, additional analysis must be performed in order to obtain the actual oscillatory status of the system as confident as possible. Therefore, this study seeks to carry out a trend analysis that allows defining a specific value of the modal parameter through a shortterm statistical analysis (not every 4 min as WAProtector statistical analysis done, but in specific windows depending on the oscillation mode frequency). The objective is to avoid wrong information concerning the system oscillatory behavior.
As shown in Fig. 1, a screenshot of the system of oscillatory stability application from active power signal recorded in a PMU of the Ecuadorian electric power system after a contingency occurred in a 230 kV transmission line (in April 2018) in which large amplitude power oscillations were recorded [17]. Fig. 1 shows that the application of modal identification allows determining dominant oscillatory modes immersed in the signal, in this case with a local mode that shows a frequency of 1,918 Hz, a damping ratio of 0.3%, and an amplitude of 9.71 MW. Because of the way how modal identification is performed, these values can vary from time to time, which is actually not desirable for the operators.

Trend analysis of data
In general, a data series trend is made by the application of linear regression or algorithms such as exponential smoothing or moving averages. Although linear adjustment has the advantage of being easily interpreted, it cannot capture changes in data trends quickly and is ineffective in the case of very short-term data. Whereas non-linear trend models often suffer from overfitting, which makes it impossible to represent variations. Therefore, they have little practical value [16,18].
In [19] proposes using electrical system data obtained from PMU to carry out the variable forecast. The study presents limitations for predicting time data by using simple time series methods such as moving average and regression analysis. But it shows that the determination of trend effectively allows establishing the monitoring of variations present in data.
In the time series where trend variations occur, simple non-adaptive methods, for a better fit, require establishing several trend segments a priory (for example, the function "detrend" in the trend model of Matlab). This shows the requirement of adaptive trend models through which trends quickly adjust to the variability of information update, an intrinsic characteristic of high dimensional data. Therefore, a trend-filtering model such as the one presented in [14] shows its feasibility to analyze the trend of high-dimensional data, such as those obtained from PMUs related to electric power system dynamics.
Analysis of trends through filtering models has been applied in high production and management of information. They have been used to improve data analysis and forecast. In general, when high-dimensional data exist, their fluctuations do not allow the intrinsic characteristics immersed in the data to be easily determined [19,20].
The large number of measurements of WAMS is subject to containing noise because every measurement device introduces its dynamics and distortions to measurements of variables of interest. Moreover, in the case of oscillatory stability, power dynamics might affect the results of modal identification in addition to the possible errors of the optimization process itself.
The Hodrick-Prescott filter is a mathematical tool used in macroeconomics, specifically in the real business cycle theory, to eliminate a time series of a cyclical component. This algorithm provides an extracted trend considering variations of sequences, through which intervals of growth or decrease are determined by the stochastic trend obtained with a smoothing condition [20]. This economics research area is oriented to the determination of the time series trend, where the series is decomposed as presented in (1) [21].

= +
(1) Where represents values of analyzed series, corresponds to the trend of series, and is a component that contains cyclical part and noise of the original time series, being the instant of time for each value of the series [22].
Moreover, to determine the trend component , it is necessary to solve the optimization (2), fulfilling two objectives. First, the trend must present a smoothing condition. Thus data before and after are analyzed and followed by random components that must be zero or very small, so they are not considered in the equation. In this context, parameter 1 is positive and is called the smoothing coefficient, which must be adjusted according to the purpose of application [12,21].
Where is the sample size, and parameter 1 allows regulating the size of difference ( − ). The trend filter 1 is a variation of the Hodrick-Prescott filter where the second term of (2) is substituted by its penalized norm, as established by (3). Consequently, the trend filter 1 produces estimations of the linear direction (not specified by the quadratic term of (2)). An adaptive way is sought to represent changes present in the series time, using the parameter 2 [22]. (1)

Preprocessing of information
WAMS allows real-time monitoring of the electric power system operation, and this information is stored in a database, which contains high-dimensional data from different electric grid buses. Measurements are stored as they arrive, so they are highly susceptible to fluctuations related to the system operations, especially when these fluctuations are profound, consequently generating information that present values that do not respond to the data set behavior ordinarily.
In addition, the optimization process developed by the modal identification algorithm is itself a cause of fluctuations in the results of modal identification from time to time, where need to be treated. These values are known as outliers or, in extreme cases, NaN, a situation that determines the necessity to carry out data cleaning and consistence (data wrangling) [1,23,24].
The preprocessing of data is done through techniques that allow identifying outliers throughout the study. One descriptive statistic (measures of central tendency and dispersion) so it is possible to describe the data behavior.
Data NaN is estimated in the present study. A linear interpolation was used now for outliers. The latter modifies data series behavior. Specialized literature shows that some methods have been implemented that allow detection and modification of these values in the signal to achieve a good behavior pattern of time series. In the present study, statistical analysis of the quartiles is used [24][25][26].

Method
The identification of trends has been used in the forecast of time series, as is the case of estimating the stock market price as presented in [22]. In [27], for extracting the trend of signals from PMUs such as voltage, the angular separation between areas, and electrical charge, the slope can be determined before variations and thus establish dynamic safety indices of the power system. Once the signal of interest has been selected, information is preprocessed using descriptive statistics, treatment of NaN data, and outliers using function "rmoutliers" of Matlab or Python [25][26][27]. In this study, some data of 1.5 times above the upper quartile (75%) or below the lower quartile (25%) are considered as outliers.
WAMS monitors the electric power system operating condition and obtains information on dynamics. These data constitute inputs of other commercial applications, as is the case of modal identification algorithm. This application performs the identification of dominant oscillatory modes immersed in the selected signal (i.e., active power) every time that a new sample arrives (i.e., each 16.67 ms). The aforementioned issues affect this computation, and therefore, the results of the modal identification can vary from time to time. Given that additionally, there is no access algorithm of the modal identification process of intrinsic dynamic characteristics of an oscillatory event, generally, appreciable variations (even lack of data) are obtained with a high sampling of data.
In addition, can also perform a statistical analysis (mean of oscillatory mode parameters) using time windows defined by the user (in of at least 4 minutes). However, this information is not completely useful for the operators who need confident results in almost real-time (few seconds). In summary, the situation that determines high-dimensional data could lead in extreme occasions not to have a specific value of analyzed signal such as frequency, amplitude, and damping ratio of mode [27]. This aspect can cause incorrect decision-making in the operators and thus possible blackouts.
As an example, Fig. 2 shows power oscillations of a generator (solid line) and trend line (dotted line) in a selected window of an event registered in WAMS. Consequently, it needs highdimensional data and a moving time window requirement. It is impossible to determine the analyzed signal value immediately considering the total event period. Therefore, it is interesting to use a moving time window for analysis. Moreover, it is possible to establish the trend (dotted line) of the signal for each window. In the present study, time window Tw is set based on frequency and damping ratio of analyzed mode as in (4), more detail about the algorithm and how to calculate the window can be found in [15]. Where is the frequency of oscillatory mode swing and and is the damping ratio of the signal identified oscillatory mode and the limit damping ratio selected by the user, respectively. In this study, the limit damping ratio was considered as 0.07 because it is one used as a reference established in the Ecuadorian electrical system electric power system. This is a characteristic required for the case of setting the modal identification algorithm provided by the of , where it is interesting to set a value, other systems can choose other values to maintain an adequate level of dynamic security.  Fig. 3 shows the proposed methodology that allows determining the trend of modal characteristics of dominant oscillatory modes (frequency , amplitude and damping ratio ). The objective function of filters requires an iterative process to determine the trend as follows: Step 1: Set oscillatory modes based on amplitude and frequency of data window selected using (4) from the database, using the Matlab tool.
Step 2: Structure matrix X of p oscillatory modes, in which the first column corresponds to the time recording of each data (t), and the following columns correspond to the selected oscillatory mode obtained from database of modal identification results. For instance, the amplitude (A) is shown in Fig. 4, a similar structure is established for damping ratio and mode frequency.
Step 3: Carry out information processing, as stated in Fig. 3, to have a refined data matrix from which the trend is determined.
Step 4: Based on what is established in 2.3 of section 2, trends are obtained through filters implemented in Python, using "statsmodels" and "pandas" libraries.

Results and Discussion
The proposed methodology is applied to the data obtained from an event that occurred in the Ecuadorian electric power system on November 27, 2018. These data were obtained from software.
Since modal identification for the Ecuadorian WAMS system is carried out through an optimization process in software, the characterization of modes offers for data they are composed of frequency, amplitude, and damping ratio.
In Fig. 5, a set of data for each mode is shown in a scatter plot of amplitude vs. frequency. The maximum amplitude is 1.36 MW with an average frequency of 0.9936 Hz, representing a local mode as observed in Table 1. This will be the "selected oscillatory mode," and their amplitude and frequency exhibit less dispersion than the damping ratio.     The modal identification tool of software produces values with considerable variation (they might be considered as errors of the optimization process), as shown in Fig. 6. This situation shows the necessity of considering trend analysis. Since, without this analysis, raw results of modal estimation could give wrong information on the oscillatory behavior of a system. On the other hand, it is impossible to use these signals of oscillatory mode to feed a piece of control equipment because they present a high variation. Given update rate and to establish greater reliability in data provided by WAMS, it requires algorithms that can better quantify the trend of a signal. It is not influenced by sudden and fictitious level changes due to regular operation or oscillatory events present in a power grid. Fig. 7 graphically shows a trend for damping ratio signal obtained using linear regression (Matlab function detrend), filters such as moving average, median, Hodrick-Prescott, and 1 .
Although moving average and median filter methods allow determining a signal trend, these are subject to adjacent data that causes data movements to present a high fluctuation similar to that shown by the original data. While Hodrick-Prescott and 1 filters allow extracting the trend of series considering its changes. It is possible to characterize the disturbance adequately. This situation can be observed more clearly in a two-minute window of the event presented for 13 minutes in the Ecuadorian system in November during the mean demand period (11:38 to 11:51). For determining the goodness of each of the methods, coefficients of determination ( 2 ) were established because they do not depend on the value of data (they are very large or small). They are in the range {−∞, 1} [20]. While the coefficient is far from 1, the method does not fit the comparison model, a global trend of series. Table 2 shows 2 coefficient for damping ratio signals and frequency for each of the applied methods. Table 2 shows that the coefficient of determination 2 that is closer to 1, corresponds to filter 1 for the case of two signals, then filter Hodrick-Prescott is found while moving average. Median filters are farthest from 1, which verifies that it maintains variability of series, a situation that can be observed in Fig. 7.
In Hodrick-Prescott and 1 filters factor λ called "smoothing parameter", which penalizes deviation of data, the high filter is adjusted towards the global trend of series (linear regression).
When is small and is close to zero, it is changed to the original data. In [13,28], the parameterization of the factor is presented through simulations and empirical tests. It is established that it depends on the type of data and the size of the window. Consequently, for determining , there is no exact analytical solution but rather one that represents changes in the data set the trend. This situation provides that the value of must be adapted to the series size to estimate changes in data trend adequately. In [21,22] an analysis of factor is carried out in which it is determined for filter 1 in time windows of an order of seconds or less than 4 minutes value can be adjusted to approximately 100. In comparison, for windows more significant than 4 minutes in references show empirically that determined is at 1200.
For the case of filter Hodrick-Prescott, a high value for is required to determine the series trend; due to the high-dimensional data. According to [21], this filter is better adapted in time series of a financial type where there is high-dimensional data these present weekly, monthly, and annual periodicities.
According to [26], where tests were carried out for different time windows, the values presented in Table 3 were used for the present study: that allows obtaining trend and observing its changes in data sets of variables under review the highest coefficient of determination 2 . For the selected oscillation mode, an analysis of different methods for determining the trend on damping ratio has been presented. The following figures show the application of filter 1 for other variables of the selected mode. Fig. 8b shows a trend of frequency, and its cyclical component for a window of 13 min, in which it is determined that it corresponds to a local mode since its frequency in Hz is between [0.98-1.01] and in Fig. 8a presents WAMS data for mode frequency. Fig. 9a shows amplitude in MW of the oscillatory mode analyzed during 13 minutes. Fig. 9b shows a value of data trend, which remains within the range [0.4-0.9], after application of the proposed methodology. This situation will allow the use of signals for a control element (for instance like input for power system stabilizer PSS adaptive tuning methods).

Conclusion
At present, very little has been reported regarding how to use data that are obtained from WAMS applications for a case of system dynamics and stability. The real-time power system oscillations must be properly processed since that data may be determining outlier fluctuations for postoperative analysis of system events. By characterizing time series, operators visualize the operating status of the system based on electric variables. In these cases, trend analysis results so important in order to help to avoid wrong information for auxiliary control signals of the power system stabilizer (PSS). So, the filtering results using 1 trend filtering technology and by some common filtering methods were compared, where the robustness of 1 trend filtering method to increase the confidence in monitoring time-series data obtained from modal identification algorithm of WAMS. This allows a considerable improvement in supervision and monitoring of oscillatory stability in power systems. Consequently, the trend permits determining the value of variables that characterizes oscillatory modes avoiding possible misunderstanding caused by estimation errors. In summary, the usage of trend filter 1 shows its applicability to characterize data series of a variable of interest, often done intuitively.
For 1 trend filtering, increasing the value covers a longer time window by keeping the highest coefficient 2 without the filtering results being distorted like the results of other filtering methods. To analyze the trend of the dynamic variables in this paper, when is in the range of 700-1200, the filtering curve of these dynamic variables by the 1 trend filtering is smooth and undistorted in the whole test time, desired features by an auxiliary signal that is used by devices such as PSS or power oscillation damping (POD) and thus guarantee a level of stability at the point of operation of the system.