Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Predictive Modelling of Electrical Grid Stability With

Machine Learning Models


Amit Kumar Dansena
Computer Science and Engineering
Lovely Professional University
Punjab, India
amitkumardansena1@gmail.com
https://colab.research.google.com/drive/1jgrWe3tgaUvbIDZRG_8yAvi55-Ks5Xus#scrollTo=DXVK0w7tPqFo

Abstract: In this study, we investigate I. Introduction


regression approaches and sophisticated
data preparation to estimate electrical In the current energy landscape, the
grid stability through predictive stability of electrical grids is essential to the
modeling. The operating characteristics uninterrupted supply of electricity needed
of actual electrical grids, such as voltage to meet the various needs of society. The
levels, power flows, and frequency problems facing grid stability have grown
variations, are included in our collection. more complicated due to the exponential
We use preprocessing methods such as rise in energy demand and the necessity of
One-Hot Encoding and StandardScaler switching to sustainable energy sources.
with 1000 instances and 12 features to Novel approaches to grid stability
handle categorical variables and prediction and management are required as
normalize numerical features. For a result of factors like the integration of
predictive modeling, we look into linear renewable energy, the growth of distributed
regression, RANSAC regression, and generation, and the introduction of smart
polynomial regression. We assess each of grid technologies that have altered the
these regression methods using metrics dynamics of grid operations. The use of
like mean squared error (MSE) and machine learning techniques has become a
Rsquared score (R2). Strong predictive viable approach to improving grid stability
accuracy of 80.01% is what our results evaluation in response to these difficulties.
show for each model. Moreover, we With the use of enormous volumes of
emphasize how model selection and operational data, machine learning models
preprocessing methods affect predictive might potentially reveal hidden patterns and
performance, providing guidance on how relationships in grid data, improving grid
to improve grid dependability and stability forecasts. Regression analysis is a
resilience. basic machine learning tool that models the
link between an output variable that
indicates the status of grid stability and
input variables that represent different
elements of grid operations. Using a variety
Keywords: Electrical grid stability, of grid operational data sets, this study aims
regression modeling, preprocessing, to investigate the predictive potential of
predictive maintenance, hyperparameter regression techniques for electrical grid
tuning. stability. The study's dataset includes a wide
range of metrics, such as power flows,
voltage levels, frequency variations, and examined in The Influence of Real-Time
system loads. Advanced preprocessing energy pricing and Participant
methods like One-Hot Encoding and Characteristics on Decentralized Grid
StandardScaler are used to convert raw data
Stability. The system known as
into an analysis-ready format so regression
models may be used for prediction. This decentralised smart grid control (DSGC) is
study's technique entails a methodical presented, which aims to synchronise real-
assessment of several regression models, time prices with variations in grid
such as polynomial, RANSAC, and linear frequency to impact patterns of production
regression. The preprocessed dataset is and consumption. This study assesses
used to train each regression model, and
dynamic grid stability in a four-node star
performance metrics like mean squared
error (MSE) and R-squared score (R2) are decentralized grid design using simulation
used to assess each model. The predicted and the transparent open box (TOB)
accuracy of the models is evaluated on learning network. TOB attains high
training and testing datasets in order to prediction accuracy despite initially weak
obtain a better understanding of their association, highlighting the significance of
capacity to generalize to new data and offer compound feature selection. The results
useful information to grid operators. In
offer important new information for
addition, the research delves into the effects
of finetuning hyperparameters on model improving grid stability in decentralized
performance, employing methods like power systems.[1] In order to link
GridSearchCV to maximize model electricity pricing to grid frequency without
parameters and improve prediction requiring significant infrastructure
precision. The goal of the research is to improvements, Decentral Smart Grid
determine the best regression models and
Control (DSGC) emphasizes its novel
parameter combinations for predicting grid
stability under various operating situations approach to demand response. Simplifying
through this iterative procedure. This paper assumptions like participant behavior
advances predictive analytics in the energy uniformity are common in existing models.
industry by clarifying the benefits and By employing data mining techniques to
drawbacks of regression algorithms in grid hone findings while preserving clarity, this
stability prediction. The study's conclusions
research seeks to address these limits.
may provide guidance to researchers,
regulators, and grid operators regarding the Deploying decision trees to reveal new
best ways to improve grid resilience and insights requires a methodical gathering of
reliability in the face of changing hypotheses and open questions along with a
operational difficulties and the energy variety of simulation runs. Notably,
landscape. The ultimate objective is to stability can endure even in the face of
support the creation of data-driven participant energy consumption adaptation
solutions that open the door to a future in
delays, and quick adaptation can improve
energy that is more robust and sustainable.
system stability and deepen our knowledge
of DSGC dynamics.[2] The
II. Literature Review unpredictability of renewable energy
sources poses a challenge to current
The intricate relationship between real-time methods for predicting power grid stability.
energy pricing, power producers' and This research proposes a revolutionary deep
customers' responsiveness, and the stability learning strategy to tackle this problem. In
of decentralized electrical networks is
order to capture the intricate temporal which might enhance resource management
dynamics of the grid, the approach makes and grid stability.[5] There is currently a
use of Bidirectional Gated Recurrent Units lack of accuracy in the methodologies used
(BGRUs). A Simulated Annealing to predict power grid blackouts caused by
approach for hyperparameter adjustment is desynchronization, or the loss of
included in the study to optimize the coordination between grid sectors. This
model's performance. Evaluations using study suggests combining machine learning
simulated grid data show that the suggested models with network science
approach is efficient in producing precise measurements to analyze transmission line
point and interval grid stability forecasts. attributes. Machine learning assists in
Through comparative analysis, the study identifying critical characteristics for
demonstrates this approach's advantages robustness and vulnerability, while network
over current options.[3] A fresh data- measurements help discover important
mining methodology to forecast the elements like redundancy and line
stability of Decentralized Smart Grid importance. Using simulated data, the
Control (DSGC) systems. By using a fuzzy researchers examine their approach and
rule-based system that is tuned for both show that it accurately (0.996 <) predicts
accuracy and interpretability, this approach desynchronization occurrences following
differs from earlier approaches. In order to line failures. They also demonstrate that
determine which aspects are most crucial, there is little performance loss when
the researchers examine the ways in which learnings are moved between grids. This
various parameters affect DSGC stability. indicates that the risk of desynchronization
They prove their approach's superiority in is mostly controlled by a small number of
giving precise and lucid forecasts while important network parameters associated
exposing the critical aspects influencing with rerouting power flow without
stability by comparing it to 39 other overloading lines.[6] Stability
existing methods. This study adds to our optimization is essential for low-voltage
understanding of DSGC behaviour from a DC microgrids since these systems are
more thorough standpoint.[4] Previous become increasingly complicated. While
research recognizes that because renewable current methods are frequently disjointed,
energy sources fluctuate, it can be difficult this study suggests a novel strategy that
to keep decentralized networks stable when integrates machine learning, simulations,
using them. Simplifying assumptions are and real-time data. The authors develop a
the foundation of traditional models. To machine learning model to forecast stability
forecast stability in such grids, a new model and examine the effects of various aspects
is proposed in this paper. Using using simulations. Furthermore, they
normalization and oversampling provide a metric to evaluate stability in
approaches, it addresses data imbalance by practical applications in a manner akin to
applying machine learning algorithms to that of simulations. This combined method
data from an online repository. In terms of provides a more thorough comprehension
frequency fluctuation prediction, the and stability optimization for DC
XGBoost algorithm produced the best microgrids.[7]
results (96.8% with random oversampling),
Expensive computational simulations are Nearest Neighbours (KNN), Naive Bayes,
the basis of current technologies for voltage Decision Tree, Random Forest, Stochastic
stability monitoring in transmission Gradient Descent (SGD) classifier,
networks. Faster alternatives are provided XGBoost, and Gradient Boosting
by machine learning, however current classifiers after analysing a dataset from
methods have trouble updating models and grid stability simulations. Accuracy,
need enormous volumes of training data. precision, recall, F1-score, AUC-ROC, and
An active learning strategy that overcomes AUC-PR curves are used to assess the
these drawbacks is suggested in this work. models. With an accuracy of 97.5%,
The method provides faster and more XGBoost proved to be the best performer,
accurate voltage stability checks by demonstrating its promise for smart grid
prioritizing data collection and training stability prediction.[10] Efficient
efforts in scenarios where machine learning distribution is necessary to prevent power
predictions do not match reality.[8] loss due to the increasing demand for
Power system transient stability (TS) electricity globally. The implementation of
evaluation techniques now in use may not machine learning (ML) has proven to be
be appropriate for real-time applications effective in enhancing customer demand
since they rely on intricate simulations. A forecast, and smart grids (SGs) present
novel machine learning method for real- encouraging prospects. Finding the best
time TS assessment is presented in this ML algorithm for SG stability assessment is
research. The approach trains a support still a crucial gap, though. Utilizing a
vector machine (SVM) classifier using publicly accessible SG dataset from the
synchronized phasor observations and UCI Machine Learning repository, this
historical data from Monte Carlo study tackles this by implementing a
simulations. Based on Single Machine number of cutting-edge machine learning
Equivalent (SIME) data, this swarm-based (ML) methods, including as Support Vector
algorithm-optimized SVM classifier Machines (SVM), K-Nearest Neighbours
predicts the TS status. The suggested (KNN), Logistic Regression, Naive Bayes,
approach provides a quicker and maybe Neural Networks, and Decision Trees.
more efficient means of determining TS Achieving remarkable performance with
and directing real-time control actions.[9] 100% precision, 99.9% recall, 100% F1
score, and 99.96% accuracy, the findings
The next generation of intelligent power
show the success of the Decision Tree
grids, known as smart grids, improve
classifier. Finding the best machine
energy flow by integrating cutting edge
learning method to predict SG stability is
technologies. Because of the shortcomings
made easier with the help of this
of conventional grid control techniques,
research.[11]
machine learning (ML) is being
investigated as a potential means of
enhancing decision-making. This paper III. Proposed methodology
evaluates different machine learning
Dataset Description:
techniques for smart grid stability
Ten continuous variables, including tau1
prediction. They apply Support Vector through tau4 and p1 through p4, which
Machine (SVM), Logistic Regression, K- reflect the operating parameters of an
electrical grid system, make up the dataset. using this method, characteristics with
These variables most likely represent bigger scales are kept out of the forefront
generating levels, power flows, and time during model training.
constants. Two further continuous ColumnTransformer: One-Hot Encoding
variables, g1 and g2, are also included in the can be applied to categorical columns and
dataset; these variables may be connected StandardScaler to numerical columns
to the properties of the generator. There are simultaneously when using
no missing values in the dataset. All things ColumnTransformer to perform various
considered, these variables offer vital preprocessing transformations to different
information about the simulated electrical dataset columns.
grid's operational dynamics, which is Pipeline: Several preparation processes can
important for forecasting grid stability. be chained together into a single workflow
using the Pipeline class. This guarantees
reproducibility and simplifies the code by
applying the preparatory procedures in a
sequential fashion. In order to ensure that
the input characteristics are properly
transformed and standardized before being
fed into the regression models, these
preprocessing approaches are essential for
getting the dataset ready for regression
analysis. This guarantees that the models
can efficiently learn from the data and
produce precise forecasts of grid stability,
which enhances their performance.

Model training:

Linear Regression:
The goal variable and the input features are
assumed to have a linear relationship under
this model. Using the fit approach, it is
started and trained to identify the
coefficients that best suit the data. Metrics
like Mean Squared Error (MSE) and R-
squared (R^2) score are used to assess the
model's performance.

Preprocessing Techniques:

One-Hot Encoding: To represent distinct


categories, categorical variables are
converted into binary vectors using OneHot
Encoding.
StandardScaler: To ensure that numerical
features have a mean of 0 and a standard
deviation of 1, StandardScaler is used. By
RANSAC Regression: IV. Experimental Analysis

Random Sample Consensus, or RANSAC Using a dataset of a simulated electrical


In order to determine which subset of inliers grid, three regression models—Linear,
best matches the data, regression is a robust RANSAC, and Polynomial—were trained
regression technique that fits models to and assessed as part of the experimental
subsets of the data iteratively. With the analysis. The data was prepared and
exception of the RANSAC Regressor class, standardized using preprocessing
it is initialized and trained similarly to techniques. Predictive accuracy was
linear regression. The same criteria used for evaluated using performance metrics such
linear regression are used to assess the as MSE and R-squared. When compared to
performance. the other models, Polynomial Regression
performed better, demonstrating its
usefulness in predicting grid stability.

Training Accuracy:

Testing Accuracy:
Polynomial Regression:

This model fits a polynomial function to the


data, expanding on the idea of linear
regression. It is first started and trained with
a Linear Regression model after generating
polynomial features using the Polynomial
Features class. The same methodology used
for the other models is used to assess the Polynomial Regression stands out as the
performance. best model for training based on the R^2
scores and MSE values. It demonstrates the
greatest ability to explain variance in the
target variable (grid stability) by achieving
the highest R^2 scores on both training and
testing datasets. Furthermore, on both
datasets, Polynomial Regression has the
lowest MSE values, indicating that it
produces the most accurate predictions with
the fewest errors.
By fitting a polynomial function to the data,
polynomial regression expands on the
linear regression model by capturing
nonlinear correlations between the target
variable and the input features. Compared
to linear and RANSAC regression, Best Fit Regression Model:
polynomial regression performs better in
terms of prediction because of its flexibility
in capturing the intricate dynamics of the
electrical grid system. Consequently,
Polynomial Regression is advised as the
optimal model for training in this scenario.

HYPERPARAMETER TUNING

The performance of the regression models,


namely Polynomial and Linear regression, V. Conclusion
was optimized through hyperparameter
tweaking. In order to determine which To sum up, the investigation carried out on
combination of hyperparameters inside the dataset of simulated electrical grid
each model architecture produces the best stability shows how well different
performance as determined by the regression models can forecast grid
designated scoring metric, tweaking was stability. Polynomial regression performed
necessary. The hyperparameter that was set better than Linear and RANSAC
for Linear Regression was "fit_intercept," regressions, with lower Mean Squared
which controls whether the model's Error (MSE) values and higher R^2 scores
intercept should be calculated. The best on training and testing datasets, according
parameter value discovered was "TRUE," to evaluation and experimentation.
suggesting that the model performed better Moreover, hyperparameter adjustment was
with the intercept term included. When used to maximize the regression models'
compared to the default configuration, the performance, which increased prediction
best score obtained by Linear Regression accuracy. More specifically, both the Linear
tweaking was roughly 0.688, suggesting a and Polynomial Regression models
greater level of prediction accuracy. performed better when the "fit_intercept"
"fit_intercept," the hyperparameter that hyperparameter was tuned; Polynomial
controls whether to include the intercept Regression scored the highest, at about
term in the polynomial regression model, 0.801.
was also modified in the case of polynomial
regression. Remarkably, the optimal
parameter value discovered was "FALSE,"
indicating that the model performed better
without the intercept term. By adjusting
Polynomial Regression, the best result was
about 0.801, which shows a significant
increase in predicting accuracy over the
default configuration. Overall, the
discovery of the best model configurations
through hyperparameter tuning resulted in
appreciable improvements in the predictive
accuracy of both linear and polynomial
regression models. Overall, the results point to polynomial
regression as a useful model for forecasting
electrical grid stability when
hyperparameters are carefully adjusted.
Accurate predictions of grid stability can be
obtained by utilizing suitable preprocessing
techniques and model optimization [1] Wood, D.A., 2020. Predicting stability
methodologies. This will enable improved of a decentralized power grid linking
decision-making in the management and electricity price formulation to grid
operation of electrical grid systems. It's frequency applying an optimized data-
critical to take into account the larger matching learning network to simulated
ramifications of the analysis done on the data. Technology and Economics of Smart
electrical grid stability dataset in addition to Grids and Sustainable Energy, 5(1), p.3.
the model performance and hyperparameter
tuning outcomes. First of all, the study [2] Arzamasov, V., Böhm, K. and Jochem,
emphasizes how crucial it is to use cutting- P., 2018, October. Towards concise models
edge machine learning methods to tackle of grid stability. In 2018 IEEE international
challenging realworld issues like grid conference on communications, control,
stability prediction. Regression models and and computing technologies for smart grids
preprocessing methods can be used to (SmartGridComm) (pp. 1-6). IEEE.
obtain important insights into the dynamics
of electrical grid functioning, which will [3] Massaoudi, M., Abu-Rub, H., Refaat,
help design more robust and effective S.S., Chihi, I. and Oueslati, F.S., 2021,
energy systems. The results also April. Accurate smart-grid stability
demonstrate the need for more investigation forecasting based on deep learning: Point
and advancement in the area of grid and interval estimation method. In 2021
stability prediction. To increase predicted IEEE Kansas Power and Energy
accuracy and robustness even more, future Conference (KPEC) (pp. 1-6). IEEE.
research might investigate deeper learning
architectures, ensemble approaches, or [4] Gorzałczany, M.B., Piekoszewski, J.
more complex regression models. The and Rudziński, F., 2020. A modern data-
analysis further clarifies the importance of mining approach based on genetically
preprocessing and highquality data in the optimized fuzzy systems for interpretable
creation of models. Using methods like and accurate smart-grid stability
One-Hot Encoding and StandardScaler to prediction. Energies, 13(10),
ensure the integrity and uniformity of input p.2559.
data is essential to getting accurate
predictions and preventing bias or mistakes [5] Ibrar, M., Hassan, M.A., Shaukat, K.,
during model training. Moreover, the study Alam, T.M., Khurshid, K.S., Hameed, I.A.,
supports the continuous endeavors to Aljuaid, H. and Luo, S., 2022. A machine
improve the sustainability and learning-based model for stability
dependability of energy infrastructure. prediction of decentralized power grid
Stakeholders may proactively manage linked with renewable energy
possible disturbances, enhance resource resources. Wireless Communications and
allocation, and assist the shift to cleaner and Mobile Computing, 2022, pp.1-15.
more resilient energy by accurately
forecasting grid stability. Overall, the [6] Titz, M., Kaiser, F., Kruse, J. and
analysis paves the way for future Witthaut, D., 2024. Predicting dynamic
developments in grid stability prediction stability from static features in power grid
and management and is a monument to the models using machine learning. Chaos: An
strength of data-driven approaches in Interdisciplinary Journal of Nonlinear
tackling challenging issues in the energy Science, 34(1).
sector.
[7] Roeder, G., Ott, L., Meier, A., Wunder,
REFERENCE: B., Wienzek, P., Baermann, A., Liers, F. and
Schellenberger, M., 2021, September.
Analysis and improvement of lvdc-grid
stability using circuit simulation and
machine learning-a case study. In NEIS
2021; Conference on Sustainable Energy
Supply and Energy Storage Systems (pp. 1-
7). VDE.

[8] Malbasa, V., Zheng, C., Chen, P.C.,


Popovic, T. and Kezunovic, M., 2017.
Voltage stability prediction using active
machine learning. IEEE Transactions on
Smart Grid, 8(6), pp.3117-3124.

[9] Echeverría, J.D.E., Cepeda, C.J.C. and


Colomé, D.G., 2017, September. Real-time
transient stability assessment of electric
power systems using predictive-SIME
based on machine learning. In 2017 IEEE
PES Innovative Smart Grid Technologies
Conference-Latin America (ISGT Latin
America) (pp. 1-6). IEEE.

[10] Ghosh, A. and KOLE, A., 2023. A


comparative analysis of enhanced machine
learning algorithms for smart grid stability
prediction. Authorea Preprints.

[11] Bashir, A.K., Khan, S., Prabadevi, B.,


Deepa, N., Alnumay, W.S., Gadekallu, T.R.
and Maddikunta, P.K.R., 2021.
Comparative analysis of machine learning
algorithms for prediction of smart grid
stability. International Transactions on
Electrical Energy Systems, 31(9),
p.e12706.

[12] Senyuk, M., Safaraliev, M., Kamalov,


F. and Sulieman, H., 2023. Power system
transient stability assessment based on
machine learning algorithms and grid
topology. Mathematics, 11(3), p.525.

You might also like