Flattening the Electricity Demand Proﬁle of O ﬃ ce Buildings for Future-Proof Smart Grids

: The built environment has the potential to contribute to maintaining a reliable grid at the demand side by o ﬀ ering ﬂexibility services to a future Smart Grid. In this study, an o ﬃ ce building is used to demonstrate forecast-driven building energy ﬂexibility by operating a Battery Electric Storage System (BESS). The objective of this study is, therefore, to stabilize / ﬂatten a building energy demand proﬁle with the operation of a BESS. First, electricity demand forecasting models are developed and assessed for each individual load group of the building based on their characteristics. For each load group, the prediction models show Coe ﬃ cient of Variation of the Root Mean Square Error (CVRMSE) values below 30%, which indicates that the prediction models are suitable for use in engineering applications. An operational strategy is developed aiming at meeting the ﬂattened electricity load shape objective. Both the simulation and experimental results show that the ﬂattened load shape objective can be met more than 95% of the time for the evaluation period without compromising the thermal comfort of users. Accurate energy demand forecasting is shown to be pivotal for meeting load shape objectives.


Introduction
The European Union agrees on drastically lowering CO 2 emissions in order to mitigate the effects of climate change [1,2]. Currently, in the Netherlands, electricity generation is mostly achieved by means of fossil fuels and is responsible for a significant portion of the total emissions [3]. To meet European targets, a transition to more sustainable energy generation is necessary within the country to decarbonize the grid [4,5]. When transitioning towards a low-carbon society, not only sustainable generation, but also energy saving on the demand side is even more important [6,7]. Transport and the built environment account for approximately 24% and 36% of total energy consumption in the Netherlands and are therefore responsible for much of the emissions due to fossil fuels [3,8]. It is evident that an effective transition to a sustainable future also requires technologies on the demand side [9,10] that can be powered by Renewable Energy Sources (RES), such as electric heat pumps [11,12] to fulfill the heating demand of buildings and electric vehicles for transport [13], in the Dutch context [4].
A transition to more sustainable energy generation is expected to bring about a variety of challenges. Firstly, the foreseen large-scale deployment of RESs may seriously affect the stability of energy grids [14,15]. An increase in power grid-connected RESs results in a change in power generation characteristics and grid operation [16]. In contrast to conventional fossil power plants, RESs are often relatively small power generators and are distributed throughout the low-and medium-voltage grid levels [17]. When RESs are integrated into the built environment, buildings will both consume The significant energy demands and the aforementioned control advantages allow HVAC systems and energy storage systems to provide effective energy flexibility and management services for the built environment. Buildings could, therefore, offer DSF by manipulating installations to respond to power system requirements by increasing or reducing electricity consumption patterns while maintaining a comfortable and productive environment for the occupants [19]. Additional DSF could also be delivered through the control of lighting and plug loads [35].
To provide the above-mentioned decision-making requirement, it is necessary to perform accurate short-term and small-scale electricity load forecasting on subsystem levels of individual buildings [36]. The energy behavior of a building is influenced by many factors, such as weather conditions, building construction, the thermal properties of the building, the occupancy, and occupant behavior [37]. Forecasting subsystem-level loads is therefore considered a complex and challenging problem [36]. However, this type of demand prediction could be a valuable contribution to maintaining a reliable electricity grid.
Contributing to solving the mentioned problems, the objective of this research is to identify and implement building energy management opportunities using subsystem-level electricity demand prediction and a Battery Electric Storage System (BESS). The objective of this study is to stabilize/flatten a building energy demand profile to demonstrate energy flexibility for a future Smart Grid without compromising user comfort. The proposed methodology in Section 2 is advantageous to the research community because it discusses the demand prediction of several subcomponents (AHU, HVAC, chiller, lighting, and plug loads) of buildings, which is otherwise rare in the existing literature. Moreover, a major contribution would be the implementation of the discussed methodology in a real-life office building. Next, the quantitative results and qualitative findings have been presented in Sections 3 and 4.

Materials and Methods
This section first introduces the case study building and its electrical load groups. Subsequently, three steps are described in the methodology used: - Step 1: Prediction models are established for each load group and the performance metrics that are used to analyze prediction accuracy are described; - Step 2: The operational strategy of the Battery Electric Storage System (BESS) is described alongside key performance indicators (KPIs) that are used to quantify the impact of the energy flexibility provided; - Step 3: The implementation procedure in the real BMS system is described.

Case Study Building
The case study office building is located in The Netherlands, which is a European country with a temperate oceanic climate (Cfb type) according to the Köppen-Geiger climate classification [38]. The office was built in 1993 and can be described as a traditional office building. The building has an approximate floor area of 1500 m 2 and a practical maximum occupancy count of 35 [19]. The building is provided with a photovoltaic system and a Battery Electric Storage System. An impression of the building is shown in Figure 1. A general overview of the loads of the building is shown in Figure 2.  A detailed description of the subcomponents of the building follows: a) AHU and HVAC control unit: The ventilation system of the building is designed for two functions: refreshing the air in the building and transporting the desired cooling capacity into the building [39]. This group is composed of a variety of different components including supply and return fans, HVAC controls, a heat recovery wheel, and the pumps for the heating system and cooling system. b) Chiller: The chiller is an electric, double-stage air-source compression cooling machine. It is an on-off operated machine, which means that it starts and stops multiple times per hour depending on the cooling load. This cooling machine is equipped with a small buffer. The distribution system supplies cold temperature to the rooms utilizing water-to-air aftercoolers. c) Lighting: The building is largely equipped with fluorescent lighting. One office space has an LED lighting system with motion sensors and the ability to individually set light temperature settings for each workplace. d) Plug loads: Plug loads consist of all the remaining electricity consuming devices such as computers, printers, coffee machines, etc. e) PV system: The case study office has 65 solar Photovoltaic (PV) panels on its roof, with 260 Wp per panel, corresponding to a total installed capacity of 16.9 kWp [40], with a 15 kW inverter. Each solar panel is individually optimized to its Max Power Point (MPP) with the use of DC/DC optimizers. f) Battery Electric Storage System: The building is equipped with a Nilar NiMH Battery Electric Storage System (BESS) with 48 kWh of storage capacity. The power conversion system is formed by the combination of a bi-directional inverter and transformer in a single   A detailed description of the subcomponents of the building follows: a) AHU and HVAC control unit: The ventilation system of the building is designed for tw functions: refreshing the air in the building and transporting the desired cooling capacity in the building [39]. This group is composed of a variety of different components includin supply and return fans, HVAC controls, a heat recovery wheel, and the pumps for th heating system and cooling system. b) Chiller: The chiller is an electric, double-stage air-source compression cooling machine. It an on-off operated machine, which means that it starts and stops multiple times per hou depending on the cooling load. This cooling machine is equipped with a small buffer. Th distribution system supplies cold temperature to the rooms utilizing water-to-a aftercoolers. c) Lighting: The building is largely equipped with fluorescent lighting. One office space has a LED lighting system with motion sensors and the ability to individually set light temperatu settings for each workplace. d) Plug loads: Plug loads consist of all the remaining electricity consuming devices such computers, printers, coffee machines, etc. A detailed description of the subcomponents of the building follows: (a) AHU and HVAC control unit: The ventilation system of the building is designed for two functions: refreshing the air in the building and transporting the desired cooling capacity into the building [39]. This group is composed of a variety of different components including supply and return fans, HVAC controls, a heat recovery wheel, and the pumps for the heating system and cooling system. (b) Chiller: The chiller is an electric, double-stage air-source compression cooling machine. It is an on-off operated machine, which means that it starts and stops multiple times per hour depending on the cooling load. This cooling machine is equipped with a small buffer. The distribution system supplies cold temperature to the rooms utilizing water-to-air aftercoolers. (c) Lighting: The building is largely equipped with fluorescent lighting. One office space has an LED lighting system with motion sensors and the ability to individually set light temperature settings for each workplace.   48 kWh of storage capacity. The power conversion system is formed by the combination of a bi-directional inverter and transformer in a single cabinet. The advantage of this configuration is that the equipment can be disconnected completely. This prevents unnecessary power loss when the battery is not utilized. Table 1 provides an overview of the specifications of the Nilar BESS and energy conversion system.
The method used to ultimately flatten the electricity demand profile for the case study building consists of three steps elaborated in Sections 2.2-2.4.

Step 1: Establish Prediction Models
Building electricity demand predictions are an essential part of developing a suitable control strategy. The total electricity consumption of the case study building consists of 5 major load groups and a BESS which were extensively monitored. Due to the different behavior of all load groups, different prediction methodologies are proposed depending on the group's characteristics. An advantage of this approach is that the cause of prediction errors is easier to trace back to the load groups which are inaccurately predicted, after which the model could be adjusted or optimized. Another argument for predicting each load group separately is that relatively simple prediction methods could be used which are specifically designed for predicting the loads of a particular load group. This also makes practical implementation of the predictions in the BMS more transparent. A priori knowledge obtained through inspection of the building's individual load groups and their characteristics enabled the construction of the prediction models as presented. On the other hand, large fluctuations in loads such as the chiller make it exceptionally difficult to accurately predict electricity demands intra-hourly. Consequently, predictions in this study are calculated for all load groups on a 1 hour resolution. Figure 3 illustrates the overview of subloads and corresponding day-ahead prediction models. BMS data from 1 January 2017 to 31 December 2018 are used in the establishment of the prediction models except for Solargis ® predictions for the outdoor temperature and PV yields. The Solargis dataset contains data from 25 May 2018 to 4 April 2019 (~10 months). (a) AHU and HVAC control unit: For this load group, a parametric approach is chosen because of the characteristic S shape of the data (see Figure 4). Parametric modeling techniques involve two steps [41]: first identifying the function form, and then fitting the parameters of the mathematical model. In order to determine a better fit for the mathematical model, the natural logarithm of the dataset is taken, which is also known as a variance-stabilizing transformation.  a) AHU and HVAC control unit: For this load group, a parametric approach is chosen because of the characteristic S shape of the data (see Figure 4). Parametric modeling techniques involve two steps [41]: first identifying the function form, and then fitting the parameters of the mathematical model. In order to determine a better fit for the mathematical model, the natural logarithm of the dataset is taken, which is also known as a variance-stabilizing transformation. Data points with an energy demand < 4 kWh.h -1 are considered outliers and were removed from the dataset. The data in Figure 4 are plotted in an S shape. This shape can be described mathematically by combining a logistic function and parabolic function. The transformation of this combined equation back to the scale of the original dataset is achieved by exponentiation. The final equation to predict the AHU and HVAC control unit energy demand (EAHU&controls) as a function of the ambient temperature (Toutdoor) is given by Equation (1).  a) AHU and HVAC control unit: For this load group, a parametric approach is chosen because of the characteristic S shape of the data (see Figure 4). Parametric modeling techniques involve two steps [41]: first identifying the function form, and then fitting the parameters of the mathematical model. In order to determine a better fit for the mathematical model, the natural logarithm of the dataset is taken, which is also known as a variance-stabilizing transformation. Data points with an energy demand < 4 kWh.h -1 are considered outliers and were removed from the dataset. The data in Figure 4 are plotted in an S shape. This shape can be described mathematically by combining a logistic function and parabolic function. The transformation of this combined equation back to the scale of the original dataset is achieved by exponentiation. The final equation to predict the AHU and HVAC control unit energy demand (EAHU&controls) as a function of the ambient temperature (Toutdoor) is given by Equation (1).
b) Chiller: Figure 5 shows a scatter plot of the hourly electricity demand of the chiller as a function of the outdoor temperature. Considering the shape of the data, a linear regression model will be used in Data points with an energy demand < 4 kWh.h −1 are considered outliers and were removed from the dataset. The data in Figure 4 are plotted in an S shape. This shape can be described mathematically by combining a logistic function and parabolic function. The transformation of this combined equation back to the scale of the original dataset is achieved by exponentiation. The final equation to predict the AHU and HVAC control unit energy demand (E AHU&controls ) as a function of the ambient temperature (T outdoor ) is given by Equation (1).
(b) Chiller: Figure 5 shows a scatter plot of the hourly electricity demand of the chiller as a function of the outdoor temperature. Considering the shape of the data, a linear regression model will be used in this case. Engineering expertise also tells us that measurements at the previous time step (t−1) may have the largest impact on the building cooling load at time t [42]. Therefore, one of the proposed models is Energies 2020, 13, 2357 7 of 27 a multi-variable linear regression model that uses a time series of T outdoor as an input and provides a prediction for the chiller's energy demand at t = i (E chiller,t = i ) as the output. The mathematical definition of this model is shown in Equation (2). By fitting the coefficients a i to the dataset, a single equation is obtained which is capable of providing predictions. The number of terms/variables that should be included in the model is determined through k-fold cross-validation [41] with k = 10. Note that k-fold cross-validation is used for the establishment of the chiller model. E chiller,t=i = a 0 + a 1 ·T outdoor,t=i + a 2 ·T outdoor,t=i−1 + a 3 ·T outdoor,t=i−2 + · · · + a n ·T outdoor,t=i−(n−1) kWh.h −1 (2) Energies 2020, 13, x FOR PEER REVIEW 7 of 27 this case. Engineering expertise also tells us that measurements at the previous time step (t-1) may have the largest impact on the building cooling load at time t [42]. Therefore, one of the proposed models is a multi-variable linear regression model that uses a time series of Toutdoor as an input and provides a prediction for the chiller's energy demand at t = i (Echiller,t = i) as the output. The mathematical definition of this model is shown in Equation (2). By fitting the coefficients to the dataset, a single equation is obtained which is capable of providing predictions. The number of terms/variables that should be included in the model is determined through k-fold cross-validation [41] with k = 10. Note that k-fold cross-validation is used for the establishment of the chiller model. c) Plug loads and lighting: Occupancy is known to be related to plug loads [43]. However, because the day-ahead occupancy cannot be predicted accurately, an approach is chosen wherein the future plug load and lighting demand are based on (recent) historic demands. The proposed model makes energy demand predictions for an hour i ( , ), based on the historic demands of the same clock hour. This model predicts hour i based on the power demands at hour i of the N most recent workdays when predicting workdays, likewise for weekend days. Equation (3) describes the model. In this equation, 24 describes the number of hours per day. This prediction model is hereby named the "recent day model".
d) Photovoltaic panels: Solargis® is a Slovakian company that provides solar, weather, and PV yield forecasts for almost any location on earth. The case study building has been using its services since May 2018. Solargis® provides both temperature and PV yield predictions on an hourly basis for every hour of the day and up to 48 hours ahead. e) Outdoor temperature: Some of the aforementioned models use the outdoor temperature as a predictor variable. Making future predictions with these models, therefore, requires outdoor temperature predictions. Solargis® services are again used to provide predictions for the outdoor temperature. The data obtained are post-processed with elevation correction and bias correction [44]. (c) Plug loads and lighting:

Performance Evaluation of Predictions
Occupancy is known to be related to plug loads [43]. However, because the day-ahead occupancy cannot be predicted accurately, an approach is chosen wherein the future plug load and lighting demand are based on (recent) historic demands. The proposed model makes energy demand predictions for an hour i (E pred,t=i ), based on the historic demands of the same clock hour. This model predicts hour i based on the power demands at hour i of the N most recent workdays when predicting workdays, likewise for weekend days. Equation (3) describes the model. In this equation, 24 describes the number of hours per day. This prediction model is hereby named the "recent day model".
(d) Photovoltaic panels: Solargis ® is a Slovakian company that provides solar, weather, and PV yield forecasts for almost any location on earth. The case study building has been using its services since May 2018. Solargis ® provides both temperature and PV yield predictions on an hourly basis for every hour of the day and up to 48 hours ahead. (e) Outdoor temperature: Some of the aforementioned models use the outdoor temperature as a predictor variable. Making future predictions with these models, therefore, requires outdoor temperature predictions. Solargis ® services are again used to provide predictions for the outdoor temperature. The data obtained are post-processed with elevation correction and bias correction [44].

Performance Evaluation of Predictions
The performance of the prediction models requires quantification. This is achieved by introducing various error metrics [45]. Two types of error metrics are used: those without dimensions (without units) and those with dimensions (with units). Error metrics without dimensions are essentially normalized errors which are necessary for comparing results with studies with different sized installations [46].
To normalize the data, error metrics with dimensions use the sum of all measured points or the average of all measured points in their denominators. This denominator has a downside when interpreting these error metrics for parameters such as the temperature or when assessing the seasonal performance of the PV predictions, since there is the possibility that the temperatures of a dataset, for example, may average to approximately 0 • C in wintertime, which in turn gives an unreasonable scaling to the performance metrics. Choosing an error metric with dimensions omits this problem and gives an intuitive value with units. (a) The Coefficient of Determination (R 2 ) R 2 evaluates how much of the variability in the actual values is explained by the model [41]. Generally, R 2 takes a value between 0 and 1, wherein 1 represents the best performance. It should be emphasized that while R 2 is a powerful metric when assessing linear models, it is an inadequate measure when assessing non-linear models [47]. R 2 is therefore only used for the assessment of the chiller model in this research. The mathematical definition of R 2 is given by Equation (4).
The predicted value for data point i (e.g., power demand), The measured (observed) value for data point i, and x The mean of all observed values in the dataset.

(b) The Weighted Average Percentage Error (WAPE)
The WAPE describes the average magnitude of error produced by the model, relative to the measured values. It is widely used as a performance measure in forecasting, since it is easy to interpret and understand [48]. This metric is robust to outliers. Forecasting is best when the WAPE is close to 0. Equation (5) shows the mathematical definition of the WAPE [48].
The CVRMSE is a performance metric that penalizes larger errors more than the WAPE [49]. The American Society of Heating, Refrigerating, and Air Conditioning Engineers (ASHRAE) recommends CVRMSE values below 30% [50] for hourly predictions and so this standard is also adopted in this research. The mathematical definition is provided in Equation (6) [49].
The MAE is the average of the absolute difference between the predicted values and observed value; see Equation (7) [51]. The closer the value is to 0, the better the prediction performance.
Energies 2020, 13, 2357 9 of 27 (e) The Root Mean Square Error (RMSE) The RMSE is the same as the CVRMSE, except for scaling by the average of all observations; see Equation (8) [52].
The MBE indicates whether a forecasting model, in general, tends to overestimate or underestimate in comparison to the actual values [46]. This metric could then be used to correct such systematic deviations. The MBE can be calculated according to Equation (9) [52]:

Total Demand Prediction of the Building
Finally, in order to predict the total day-ahead (lead time: 24 h) electricity demand of the building, the established prediction models for all load groups and Solargis ® temperature and PV prediction services are integrated into one combined model (see Figure 6). The predictions are performed each day at 00:00 and error metrics are computed. The dataset used in the integrated model consists of Solargis ® and historic building energy demands from 25 May to 4 April 2019. MATLAB is used for the integration of the models and assessment of the data. After combining the predicted energy demands of each subcomponent, the resulting total building demand prediction with the hourly resolution data in kWh.h -1 is taken as the power demand in kW.

Total Demand Prediction of the Building
Finally, in order to predict the total day-ahead (lead time: 24 h) electricity demand of the building, the established prediction models for all load groups and Solargis® temperature and PV prediction services are integrated into one combined model (see Figure 6). The predictions are performed each day at 00:00 and error metrics are computed. The dataset used in the integrated model consists of Solargis® and historic building energy demands from 25 May to 4 April 2019. MATLAB is used for the integration of the models and assessment of the data. After combining the predicted energy demands of each subcomponent, the resulting total building demand prediction with the hourly resolution data in kWh.h -1 is taken as the power demand in kW.

Step 2: Establish the Operational Strategy and BESS Simulations
The objective of this study is to stabilize/flatten a building energy demand profile during office work hours using a BESS. Peak shaving and valley filling are necessary to meet the load shape objective. A peak refers to a significantly higher power demand than desired, and a valley to a significantly lower power demand than desired. Before peak shaving and valley filling can be considered, a 'desired power demand profile' of the building should be established. A comparison between the actual building load and the desired load then allows for the identification of peaks and valleys. Instead of the term 'desired power demand', henceforth, the term 'baseline' (BL) is used. An illustrative example of a BL which is set between 07:00 and 17:00 (working hours of the building) is shown in Figure 7. By charging and discharging the BESS, load shape objectives can be met. In principle, this baseline can be developed to reflect the different objectives of the building owners such as maximizing self-energy consumption, minimizing electricity costs, and matching flexible Smart

Step 2: Establish the Operational Strategy and BESS Simulations
The objective of this study is to stabilize/flatten a building energy demand profile during office work hours using a BESS. Peak shaving and valley filling are necessary to meet the load shape objective. A peak refers to a significantly higher power demand than desired, and a valley to a significantly lower power demand than desired. Before peak shaving and valley filling can be considered, a 'desired power demand profile' of the building should be established. A comparison between the actual building load and the desired load then allows for the identification of peaks and valleys. Instead of the term 'desired power demand', henceforth, the term 'baseline' (BL) is used. An illustrative example of a BL which is set between 07:00 and 17:00 (working hours of the building) is shown in Figure 7. By charging and discharging the BESS, load shape objectives can be met. In principle, this baseline can be developed to The operation of the BESS relies heavily on the established BL. When the baseline is too high, power demands are unnecessarily high, and the BESS may not be able to fill all valleys. On the other hand, when the BL is too low, the BESS may not be able to deliver the power necessary to shave all the peaks. Another important parameter that is dependent on the baseline (and vice versa) is the initial state of charge (SoCini) of the BESS before the load balancing period starts. In this case, the load balancing period starts at 07:00. The mutual dependence of BL and SoCini calls for a strategy to determine the best balance. The steps taken to determine the best balance are described below. For both workdays and weekend days, the predictions are calculated at 00:00 for the upcoming 24 h and then used when determining the BL and SoCini.

Workdays
The determination of suitable values for the BL and SoCini is a dynamic process performed by using the established energy predictions for each day. On the other hand, battery operation is constrained to work between a 0.8 SoC and 0.2 SoC margin, which means a capacity of ~28.8 kWh out of the total 48 kWh is available for operation throughout the day. The other operational constraints, e.g., the limited number of charging cycles, which affect the degradation of the battery are not taken into account.
The algorithm starts at 00:00 by receiving the predicted energy demand profile for the upcoming day. Based on the maximum predicted power demand of the prediction profile, a series of test baselines (BLtest) are generated as shown in Figure 8a. Next, for different SoCini values ranging from 20% to 80% (20%, 30%, …, 80%), the charging and discharging patterns of battery storage are evaluated for each BLtest profile as illustrated in Figure 8b. For the evaluation, the charging efficiency is taken as 85.5%, and the discharging efficiency is taken as 95%. The operation of the BESS relies heavily on the established BL. When the baseline is too high, power demands are unnecessarily high, and the BESS may not be able to fill all valleys. On the other hand, when the BL is too low, the BESS may not be able to deliver the power necessary to shave all the peaks. Another important parameter that is dependent on the baseline (and vice versa) is the initial state of charge (SoC ini ) of the BESS before the load balancing period starts. In this case, the load balancing period starts at 07:00. The mutual dependence of BL and SoC ini calls for a strategy to determine the best balance. The steps taken to determine the best balance are described below. For both workdays and weekend days, the predictions are calculated at 00:00 for the upcoming 24 h and then used when determining the BL and SoC ini .

Workdays
The determination of suitable values for the BL and SoC ini is a dynamic process performed by using the established energy predictions for each day. On the other hand, battery operation is constrained to work between a 0.8 SoC and 0.2 SoC margin, which means a capacity of~28.8 kWh out of the total 48 kWh is available for operation throughout the day. The other operational constraints, e.g., the limited number of charging cycles, which affect the degradation of the battery are not taken into account.
The algorithm starts at 00:00 by receiving the predicted energy demand profile for the upcoming day. Based on the maximum predicted power demand of the prediction profile, a series of test baselines (BL test ) are generated as shown in Figure 8a. Next, for different SoC ini values ranging from 20% to 80% (20%, 30%, . . . , 80%), the charging and discharging patterns of battery storage are evaluated for each BL test profile as illustrated in Figure 8b. For the evaluation, the charging efficiency is taken as 85.5%, and the discharging efficiency is taken as 95%.
For each case, the cumulative energy which could not be delivered by the BESS to shave the peaks throughout the day, denoted by X discharge (read: 'inability to discharge'), and the cumulative energy which could not be stored by the battery to fill the valleys throughout the day, denoted by X charge (read: 'inability to charge'), are calculated. Performing the simulations for each case results in a complete overview with all different combinations of BL and SoC ini , and corresponding values for X discharge and X charge . This information forms the basis in order to decide which case is expected to perform the best. Then, the chosen BL and SoC ini are used for the operation of the specific workday.
The algorithm starts at 00:00 by receiving the predicted energy demand profile for the upcoming day. Based on the maximum predicted power demand of the prediction profile, a series of test baselines (BLtest) are generated as shown in Figure 8a. Next, for different SoCini values ranging from 20% to 80% (20%, 30%, …, 80%), the charging and discharging patterns of battery storage are evaluated for each BLtest profile as illustrated in Figure 8b. For the evaluation, the charging efficiency is taken as 85.5%, and the discharging efficiency is taken as 95%.

Weekend Days and Holidays
The operational strategy of the weekend/holiday is to maximize PV self-consumption and prevent net power injection into the grid, meaning BL = 0 kW is chosen for weekends. At 00:00, an energy demand profile of the building is generated based on the predictions for the upcoming 24 h. By using these energy predictions and the assumed charging efficiency of the battery, the expected required storage capacity of the battery to prevent net injection between 07:00 and 17:00 is estimated. From this, the required SoC ini is calculated. Figure 9 shows a visual representation of an example weekend day. For each case, the cumulative energy which could not be delivered by the BESS to shave the peaks throughout the day, denoted by Xdischarge (read: 'inability to discharge'), and the cumulative energy which could not be stored by the battery to fill the valleys throughout the day, denoted by Xcharge (read: 'inability to charge'), are calculated. Performing the simulations for each case results in a complete overview with all different combinations of BL and SoCini, and corresponding values for Xdischarge and Xcharge. This information forms the basis in order to decide which case is expected to perform the best. Then, the chosen BL and SoCini are used for the operation of the specific workday.

Weekend Days and Holidays
The operational strategy of the weekend/holiday is to maximize PV self-consumption and prevent net power injection into the grid, meaning BL = 0 kW is chosen for weekends. At 00:00, an energy demand profile of the building is generated based on the predictions for the upcoming 24 h. By using these energy predictions and the assumed charging efficiency of the battery, the expected required storage capacity of the battery to prevent net injection between 07:00 and 17:00 is estimated. From this, the required SoCini is calculated. Figure 9 shows a visual representation of an example weekend day. An illustration of the operational strategy to maintain the flattened demand profile on weekdays and weekends/holidays is shown in Figure 10. Before implementing it in the real building, the prediction models that are established in Section 2.2, the operational strategy and algorithm to determine the BL and SoCini, as well as a BESS model are implemented in MATLAB.
Charge/discharge to maintain Discharge to maintain baseline An illustration of the operational strategy to maintain the flattened demand profile on weekdays and weekends/holidays is shown in Figure 10. Before implementing it in the real building, the prediction models that are established in Section 2.2, the operational strategy and algorithm to determine the BL and SoC ini , as well as a BESS model are implemented in MATLAB. An illustration of the operational strategy to maintain the flattened demand profile on weekdays and weekends/holidays is shown in Figure 10. Before implementing it in the real building, the prediction models that are established in Section 2.2, the operational strategy and algorithm to determine the BL and SoCini, as well as a BESS model are implemented in MATLAB. Even though the demand predictions are carried out with hourly resolution data, after the determination of the required baseline (BL) and SoC ini , operational strategies are simulated with the highest-resolution data available, i.e., 1 min resolution data. This is becausecontrol of the real system occurs on the time scale of seconds rather than hours. Furthermore, battery behavior can only be accurately modeled when simulating with very high-resolution data. After simulation of the power flows in the BESS, the 1 min operation data are averaged to 15 min resolution data. The 15 min resolution is of interest because national electricity grid balancing in the Netherlands is carried out in time blocks of 15 min (clock quarters), also known as the program time unit (PTU) [53]. It is, therefore, reasonable to assess the performance of flexibility efforts at the same resolution.

Assessment of Operational Strategy
Because this research focuses on assessing the building's electrical energy flexibility, key performance indicators (KPIs) are chosen wherein the actual impact of energy flexibility is quantified. Important KPIs that evaluate overall building energy performance and which are used in this research are: (a) KPI 1: Total energy consumption (excluding PV power generation) [54]. In this paper, this is limited to electricity only; (b) KPI 2: Exported electricity (feed in from the building's PV system into the AC grid) [54]; (c) KPI 3: Imported electricity (power from the grid) [54]; (d) KPI 4: Battery Electric Storage System (BESS) losses; (e) KPI 5: Self-consumption [55]; (f) KPI 6: Self-sufficiency [55]; (g) KPI 7: Percentage indicating the proportion of working hours wherein the baseline is successfully maintained.
Furthermore, a qualitative assessment is included using the load duration curves only for working hours and for both working and non-working hours. In addition, similar to the load duration curve, a Baseline Deviation Duration Curve (BDDC) is defined, since the aim of the model is to maintain the power demand as set by the baseline for the building through the operation of the BESS. This curve visualizes how well the system can maintain the baseline during the operational hours. The BDDC can be constructed by calculating the offset between the baseline and electricity consumption from the grid (P building,net ) for all working hours, as shown in Equation (10). P baseline,deviation,t=i = P building,net, t=i − P baseline,t=i [kW] (10) Then, the values of P baseline,deviation are sorted in descending order. This leads to a curve that is analogous to the load duration curve. The obtained Baseline Deviation Duration Curve visualizes how well the BESS strategy can maintain the baseline.

Step 3: Real Building Management System (BMS) Implementation
The final step concerns the practical implementation of the prediction models, algorithms, and BESS control strategies in the InsiteView ® Building Management System (BMS). The BMS platform coordinates sensor-based measurements, actuators, and monitoring data at all operational levels in the building and provides an environment where advanced control algorithms can be implemented. After beta testing for~4 weeks, an experimental phase was conducted for 13 days, from 7 August 2019 to 19 August 2019.
An overview of the general methodological steps that are used to structure Section 2 and the results (Section 3) is provided in Figure 11.
Energies 2020, 13, x FOR PEER REVIEW 13 of 27 Figure 11. Summary of the methodological framework.

Results
The results are discussed following the steps described in Section 2.2 to 2.4.

Step 1. Establish Prediction Models
a) AHU and HVAC control unit: Parametric model As mentioned in Section 2.2, from the scatter plot obtained for the energy demands of the AHU and HVAC control unit load group (EAHU&controls) against the outdoor temperature (Toutdoor), a parametric approach was considered for demand prediction. Figure 12 shows the results of the curve fitting, where (a) shows the measurements and fitted curve, and (b) the residuals. The fitted parameters to Equation (1) are provided in Table 2. Thereby, the parametric model is represented by Equation (11).

Results
The results are discussed following the steps described in Sections 2.2-2.4.

Step 1. Establish Prediction Models
(a) AHU and HVAC control unit: Parametric model As mentioned in Section 2.2, from the scatter plot obtained for the energy demands of the AHU and HVAC control unit load group (E AHU&controls ) against the outdoor temperature (T outdoor ), a parametric approach was considered for demand prediction. Figure 12 shows the results of the curve fitting, where (a) shows the measurements and fitted curve, and (b) the residuals. The fitted parameters to Equation (1) are provided in Table 2. Thereby, the parametric model is represented by Equation (11).
A major factor for the deviations from the function fit above the curve is found to be the opening of the variable air volume (VAV) valve depending on the indoor CO 2 concentration. The error calculation metrics for the fitted curve are a WAPE of 2.81% and a CVRMSE of 4.36%. Since these values are in line with the requirements, the model is considered accurate enough for its predictions. a) AHU and HVAC control unit: Parametric model As mentioned in Section 2.2, from the scatter plot obtained for the energy demands of the AHU and HVAC control unit load group (EAHU&controls) against the outdoor temperature (Toutdoor), a parametric approach was considered for demand prediction. Figure 12 shows the results of the curve fitting, where (a) shows the measurements and fitted curve, and (b) the residuals. The fitted parameters to Equation (1) are provided in Table 2. Thereby, the parametric model is represented by Equation (11).

Parameter
Value 0.0075 -0.3576 123.8934   (2)) are shown in Figure 13. Overall, the performance is very similar regardless of the number of variables involved. At first, there is a (slightly) increasing performance when using one variable compared to two variables. This behavior is in line with the literature claiming that temperatures at previous time steps (t−1) may have the largest impact on the building cooling load at time t [42]. Including more variables in the regression results in unexpected behavior; at first, the performance decreases, and then it appears to increase again. Since this observed behavior cannot be proven, the sudden increase in performance using ≥ 6 variables is thought to have a mathematical or coincidental origin rather than a physical origin.
Energies 2020, 13 A major factor for the deviations from the function fit above the curve is found to be the opening of the variable air volume (VAV) valve depending on the indoor CO2 concentration. The error calculation metrics for the fitted curve are a WAPE of 2.81% and a CVRMSE of 4.36%. Since these values are in line with the requirements, the model is considered accurate enough for its predictions. b) Chiller: Multi-variable linear regression For chiller demand prediction, multi-variable linear regression is used. The results of the k-fold cross-validation for different numbers of variables involved in the regression formula (see Equation (2)) are shown in Figure 13. Overall, the performance is very similar regardless of the number of variables involved. At first, there is a (slightly) increasing performance when using one variable compared to two variables. This behavior is in line with the literature claiming that temperatures at previous time steps (t-1) may have the largest impact on the building cooling load at time t [42]. Including more variables in the regression results in unexpected behavior; at first, the performance decreases, and then it appears to increase again. Since this observed behavior cannot be proven, the sudden increase in performance using ≥ 6 variables is thought to have a mathematical or coincidental origin rather than a physical origin. The results of the k-fold cross-validation for different numbers of variables involved in the regression formula are investigated for up to 10 variables; see Figure 14. As discussed in the previous section, k-fold cross-validation where k = 10 is used-this means that the process of taking the 9  The results of the k-fold cross-validation for different numbers of variables involved in the regression formula are investigated for up to 10 variables; see Figure 14. As discussed in the previous section, k-fold cross-validation where k = 10 is used-this means that the process of taking the 9 training folds, determining the regression coefficients, and then inputting the validation fold as input is repeated 10 times in total until all folds are used once as a validation set. Each repetition of this process yields a set of regression coefficients. These regression coefficients are plotted in Figure 14. It is observed that the value for a 1 is nearly the same value for all folds, indicating a low uncertainty in the value of this parameter. The results for parameter a 2 show that most values are slightly below zero, indicating a weak negative correlation. For a 3 and beyond, parameter values become extremely uncertain; as shown by the distribution of values around zero, it can be concluded that it is not even clear whether there is a small positive correlation, small negative correlation, or no correlation at all. Therefore, these and subsequent terms were not considered.  The regression with two variables reaches a local performance maximum with an R 2 value of 0.89, a WAPE of 19.7% and a CVRMSE of 27.6%. Since the best results are obtained by using two variables, a model of the form as shown in Equation (12) is used and fitted to the dataset. The corresponding coefficients are provided in Table 3. The results of the performance assessment for the lighting and plug load predictions according to the model described by Equation (3) are shown in Figure 15. The performance for all hours (= working + non-working) of the dataset is shown in blue, and the prediction performance for only work hours, is shown in orange. The regression with two variables reaches a local performance maximum with an R 2 value of 0.89, a WAPE of 19.7% and a CVRMSE of 27.6%. Since the best results are obtained by using two variables, a model of the form as shown in Equation (12) is used and fitted to the dataset. The corresponding coefficients are provided in Table 3.  (3) are shown in Figure 15. The performance for all hours (= working + non-working) of the dataset is shown in blue, and the prediction performance for only work hours, is shown in orange. The results of the performance assessment for the lighting and plug load predictions according to the model described by Equation (3) are shown in Figure 15. The performance for all hours (= working + non-working) of the dataset is shown in blue, and the prediction performance for only work hours, is shown in orange.  The predictions show a sharp increase in performance between N = 1 and N = 2 for both lighting and plug loads. Using multiple historic data points for the prediction of a future data point is thought to have a stabilizing effect because the outliers which may be present in the historic data are combined with more representative historic values. The predictions, which are made by taking the average of these historic data points, are therefore less affected by outliers. Both the lighting and plug load predictions reach optimum performance when using five historic days (N = 5) in the forecast. With N = 5 for work hours, the lighting load predictions yield a WAPE of 8.6% and a CVRMSE of 12.0%, and the plug load predictions yield a WAPE of 10.6% and a CVRMSE of 13.8%. (d) PV power: Solargis ® During the night, there is no sunlight, and PV power predictions for these hours are always zero. These predictions are of course always 100% accurate. These predictions should not be considered in performance evaluation. Specifically, predictions which are done for hours between 17:00 and 07:00 are not included in the Solargis ® PV prediction evaluation. Prediction accuracy is determined by comparing Solargis ® predictions with the AC-side power measurements of the PV system. Figure 16 gives an overview of the Solargis ® prediction performance as a function of the lead time for the case study building. The overall performance of the predictions shows a rapid decrease in prediction accuracy in the first few lead hours. A peak at 5 lead hours is followed by a sharp decrease in the MAE and the RMSE, after which a long approximately stable period follows. The peak and subsequent decrease mark the transition between satellite-based models and numerical weather prediction models used by Solargis ® [46].
The subplots for the different seasons all show similar behavior in terms of the MAE and the RMSE. However, the MBE clearly shows different fluctuations depending on the season and the lead time. As stated earlier, the MBE indicates whether there is systematic overestimation or underestimation in the predictions. In principle, the MBE can be used to easily correct prediction inaccuracy, e.g., by subtracting the value of the MBE in case of overestimation. Due to the various fluctuations, there will be no attempt to improve prediction accuracy through MBE compensation. Such an analysis is beyond the scope of this research.
(e) Outdoor temperature: Solargis ® The accuracy of the temperature predictions is assessed by comparing Solargis ® temperature predictions with the temperature measurements which are calculated by the weather station on the roof of the building; see Figure 17. time for the case study building. The overall performance of the predictions shows a rapid decrease in prediction accuracy in the first few lead hours. A peak at 5 lead hours is followed by a sharp decrease in the MAE and the RMSE, after which a long approximately stable period follows. The peak and subsequent decrease mark the transition between satellite-based models and numerical weather prediction models used by Solargis® [46]. The subplots for the different seasons all show similar behavior in terms of the MAE and the RMSE. However, the MBE clearly shows different fluctuations depending on the season and the lead time. As stated earlier, the MBE indicates whether there is systematic overestimation or underestimation in the predictions. In principle, the MBE can be used to easily correct prediction inaccuracy, e.g., by subtracting the value of the MBE in case of overestimation. Due to the various fluctuations, there will be no attempt to improve prediction accuracy through MBE compensation. Such an analysis is beyond the scope of this research.

e) Outdoor temperature: Solargis®
The accuracy of the temperature predictions is assessed by comparing Solargis® temperature predictions with the temperature measurements which are calculated by the weather station on the roof of the building; see Figure 17. The results of the analysis of the temperature forecasts for the case study building are shown in Figure 18. The overall performance of all data points is shown as well as subplots for the performance during the different seasons. From the magnitude of the MAE and the RMSE (without MBE correction), it can be seen that temperature predictions are quite accurate overall. The autumn and winter temperatures are predicted best. The errors increase only gradually for longer lead times. For an unknown reason, a small spike at lead time = 25 h is observed. The behavior of the MBE in the overall assessment shows a steady underestimation, with a value of -0.5 °C. Although this value is slightly changed for the different seasons, a systematic underestimation (indicated by the "-" sign) occurs throughout the seasons. MBE correction can be used to improve the predictions. This is achieved by adding a value of 0.5 °C to all the Solargis® temperature predictions of the dataset. The dashed lines in Figure 18 show the modified results. The figure clearly shows that the MBE has shifted upwards to the desired value of ~0 °C. The lower values for the MAE and the RMSE in all plots show that this correction is an appropriate measure to better align the predictions with the measurements. The results of the analysis of the temperature forecasts for the case study building are shown in Figure 18. The overall performance of all data points is shown as well as subplots for the performance during the different seasons. From the magnitude of the MAE and the RMSE (without MBE correction), it can be seen that temperature predictions are quite accurate overall. The autumn and winter temperatures are predicted best. The errors increase only gradually for longer lead times. For an unknown reason, a small spike at lead time = 25 h is observed. The behavior of the MBE in the overall assessment shows a steady underestimation, with a value of -0.5 • C. Although this value is slightly changed for the different seasons, a systematic underestimation (indicated by the "-" sign) occurs throughout the seasons. MBE correction can be used to improve the predictions. This is achieved by adding a value of 0.5 • C to all the Solargis ® temperature predictions of the dataset. The dashed lines in Figure 18 show the modified results. The figure clearly shows that the MBE has shifted upwards to the desired value of~0 • C. The lower values for the MAE and the RMSE in all plots show that this correction is an appropriate measure to better align the predictions with the measurements. occurs throughout the seasons. MBE correction can be used to improve the predictions. This is achieved by adding a value of 0.5 °C to all the Solargis® temperature predictions of the dataset. The dashed lines in Figure 18 show the modified results. The figure clearly shows that the MBE has shifted upwards to the desired value of ~0 °C. The lower values for the MAE and the RMSE in all plots show that this correction is an appropriate measure to better align the predictions with the measurements.

Summary of Subcomponent Prediction Models
The subprediction models and Solargis® services that were demonstrated in Section 2.2 form the building blocks of the complete building energy demand prediction. A summary of the developed Figure 18. Outdoor temperature prediction performance assessment.

Summary of Subcomponent Prediction Models
The subprediction models and Solargis ® services that were demonstrated in Section 2.2 form the building blocks of the complete building energy demand prediction. A summary of the developed models and corresponding performance metrics for each load group is provided in Table 4. For the purpose of this research, the proposed model accuracies are considered sufficient.

Total Demand Prediction of the Building
The established prediction models for all load groups and Solargis ® temperature and PV prediction services are integrated into a combined model, wherein the building's total energy demand is predicted. The dataset used in the integrated model consists of the Solargis ® and historic building energy demands from 25 May 2018 to 4 April 2019. The error metrics are computed for the predictions which are calculated at 00:00. Only the predictions calculated for workdays between 07:00 and 17:00 are included in quantifying the error matrices. Figure 19 shows the prediction accuracy of all the models on average for all the months. Predictions for lighting and plug loads are combined and simultaneously assessed for convenience.
From Figure 19b it can be seen that prediction errors are largest during the summer months. Since the chiller operates the most during these months, and with the highest energy demands, the magnitude of error is also larger. During the colder months, the chiller is mostly in standby mode and is thus nearly perfectly predicted because standby power is constant. In Figure 19c, the months January and February show an above-average error magnitude. From the large relative difference between the MAE and the RMSE, it follows that there were a few moments with a relatively large prediction error. These are caused by the opening of the variable air volume (VAV) valve due to CO 2 concentration, which is not a factor that is considered in the predictions. demand is predicted. The dataset used in the integrated model consists of the Solargis® and historic building energy demands from 25 May 2018 to 4 April 2019. The error metrics are computed for the predictions which are calculated at 00:00. Only the predictions calculated for workdays between 07:00 and 17:00 are included in quantifying the error matrices. Figure 19 shows the prediction accuracy of all the models on average for all the months. Predictions for lighting and plug loads are combined and simultaneously assessed for convenience. From Figure 19b it can be seen that prediction errors are largest during the summer months. Since the chiller operates the most during these months, and with the highest energy demands, the magnitude of error is also larger. During the colder months, the chiller is mostly in standby mode and is thus nearly perfectly predicted because standby power is constant. In Figure 19c, the months January and February show an above-average error magnitude. From the large relative difference between the MAE and the RMSE, it follows that there were a few moments with a relatively large prediction error. These are caused by the opening of the variable air volume (VAV) valve due to CO2 concentration, which is not a factor that is considered in the predictions.
Lighting and plug load prediction accuracy show above-average larger errors in January and March. As can be seen for the first day in Figure 20a, and in Figure 20b, the building shows completely different behavior compared to expectations. Due to abnormal building operation, which is probably caused by anomalously low occupancy, the predictions are far off, resulting in a large prediction Lighting and plug load prediction accuracy show above-average larger errors in January and March. As can be seen for the first day in Figure 20a, and in Figure 20b, the building shows completely different behavior compared to expectations. Due to abnormal building operation, which is probably caused by anomalously low occupancy, the predictions are far off, resulting in a large prediction error. Additionally, due to the history-based model used for lighting and plug-load predictions, these abnormal days are still incorporated in the predictions for the next day. Since data from historic days are used to make the forecasts, this again results in the estimation of the demand in the upcoming days. One abnormal day could, therefore, trigger a cascade of prediction accuracy deviation for several days. Nonetheless, overall, prediction errors for this load group are comparatively small and prediction results are satisfactory.
Energies 2020, 13, x FOR PEER REVIEW 19 of 27 error. Additionally, due to the history-based model used for lighting and plug-load predictions, these abnormal days are still incorporated in the predictions for the next day. Since data from historic days are used to make the forecasts, this again results in the estimation of the demand in the upcoming days. One abnormal day could, therefore, trigger a cascade of prediction accuracy deviation for several days. Nonetheless, overall, prediction errors for this load group are comparatively small and prediction results are satisfactory.

Step 2: BESS Simulations
In the previous step, multiple prediction models were developed and ultimately combined to predict the total demand of the building. The prediction models are integrated with the proposed operational strategy and simulated in MATLAB. The results of the simulations are evaluated in this

Step 2: BESS Simulations
In the previous step, multiple prediction models were developed and ultimately combined to predict the total demand of the building. The prediction models are integrated with the proposed operational strategy and simulated in MATLAB. The results of the simulations are evaluated in this section. Table 5 provides an overview of the assessed Key Performance Indicators (KPIs). The overview shows that total energy consumption (KPI 1) has increased by 2.2%, which is caused by conversion loss in the BESS (KPI 4). From a decrease of 60.9% in exported electricity (KPI 2), it follows that the operational strategy has significantly increased self-consumption (KPI 5) from 82.3% to 93.1%. Due to the storage of this excess PV power that would otherwise be exported, the amount of imported electricity (KPI 3) is reduced by 0.4%, as the BESS was capable of providing (some of) the required energy. Overall, self-sufficiency (KPI 6) has increased by 2%, which means that the ratio of self-consumed electricity from PV to total energy consumption (KPI 1) has improved. KPI 7, which quantifies the ability of the system to maintain the baseline, shows that the baseline was successfully maintained for 97.2% of the time on weekdays between 07:00 and 16:33 (see also Figure 10). In Section 2.3.3, the Baseline Deviation Duration Curve (BDDC) was defined. This curve provides a visual impression of the ability of the demand curve to maintain the baseline throughout the day. Figure 21 illustrates the baseline deviation. This curve provides a visual impression of the ability of the demand curve to maintain the baseline throughout the day. Figure 21 illustrates the baseline deviation. It is important to realize that the BESS cannot always store/deliver power due to the applied constraints-this means that whenever the difference between Pbuilding,net and the baseline is too small, the battery will not deliver or store power. A slight deviation from the baseline (BL) value cannot be prevented, and it is not a problem. This is why the tolerance band, which marks the baseline deviation It is important to realize that the BESS cannot always store/deliver power due to the applied constraints-this means that whenever the difference between P building,net and the baseline is too small, the battery will not deliver or store power. A slight deviation from the baseline (BL) value cannot be prevented, and it is not a problem. This is why the tolerance band, which marks the baseline deviation between which the deviation is considered acceptable, is defined. The green area marks the bandwidth around the zero line of -3.51 kW to 2.85 kW. These values naturally follow when considering the minimum requirement of a 3 kW charging/discharging power constraint before the BESS starts to operate and charging/discharging efficiencies (85.5% and 90% are the charging/discharging efficiencies): • The BESS is controlled such that it starts charging when there is at least 3 kW/0.855 = 3.51 kW of AC power available. Or in other words, when P building,net −BL ≤ −3.51 kW.

•
Similarly, the BESS starts discharging when at least 3 kW × 0.95 = 2.81 kW of AC power is required by the building. This means that when P building,net −BL ≥ 2.81 kW, then the BESS starts discharging.
Therefore, whenever the baseline deviation ≤ -3.51 kW, the BESS should have charged to fill the valley. Whenever the baseline deviation ≥ 2.85 kW, the BESS should have discharged to shave the peak. Finding baseline deviation values outside of the tolerance means that the BESS was incapable of maintaining the BL and this was not caused by the minimum power constraint.
From the parts of the load duration curve outside of the green area, it can be seen that it was not always possible to discharge/charge to deliver/store the power necessary to maintain the baseline. The peaks which could not be shaved by the BESS are marked by the red area and have a total duration of~32 hours during the evaluated period. The valleys which could not be filled by the BESS are marked by the yellow area and have a total duration of~19 hours. Nevertheless, it can be concluded that the system is well capable of actively maintaining the baseline 97.2% of the time (within the green tolerance band). From Figure 22 it can be seen that, overall, there is a decrease in load duration of high positive power and an increase in the duration of low positive power. This is the direct consequence of the load balancing strategies wherein peaks are shaved and valleys are filled. From the parts of the load duration curve outside of the green area, it can be seen that it was not always possible to discharge/charge to deliver/store the power necessary to maintain the baseline. The peaks which could not be shaved by the BESS are marked by the red area and have a total duration of ~32 hours during the evaluated period. The valleys which could not be filled by the BESS are marked by the yellow area and have a total duration of ~19 hours. Nevertheless, it can be concluded that the system is well capable of actively maintaining the baseline 97.2% of the time (within the green tolerance band). From Figure 22 it can be seen that, overall, there is a decrease in load duration of high positive power and an increase in the duration of low positive power. This is the direct consequence of the load balancing strategies wherein peaks are shaved and valleys are filled.

Step 3. BMS Implementation
The KPIs of the building when operating the BESS can readily be calculated from the measurements that are extracted from the Building Management System (BMS) during the experimental period from 7 August 2019 to 19 August 2019. An overview of the resulting KPIs for the experimental period is shown in Table 6. Table 6. Key performance indicator (KPI) assessment for experimental results.

Step 3. BMS Implementation
The KPIs of the building when operating the BESS can readily be calculated from the measurements that are extracted from the Building Management System (BMS) during the experimental period from  Table 6. After introducing the BL strategy, total energy consumption increased due to BESS losses. Furthermore, it follows that exported electricity to the national grid is reduced from 115 to 70 kWh, and imported electricity increased from 1500 to 1582 kWh. Self-sufficiency has increased from 31.5% to 31.7% and self-consumption from 85.8% to 91.3%. Finally, during 96.2% of the time, the BESS was able to successfully maintain the BL within the tolerance, thereby, demonstrating that the load shape objectives are most often met. In the future, the value of flexibility can be established if the relevant guidelines and regulations are provided by the energy markets. The load duration curves for the experimental period on the real building are shown in Figure 23.
KPI 1: Total energy consumption (excluding PV power generation) [54] (in this paper, this is limited to electricity only) After introducing the BL strategy, total energy consumption increased due to BESS losses. Furthermore, it follows that exported electricity to the national grid is reduced from 115 to 70 kWh, and imported electricity increased from 1500 to 1582 kWh. Self-sufficiency has increased from 31.5% to 31.7% and self-consumption from 85.8% to 91.3%. Finally, during 96.2% of the time, the BESS was able to successfully maintain the BL within the tolerance, thereby, demonstrating that the load shape objectives are most often met. In the future, the value of flexibility can be established if the relevant guidelines and regulations are provided by the energy markets. The load duration curves for the experimental period on the real building are shown in Figure 23.  The ability of the demand curve to maintain the BL is visualized in Figure 24 using a Baseline Deviation Duration Curve (BDDC). During 96.2% of the time, the BL was maintained within the constraints. There was a total duration of 3 hours wherein peaks were not shaved. However, all valleys were effectively filled during the experimental period. The ability of the demand curve to maintain the BL is visualized in Figure 24 using a Baseline Deviation Duration Curve (BDDC). During 96.2% of the time, the BL was maintained within the constraints. There was a total duration of 3 hours wherein peaks were not shaved. However, all valleys were effectively filled during the experimental period.

Discussion
The objective of this study was to stabilize/flatten a building energy demand profile during office hours by means of peak shaving and valley filling using a Battery Electric Storage System. This was achieved by defining load shape objectives in the form of a baseline that is determined based on electricity demand forecasts for the building. Before doing so, predicting the electricity demand of the various load groups in the building was achieved through relatively simple models. All individual prediction models of each load group proved to be sufficiently accurate for use in the control strategy of the BESS. Finally, testing the operational strategy with BESS after the predictions resulted in meeting the flattened load shape objectives over 95% of the time in both simulations and practical implementation. The practical implementation was performed without compromising the thermal comfort of the building users. Peak loads, which increase the risk of congestion, were also successfully reduced both in magnitude and duration. Due to BESS losses, total energy consumption is shown to have increased marginally.
Total energy demand forecasting of the building was achieved by combining the separate predictions for each load group. The level of detail required to assess these separate models in order to determine the best performing algorithm makes this approach a labor-intensive process. Even though data-driven machine learning prediction methods are expected to increase prediction accuracy while allowing for higher levels of abstraction, with the current BMS structure of the case study building, the question remains whether that would be practically implementable. The prediction models that were developed in this work were constrained by practical considerations. Nevertheless, the relatively simple prediction models that were developed and optimized proved to be well capable of predicting the building's energy demands with sufficient accuracy within the practical setting.

Discussion
The objective of this study was to stabilize/flatten a building energy demand profile during office hours by means of peak shaving and valley filling using a Battery Electric Storage System. This was achieved by defining load shape objectives in the form of a baseline that is determined based on electricity demand forecasts for the building. Before doing so, predicting the electricity demand of the various load groups in the building was achieved through relatively simple models. All individual prediction models of each load group proved to be sufficiently accurate for use in the control strategy of the BESS. Finally, testing the operational strategy with BESS after the predictions resulted in meeting the flattened load shape objectives over 95% of the time in both simulations and practical implementation. The practical implementation was performed without compromising the thermal comfort of the building users. Peak loads, which increase the risk of congestion, were also successfully reduced both in magnitude and duration. Due to BESS losses, total energy consumption is shown to have increased marginally.
Total energy demand forecasting of the building was achieved by combining the separate predictions for each load group. The level of detail required to assess these separate models in order to determine the best performing algorithm makes this approach a labor-intensive process. Even though data-driven machine learning prediction methods are expected to increase prediction accuracy while allowing for higher levels of abstraction, with the current BMS structure of the case study building, the question remains whether that would be practically implementable. The prediction models that were developed in this work were constrained by practical considerations. Nevertheless, the relatively simple prediction models that were developed and optimized proved to be well capable of predicting the building's energy demands with sufficient accuracy within the practical setting.

Conclusions
Utilization of flexibility in the future Smart Grid will occur through information and communication technology (ICT) regardless of the exact market design. In the future, it is unknown whether a steady load profile as demonstrated in this paper will be the true load shape objective of a Smart Grid. However, because no operational Smart Grid exists that can be used to define the load shape objective in the Dutch context, and since the method introduced in this article has proven to be successful after implementing in the building, it is safe to conclude that the baseline approach is adequate for demonstrating load flexibility for a future electricity grid setting.
As an extension of this work, in the future, the baseline approach can be extended to a dynamic baseline which varies hourly depending on the grid's needs. BESS flexibility, as well as other sources of flexibility (e.g., HVAC system flexibility), could then be integrated to achieve even greater flexibility. The optimal load shape could be determined based on the combination of the predicted energy demand of the buildings or neighborhoods according to the Smart Grid's needs. However, this work did not include an economic assessment of a Smart Grid using PVs and a BESS. An extension of this study could also be made with an added economic assessment. However, in such a study, a time-of-use tariff structure and the economic value of provided flexibility should be incorporated.
The built environment has the potential to contribute to maintaining a reliable grid by actively participating in future grids. The case study building provided a perfect opportunity for demonstrating and investigating such characteristics.