Next Article in Journal
Adaptative Cover to Achieve Thermal Comfort in Open Spaces of Buildings: Experimental Assessment and Modelling
Next Article in Special Issue
Optimization of Water Pressure of a Distribution Network within the Water–Energy Nexus
Previous Article in Journal
Ellipsoidal Path Planning for Unmanned Aerial Vehicles
Order Article Reprints
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:

Optimization of the Electrical Demand of an Existing Building with Storage Management through Machine Learning Techniques

Industrial Engineering School, Universidade de Vigo, Rúa Maxwell s/n, 36310 Vigo, Spain
Author to whom correspondence should be addressed.
Appl. Sci. 2021, 11(17), 7991;
Received: 27 July 2021 / Revised: 25 August 2021 / Accepted: 27 August 2021 / Published: 29 August 2021
(This article belongs to the Special Issue 5th Anniversary of Energy Section—Recent Advances in Energy)



Featured Application

The methods and models presented in this paper optimize the management of a building’s storage system by modeling and predicting electrical demand using Machine Learning techniques, obtaining high accuracy results.


Accurate prediction from electricity demand models is helpful in controlling and optimizing building energy performance. The application of machine learning techniques to adjust the electrical consumption of buildings has been a growing trend in recent years. Battery management systems through the machine learning models allow a control of the supply, adapting the building demand to the possible changes that take place during the day, increasing the users’ comfort, and ensuring greenhouse gas emission reduction and an economic benefit. Thus, an intelligent system that defines whether the storage system should be charged according to the electrical needs of that moment and the prediction of the subsequent periods of time is defined. Favoring consumption in the building in periods when energy prices are cheaper or the renewable origin is preferable. The aim of this study was to obtain a building electrical energy demand model in order to be combined with storage devices with the purpose of reducing electricity expenses. Specifically, multilayer perceptron neural network models were applied, and the battery usage optimization is obtained through mathematical modelling. This approach was applied to a public office building located in Bangkok, Thailand.

1. Introduction

Compliance with the objectives set in the Paris agreement requires a change in the direction of greenhouse gas reduction on each economic sector, with most of the emissions linked to energy consumption, directly or not, as discussed in Regulation 2018/842 [1] and in Directive 2018/844 [2]. Regarding the residential and industrial sectors, buildings are responsible of 40% of final energy consumption and 36% of the emissions in Europe [3].
The key factor in achieving these goals is a dual strategy that encourages the creation and diffusion of renewable energy sources and other zero-emission technologies [4]. In [5] the emissions and the energy demand of three types of residential neighborhoods were analyzed, showing that the increase in renewable energy sources mitigates emissions by 10–25%. In addition, the study shows the importance of controlling electricity production in order to reduce emissions, which can be up to 95% lower. In [6] an analysis of nine neighborhoods was carried out in order to propose strategies to reduce energy consumption in the study region. It is shown that the application of renewable energy sources and electric vehicles would considerably improve energy performance in the analyzed region. Ref. [7] is a review of the results of 144 studies on the zero-emission neighborhood topic. Focus areas, research gaps, and future research possibilities are identified.
Controlling the electricity supply is one of the main pillars for the achievement of sustainable development marked by the United Nations [8]. Thus, energy efficiency in the electrical network fluctuates throughout the day according to generation needs, to meet consumption. Generally, periods with renewable energy correspond to periods with lower prices [9].
The European Union recognizes the development of batteries as a strategic value chain to obtain a prosperous and neutral economy from the point of view of global warming [10]. By means of a storage management system, supply control is optimized by adapting demand to possible changes that may appear throughout the day, favoring consumption in the building in periods when energy prices are cheaper or of renewable origin [11] and supplying power in possible unexpected grid outages [12].
The development of a good battery energy control system allows the achievement of a building with a high quality of energy use [13]. The management system can be more complex in case of considering the production of renewable energy in the same building, the charging of electric vehicles, or a combination of factors, reducing the electrical needs on the electrical network and achieving a nearly zero energy building [14]. In [15] an analysis of the impact of different battery parameters, as capacity, charge/discharge rate, power request process, and cost function, on the cost savings using different energy storage algorithms is performed. In [16] an analysis of the savings, efficiency and emissions in three scenarios with storage using a mathematical optimization was performed. It is shown that the storage system can generate great benefits in each of the fields of study. In [17] an intelligent system of a microgrid with photovoltaic, storage, hybrid vehicle and electrical network was proposed. The control algorithm shows a benefit in reducing demand, maximizing user comfort and minimizing energy costs.
There are diverse models of optimization of the battery management system, often consisting of a multiobjective problem. Some of the most used algorithms to solve problems in the field are genetic algorithms [18], linear programming [19], mixed-integer linear programming [20], mixed-integer quadratic programming [21], nonlinear programming [22], mixed-integer nonlinear programming [23], convex programming [24], and reinforcement learning [25].
Accurately recognizing fluctuations in electrical demand, in building, is a key step in optimizing the performance of the storage management system. There are different methods that are developed to know the energy demand. Among them are the white box, through physical modelling; black box, through data driven modelling; and grey box, through the combination of previous models [26].
Among the methods presented, the impact of black box modelling stands out in recent years, mainly because of the development of machine learning techniques, specifically, the deep learning techniques [27]. These replicate how the human brain works, being the key point in offering models the ability to learn. In this way, with deep learning techniques, computers have the ability to identify complex patterns in the data without being explicitly programmed, offering accurate predictions at a low cost [28].
Deep Learning techniques have enormous potential, however, mainly because the dependence on a variety of hyperparameters, the performance of the algorithm can vary significantly, generating erroneous results under certain circumstances, either overfitting or underfitting. These hyperparameters correspond to the number of layers, the number of nodes per layer, the type of activation function in each layer, the selection of a suitable learning rate, considering if it is necessary to consider a decay rate in the problem, the optimizer, or the number of epochs and batches in the model [29]. Nowadays, the selection of the best values or settings and how to adjust each hyperparameter to achieve the best performance is still unclear and is an open question in computer sciences [30]. In this way, the search for the appropriate configuration of these hyperparameters is a challenging problem and the applicability of these techniques on modeling and prediction of electrical energy is in continuous improvement [31].
Deep learning methods are usually divided into three branches: standard neural networks (SNN), convolutional neural networks (CNN), and recurrent neural networks (RNN). The fields of application are diverse, SNNs being habitually linked to areas as building energy [32] or environment (e.g., saline particles classification [33] and botanical origin of honeys prediction [34]); CNN, to image recognition (e.g., object detection [35] and face recognition [36]), or autonomous driving (e.g., road architecture recognition [37] and sign detection [38]); and RNN, to speech recognition [39] or translation [40]. The common characteristic is the structure, from some input data, it is sought to extract a pattern in order to extrapolate the results to new data. However, depending on the type of data used, the results will have greater accuracy. So SNN are often used with tabular data, CNN, with image data and RNN, with sequence data [27].
Similar tasks to those proposed here have been solved with deep learning or related techniques: prediction of the energy consumption of a green building [41], implementation of demand-response programs at a multiple-building scale [42], forecasting of the behavior of a group of residential buildings [43], scheduling of the storage system based on reducing the peak load [44] or forecasting in smart home applications [45].
To carry out this study, the SNN are applied to predict the electricity consumption of an office building. Thus, the fitting of the SNN to problems in the field of study is widely demonstrated; it is possible to obtain a very good accuracy despite the simplicity they present in their structure [46]. In addition, the adjustment of this type of neural network also has great accuracy in the field of photovoltaic production prediction. It is able easy to extend the models [47]. In [48] a RF-XGBoost model was used for the prediction of electrical energy from temperature, humidity, air density and pressure. In [49] different machine learning models (SNN, support vector machine, and RNN) were compared for the prediction of photovoltaic production, heating, cooling, and illumination from outdoor air-dry bulb temperature, outdoor humidity, global solar radiation, cloudiness ratio, schedules of occupants and office equipment, indoor air-dry bulb temperature, and photovoltaic surface temperature. In [50] a SNN model was used for the prediction of electrical energy from outdoor dry-bulb temperature, outdoor relative humidity, precipitation probability, rain indicator, wind speed, sky condition, day indicator, interval stamp, and operational condition.
Based on the model obtained with this technique, in this paper the electrical consumption prediction is applied in order to optimize the storage management system, in which, by performing a mathematical analysis, it is sought to minimize costs in the building. The combination of both techniques makes it possible to generate integrated and automated management and control in order to increase energy efficiency and the level of comfort through the flexibility of electricity consumption in the building [51]. The battery management system makes it possible to supply power at necessary moments from the stored energy because the knowledge and prediction of the machine learning models. In this way, the quality of energy consumption can be improved, with a greater and better use of green sources, facing the energy crisis and environmental concerns present nowadays [52]. It can be said that the novelty of this research work lies in the combination of two concepts: modeling the prediction of energy demand using machine learning techniques and minimizing the electricity expenses by optimizing the management of the storage system. Both concepts have their own circumstances: in the first case, parameter adjustment is the key of the process. The latter combines the equations of the storage system, the information related with tariffs and the optimization techniques.
Besides, and in order to justify the use of the above mentioned techniques, focus on the fact that, according to the no free lunch theorem, none of the evolutionary optimization algorithms can outperform the others if they are averaged over all possible problems [53], i.e., the use of the SNN in this type of problem is as valid as any other, taking into account that the solution obtained is acceptable.
This paper is organized as follows: the methods and models developed in the study are presented in Section 2; a specific case and the corresponding simulation are shown in Section 3; and the conclusions are outlined in Section 4.

2. Models and Methods

This section presents the mathematical structures that used in the realization of this research work. According to the analysis presented, the first part shows the methodology to estimate the electrical consumption through SNN, and the second, the model developed to maximize the benefits of the storage management system by reducing electricity expenses.

2.1. Machine Learning Prediction

The methodology used is based on supervised learning techniques. From a layer with the input data, the input layer, it is sought to predict one or more labeled variables located in the last layer, the output layer. Between both, there are some interconnected, hidden layers. Depending on the complexity of the problem, the hidden layers vary in their number of nodes and layers. The algorithm used to solve the SNN is divided into three steps, forward propagation, backward propagation and weights update. In addition, the Adam optimizer has been used to speed up and improve convergence. The full operation is shown in Figure 1.
Figure 1 shows in detail the classical neural network methodology from the achievement of each of the variables in a specific layer. As can be seen, the method is divided in three stages, forward propagation, backward propagation and update. The steps carried out for the computation of each of the variables are introduced in the following paragraphs.
First, the information provided by the input data, in the input layer, is propagated through the hidden layers by the connections between the nodes until the variable of interest is predicted in the output layer. This is called forward propagation and is divided into two steps. In the first, given by the Equation (1), the nodes of the layer l are fitted to a linear equation Z [ l ] considering the bias and the kernel weights, b [ l ] and W [ l ] , and the predicted values of the previous layer, A [ l 1 ] . In the second, given by Equation (2), the activation of the obtained values in layer l by the previous equation is carried out. The most common activations are shown in Figure 2.
Z [ l ] = W [ l ] · A [ l 1 ] + b
A [ l ] = g [ l ] ( Z [ l ] )
When the predicted values correspond to the last layer L (or output layer), the second stage begins, called backward propagation and given by the Equation (3). This commences by determining the error between the predicted variable Y ^ , and the real variable Y . Once this deviation is known, the information is propagated to the input layer by determining the derivatives of the layer function d Z [ l ] using the chain rule. The bias weight is not considered because its influence with respect to the kernel weight is negligible.
Z [ l ] = { i = 1 N ( Y i Y ^ i ) 2 N     i f   l = L W [ l + 1 ] · Z [ l + 1 ] g [ l ] ( Z [ l ] )     e l s e
where Y ¯ corresponds to the mean of the output variable, N is the total number of values, and g [ l ] ( Z [ l ] ) is the derivative of the activation function considered in layer l .
At this stage, the error determined is also propagated through the kernel and bias weights with the purpose of obtain the optimal settings for them, Equations (4) and (5) respectively.
W [ l ] = 1 N · Z [ l ] · A [ l 1 ]
b [ l ] = 1 N · i = 1 N Z [ l ]
Finally, the kernel and bias weights are updated with the Adam optimizer, Equations (6) and (7) respectively.
W [ l ] = W [ l ] α · V W S W + ε
where α is the learning rate, V W and S W are Adam optimizer kernel weights, computed with Equations (8) and (9) respectively, and ε is a small number to prevent zero division.
b [ l ] = b [ l ] α · V b S b + ε
where V b and S b are Adam optimizer bias weights, computed with Equations (10) and (11) respectively.
V W = β 1 · V W + ( 1 β 1 ) · W ( 1 β 1 t )
where β 1 corresponds to the first moment of the exponential decay rate.
S W = β 2 · S W + ( 1 β 2 ) · W 2 ( 1 β 2 t )
where β 2   corresponds to the second moment of the exponential decay rate.
V b = β 1 · V b + ( 1 β 1 ) · b ( 1 β 1 t )
S b = β 2 · S b + ( 1 β 2 ) · b 2 ( 1 β 2 t )

2.2. Battery Management Optimization

Electricity price varies according to the period of the day, p , in which the consumption is established. Usually, these periods have been divided into peak, with high prices, and valley hours, with low prices, however, with the proliferation of the electric vehicle, a new period has appeared, the flat hours, with intermediate prices. The benefits of machine learning techniques allow a model to be obtained with which the electrical demand can be predicted in subsequent periods of time, δ t . The energy storage system benefits from this model, being able to recognize at any time, t , the trend in consumption. In this way, it is possible to predict the best option that the storage system can take in order to maximize the electrical energy consumption in periods with lower electricity costs. The Figure 3 shows the storage flowchart and following paragraphs describe the mathematical model performed in order to minimize the electricity bills.
The first stage is to apply the first principle of thermodynamics by balancing the power demand in the building, D B , with the power consumed from the electrical network, P . The effects of the battery in both directions are also considered, i.e., the charging and discharging powers, P C h and P D i s c h respectively. Equation (12) shows this principle applied to each period of time t .
P ( t ) + P D i s c h ( t ) = D B ( t ) + P C h ( t )
Subsequently, the battery state of charge at time t , S o C ( t ) , is computed from the previous state, S o C ( t 1 ) , and the charging and discharging needs in the building. In order to optimize the storage according to the needs of the building, in Equation (13) the charging is multiplied by a function that establishes the amount of power consumed from the electrical network needed at each time t , f ( S o C ,   p ,   t ,   δ t ) . This function is carried out from the predefined neural network model and allows the estimating of whether an overcharging, cover only the demand, a charging defect or a zero charging period is necessary.
S o C ( t ) = S o C ( t 1 ) P D i s c h ( t ) C n o m · η D i s c h + P C h ( t ) · η C h C n o m · f ( S o C ,   p ,   t ,   δ t )
where η D i s c h ( t ) and η C h ( t ) are the battery discharging and charging efficiencies, and C n o m is the capacity.
In order to avoid irregularities in battery usage, its boundary conditions are stablished. On the one hand, the energy stored in the battery cannot exceed the capacity, due to physical limits, neither can be completely emptied, to protect and extend its life cycle. Equation (14) shows this restriction using S o C m i n as the minimum allowed state of charge.
S o C m i n S o C ( t ) 1
On the other hand, the battery cannot be discharged or charged outside of the maximum ranges established by the manufacturer, P D i s c h ,   m a x and P C h ,   m a x respectively. Equations (15) and (16) show these conditions.
P D i s c h ( t ) P D i s c h ,   m a x
P C h ( t ) P C h ,   m a x
Finally, the cost function is determined from the calculations of power and energy consumed from the electrical network at each time t , P ( t ) and E ( t ) respectively, shown in Equation (17).
C o s t = t [ P ( t ) · C P ( t ,   p ) + E ( t ) · C D ( t ,   p ) ]
where C P ( t ,   p ) and C D ( t ,   p ) are the power and energy costs in period p and time t respectively.

3. Case Study and Results

The aim of this study is to obtain a model to predict, with high accuracy, the electrical energy demand, by using SNN to manage the energy storage system in order to reduce the electricity expenses of a building. The validation of the methods proposed in the previous section is implemented in an office building divided into seven floors and located in Bangkok, Thailand. The monitored data have a period of 1 min and are collected in different zones on each floor. These data correspond to indoor temperature, ambient illumination and lighting and loads consumption [54]. Furthermore, the external monitored data have a period of 30 min and correspond to outdoor temperature.
The study is performed in zone 2 of the second floor due to data quality. The monitoring period goes from 1 July at 12 a.m. to 12 September at 4 p.m., both in 2018, and from 3 March 2019, at 2 p.m. to 1 January 2020, at 12 a.m. The percentage of errors of each variable monitored in the collection period are shown in Table 1. As can be seen, the errors of the building’s interior sensors are 1.56%, the exterior ones, 0.66%, and those of the energy meters, 0.15%.
The tariff considered has hourly discrimination with three periods, peak hours, flat hours, and valley hours. On working days, peak hours go from 10 a.m. to 2 p.m. and from 6 p.m. to 10 p.m., flat hours, from 8 a.m. to 10 a.m. and from 10 p.m. to 12 a.m., and valley hours, from 12 a.m. to 8 a.m. On the other hand, nonworking days are always considered as valley hours. The prices of energy and power prices in each period are presented in Table 2.
The energy storage system must have values according to the demand in the selected zone. The capacity must be adjusted to the consumption, avoiding oversizing or undersizing. The charging and discharging powers must also be high enough in order to be able to supply the energy in each instant. Therefore, from the study of the electricity demand of the building zone, the data used to simulate the battery are shown in Table 3.

3.1. Machine Learning

Data with a period of 1 min are converted to 30 min by adding or averaging their values over the periods, due to differences in the monitoring period. Thus, as NaN values are allowed in the neural network, there are 17,956 values. In addition to the data presented above, the neural network also considers the hour of the day, day of the week and day of the year, with the final objective being to recognize the electrical consumption of the building (lighting and loads) from the rest of the variables.
The configuration shown in Figure 4 has been obtained from the selection of the best configuration with root mean square error (RMSE), modeled in Python. I.e., the following hyperparameters are properly adjusted: number of layers, the number of nodes per layer, the type of activation function in each layer, the selection of a suitable learning rate, the optimizer, or the number of epochs and batches in the model. The testing was carried out for neuron values corresponding to the range 0–100 with step 25 and with the possibility of up to six hidden layers. All possible configurations of the activations shown in Figure 2 were also evaluated.
The methodology used consisted of a batch learning of 64 units in each epoch, with a maximum of 500. The proposed model was carried out with a 90% Train/Dev and 10% test sample partition, i.e., 90% modelling and 10% predicting, and a 10 division k-fold method. The mean error for the different divisions of the sample and the global sample is shown in Table 4.
As can be seen in Table 4, the errors of the SNN model with k-fold reduced. On the one hand, the mean modeling errors are 5.44% for the training set, and 5.59% for the validation set (Dev). On the other hand, the mean errors of the prediction set (Test) are 5.28%. In this way, it has been possible to obtain a model that can model and predict the data with mean errors of 5.47%. The fitting of the electricity demand of this SNN model with k-fold presented with respect to the real data is shown in Figure 5.
As can be seen in Figure 5, the SNN k-fold results were accurate. The model adjusted to the variations in electrical consumption that occur through the day in the building, both in the Train/Dev and Test partitions. Therefore, it can be determined that the model is capable of modeling and predicting electricity consumption in the selected office building. From Figure 5, it is also possible to determine the use established in the building, setting up the working hours through the day and closing at night. In addition, the figure shown corresponds to a weekday, since, as expected, no activity is established on weekends.

3.2. Management Storage

The storage management system was implemented to minimize the global energy cost. The models used established that the battery must not be charged during peak hours. It should not be charged during flat hours, and there are no restrictions for valley hours. To consider the prediction of future consumption from the inputs presented, a lag 2 was considered, i.e., 1 h. In addition, an error of 5% of the inputs was considered in the lagged periods to simulate the imprecision of the prediction system. Furthermore, with the purpose of protecting the battery and maximizing its life cycle, a depth of discharge of 90% was considered. Figure 6 shows the evolution of the state of charge of the battery from the management storage system proposed with the data from the SNN model with k-fold. This figure shows both the Train/Dev and the Test divisions. The results for both partitions are similar, not showing a priori irregularities in the prediction model.
As can be seen in Figure 6, the battery was charged in the valley hours and discharges in the flat and peak hours. The greatest discharge occurred in the hours in which the demand is greatest, corresponding mainly to the central hours of the day, establishing both peak hours and a small period of flat hours. Battery discharge began at 8 a.m., when the building workday begins. From 9 p.m. the battery maintained its state of charge until the valley hours are reached, since the flat hours were established and there was no consumption in the building.
Once the evolution of the battery’s state of charge was determined, Figure 7 shows the variation that the storage management system produced in the instantaneous energy costs. In the same way as before, both the Train/Dev and the Test divisions are shown, not existing strange results in the predictions.
The period of electrical consumption that was established in the building generated costs in the hours with high energy cost, i.e., peak hours and flat hours. For this reason, as can be seen in Figure 7, the building’s habitual consumption costs were established in these hours. On the contrary, with the energy storage system, the building’s electrical consumption was covered by the discharge of the battery. Thus, the costs in the battery system were set at the lowest energy cost, i.e., valley hours, the costs in peak hours and flat hours being null. In this way, an economic benefit was generated. The differences between both situations are presented in Table 5.
As previously determined, the battery allowed us to alleviate the demand of the electrical network in the periods in which the price of electricity was higher and to consume in periods with low price. As can be seen in Table 5, the total electricity price in the study period, twelve months divided into two periods, of the building’s usual consumption was higher than that generated with the energy monitoring system proposed.

4. Conclusions

The aim of this paper was to obtain an integrated and automated management and control in buildings. Based on the data of an office building located in Bangkok, the possibility of carrying out a control system using machine learning techniques for the prediction of electrical consumption and mathematical models for the storage management system has been demonstrated.
The fitting of the SNN model obtained, i.e., the adjustment of the corresponding parameters, was accurate and allowed us to predict instant and subsequent electricity consumption. The results obtained present clear evidence that the combination of the techniques presented establish a model that is more beneficial to the environment and with consequent economic savings.
Specifically, the SNN with k-fold model established sought to characterize the electricity consumption in the building from the interior and exterior temperatures, the interior lighting and the temporal variables of time of day, day of year and day of week. The determined dataset samples, either modelling or predicting, had errors over 5% and were made up of two hidden layers with 100 and 75 units and with linear and sigmoid activations respectively, being the activations of the output layer sigmoid. In case of considering the management storage system based on the machine learning model presented, the savings in the study zone were considerable, amounting to a reduction of 52.72 € in the electricity bills in the period analyzed.

Author Contributions

Conceptualization, M.C.-C. and D.V.; methodology, D.V. and P.E.-O.; software, M.C.-C.; validation, D.V. and P.E.-O.; formal analysis, M.C.-C.; investigation, M.C.-C.; resources, D.V. and P.E.-O.; data curation, M.C.-C.; writing—original draft preparation, M.C.-C. and D.V.; writing—review and editing, P.E.-O.; visualization, D.V.; supervision, D.V. and P.E.-O.; project administration, D.V. and P.E.-O.; funding acquisition, P.E.-O. All authors have read and agreed to the published version of the manuscript.


This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data analyzed in this study are presented in [54].

Conflicts of Interest

The authors declare no conflict of interest.


  1. European Union. Regulation 2018/842; European Union: Brussels, Belgium, 2018. [Google Scholar]
  2. Official Journal of the European Union. Directive 2018/844 of the European Parliament and of the Council of 30 May 2018; EU: Brussels, Belgium, 2018. [Google Scholar]
  3. Li, D.H.W.; Yang, L.; Lam, J.C. Zero energy buildings and sustainable development implications—A review. Energy 2013, 54. [Google Scholar] [CrossRef]
  4. European Commission. 100 Climate-Neutral Cities by 2030—By and for the Citizens; EU: Brussels, Belgium, 2020. [Google Scholar]
  5. Nematchoua, M.K.; Sadeghi, M.; Reiter, S. Strategies and scenarios to reduce energy consumption and CO2 emission in the urban, rural and sustainable neighbourhoods. Sustain. Cities Soc. 2021, 72, 103053. [Google Scholar] [CrossRef]
  6. Nematchoua, M.K.; Marie-Reine Nishimwe, A.; Reiter, S. Towards nearly zero-energy residential neighbourhoods in the European Union: A case study. Renew. Sustain. Energy Rev. 2021, 135, 110198. [Google Scholar] [CrossRef]
  7. Brozovsky, J.; Gustavsen, A.; Gaitani, N. Zero emission neighbourhoods and positive energy districts—A state-of-the-art review. Sustain. Cities Soc. 2021, 72, 103013. [Google Scholar] [CrossRef]
  8. European Commission. Report from the Commission to the European Parliament and the Council: On Progress of Clean Energy Competitiveness; EU: Brussels, Belgium, 2020. [Google Scholar]
  9. Belton, C.A.; Lunn, P. Smart choices? An experimental study of smart meters and time-of-use tariffs in Ireland. Energy Policy 2020, 140, 111243. [Google Scholar] [CrossRef][Green Version]
  10. European Commission. Study on Energy Storage—Contribution to the Security of the Electricity Supply in Europe; EU: Brussels, Belgium, 2020. [Google Scholar]
  11. Van De Ven, P.M.; Hegde, N.; Massoulie, L.; Salonidis, T. Optimal control of end-user energy storage. IEEE Trans. Smart Grid 2013, 4, 6477197. [Google Scholar] [CrossRef][Green Version]
  12. Uski, S.; Forssén, K.; Shemeikka, J. Sensitivity assessment of microgrid investment options to guarantee reliability of power supply in rural networks as an alternative to underground cabling. Energies 2018, 11, 2831. [Google Scholar] [CrossRef][Green Version]
  13. Banos, R.; Manzano-Agugliaro, F.; Montoya, F.G.; Gil, C.; Alcayde, A.; Gomez, J. Optimization methods applied to renewable and sustainable energy: A review. Renew. Sustain. Energy Rev. 2011, 15, 1753–1766. [Google Scholar] [CrossRef]
  14. Gao, Y.; Li, S.; Dong, W. A learning-based load, PV and energy storage system control for nearly zero energy building. In Proceedings of the 2020 IEEE Power & Energy Society General Meeting (PESGM), Montreal, QC, Canada, 2–6 August 2020; p. 9281924. [Google Scholar] [CrossRef]
  15. Codemo, C.G.; Erseghe, T.; Zanella, A. Energy storage optimization strategies for Smart grids. In Proceedings of the 2013 IEEE International Conference on Communications (ICC), Budapest, Hungary, 9–13 June 2013; p. 6655201. [Google Scholar] [CrossRef]
  16. Villanueva, D.; Cordeiro, M.; Feijoó, A.; Míguez, E.; Fernández, A. Effects of adding batteries in household installations: Savings, efficiency and emissions. Appl. Sci. 2020, 10, 5891. [Google Scholar] [CrossRef]
  17. Chauhan, R.K.; Chauhan, K. Building automation system for grid-connected home to optimize energy consumption and electricity bill. J. Build. Eng. 2019, 21, 409–420. [Google Scholar] [CrossRef]
  18. Bingham, R.D.; Angelin-Chaab, M.; Rosen, M.A. Whole building optimization of a residential home with PV and battery storage in The Bahamas. Renew. Energy 2019, 132, 1088–1103. [Google Scholar] [CrossRef]
  19. Mason, I.G.; Miller, A.J.V. Energetic and economic optimization of islanded household-scale photovoltaic-plus-battery systems. Renew. Energy 2016, 96, 559–573. [Google Scholar] [CrossRef]
  20. Ozoe, S.; Tanaka, Y.; Fukushima, M. A two-stage stochastic mixed-integer programming approach to the smart house scheduling problem. Electr. Eng. Jpn. 2014, 186, 48–58. [Google Scholar] [CrossRef]
  21. Mazzoni, S.; Ooi, S.; Nastasi, B.; Romagnoli, A. Energy storage technologies as techno-economic parameters for master-planning and optimal dispatch in smart multi energy systems. Appl. Energy 2019, 254, 113682. [Google Scholar] [CrossRef]
  22. Zhao, Y.; Lu, Y.; Yan, C.; Wang, S. MPC-based optimal scheduling of grid-connected low energy buildings with thermal energy storages. Energy Build. 2015, 86, 415–426. [Google Scholar] [CrossRef]
  23. Lu, Y.; Wang, S.; Sun, Y.; Yan, C. Optimal scheduling of buildings with energy generation and thermal energy storage under dynamic electricity pricing using mixed-integer nonlinear programming. Appl. Energy 2015, 147, 49–58. [Google Scholar] [CrossRef]
  24. Wu, X.; Hu, X.; Yin, X.; Zhang, C.; Qian, S. Optimal battery sizing of smart home via convex programming. Energy 2017, 140, 444–453. [Google Scholar] [CrossRef]
  25. Vazquez-Canteli, J.R.; Nagy, Z. Reinforcement learning for demand response: A review of algorithms and modeling techniques. Appl. Energy 2019, 235, 1072–1089. [Google Scholar] [CrossRef]
  26. Martínez-Comesaña, M.; Febrero-Garrido, L.; Granada-Álvarez, E.; Martínez-Torres, J.; Martínez-Mariño, S. Heat Loss Coefficient Estimation Applied to Existing Buildings through Machine Learning Models. Appl. Sci. 2020, 10, 8968. [Google Scholar] [CrossRef]
  27. Lecun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature 2015, 521, 436–444. [Google Scholar] [CrossRef]
  28. Alom, M.Z.; Taha, T.M.; Yakopcic, C.; Westberg, S.; Sidike, P.; Nasrin, M.S.; Hasan, M.; Van Essen, B.C.; Awwal, A.A.S.; Asari, V.K. A state-of-the-art survey on deep learning theory and architectures. Electronics 2019, 8, 292. [Google Scholar] [CrossRef][Green Version]
  29. Hutter, F.; Lücke, J.; Schmidt-Thieme, L. Beyond Manual Tuning of Hyperparameters. Künstl. Intell. 2015, 29, 329–337. [Google Scholar] [CrossRef]
  30. Yang, X.S. Nature-inspired optimization algorithms: Challenges and open problems. J. Comput. Sci. 2020, 46, 101104. [Google Scholar] [CrossRef][Green Version]
  31. Ozcanli, A.K.; Yaprakdal, F.; Baysal, M. Deep learning methods and applications for electrical power systems: A comprehensive review. Int. J. Energy Res. 2020, 44, 7136–7157. [Google Scholar] [CrossRef]
  32. Bedi, J.; Toshniwal, D. Deep learning framework to forecast electricity demand. Appl. Energy 2019, 238, 1312–1326. [Google Scholar] [CrossRef]
  33. Alshehri, M.; Kumar, M.; Bhardwaj, A.; Mishra, S.; Gyani, J. Deep learning based approach to classify saline particles in sea water. Water 2021, 13, 1251. [Google Scholar] [CrossRef]
  34. Anjos, O.; Iglesias, C.; Peres, F.; Martínes, J.; García, Á.; Taboada, J. Neural networks applied to discriminate botanical origin of honeys. Food Chem. 2015, 175, 128–136. [Google Scholar] [CrossRef]
  35. Girshick, R.; Donahue, J.; Darrell, T.; Malik, J. Region-based convolutional networks for accurate object detection and segmentation. IEEE Trans. Pattern Anal. Mach. Intell. 2016, 38, 7112511. [Google Scholar] [CrossRef] [PubMed]
  36. Taigman, Y.; Yang, M.; Ranzato, M.; Wolf, L. Deepface: Closing the gap to human-level performance in face verification. In Proceedings of the 2014 IEEE Conference on Computer Vision and Pattern Recognition, Columbus, OH, USA, 23–28 June 2014. [Google Scholar]
  37. Al-Qizwini, M.; Barjasteh, I.; Al-Qassab, H.; Radha, H. Deep learning algorithm for autonomous driving using GoogLeNet. In Proceedings of the 2017 28th IEEE Intelligent Vehicles Symposium (Iv 2017), Los Angeles, CA, USA, 11–14 June 2017; p. 7995703. [Google Scholar]
  38. Chen, L.; Hu, X.; Xu, T.; Kuang, H.; Li, Q. Turn signal detection during nighttime by CNN detector and perceptual hashing tracking. IEEE Trans. Intell. Transp. Syst. 2017, 18, 7891988. [Google Scholar] [CrossRef]
  39. Graves, A.; Mohamed, A.; Hinton, G. Speech recognition with deep recurrent neural networks. In Proceedings of the 2013 IEEE International Conference on Acoustics, Speech and Signal Processing, Vancouver, BC, Canada, 26–31 May 2013. [Google Scholar]
  40. Zhang, H.; Li, J.; Ji, Y.; Yue, H. Understanding subtitles by character-level sequence-to-sequence learning. IEEE Trans. Ind. Inform. 2017, 13, 7547277. [Google Scholar] [CrossRef]
  41. Ding, Z.; Chen, W.; Hu, T.; Xu, X. Evolutionary double attention-based long short-term memory model for building energy prediction: Case study of a green building. Appl. Energy 2021, 288, 116660. [Google Scholar] [CrossRef]
  42. Deltetto, D.; Coraci, D.; Pinto, G.; Piscitelli, M.S.; Capozzoli, A. Exploring the potentialities of deep reinforcement learning for incentive-based demand response in a cluster of small commercial buildings. Energies 2021, 14, 2933. [Google Scholar] [CrossRef]
  43. Khan, A.-N.; Iqbal, N.; Rizwan, A.; Ahmad, R.; Kim, D.-H. An ensemble energy consumption forecasting model based on spatial-temporal clustering analysis in residential buildings. Energies 2021, 14, 3020. [Google Scholar] [CrossRef]
  44. Bhatt, D.; Danalakshmi, D.; Hariharasudan, A.; Lis, M.; Grabowska, M. Forecasting of Energy Demands for Smart Home Applications. Energies 2021, 14, 1045. [Google Scholar] [CrossRef]
  45. Hwang, J.S.; Fitri, I.R.; Kim, J.-S.; Song, H. Optimal ESS scheduling for peak shaving of building energy using accuracy-enhanced load forecast. Energies 2020, 13, 5633. [Google Scholar] [CrossRef]
  46. Martínez-Comesaña, M.; Febrero-Garrido, L.; Troncoso-Pastoriza, F.; Martínez-Torres, J. Prediction of Building’s Thermal Performance Using LSTM and MLP Neural Networks. Appl. Sci. 2020, 10, 7439. [Google Scholar] [CrossRef]
  47. López-Gómez, J.; Ogando-Martínez, A.; Troncoso-Pastoriza, F.; Febrero-Garrido, L.; Granada-Álvarez, E.; Orosa-García, J.A. Photovoltaic Power Prediction Using Artificial Neural Networks and Numerical Weather Data. Sustainability 2020, 12, 10295. [Google Scholar] [CrossRef]
  48. Banik, R.; Das, P.; Ray, S.; Biswas, A. Prediction of electrical energy consumption based on machine learning technique. Electr. Energy 2021, 103, 909–920. [Google Scholar] [CrossRef]
  49. Luo, X.J.; Oyedele, L.O.; Ajayi, A.O.; Akinade, O.O. Comparative study of machine learning-based multi-objective prediction framework for multiple building energy loads. Sustain. Cities Soc. 2020, 61, 102283. [Google Scholar] [CrossRef]
  50. Chae, Y.T.; Horesh, R.; Hwang, Y.; Lee, Y.M. Artificial neural network model for forecasting sub-hourly electricity usage in commercial buildings. Energy Build. 2016, 111, 184–194. [Google Scholar] [CrossRef]
  51. Thomas, D.; Deblecker, O.; Ioakimidis, C.S. Optimal operation of an energy management system for a grid-connected smart building considering photovoltaics’ uncertainty and stochastic electric vehicles’ driving schedule. Appl. Energy 2018, 210, 1188–1206. [Google Scholar] [CrossRef]
  52. Brahman, F.; Honarmand, M.; Jadid, S. Optimal electrical and thermal energy management of a residential energy hub, integrating demand response and energy storage system. Energy Build. 2015, 90, 65–75. [Google Scholar] [CrossRef]
  53. Orosz, T.; Rassõlkin, A.; Kallaste, A.; Arsénio, P.; Pánek, D.; Kaska, J.; Karban, P. Robust Design Optimization and Emerging Technologies for Electrical Machines: Challenges and Open Problems. Appl. Sci. 2020, 10, 6653. [Google Scholar] [CrossRef]
  54. Pipattanasomporn, M.; Chitalia, G.; Songsiri, J.; Aswakul, C.; Pora, W.; Suwankawin, S.; Audomvongseree, K.; Hoonchareon, N. CU-BEMS, smart building electricity consumption and indoor environmental sensor datasets. Sci. Data 2020, 7, 241. [Google Scholar] [CrossRef]
Figure 1. Schematic description of the operation of the neural network in layer l .
Figure 1. Schematic description of the operation of the neural network in layer l .
Applsci 11 07991 g001
Figure 2. Common activation functions used in neural networks problem. (a) Linear: g ( Z ) = Z ; (b) rectified linear unit (ReLU): g ( Z ) = m a x ( 0 ,   Z ) ; (c) sigmoid: g ( Z ) = 1 / ( 1 + e Z ) ; (d) hyperbolic tangent (tanh): g ( Z ) = ( e Z e Z ) / ( e Z + e Z ) .
Figure 2. Common activation functions used in neural networks problem. (a) Linear: g ( Z ) = Z ; (b) rectified linear unit (ReLU): g ( Z ) = m a x ( 0 ,   Z ) ; (c) sigmoid: g ( Z ) = 1 / ( 1 + e Z ) ; (d) hyperbolic tangent (tanh): g ( Z ) = ( e Z e Z ) / ( e Z + e Z ) .
Applsci 11 07991 g002
Figure 3. Storage flowchart.
Figure 3. Storage flowchart.
Applsci 11 07991 g003
Figure 4. Best configuration of the SNN model in the office building tested.
Figure 4. Best configuration of the SNN model in the office building tested.
Applsci 11 07991 g004
Figure 5. Comparison between the predicted electrical consumption with the SNN k-fold model and the actual consumption in a working day in the selected zone of the building. (a) Train/Dev sample division; (b) Test sample division.
Figure 5. Comparison between the predicted electrical consumption with the SNN k-fold model and the actual consumption in a working day in the selected zone of the building. (a) Train/Dev sample division; (b) Test sample division.
Applsci 11 07991 g005
Figure 6. Battery charge period in a working day in the selected zone of the building. (a) Train/Dev sample division; (b) Test sample division.
Figure 6. Battery charge period in a working day in the selected zone of the building. (a) Train/Dev sample division; (b) Test sample division.
Applsci 11 07991 g006
Figure 7. Variation of the electricity costs in a working day in the selected area of the building considering or not the installation of the battery. (a) Train/Dev sample division; (b) Test sample division.
Figure 7. Variation of the electricity costs in a working day in the selected area of the building considering or not the installation of the battery. (a) Train/Dev sample division; (b) Test sample division.
Applsci 11 07991 g007
Table 1. Percentage of errors in the collection period of the variables considered.
Table 1. Percentage of errors in the collection period of the variables considered.
Indoor TemperatureAmbient IlluminationLoads ConsumptionLighting ConsumptionOutdoor Temperature
Errors (%)1.561.560.150.150.66
Table 2. Energy and power prices by period of the tariff considered.
Table 2. Energy and power prices by period of the tariff considered.
Peak HoursFlat HoursValley Hours
Energy prices (€/kWh)0.20610.11280.0777
Power prices (€/kW-day)0.08750.08750.0073
Table 3. Battery characteristics considered.
Table 3. Battery characteristics considered.
Charging Power (W)Discharging Power (W)Capacity (Wh)Efficiency (%)
Table 4. Mean values of the RMSE in the different divisions of the sample.
Table 4. Mean values of the RMSE in the different divisions of the sample.
TrainDevTestFull Sample
RMSE (%)5.445.595.285.47
Table 5. Comparative of the electricity bills in the study period in the selected zone of the building considering or not the installation of the battery.
Table 5. Comparative of the electricity bills in the study period in the selected zone of the building considering or not the installation of the battery.
Without BatteryWith BatterySavings
Electricity expenses (€)97.2639.5457.72
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Cordeiro-Costas, M.; Villanueva, D.; Eguía-Oller, P. Optimization of the Electrical Demand of an Existing Building with Storage Management through Machine Learning Techniques. Appl. Sci. 2021, 11, 7991.

AMA Style

Cordeiro-Costas M, Villanueva D, Eguía-Oller P. Optimization of the Electrical Demand of an Existing Building with Storage Management through Machine Learning Techniques. Applied Sciences. 2021; 11(17):7991.

Chicago/Turabian Style

Cordeiro-Costas, Moisés, Daniel Villanueva, and Pablo Eguía-Oller. 2021. "Optimization of the Electrical Demand of an Existing Building with Storage Management through Machine Learning Techniques" Applied Sciences 11, no. 17: 7991.

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop