1. Introduction
The rapid adoption of variable renewable energy sources (VREs) is creating a growing need for energy storage, flexible loads, and smart automation technologies for better management of a fluctuating electric grid. In deregulated markets, market mechanisms are used at a wholesale level to ensure that supply meets the demand. However, in the vast majority of markets, small- and medium-scale end users are insulated from the market and have fixed or simplified electric rate structures. While there are reasons for this simplicity, it removes any incentive for these end-users to invest in storage or smart scheduling technology. With a flat rate, for example, only total energy consumption matters, financially, to customers. Alternatively, if customers had variable, or even real-time prices, when they use energy might be as important as how much energy they use. This would create a financial incentive for them to invest in battery storage technologies and to use systems that automate their energy usage (such as with smart HVAC scheduling). This would be difficult or impossible for consumers to manage on their own. However, with optimization-based, proactive automation to charge and discharge the battery as well as manage HVAC set points, the consumer would not have to manage their energy usage actively. The combination of variable prices reflecting supply and demand on the market, widespread adoption of energy storage, and smart automation technologies have the potential to transform energy users into a valuable asset for grid management. While there are substantial regulatory hurdles for this scenario to become a reality, the purpose of this paper is to model, at the grid level, the potential impact of the confluence of these three factors and to develop energy demand prediction models would represent this system. The developed energy demand prediction models would then be used, in future studies, to optimize the operation of the grid.
Demand-side management (DSM) is an essential part of a smart grid that creates a decision platform for key stakeholders to trade energy between the consumers and providers [
1]. DSM is defined as the planning and implementation of those activities designed to influence consumer use of electricity in ways that will result in changes in the utility’s load shape [
2]. Different DSM techniques are being practiced throughout the world with several targets. Among these targets are the following: increasing energy efficiency by reducing demand in the long term and employing demand response programs that can influence the demand in the short term in response to variable energy price signals. The formulation and impacts of DSM models and techniques on the smart grid have been widely studied in the literature. Many researchers have proposed models to perform load shifting in smart grids with the inclusion of electric vehicles [
3,
4,
5]. Other researchers have studied DSM for smart building automation [
6,
7,
8,
9]. In fact, studies related to DSM and its impact on the power sector cannot be just summarized in a few lines. However, various review articles have deeply discussed and surveyed these issues [
10,
11,
12,
13].
With the presence of DSM along with multi-scale renewable generation, energy demand prediction is becoming important as it helps to improve the efficiency of the smart grid network on both the distribution end and the generation stations [
14,
15]. Different techniques have been proposed for energy load forecasting in recent years. Computational intelligence for energy forecasting can use a single machine learning model or hybrid models. Single models include fuzzy logic sets, artificial neural networks (ANN), support vector machines (SVM), linear and nonlinear regression, clustering techniques, genetic algorithms (GA), artificial bee algorithm, artificial immune systems (AIS), and particle swarm optimization (PSO). Hybrid models include neuro-fuzzy (NF), artificial neural network and wavelet transform, optimization algorithms integrated with ANN, ANN and clustering techniques, and optimization algorithms integrated with SVM. Fallah et al. discussed the aforementioned techniques showing the advantages and disadvantages of each of them and the challenges for the future [
1]. Many researchers have developed different models and optimization techniques for predicting the energy demand for various entities of the demand side of the electricity grid using machine learning mainly for minimizing the operational cost or optimizing energy usage [
16,
17,
18,
19]. Other researchers have developed energy demand prediction models, scheduling techniques, and energy management systems considering the demand side and the supply side as well for several purposes, including cost minimization and grid frequency control [
20,
21,
22]. Dahraie et al. presented a scheduling approach to balance the supply and demand with an overall purpose of minimizing the operational cost taking into consideration the constraints related to the maximum and minimum capacities of the included energy storage devices and renewable energy resources under different demand response programs [
23]. Muralitharan et al. developed an energy demand prediction model and mentioned that with the developed model it would be possible to improve the management of demand and supply, planning of power grid and prediction of future energy requirement in the smart grid, but the authors never mentioned how the developed model would do so [
15]. To the best of our knowledge, no deeper investigation has been done into how energy price signals with a real-time pricing structure (RTP) would affect the energy demand required from non-renewable energy resources (e.g., thermal power plants) in a smart grid environment. Using energy price signals as a manipulated variable to leverage battery energy storage and flexible loads (i.e., air conditioning temperature set points) within residential buildings is a novel idea that needs to be addressed.
This study aims to illustrate how using price signals as decision variables would encourage homeowners to use energy storage systems and flexible loads to reduce their bills significantly. In doing that, energy demand prediction models were developed using weather forecasts, historical demand data, and energy price signals. Three different single model machine learning techniques have been used to develop the demand prediction models; linear autoregressive with exogenous inputs regression model (L-ARX regression model), nonlinear autoregressive with exogenous inputs regression model (N-ARX regression model), and nonlinear autoregressive with exogenous inputs neural network (N-ARXnet model). A smart grid model for a city of 60,000 houses is presented to illustrate the relationship between all the parameters of the grid and how making the energy price signals a decision variable would affect the control and operation of the grid. The energy demand prediction models presented in this study will be used to solve a grid-level optimization problem in another future study. The ultimate goal is to motivate homeowners to invest in ESS and to encourage policymakers to implement real-time pricing rate structures while making them available to homeowners.
The remainder of this manuscript is organized as follows.
Section 2 presents the smart grid model and its components in general.
Section 3 presents the model formulation, including the smart houses, solar power plant, conventional natural gas thermal power plant, and frequency control. Problems related to the electricity grid and potential solutions using energy prices are discussed in
Section 4. A clear illustration of the novelty of this work is presented in
Section 4. A description of the machine learning techniques used is presented in
Section 5. The results and discussion are presented in
Section 6. Finally, the conclusion and future work are summarized in
Section 7.
2. System Description
The smart grid system used in this study is composed of a city of 60,000 houses, a solar power plant, and a thermal power plant.
Figure 1 shows a simple schematic of the system. The first element of the grid is the smart houses representing the power demand for a city of 60,000 houses. The houses are referred to as smart houses because of the smart automation of the HVAC system implemented within each house, in addition to the use of battery energy storage.
The second element of the grid is a conventional natural gas thermal power plant. While the thermal power plant is the primary energy source in this study, it is flexible and dispatchable, so it is used as a manipulated variable to regulate the frequency of the grid at 60 Hz.
Figure 2 illustrates the operation of the grid. The energy demand from the city, together with the generated power from the thermal and solar power plants are used to calculate the frequency of the grid. Each house in the city has a proactive energy management system, where it charges or discharges the battery and regulates the HVAC temperature setpoint based on the price signals and the weather forecast. The calculated frequency is then sent to a PI controller, which has a set point of 60 Hz. The PI controller determines the required generation from the thermal power plant that would keep the frequency of the grid at 60 Hz using a very tight control scheme.
The third element of the grid is a solar power plant. The solar power plant is a secondary power supply that provides energy as available from the sun while relying on the thermal power plant to regulate the frequency and to ensure that supply meets demand at all times. In this model, the size of the solar plant can be changed to determine how much solar energy the aforementioned storage and automation techniques can accommodate.
The model formulation of the system, including the houses energy management systems, solar power plant, thermal power plant, and the energy demand models is discussed in
Section 3.
5. Machine Learning Techniques
For this study, three different techniques were used with two different prediction mechanisms: a one-step mechanism and a two-step mechanism.
Figure 8 illustrates the three machine learning techniques, while
Figure 9 illustrates the two prediction mechanisms. As presented in
Figure 8, the three methods are linear autoregressive with exogenous inputs regression model (L-ARX Model), non-linear autoregressive with exogenous inputs regression model (N-ARX Model), and non-linear autoregressive with exogenous inputs neural network model (N-ARXnet Model). L-ARX and N-ARX regression techniques were used because they represent the simplest forms of machine learning for linear systems and nonlinear systems, respectively. If the system can be well represented with one of these simple forms, then there will not be any need for using a more complex technique that would make the problem computationally expensive. The N-ARX neural network technique was used because it showed good potential in solving different complex systems in the literature in the same field [
33,
34,
35]. Autoregressive models were used because of the temporal nature of demand. Actually, a standard feedforward neural network was tested first but gave poor results and thus was neglected and substituted by an autoregressive neural network with exogenous inputs. As discussed earlier in the introduction, many different machine learning techniques can be used, but for this study, only the three aforementioned techniques were used. Using a wider range of techniques is a good idea and could be the focus of future studies, but this study is trying more to convey the idea of using variable price signals to leverage storage and flexible loads than to compare a lot of machine learning techniques.
For each method, two mechanisms are applied, as illustrated in
Figure 9. For the one-step mechanism, only one model is formulated with two inputs: ambient temperature and price signals. The model, as well, considers old demand values as inputs. For the two-step mechanism, two models are used: one to predict the total battery SOC for the city, then the second model is used to predict the demand by taking the predicted values for the SOC as inputs in addition to the ambient temperature and the price signals.
In developing the models, the pricing profile shown in red color in
Figure 3, along with the corresponding energy demand was used for the training and validation phases, while the rest of the pricing profiles of
Figure 3 were used for the testing phase. The dataset used for training and validation was divided into two datasets; one for training (80% of the data points) and one for validation (20% of the data points). The number of old demand values (number of lags) used as inputs was tuned in the validation phase until a value of three hours of previous energy demand data (12 data points because of the 15 min time interval) was chosen as an optimal value. More hours of lag did not result in any significant improvement in the results and would only increase the computational time, while fewer hours did not give good enough results. The developed models are described as follows.
5.1. Linear ARX Regression Models
Linear regression is a method of identifying the relationship between correlated inputs and outputs of a certain system by only including linear terms in the relation between them. ARX model (autoregressive with exogenous inputs) means that the model uses previous output values as inputs to the system with additional new inputs as well. The L-ARX regression models used in this study were developed using new codes written by the authors in Matlab. A “base case” L-ARX regression model that does not include the electricity prices in the inputs was considered and has the following form:
By including electricity prices in the inputs, the following one-step model was developed for predicting the energy demand using L-ARX regression:
where
is the energy demand of the city at time “
” in MWh and
,
,
, and
are the model coefficients. Note that the time step is 15 min, which means that in every hour there are four points or four-time steps. The 108 points in the second and third term are the time steps for 27 h (24 h in the future and three hours in the past) and calculated like this:
. For the 4th term, two hours of past demand values are used (eight-time steps in the past).
Equations (9) and (10) represent the two-step L-ARX regression model as follows:
where
is the total state of charge of the city at time “
” in MWh. Notice that the values of the model coefficients are different for each equation.
5.2. Nonlinear ARX Regression Models
Nonlinear regression is a method used to identify the relation between correlated inputs and outputs of a system by including all different combinations between the terms either linear or nonlinear. In this study, multiple possible N-ARX expressions have been tested starting from basic quadratic functions up to the complicated expressions shown in Equations (11)–(13). These expressions were chosen because they gave the best regression results among all the tested models. The N-ARX regression models used in this study were developed using new codes written by the authors in Matlab. The following expression represents the one-step model that was developed for predicting the energy demand using N-ARX regression:
Equations (12) and (13) represent the two-step N-ARX regression model as follows:
The number of terms in the two-step N-ARX regression model is less than the number of terms in the one-step model. This is because, during the tuning of the two-step model, it was observed that using more terms results in overfitting that reduces the accuracy of the results. Again, note that all the model coefficients in Equations (7)–(13) are all different.
Notice that, if the cost terms were removed from the one-step methods presented in Equations (8) and (11), they would have the same form, which is exactly the “base case model” presented in Equation (7). The only difference would be the model coefficients.
5.3. Nonlinear ARX Neural Network Model (N-ARXnet)
N-ARXnet is an artificial neural network where the outputs are fed back and used as inputs that form a cycle, with new inputs always added at every time step (i.e., N-ARXnet has two different time series, one for the feedback inputs and one for the new inputs). In this study, a three-layer perceptron is used. The three layers are input, hidden, and output layers. The N-ARX neural network models used in this study were developed using “narxnet” function available within Matlab. A “base case” N-ARXnet is considered in this study, which does not have electricity prices as inputs.
Figure 10 illustrates the structure of the N-ARXnet used as a base case, while
Figure 11 illustrates the structure of the N-ARXnet used for the one-step prediction mechanism. For the one-step mechanism, the new inputs at every time step are the 24-h ahead ambient temperature values and 24-h ahead energy prices. Two different time series are used with a three-hour difference. This means that the demand values for the previous three hours are fed back as inputs for each time step and three hours of previous values of the new inputs (ambient temperature and energy prices) are used as well.
is the weight for each input and
is the output. The network was tuned with different numbers of nodes until an optimal value of eight nodes was chosen because a bigger number of nodes did not show any significant improvement in the results and would result in overfitting problems. Remember that the time step is 15 min, which means that 12 past values of the energy demand are fed back to the inputs. The same criteria used for the one-step mechanism were also used for the two-step mechanism with the SOC included in between as shown in
Figure 12. First, a network was tuned to predict the SOC. Then the results from this SOC network were used as input in the tuning of the second network to predict the energy demand.
The results for the training, validation, and testing of all three machine learning techniques are presented and discussed in
Section 6 (Results and Discussion).
6. Results and Discussion
To illustrate the complexity of the input dynamic Simulink model,
Figure 13 presents a 10-day profile of the ambient temperature, the temperature setpoint of one of the houses, and the total state of charge (SOC) of all houses. Note that, these are not the only variables of the system; the data for each house includes, as well, lighting, energy consumption from kitchen appliances (e.g., refrigerator, stove, microwave, etc.) and plug loads (e.g., computers, printers, fans, etc.). Although lighting, kitchen appliances, and plug loads have minor effects compared to HVAC and batteries, they are still taken into consideration. In addition to these data, there is also the variable pricing profiles, which has been illustrated in
Figure 3. From
Figure 13, it can be noticed that there is no specific trend for any of the plots, except that the ambient temperature, of course, goes to lower values at night and higher values during daylight. However, the ambient temperature might stay at relatively lower values for a whole day (as in the period from 100 to 120 h on the plot). Putting all of these together, while considering 60,000 houses, gives a sense of the extremely complex system under study. Building a model with machine learning to represent this complex system with limited input information (just ambient temperature and price signals) was not an easy task.
The three methods used were trained and validated for the summer period (May through September) using ambient temperature obtained from TMY3 weather data for Salt Lake City, Utah and random energy price profiles as inputs for the system and the energy demand resulting from the Matlab/Simulink smart grid model as the system output. As mentioned earlier, the houses are assumed to be gas heated. In this study, the winter months which involve most or all the space heating were not accounted for in the developed models. Different models would need to be built to account for the space heating by natural gas, not electricity and this is out of the scope of this study. The coefficient of determination, root mean squared error, and normalized root mean squared error were used to compare and evaluate the performance of each resulted model.
Training, Validation, and Testing
The results of the training and validation of each model are illustrated in the parity plots shown in
Figure 14. The main observation that can be drawn from the parity plots is that there are some residuals when the value of the demand is close to zero, and this is visible especially in the parity plots of the L-ARX regression models (
Figure 14a–c). Generally, this makes sense because it is harder to correlate the data when their values are closer to zero. Also, in
Figure 14a,f (base case models), it can be noticed that the points are more dispersed than all the other parity plots. Notice that, for example in
Figure 14a (base case L-ARX model parity plot), the range of the error is very big to the level that some points have actual demand values above 600 MWh while the corresponding model values are negative. This means that electricity prices have significant effect on the parity plots.
Another important observation is that the data are more dispersed in
Figure 14b–e than in
Figure 14g,h. This means that the N-ARXnet models have a better performance than the L-ARX and N-ARX regression models. However, only observing the parity plots is not enough for quantifying the performance of each model. Therefore, the coefficient of determination, root mean squared error, and normalized root mean squared error were used to quantify and compare the performance of all the developed models.
Table 2 presents the results of these metrics for each model with the training and validation dataset vs. the results with testing datasets.
Different energy price profiles (
Figure 3) from 10 different datasets were used to test the developed models. Variations in the ambient temperature were considered minor and were not taken into consideration. However, separate studies should be performed to evaluate the effect of the uncertainty resulting from TMY3 weather data.
Figure 15 presents the energy demand calculated using the training and validation dataset vs. the energy demand calculated using one of the testing datasets for all models. The most obvious observations are in
Figure 15a,f (base case models that do not account for electricity prices) which show that the models completely failed in matching the actual data. This proves that electricity prices are crucial parameters and have to be considered in the models.
From
Figure 15b,c, it can be noted that the L-ARX regression models have poor performance when different input dataset is used. Notice that the model failed to predict the maximum demand values at around 8 AM and 4 PM. The N-ARX regression models have a better performance than the L-ARX regression ones, and the N-ARXnet models have slightly better performance than the N-ARX regression models.
On the other hand, it can be noted from
Figure 15 that the energy demand profile reaches negative values several times. This means that the grid is a net producing grid at these times. As mentioned earlier a PI controller for controlling the frequency of the grid has been tuned to avoid any complications in such cases.
Figure 16 illustrates the frequency profile that corresponds to the energy demand profiles of
Figure 15. Notice that the frequency has a slight increase at the times where the energy demand goes below zero, but still remains within safe operating conditions all the time.
To evaluate the models numerically,
Table 2 shows the values of the coefficient of determination (R
2), root mean squared error (RMSE), and normalized root mean squared error (NRMSE) for each model with the training and validation dataset and the testing datasets. The values shown for testing are the average values obtained from the ten testing datasets. Equations (14)–(16) were used to calculate R
2, RMSE, and NRMSE, respectively.
where
is the actual demand,
is the model demand,
is the mean of the actual demand,
is the maximum value of the actual demand, and
is the minimum value of the actual demand.
From
Table 2, it can be observed that the base case models completely failed, especially with the testing data. Notice that the base case N-ARXnet model has a negative testing R
2 which illustrates how bad is this model. Also, L-ARX and N-ARX regression models have low performance. Interestingly, the two-step mechanisms for L-ARX and N-ARX regression have lower performance than the one-step mechanisms. On the contrary, the two-step mechanism N-ARXnet model has the best values for all metrics (highest R
2 and lowest RMSE and NRMSE) as shown in bold in the table. This means that the two-step NARXnet model is the most trustworthy of all the models. However, the two-step models, in general, do not have a significant difference from the one-step models in terms of all the metrics. This is an important result as it means that the extra step of using the SOC in the calculations is not necessary to a certain extent, especially because using the SOC would require monitoring the battery usage of each house to collect training data. Therefore, considering the one-step models only, the N-ARXnet model is preferred as it has better performance (higher R
2, lower RMSE, and NRMSE) than the other one-step models.
These results mean that with minimal information about the energy consumption within each house (only the battery SOC for the two-step mechanism) or with almost no information about it (the one-step mechanism), reliable data for the energy demand of the city can be predicted.
7. Conclusions and Future Work
The growing penetration of VREs is driving much technology development and deployment. Consumers at the residential level are incentivized to generate their power via rooftop PV. However, flat or simplified pricing structures give them no financial incentive to invest in storage or to pay any attention to when they use energy. While many regulatory would exist, this work has demonstrated that the introduction of variable pricing, combined with storage and proactive energy management systems would incentivize homeowners to invest in storage. This would allow them to respond to grid signals showing future pricing profiles and allow them to use these resources, in an automated way, to help alleviate some of the supply and demand mismatch issues that currently exist.
In this study, different machine learning models were developed for predicting the energy demand using only weather forecasts and electrical energy price profiles. The techniques used are L-ARX regression, N-ARX regression, and N-ARX neural network. The results showed that models with the two-step mechanism, which includes an intermediate step of predicting the total state of charge of the batteries, do not give significantly different results from the one-step model that predicts the energy demand in one-step. This justifies that the one-step models shall be preferred to avoid collecting SOC data for each house. Also, the base case models proved that using the electricity prices in the models is very important for catching all the changes that happen as the price varies.
A novel way for solving the complications that come with renewable penetration, as described in
Section 4, is to set up an optimization problem incorporating the developed models in the structure of the problem (the objective function and the constraints), where the decision variables of the system would be the electricity prices. Building models that predict the energy demand with the electricity prices being the only decision variables are considered the main contribution of this study. In other words, the electricity prices can now be used to leverage electrical energy storage (ESS) and smart HVAC to regulate the operation of the grid and avoid most of its complications (e.g., complications resulting from the duck curve).
In future work, more rigorous ways for solving the problems related to smart grid operations, as discussed in
Section 4, will be developed using stochastic optimization techniques instead of just using manual iterations. The results of these studies shall motivate policymakers in different countries to change the current electricity rate structures and to encourage homeowners to invest in smart home automation, including HVAC optimization and ESS.