Machine Learning Based Real-Time Monitoring of Long-Term Voltage Stability Using Voltage Stability Indices

This article presents a machine learning approach to predict the long-term voltage stability margin as represented by the Loadability Margin (LM). LM is an intuitive and easily understandable indicator of voltage stability. The unique feature of the proposed technique is the use of different Voltage Stability Indices (VSI) proposed in the literature as inputs to an ensemble of machine learning models which predict the LM. The VSIs used are carefully selected to include those based on different principles and computable using real time synchrophasor measurements. In addition, the paper presents a methodology to generate training data under different operational conditions and N-1 contingencies to train the machine learning models. The best machine learning algorithm and the categories of input VSIs are selected through a comparative study. These studies were conducted on the IEEE 14 bus system and IEEE 118 bus system and led to the selection of Random Forest Regression machine learning algorithm, and confirmed the accuracy and robustness of the proposed method. The system was implemented on real time PhasorSmart® synchrophasor application platform and validated using RTDS® real-time simulator. The impact of synchrophasor measurement errors on the proposed technique were also analyzed.


I. INTRODUCTION
Modern power systems are operated with smaller stability margins to optimize the utilization of assets, to cater diverse demand patterns and to accommodate ever increasing renewable generation. Therefore they are more prone to various system instabilities, and specifically the voltage instability draws a special attention as the major cause responsible for a number of black-outs occurred in various parts of the world. In many of these events, progressive voltage drops lead to cascaded tripping of transmission lines associated with rotor angle instabilities, eventually collapsing entire networks [1]- [4]. The voltage stability is mainly affected by the available generator reactive power limits, transmission network The associate editor coordinating the review of this manuscript and approving it for publication was Gianluigi Ciocca . strength, limits of reactive power compensation devices and load characteristics. However with high renewable penetration levels, the capability limitations of distributed renewable resources and associated electronic controllers also impact the voltage stability margin of the power system [5].
Different approaches used to voltage stability assessment include modal analysis, P-Q and Q-V curve analysis, singular value decomposition, sensitivity analysis, voltage stability indices and continuation power flow [6]. With respect to online voltage stability monitoring, Voltage Stability Indices (VSI) have gained more attention, which can provide quantitative parameters to determine the proximity of voltage instability on a real-time basis [7].
Voltage stability in a Region of Interest (ROI) can be considered as wide area phenomenon. Therefore, the VSIs which are calculated using real-time wide-area measurements provides a better insight into the voltage stability of a particular ROI [7]. Synchrophasors provide high-resolution synchronized dynamic data across a wide area of power system [8], [9] enabling a wide range of voltage stability monitoring and controlling potentials for real-time implementations. In literature, many VSIs which could be used to assess wide area voltage stability using synchrophasor measurements have been proposed [7]- [12] and some are detailed in Section II-B. One major drawback of many VSIs proposed in the past literatures from the Operators perspective is that they do not provide enough intuitive information as provided by the offline analysis tools such as P-V curves or continuation power flow for making proper decision. Moreover, these VSIs show different levels of accuracy under different conditions and load models [6]. The practical aspects such as measurement errors and incorrect network topology information can also affect the accuracy of VSIs estimation in different ways and it is difficult to single out one VSI which is more reliable.
Application of computational intelligence and data mining for voltage stability assessment has been investigated in recent years. Online Long Term Voltage Stability (LTVS) assessment using an Artificial Neural Network (ANN) with voltage phasors is proposed in [16]. Decision Tree (DT) based classification approaches are proposed in [13], [14] for assessing system voltage security, while [15] used DT classification for LTVS assessment under small disturbances. To optimize prediction accuracy and speed, Extreme Learning Machine (ELM) technique is introduced for Short Term Voltage Stability (STVS) assessment in [17], [18]. Voltage stability margin prediction via Convolutional Neural Network (CNN) is also proposed in [19]. Support Vector Machine (SVM) based regression has been presented in [20], [21] to assess LTVS. These works have shown a good potential, however, their real-time performance has not been validated and tested thoroughly to improve the real-time operation. There is a rapid progress in machine learning technology and data science, due to continuous availability of increased computational power, and cloud technology in dealing with large power systems [22], [23] and efficient automation tools for power system analysis.
This article investigates a new approach in which the strengths of machine learning and traditional VSI based approaches are combined to compute a familiar and easily interpretable composite VSI suitable for real-time applications. Although machine learning based approaches such as artificial neural networks and support vector machines have been proposed to predict the voltage stability or loadability margin in previous studies, this article introduces two new concepts to improve the accuracy and robustness: (i) use of multiple voltage stability indices as input features instead of homogeneous set of measurements, and (ii) use of multiple machine learning models in an ensemble to enable robust predictions under varying system topology conditions. It will be shown that these two factors can contribute to improve the accuracy and robustness when applying to larger systems. In addition, the paper also presents systematic approaches to select the input features and parameters for the machine learning models. Finally, the proposed method was implemented and demonstrated on a real-time test setup while highlighting and solving some unique problems that would be encountered only in a real-time practical power systems. Reminder of the paper, framework of the approach and the method of development is presented in Section II and III. Numerical results is presented in Sections IV and V, the practical implementation is demonstrated using a test setup consisting of a RTDS R real-time simulator and PhasorSmart R , which is a platform for synchrophasor application development and visualization.

II. PROPOSED SOLUTION AND RELEVANT FUNDAMENTALS A. LOADABILITY MARGIN (LM)
The voltage stability is commonly explained considering a load (PQ bus) with rest of the power system represented using a Thevenin equivalent circuit as shown in Figure 1(a). The inductive network elements limit the voltage support at the load bus, as the power flow increases [4]. This leads to a point where more power cannot be transferred through the transmission network. This point is defined as the voltage collapse point. The additional power that can be transmitted before reaching the voltage collapse point from the current point of operation is usually referred to as the Voltage Stability Margin or the Loadability Margin (LM), which is typically illustrated using the P-V curve as shown in Figure 1(b). LM is an intuitive and easily understandable indicator of proximity to voltage instability. Operators can be alerted and automatic remedial actions can be initiated when the LM drops below pre-determined critical values.
However, it is impossible to calculate the LM using traditional power flow solution methods since they diverge near the vicinity of the voltage collapse point due to ill conditioned Jacobian matrix. In order to avoid singularity of the Jacobian matrix, the power flow equations can be reformulated by applying a locally parameterized continuation technique. The resulting Continuation Power Flow (CPF) algorithm [3] can be used to trace the P-V curve beyond the voltage collapse point. Although LM is a good indicator, it is difficult to compute the LM in real-time using the CPF for a large network, due to iterative computations involved. Furthermore,  topology and parameters of the network at current time is required by CPF.

B. MACHINE LEARNING BASED APPROCH FOR COMPUTING LM
It is proposed to express the LM as a function of a set of VSIs which can be computed using synchrophasor measurements on a real-time basis. The particular function that relates the input VSIs to LM can be learned from data using a suitable machine learning technique. It is also proposed to use an ensemble of machine learning models (MLMs), each of which uses a different group of input VSIs or machine learning principle. The underline hypothesis is that by combining models that use VSIs based on different principles, LM can be predicted in a robust manner. The concept is illustrated in Figure. 2.

C. MACHINE LEARNING TECHNIQUES
Machine learning techniques are used to approximate the unknown relationship between the multiple input features, VSIs in this case, and the output LM. Supervised machine learning is applied in this work, and the feasibility of the regression techniques listed in Table 1 are examined.

D. VOLTAGE STABILITY INDICES (VSI)
Eleven candidate VSIs which evaluate the voltage stability using diverse principles are considered. Their definitions and the conditions pertaining to the derivation are briefly given in Table 2. Some VSIs assess the voltage stability of a particular load bus considering a Thevenin equivalent as shown in Figure 1(a). To obtain the Thevenin equivalent at the i th bus, the online technique proposed in [24], which uses two different local measurements at bus i for the calculation, can be used.
Placement of phasor measurement units (PMUs) depends on the measurement requirement of each VSI. PMUs are needed at the bus of interest for the local measurement based VSIs such as SDC, ISI, VSI bus , VSLI, VSLBI, VCPI_1 and VSM (see in Table 1 for definitions). In order to determine L and ERPR indices, PMUs are required at all generator buses and at the bus of interest. WALI index can be determined by placing synchrophasor at the boundaries of the region of interest (ROI). Synchrophasors must be placed at all the system buses to determine SVSI index. All these VSIs require positive sequence quantities of the synchrophasor measurements.

III. METHODOLOGY
The development of the proposed voltage stability assessment system consists of several steps, including generating training data, training and evaluation of the machine learning algorithm, and addressing real-time implementation issues. These steps are shown in Figure 3 and described in the following sections.

A. DATA GENERATION FOR MACHINE LEARNING MODEL TRAINING
The approach used for calculating the training data is to perform a continuation power flow, starting from a given operating point. The values of VSIs and the corresponding LM are then calculated using CPF results. The training data set should properly cover the expected region of operation under both normal and contingency situations, and therefore, the base case scenario along with credible N-1 (and N-2, etc. as required) contingency scenarios such as tripping of generator units, transmission lines, fixed shunts, transformers and loads should be taken in to account when generating initial operating points for the CPF.
Random deviations are introduced to load and generator settings of the base case and other contingency scenarios in order to have different initial operating points. It is more desirable to generate these random deviations using a normally distributed random variable to follow the natural trend of decrease in the frequency of occurrence with the increase of magnitude of deviation, rather than using a uniformly distributed random variable. Therefore load active and reactive power perturbation are generated using (1) and (2) respectively; where P (i) LO denotes original active power of i th bus and ε (i) PL (k) represents the normally distributed k th random variable with a mean of 0 and a standard deviation of 0.1 for the i th bus. The load reactive power and generator active power deviations are generated in a similar fashion with the same mean and the standard deviation. When computing generator voltage set point deviations using (3), a standard deviation of 0.01 is considered.
All the randomly generated operating points are however not realistic, and their feasibility should be checked by running a power flow. The well-known power system analysis software PSSE R [37] was automated to conduct power flow studies for feasibility check in this work; if the power flow converges before reaching the iteration limit, the operating point is considered feasible.
In order to limit the number of data points, some noninfluential contingencies (for voltage stability) are eliminated by considering the value of Contingency Severity Factor (CSF) shown in (4) where V i represents the steady-state voltage of the i th bus after the contingency, V BC i represents the base case voltage and V tol i denotes the defined voltage deviation tolerance which is equal to 0.025 in this study. If CSF exceeds 1 for at least one of the load buses after the contingency, it is considered as a severer contingency.

B. CALCULATION OF INPUT-OUTPUT DATA SET
In order to generate voltage and current phasors, and LM data up to the voltage collapse point, the conventional CPF technique [3], [38] is used. Important aspects such as generator over-excitation limit reach and automatic transformer tap changing operations are integrated into the CPF algorithm.
In CPF, when a generator reactive power rises to its limit, it is treated as a PQ bus with generator's Q injection set to its limit. When a transformer is equipped with an on-load tap changer, the secondary voltage is regulated between two set points, until the maximum tap positions are reached. The load is increased uniformly for all load busses in this work, but it is possible to introduce more specific or randomized load change patterns if desired. Once the CPF is performed, the trajectory is resampled, and for each sample point, VSIs and the corresponding LM are computed, and saved to a database.

C. MACHINE LEARNING MODEL (MLM) TRAINING
Finally, using the data generated, the machine learning models are trained to predict the LM and are tested to avoid over and under fitting. Predicting the system LM using calculated VSIs requires a multi-variable regression. The database is split in the ratio of 4:1 as training and testing data. K -fold cross validation, where the training dataset is again split into K consecutive folds and each split is then used once as validation set while the remaining K -1 folds are used for training. The best cross validation split is used to obtain the best generalized estimate. In this study K was defined as 10. Root Mean Square Error (RMSE) and coefficient of multiple determination (R 2 ) are considered as measures to evaluate each MLM.

A. TEST SYSTEMS
The IEEE 14 bus system and the IEEE 118 bus system are considered for evaluating the proposed voltage stability margin assessment approach. The IEEE 14 bus system Figure 4 consists of 5 generators, 9 load buses with static loads and one fixed shunt. Generators at bus-3, -6 and -8 are operated as synchronous condensers. Analysis of the voltage profile of the system under severer contingency scenarios showed that bus-14 is the most critical bus in terms of the voltage instability for this system. The IEEE 118 bus system consists of 19 generators, 35 synchronous condensers, 56 load buses with static loads and 14 fixed shunts. It was found that bus-45 is the most vulnerable bus for voltage instability in the IEEE 118 test system. The data of the IEEE-14 and -118 bus test systems are available in [39] and [40] respectively.

B. DATA PREPARATION
The bus voltage phasors and the VSI data sets were generated through the approach described in Section III for both test systems. The number of initial operational points considered when creating the training and testing database for the IEEE 14 bus system was 3,196 and that for the IEEE 118 bus system was 5,424. The total number of data points generated through resampling of CPF results were 338,366 and 632,161respectively for the 14 and 118 bus systems. A CPF program was implemented in MATLAB R with all necessary features and its accuracy was verified. Figure 5 shows an example of a PV curve of a load bus (Bus14) in the IEEE 14 test system. The curve shows the impact of a generator reaching its over-excitation limit as well as the action of an automatic tap changing operations of a transformer. The generator connected to bus-2 reaches its over-excitation limit and changes the trajectory of the voltage profile when the system loads increase gradually as shown in Figure 5.The automatic transformer tap changing operation of transformer between bus-4 and -7 rises the P-V curve and pushes the critical point further as shown in Figure 5.

C. TRAINING FEATURE SELECTION
Four different MLMs that use different categories of input features were developed for identifying the best feature set: MLM-1: Uses a set of bus voltage magnitudes and phase angles as inputs. The most relevant buses are selected using the recursive feature elimination method [41]. This MLM is similar to the approach proposed in [16] and will be used a reference model. MLM-2: Uses all of the VSIs listed in Table-I as input  features. MLM-3: Uses a set of VSIs which are calculated using only the local measurements of the considered bus. The VSIs used in MLM-3 are SDC, ISI, VSI bus , VSLI, VSLBI, VCPI_1 and VSM.
MLM-4: Uses a set of most relevant VSIs as inputs. The most relevant inputs are selected through Spearman's rank correlation coefficient method [42], which provides a correlation coefficients equal or close to 1 or −1 when two data sets have close monotonic relationship. When there is no monotonic relationship, the correlation coefficients are close to 0. In this study, only the features with very high   positive or negative correlation were selected to minimize the number of input features and improve the accuracy. As a rule of thumb used in statistics [49], Spearman's rank correlation coefficients equal or higher than 0.9 or equal or less than −0.9 are considered as having very high correlation. Therefore, 0.9 was used as the magnitude threshold for feature selection.
Application of recursive feature elimination for the IEEE 14 bus system phasor data resulted in voltage phasors of bus 1, 2, 8, 10 and 14 are the inputs for MLM-1. The corresponding voltage phasors for the MLM-1 for IEEE 118 bus system are from the buses 2, 3, 5, 11, 13, 18, 19, 29, 32, 56, 57, 80, 81, 88 and 95. The Spearman's rank correlation coefficients heat map for the IEEE 14 bus system, computed with database created in Section II-B, are shown in Figure 6 The indices SVSI, VCPI, VSLBI, VSLI, VSM and L indices can be recognized as the most important features (correlation > 0.9). However correlation between VSM, VSLI, VCPI and VSLBI is 1, hence representing only one of these is sufficient, and VCPI was selected. Thus inputs to MLM-4 are VCPI, SVSI, and L.      testing phases with the five machine learning algorithms considered. The results clearly indicate that ANNR and RFR are better algorithms for this problem. Although the linear regression perform somewhat statisfactorily for the 14 bus system, its performance is poor when the system becomes large. A second degree polynomial equation was considered for the polynomial regression since training of higher order polyinomials was extremely difficult due to eponentially growing number of terms with multiple inputs. As the number of data points were extremely large, computer memory became a constraint during the training of both IEEE 14 and IEEE118 bus systems.
Both LR and PR are generic parametric functions where the parameters are determined with the objective of minimizing the error between the fitted curve estimation and the training data. It can be observed that these parametric curves will predict the LM with an acceptable accuracy when the system is small; however when the system size increases, the predictions from these generic parametric functions show higher errors and lower co-relation. Therefore generic parametric functions are not very satisfactory for this problem.
ANNR learner shows much higher testing error for MLM-2 and MLM-3. Analysis of the learning curves showed that these two trained ANNR models have high variance in testing error [43], although the training error was decreasing with each iteration. Since RFR shows better accuracy than ANNR model in both IEEE 14 and IEEE 118 bus systems, and exhibit good generalization compared to ANNR, RFR is clearly the most appropriate algorithm for this problem.
When consider the results from both IEEE 14 and 118 bus test systems, predictions from MLM-2 which uses VSIs as the input features shows better overall performance (especially for the larger 118 bus system) than MLM-1 which directly uses voltage phasors, confirming the initial hypothesis. Moreover, MLM-2 achieves this with a lower number of inputs features; MLM-1 of 118 bus system uses 30 features (magnitudes and angles of 15 phasors) while MLM-2 uses 11 input features. Although calculation of 11 features need all of phasor measurements, intermediate step of calculating VSIs makes the MLM simpler and more accurate. MLM-3 is better suited for practical implementation as it requires synchrophasor data only from the most critical buses to be monitored, but comes with little sacrifice in the accuracy. MLM-4 and MLM-3 are comparable, but MLM-3 has marginally better accuracy than MLM-4 for the 118 bus system.

D. SENSITIVITY TO SYNCHROPHASOR MEASUREMENT ERRORS
Noise, bias errors, outliers and communication errors can be associated with field measurements. Such errors in synchrophasor measurements can be identified and corrected by using an appropriate data validation method. Detailed investigation of data validation is out of scope of this article but possible methodologies can be found in literature [46]. However synchrophasor measurement errors cannot be corrected using data validation.
Practical Synchrophasor measurements data may induce errors in the VSIs which could affect the LM prediction. According IEEE standard C37.118-2011 [44] synchrophasors must maintain a total vector error (TVE) less than 1% under steady state conditions. The effect of synchrophasor measurement errors to LM prediction is analyzed by inputting erroneous voltage and current phasors generated by introducing random errors to magnitudes and phase angles such that TVE ≤ 1%. The voltage input for the i th bus with measurement errors can be represent as in (5) where V i and θ i are the per unit magnitude and angle errors.
The erroneous current phasors are generated in a similar fashion, and used to calculate the VSIs which are fed to different MLMs trained using RFR algorithm. Fig. 7 compares the RMSE of different MLMs with and without the influence of synchrophasor measurement errors. MLM-3 shows significant prediction error under the influence of synchrophasor measurement errors compared to the others which show relatively lower prediction error even with synchrophasor measurement errors.

E. MACHINE LEARNING MODEL ENSEMBLE
In an MLM ensemble, multiple diverse models are used to predict a common outcome in order to improve the overall performances and robustness. Even though MLM-3 is more amenable for practical implementation, MLM-1 shows higher resilience to synchrophasor measurement errors. MLM-4 on the other hand is more accurate for larger systems.
Hence the strengths of different MLMs can be exploited through ensemble modeling. Using the weighted average ensemble method, the final prediction Y en is obtained as denoted in (6) using predictions of individual MLM-s.   Table 8. The best weightages, 0.5, 0.25 and 0.25, were selected considering the RMSE and R 2 for the testing data set of IEEE 14 and IEEE 118 bus systems. It can be seen that the ensemble model shows better performance than individual MLMs. Figure 8 shows an example case of LM prediction for the IEEE 14 bus system under n-1 contingency (transmission line between bus-2 and -4 out of service). The predictions of different MLMs from the initial operating point to the voltage collapse point are shown. The scenario includes a generator hitting its reactive power limit (when LM≈0.13) The predictions of the ensemble model are much closer to the target compared to the predictions individual MLMs, some of which clearly deviate at the point of generator reaching its reactive power limit.

F. COMPARATIVE EVALUATION
In order to compare the efficacy of the proposed LM prediction approach, its performance was compared with two somewhat similar approaches proposed in the literature to estimate the loadability margin. These three candidate approaches are compared in terms of the prediction accuracy.
Approach A: This is the MLM ensemble proposed in this article. Input features include the critical bus voltage phasors and calculated VSIs. In this approach RFR models with 20 trees and 100 trees were used for the IEEE 14 and 118 bus systems respectively.
Approach B: This is the LM prediction approach proposed in [16]. The voltage phasors from the critical buses of the power system are the input features. An ANNR model with three hidden layers of 100 neurons was used for IEEE 14 bus system. For the IEEE 118 bus system, an ANNR model seven with a hidden layers of 100 neurons was used.
Approach C: This LM estimation technique is proposed in [20] and uses the real and reactive powers of all buses in the power system as input features for a ε-Support Vector Regression (SVR) model. A ε-SVR model with ''rbf'' kernel, C=1 and γ = 0.1 was used for the IEEE 14 bus system and a ε-SVR model with ''rbf'' kernel, C=1 and γ = 0.15 was used for the IEEE 118 bus system. These parameters were chosen using a trial and error approach.
Prediction models in all three approaches were trained and tested using the same set of data (for each power system) containing the same operational conditions and power system contingencies. Table 8 summarizes the testing results for the three approaches for both IEEE 14 and IEEE 118 bus systems. Approach has a lower RMSE and R 2 compared to the other two Approaches. Although Approaches B and C have close performance for the IEEE 14 bus system, its RMSE is significantly higher for the IEEE 118 bus system. This is despite taking measurements from every bus in the case of Approach C. This comparison highlights the robustness of the approach proposed in this article for larger systems.

V. REAL-TIME VOLTAGE STABILITY MARGIN PREDICTION TESTBED
The proposed methodology of predicting LM using local measurement based VSIs and voltage phasors of significant buses was implemented on the real-time synchrophasor application platform PhasorSmart R , and tested using an experimental setup consisting of RTDS R real-time simulator and a laboratory synchrophasor network. RTDS system simulated the IEEE 14 bus system model in real-time and published the synchrophasor measurements. The loads were gradually increased during the real-time simulation to push the system towards the voltage instability. At each steady state operation condition, VSIs were calculated and fed to the trained RFR model to predict LM. The results were displayed on the Grafana R visualization tool, which is a part of the PhasorSmart platform.

A. TEST-BED ARCHITECTURE
A schematic of the hardware architecture of the test bed is shown in Figure 9. The real-time simulator consisted of a RTDS rack containing PB5 processor cards, a GTNET_PMU communication card, and a GTSYNC card connected to a SEL R 2407 satellite clock. A local area network (implemented using a RuggedCom utility grade Ethernet switch) connects the GTNET output with a PC that runs the PhasorSmart platform. VOLUME 8, 2020 Software architecture of the synchrophasor application program consists of three main platforms: ePDC Phasor Data Concentrator (PDC) and Synchronous Data Server (SDS), C++ application program which implement the VSI analytics and LM estimation using the trained RFR module using data extracted from SDS, and the web based Grafana visualization tool. Grafana provides the operator a user friendly monitoring interface along with the alarms that activate when the system become closer to the verge of voltage stability.

B. TRANSIENT IDENTIFICATION USING WAVELET ANALYSIS
When subjected to a significant disturbance such as a fault, sudden load change, tripping of a line or equipment, etc., power systems variables go through transient variations. Evaluation of VSIs using transient measurements results in highly unrealistic values. The accuracy of synchrophasor measurements during the transients is not defined [44]. On the other hand, the long term voltage stability is a slower phenomenon and calculation VSIs and LM during the transient periods is meaningless. Therefore, transient periods must be detected and the process of calculating LM should be suspended until the system approaches a steady state. In addition, many VSIs require voltage and current phasors taken at two different steady states, and the transient detection can also be used to recognize possible occurrence of new steady states.
Wavelet analysis which decomposes a signal into basis functions that are localized in scale and time has been used as an efficient technique to detect the transient changes.
In order to detect transients, it is proposed to apply online Discrete Wavelet Transform (DWT) implemented using Mallat's tree algorithm [45] on the synchrophasor magnitudes. Three decomposition levels with ''Haar'' mother wavelet applied on synchrophasors voltage magnitudes measured at 30 frames per second found to be sufficient. Mean Wavelet Energy (MWE) computed using detail wavelet coefficients as proposed in [46] is a good indicator of transients. MWE is calculated using a moving data window as in (7) where d i,k denotes the decomposed wavelet coefficient of the i th decomposition level of the k th sample of the data window with total of N samples.
Calculated MWE of the moving window is compared against a threshold to identify any transients within the window. A data window of 8 measurements (N=8) and a threshold of 0.0005 pu was used in this study. When the measurements are free of transients, the local measurement based VSIs are calculated in 128 cycles (2.13s) intervals. At the beginning, voltage and current phasors are measured if the system is at the steady state. Afterwards if the system changes from one steady state to another steady state the voltages and current phasors will be measured and saved to V 1 and I 1. Previous V 1 and I 1 values will be saved to V 0 and I 0 .
Hence it avoids calculating VSIs during transients. Therefore LM prediction shows previous LM during the transient and it will update when the transient is over.  Figure 10(b) contain both LM prediction form the ensemble ML model and theoretical LM under different power system operational situations. The simulated scenario start in a steady state, and then goes through a period of gradual load increment. After a brief period of steady operation, the system sees a sudden load increment followed by a sudden load decrement. The last part of the simulation correspond to a three phase fault with consequent tripping of a transmission line.
The loads were increased or decreased by a percentage of scheduled active and reactive powers of the buses. In the case of gradual power increment, active and reactive power was increased by steps of 0.001 pu in every 5s. In the case of sudden power increment 20 % of active and reactive power increment at bus 9 was introduced and in the case of sudden power decrement, 10 % of power decrement was introduced at the same bus. A three phase fault is applied on the line between bus-1 and bus-5 in close proximity to bus-5. The fault was set to persist for 4 cycles before it was cleared by tripping the line. Predicted LM is validated with respect to theoretical LM under all the operational conditions as shown in the Figure 10 (b). Theoretical LM is calculated using conventional CPF program. In CPF all loads are gradually increased till the nose point of P-V curve, therefore variation of the theoretical LM during the gradual load increase can be obtained directly from the CPF. In order to calculate the theoretical LM under sudden load increment at bus 9, the conventional CPF is modified to change the load at bus 9 while maintaining a constant load value at other load buses during the change. Line tripping scenario is simulated by performing CPF under the contingency of tripping the line between bus-1 and bus-5. The actual predicted LM values from synchrophasors appears to be slightly conservative, and therefore no major concern.
The spikes in MWE in Figure 10 (c) corresponds to transient changes such as sudden changes in voltage of faults. When MWE is above the defined threshold of 0.0005, the bit value of the transient status changes from 0 to 1, and remains at 1 until the voltage magnitude becomes steady as shown in Figure 10 (d).The predicted LM vary responding to the changes in the load. The voltage of bus-14 drops slightly after removing the line after the fault, but the predicted LM drops significantly, which agree with the correct behavior of the voltage stability monitoring system.
A sample of the system voltage stability monitoring dashboard implemented on PhasroSmart R platform is shown in Figure 11.This provides a simple overview of the current status of the system voltage stability and its trend over a selected time window in the immediate past to the system operator. The visualization is customizable; the window shown in

VI. CONCLUSION
A novel machine learning based approach to predict the long term voltage stability, as represented by the loadability margin, is presented. The proposed method utilizes an ensemble of machine learning based regression models which use selected sets of voltage stability indices as input features for the machine learning models. Machine learning models that use Random Forest regression proved to be robust and accurate irrespective of the system size. Although the loadability margin can be predicted with a random forest regression model that directly uses voltage magnitudes and phase angles with reasonable accuracy, the predictions obtained with voltage stability indices as inputs have a higher accuracy, especially for the larger systems. Furthermore, when an ensemble of machine leaning models that use different input features is used, the accuracy and the robustness can be increased under both normal operating conditions and N-1 contingencies. With the ensemble approach, the correlation between the predicted and actual loadability margin could be improved to 99.7 % and 97.6% for the IEEE 14 bus and 118 bus test cases respectively. When compared to two previously proposed approaches, the ensemble approach proposed in this article could predict LM more accurately, especially for larger power systems. The practicality of the proposed method was demonstrated by implementing the scheme on PhasorSmart R real-time synchrophasor based platform and validating it on RTDS R real-time simulator. However, some future work such as managing transients, and PMU data quality issues needs to be implemented to improve the performance of the proposed technique for real-time implementation. Opportunities also exist for further improvements such as employing of methods to adapt for seasonal loading conditions and online training using real-time measurements. KRISH NARENDRA (Senior Member, IEEE) received the Ph.D. degree. He is currently the COO and the Technology Lead of Electric Power Group, LLC, Pasadena, USA. He has more than 27 years of experience in power system protection, monitoring, control, synchrophasor technology, and analysis. He is an internationally recognized Expert in power systems protection, monitoring, and control. Prior to joining EPG, he was the CTO and a Board Member of ERLPhase Power Technologies Ltd., Canada, from June 2007 to August 2017, with ERLPhase. He has published more than 45 papers in various IEEE/IEC journals and conferences. He is a valued IEEE member for more than 20 years and an active participant in IEEE PRSC working groups, and a member of the PRTT of NASPI, CIGRE C4-B5, the C.18 Working Group, and the NERC SMS Committee.