Seasonal Electrical Load Forecasting Using Machine Learning Techniques and Meteorological Variables
International Journal of Robotics and Control Systems Vol. 4 No. 3 (2024) 1092-1108
Abstract
Accurate forecasting of seasonal power consumption is crucial for effective grid management, especially with increasing energy demand and renewable energy integration. Weather patterns significantly influence energy usage, making load prediction a challenging task. This study employs machine learning algorithms, including Random Forest (RF), Artificial Neural Networks (ANN), and Decision Tree (DT) models, to forecast electricity consumption using meteorological variables such as solar irradiance, humidity, and ambient temperature. The impact of weather elements on load prediction accuracy across different seasons is explored using seasonal forecasting techniques. The results demonstrate the superior performance of ANN and RF models in forecasting summer and winter loads compared to the rainy season. This discrepancy is attributed to the abundance of data for the summer and winter seasons, and the ability of the models to capture complex patterns within the data for these particular seasons. The study highlights the potential of machine learning techniques, particularly ANN and RF, in conjunction with meteorological data analysis, for enhancing the accuracy of seasonal electrical load forecasting. This can contribute to more effective power grid management and support the transition towards a more sustainable energy landscape. The findings underscore the importance of data quality, quantity, and appropriate model selection for different seasonal conditions.
1.Introduction
Accurate energy demand estimation is crucial for ensuring sustainability and long-term economic prosperity in the face of rapidly increasing global energy consumption [1]. Effective utilization and management of energy resources are imperative to control energy demand and promote sustainable economic growth. Energy demand management aids in identifying energy-saving opportunities, anticipating future needs, prioritizing energy sources, improving energy efficiency, formulating policies, and developing strategies for emissions reduction.
Electrical consumption is influenced by a multitude of interrelated factors, including economic conditions, calendar periodicities (weekly and yearly), and meteorological variables [2]. Power load forecasting is categorized into long-term, mid-term, and short-term based on the forecasting step size projection. Long-term forecasting, aimed at anticipating yearly and monthly demands, is often used for power infrastructure construction planning. However, the system's performance is significantly impacted by medium-short-term forecasting, which projects weekly, daily, and hourly power loads [3].
The quantity of electrical power utilized is known to be significantly influenced by weather conditions. Meteorological variables, such as temperature, humidity, and solar radiation, are generally considered significant factors [4]. Temperature and electrical power demand exhibit a non-linear relationship, with discernible increases in power consumption observed in response to both decreases in temperature below a threshold and increases above a threshold [5], [6]. A similar relationship holds for solar irradiance and humidity. Due to the variable nature of solar irradiance, ambient temperature, and humidity, predicting electrical load demand remains a challenge [7].
Every machine learning model has its benefits and drawbacks. However, power load forecasting primarily relies on efficiency and accuracy [8], [9]. Since each temporary installation might have distinct characteristics and varying durations, classifying and predicting loads for smart grids is challenging [10]. Solar irradiance, wind speed and direction, humidity, and temperature are among the most critical climatic variables influencing electricity consumption patterns, especially in residential areas [8].
This research proposes an efficient and reliable approach for load forecasting. Given the continuous growth of research on Smart Grids, the use of precise and accurate load forecasting approaches may provide several benefits [11]:
- Efficient management of electricity supply and demand enhances the reliability of the power system by empowering operators to make strategic choices for market participants.
- Incorporating machine learning techniques with renewable energy sources can effectively address environmental issues such as climate change and pollution.
- Accurate load modelling enables utilities to effectively respond to power supply demands and regulate operations, while proper load definition ensures appropriate actions are taken.
This study examines the relationship between meteorological characteristics and electrical load demand. To investigate this relationship, a load forecasting model based on ANN, RF, and DT is presented. Section 2 introduces existing methods for predicting power demand and highlights the need to investigate the impact of weather patterns on power load demand. Section 3 outlines the methodology, including data collection, preprocessing, and the development of ANN, RF, and DT models. The performance of these models on the power load dataset is evaluated in Section 4, and finally Section 5 presents a comparative analysis of their forecasting capabilities across different seasons.
2.Background
Advances in machine learning research have led to the integration of techniques like neural networks [12]-[15] and support vector machines into power systems daily load forecasting models [16]-[30]. While some studies incorporate workdays and holidays into the input matrix [31], [32], most rely on historical data as the primary input feature. However, weather is a significant factor influencing electricity load demand, in addition to past trends and the nature of workdays and holidays.
Several researchers have considered meteorological data in previous studies. In [33], temperature data was used to create a load forecast model using an ANN and bagged regression trees. An analysis was conducted [34] on the relationship between temperature, solar irradiance, and load, where the ANN model's accuracy was improved by using mutual information to select input features. In [35], a small town in Italy with only residential consumers was studied, using the Humidex indicator (a comprehensive measure of atmospheric temperature and humidity) as an input to predict the regional power load. Zachariadis [36] offered a projection of Cyprus's power usage until 2030, derived from an econometric study of energy consumption in relation to macroeconomic factors, pricing, and meteorological conditions.
Precise load forecasting is crucial for the efficient functioning of power systems, as electrical load is highly volatile and nonlinear. Appropriate prediction methods are necessary to forecast such complex signals. The common forecasting methods fall into two categories: artificial intelligence (AI) and techniques based on statistics. There are three main types of energy forecasting models: black box, white box, and grey box [37]. Community microgrid load dispatch faces several challenges due to the inherent instability and unpredictability of renewable energy sources. Consequently, several studies have examined the integration of intermittent renewable energy into the microgrid's load dispatch model [38]-[40]. However, few studies have been conducted on microgrid power demand forecasting considering weather conditions. For example, [41] attempted to provide a day-ahead load prediction using ambient temperature as the weather characteristic directly but did not examine the precise impact of other meteorological features such as solar irradiance and humidity. Low-power circuit design techniques [42]-[45] enable energy-efficient hardware implementations of machine learning models for seasonal electrical load forecasting. These specialized hardware accelerators can offer significant performance improvements and power savings when incorporating meteorological variables into load forecasting models.
3.Methodology
Load forecasting is a complex subject involving several parameters, such as time, environmental conditions, and other variables. This technology is extensively used in all sectors of power systems, catering to diverse fundamental needs in industrial, commercial, and household environments. The fluctuation of loads across various time frames has distinct characteristics. In general, a broader time range leads to a greater impact on variables and an increase in the complexity of the issue [8]. The outcomes will be examined using different ANN or machine learning methods. Fig. 1 illustrates the sequence of steps in the process.
3.1.Input Data
Data for predicting electrical loads is obtained from publicly available databases [46], while meteorological data is taken from the National Renewable Energy Laboratory (NREL). The data for the electric power load, also known as the active power load, is generated using the hourly voltage (V), current (I), and power factor (pf) information accessible at the 33/11 kV substation at Godishala, Huzurabad, Telangana state, India. These states are selected due to their diverse climatic conditions, which include distinct summer, rainy, and winter seasons. This diversity is crucial for studying the impact of various meteorological variables on electrical load forecasting. Information on voltage, current, and power factor was gathered on an hourly basis between January 1, 2021, and December 31, 2021. The data includes hourly load, day status (0 for weekdays and 1 for weekends), season (1 for Winter, 2 for Summer, and 0 for Rainy), as well as hourly humidity and temperature information. The data range from January 1, 2021, to December 31, 2021, provides a comprehensive annual cycle, capturing seasonal variations essential for accurate forecasting Meanwhile, solar irradiance data for the same latitude and year has been obtained from the NREL. In Fig. 2, one-year hourly data for each feature has been divided into three seasons: Summer, Rainy, and Winter.
There are a total of 8760 hourly load data values included within this collection. In this particular dataset, the load data is presented in kilowatts, the temperature is expressed in Fahrenheits, and the humidity is expressed as a percentage. It has been noted that the distribution of load data has a mean value of 2130 kW, a standard deviation of 1302 kW, a minimum load of 412 kW, and a peak load of 6306 kW. The seasonal hourly average data of solar irradiance, humidity, and temperature is shown in Fig. 3 (a,b,c). The electrical load profile hourly average for all three seasons is shown in Fig. 3 (d), which examines that during the winter season, the load demand is higher compared to the rainy and summer seasons.
Fig. 3 (a) depicts the seasonal 24-hour average solar irradiance (measured in W/m2) for the summer, rainy, and winter seasons. The figure illustrates the typical patterns of solar irradiance throughout the day across the different seasons. In the summer season, the solar irradiance levels are higher, peaking around midday, while in the rainy and winter seasons, the irradiance levels are generally lower due to cloud cover and shorter daylight hours.
Fig. 3 (b) shows the seasonal 24-hour average humidity levels (expressed as a percentage) for the three seasons. The humidity patterns can vary significantly depending on the local climate and weather conditions. In some regions, the rainy season may exhibit higher humidity levels, while in others, the summer season could be more humid. Examining the humidity patterns can provide insights into the potential impact on electrical load, as higher humidity levels may increase the demand for air conditioning and dehumidification.
Fig. 3 (c) presents the seasonal 24-hour average temperatures (measured in degrees Fahrenheit) for the summer, rainy, and winter seasons. Temperature is a crucial factor influencing electrical load demand, as both heating and cooling requirements are directly impacted by ambient temperatures. The figure allows for the analysis of temperature patterns throughout the day, enabling a better understanding of the potential load fluctuations caused by temperature variations.
Fig. 3 (d) illustrates the seasonal 24-hour average electrical load (measured in kilowatts) for the three seasons. This figure provides a visual representation of the actual electrical load demand patterns observed during the summer, rainy, and winter seasons. By examining this figure, it becomes evident that the winter season exhibits higher load demand compared to the rainy and summer seasons. This observation could be attributed to factors such as increased heating requirements during the winter months or specific regional characteristics that influence energy consumption patterns.
Fig. 4 presents the correlation coefficient matrix, which provides a visual representation of the strength and direction of the linear relationships between the different variables in the dataset. The correlation coefficient is a statistical measure that ranges from -1 to 1, where -1 indicates a perfect negative correlation, 0 indicates no correlation, and 1 indicates a perfect positive correlation. In the context of this study, the correlation coefficient matrix highlights the associations between the meteorological variables (solar irradiance, humidity, and temperature) and the electrical load demand. The correlation coefficient between solar irradiance and electrical load reveals the degree to which higher levels of solar irradiance are related to increased electrical load demand, potentially due to factors such as increased use of air conditioning or other cooling systems. Similarly, the correlation between temperature and electrical load can shed light on the impact of temperature fluctuations on energy consumption patterns.
3.2.Data Preprocessing
Data preprocessing consists of cleaning, smoothing, and reconstructing the data to achieve better prediction accuracy. If load data is absent for Monday, the average load for Saturday and Tuesday is considered. Likewise, if load data is missing on Saturday, the average load for Friday and Monday is considered. Outliers in a dataset are unusual numbers that have the potential to skew statistical analysis. Outliers can lower data variability and, consequently, statistical power. Eliminating outliers can improve the results' statistical significance by counteracting erroneous values in the dataset. To remove such outlier data, the Z-Score is used. The Z-Score method is chosen for outlier detection due to its effectiveness in identifying data points that deviate significantly from the mean; it's calculated as given in Equation (1):
By establishing a threshold for outlier elimination, the Z-Score is computed for each sample in the collection. Data points with a Z-Score exceeding a predefined threshold (typically ±3) are considered outliers and are removed.
Normalization helps ANN and RF algorithms learn the best parameters for each input more rapidly. To avoid deceptive results, inputs should approximately fall within the range of -1 to 1. This can be achieved using the min-max normalization method. Min-max normalization is used to scale the data to a fixed range (0-1), which helps improve the performance of machine learning algorithms. The formula for min-max normalization (S) is given in Equation (2):
Where X is the original value, and X_minimum and X_maximum are the minimum and maximum values in the dataset, respectively.
3.3.Model Development and Electrical Load Forecasting Algorithms
The load forecasting has been achieved using ANN and machine learning algorithms such as support vector machine (SVM) and multiple linear regression (MLR). For the given methods the total number of independent variables are six which consist of day, hour, temperature (0F), humidity (%age), weekday/weekend (0/1) and solar irradiance (W/m2) while the dependent variable is electrical load (KW). Mean absolute percentage error (M), root mean square error (R), and mean squared error (E) are the metrics that have been employed in order to evaluate the performance of the model shown in Equation (3), Equation (4) and Equation (5).
Where
is the number of data points
are the actual and predicted value for the ith data point
3.3.1.ANN Model for Electrical Load Forecasting
Artificial neural networks are a specialized branch within artificial intelligence (AI). These systems are engineered to replicate the functionality of the human brain through the analysis and processing of information in a manner that closely resembles human cognition. ANNs are biologically inspired computational models that consist of interconnected nodes or 'neurons' organized in layers. They are capable of learning complex patterns and relationships in data. In this work, the power usage pattern has been predicted using artificial neural networks. In ANNs, the output is determined by the accumulation of neurons in the input and hidden layers. For this investigation, the data has been partitioned into three distinct sets: training (70% of data), testing (15% of data), and validation (15% of data). The mathematical model of ANN is represented as Equation (6):
Here, X and y are the input and output values, respectively, while W and b represent weight and bias. The input feature quantity dictates the input layer's dimensions. Utilizing a standard neural network with a single hidden layer, the prediction has been executed. The number of hidden neurons is established via the trial and error method. The ANN architecture for all three seasons is shown in Fig. 5, having six input nodes and one output node. The total number of hidden layers is two, and the ReLU activation function is used at each layer. The ReLU activation function is used in the hidden layer due to its effectiveness in mitigating the vanishing gradient problem. A dual hidden layer is chosen as it provides a good balance between model complexity and computational efficiency for this particular forecasting task.
3.3.2.Random Forest Model for Electrical Load Forecasting
Random Forest is an ensemble learning technique that utilizes decision trees (specifically, the CART algorithm) as the basic models [47]. It is applicable for both regression and classification tasks. This work primarily focuses on using RF regression based on regression trees for prediction, as shown in Fig. 6. RF overcomes common issues seen in individual decision trees, such as unstable splits and a lack of smoothness [48].
It integrates bagging with a stochastic subspace technique. The primary objective of the random subspace technique is to enhance the heterogeneity across trees by constraining them to operate on distinct random subsets of the complete predictor space. Every tree inside the forest is constructed using a bootstrap sample derived from the original dataset, thus introducing an additional element of variability. The use of random predictors in the nodes of bagged trees serves to decorrelate the trees, leading to enhanced prediction accuracy and reduced model variance.
3.3.3.Decision Tree Model for Electrical Load Forecasting
Decision tree are tree-like models that make decisions based on asking a series of questions about the features in the data. The structure is equivalent to that of a “flowchart”, with each internal node represented by a rectangle and the leaf nodes represented by an oval. Each internal node has splits, which test the value of an expression of the attributes, and each internal node has at least two offspring nodes.
4.Results
This section presents the performance of the three machine learning models - Artificial Neural Network, Random Forest, and Decision Tree - in forecasting electrical load across three seasons: summer, rainy, and winter.
4.1.ANN Model Performance
The ANN model showed strong performance across all seasons, with particularly good results for summer and winter. The regression values for all the seasons are mentioned in Fig. 7. These graphs illustrate the correlation between predicted and actual values for each season, with higher R-values indicating better model performance.The performance matrix of the ANN is shown in Table 1 for the summer, rainy, and winter seasons. The rainy season showed slightly lower performance with an R-value of 0.85, possibly due to the complexity of capturing the intricate patterns in the data during this period. The MAPE values for summer (9.01%) and winter (9.08%) are significantly lower than for the rainy season (12.90%), indicating more accurate predictions for these seasons.
| Season | R-Value | MAPE | RMSE | MSE |
|---|---|---|---|---|
| Summer | 0.96 | 9.01 | 297.12 | 1.5x105 |
| Rainy | 0.85 | 12.90 | 461.34 | 2.1x105 |
| Winter | 0.96 | 9.08 | 302.34 | 1.5x105 |
4.2.Random Forest Model Performance
The RF model also demonstrated strong predictive capabilities, particularly for summer and winter seasons. These R-values for the summer, rainy, and winter seasons are shown in Fig. 8.
Table 2 presents the performance matrix of the RF Model for the three distinct seasons: summer, rainfall, and winter. Significant R-values and relatively low MAPE values indicate that the RF model exhibits satisfactory overall accuracy during both the summer and winter seasons, similar to the ANN model. However, the RF model's performance is also lower for the rainy season compared to the other seasons.
| Season | R-Value | MAPE | RMSE | MSE |
|---|---|---|---|---|
| Summer | 0.97 | 7.02 | 210.3 | 4.4x104 |
| Rainy | 0.85 | 12.88 | 457.77 | 2.0x105 |
| Winter | 0.93 | 8.484 | 378.34 | 1.4x105 |
4.3.Decision Tree Model Performance
The The DT model, while effective, showed slightly lower performance compared to ANN and RF models. The R-values for the summer, rainy, and winter seasons are shown in Fig. 9.
Table 3 presents the performance matrix of the DT Model for each of the three separate seasons: summer, winter, and rains. The DT model has significant R-values and relatively low MAPE values, indicating good overall accuracy during both the summer and winter seasons. However, similar to the ANN and RF models, the DT model's performance is lower for the rainy season compared to the other seasons.
| Season | R-Value | MAPE | RMSE | MSE |
|---|---|---|---|---|
| Summer | 0.95 | 5.63 | 281.81 | 7.9x104 |
| Rainy | 0.81 | 10.1 | 519.19 | 2.6x105 |
| Winter | 0.91 | 8.484 | 433.89 | 1.8x105 |
5.Comparative Analysis and Discussions
Table 4 demonstrates that the artificial neural network and random forest models consistently provide accurate load predictions. Nevertheless, there are instances where the forecasts exhibit less precision. During the summer season, the ANN model tends to overestimate the demand by around 100 kilowatts (kW). The mean load prediction in all seasons is almost the same for both the ANN and RF models. The comparative analysis of the actual and predictive models for the seasonal hourly average electrical load is shown in Fig. 10.
| Season | Method | Minimum Load (KW) | Maximum Load (KW) | Mean Load (KW) |
|---|---|---|---|---|
| Summer | Actual | 533.3747 | 6089.724 | 1932.883 |
| ANN | 712.4548 | 5691.507 | 1933.317 | |
| RF | 708.0106 | 5537.794 | 1932.507 | |
| Rainy | Actual | 458.0201 | 6306.206 | 2001.276 |
| ANN | 218.9659 | 6184.378 | 2001.45 | |
| RF | 616.4439 | 5522.614 | 2000.03 | |
| Winter | Actual | 412.0341 | 5779.171 | 2462.301 |
| ANN | 586.4569 | 5476.03 | 2463.136 | |
| RF | 514.4936 | 5449.614 | 2462.173 |
The results indicate that the ANN and RF models perform better in predicting electrical loads during the summer and winter seasons compared to the rainy season. This discrepancy could arise due to two potential reasons:
- The abundance of data pertaining to the summer and winter seasons, providing more comprehensive training data; or
- The superior ability of the models to accurately represent the intricate patterns within the data for these particular seasons, as the weather conditions during summer and winter may exhibit more consistent and predictable trends.
6.Conclusion
This study area has substantial potential to tackle crucial difficulties in the energy sector and provide a more sustainable and dependable electrical system. Through the integration of sophisticated machine learning algorithms and extensive analysis of meteorological data, precise and dependable predictions of seasonal electrical load may be achieved, thereby facilitating effective management of power grids and fostering a more sustainable energy landscape. The Artificial Neural Network and Random Forest models exhibit superior performance in forecasting load during the summer and winter seasons compared to the rainy season. This discrepancy may arise due to the abundance of data pertaining to the summer and winter seasons, or due to the superior ability of the models to accurately represent the intricate patterns within the data for these particular seasons.
Author Contribution: All authors contributed equally to the main contributor to this paper. All authors read and approved the final paper.
Funding: This research received no external funding
Conflicts of Interest: The authors declare no conflict of interest.
References
Original publication: International Journal of Robotics and Control Systems. CC BY-SA 4.0. This reading version reformats the supplied article for browser presentation and converts TeX equations to MathML.
Publication information
Published: 2024-07-01