1. Introduction
The increasing demand for energy in buildings, driven by population growth and urbanization, has significantly raised energy consumption levels. Buildings are currently responsible for consuming 74% of electricity in the U.S. [
1], with projections indicating that building energy use will rise by 40% within the next two decades [
2]. Such an escalation in energy consumption exacerbates environmental impacts, particularly through heightened greenhouse gas (GHG) emissions. In response, the concept of net-zero energy buildings (NZEBs) has been advocated as a vital solution designed to equalize the energy consumed with the energy produced on-site through renewable sources [
3,
4,
5]. Beyond theoretical frameworks, NZEBs offer a tangible approach to markedly reduce the carbon footprint of building infrastructures.
Buildings can be classified into three major categories based on their primary use: residential, commercial, and industrial. Numerous studies have been conducted on each building type with the aim of achieving net-zero energy consumption. For example, it is noted in ref. [
6] that advancements in residential NZEBs focus on optimizing energy infrastructure connections, renewable energy sources, and energy-efficiency measures to reduce energy consumption and emissions. In ref. [
7], a real-world residential building is retrofitted and concluded that this can reduce greenhouse gas emissions by over 60%, with potential reductions of up to 96% through more advanced measures. Similarly, a net-zero energy management approach for commercial buildings is proposed in ref. [
8] using renewable energy, pumped hydro storage, and hydrogen taxis, offering a framework for urban decarbonization by 2050. The key themes for commercial NZEB are discussed in ref. [
9], identifying key themes such as energy efficiency and life cycle assessment through bibliometric and qualitative analysis. In ref. [
10], the authors discuss region-specific transition plans and policy packages to achieve net-zero industrial emissions by mid-century, such as material efficiency, carbon pricing, and decarbonized technologies. The authors in ref. [
11] outlined emission reduction challenges in the cement industry and proposed solutions across its value chain to achieve net-zero emissions and minimize environmental impacts.
In addition, the challenges associated with NZEBs can be broadly categorized into two distinct phases: the planning phase and the operation phase. The planning phase focuses on site selection, design, energy modeling, and sizing of energy equipment. Meanwhile, the operation phase emphasizes real-time energy monitoring, regular maintenance, and optimal energy management. The benefits of multi-energy system co-planning in nearly zero-energy districts are discussed in ref. [
12] while identifying key research gaps related to temporal and spatial representations. An investment planning approach for NZEB in Canada is proposed in ref. [
13] examining the influence of geographical factors on energy retrofits. The significance of planning NZESs for large energy consumers, like data centers, is discussed in ref. [
14] to facilitate the integration of volatile renewable energy sources. The operational and energy management aspects of NZEBs are discussed in refs. [
15,
16,
17] where energy management of a real building in China is accessed in ref. [
15], the role of HVAC in achieving net zero is discussed in ref. [
16], and the role of efficiency measures is discussed in ref. [
17].
However, the adoption of NZEBs encounters considerable challenges. Primarily among these are the unpredictability of renewable energy sources and the complexities associated with efficient energy management [
18]. Solar power’s intermittency introduces uncertainties in the building energy system, affecting the consistency of power output from photovoltaic (PV) systems. To mitigate these issues, various predictive models have been developed. For instance, the authors in ref. [
19] have developed a hybrid machine-learning model integrating an extreme learning machine with a genetic algorithm and a similar day analysis for precise hourly PV power output predictions. This model has been validated through robust performance metrics such as the coefficient of determination, mean absolute error, and normalized root mean square error, demonstrating high accuracy and stability in day-ahead PV power predictions. Another study in ref. [
20] has utilized machine learning tools to develop a PV output prediction model that includes data quality checks, a machine learning algorithm, weather clustering, and accuracy assessments, resulting in enhanced prediction capabilities when linear regression coefficients are applied.
Despite advances in forecasting accuracy, precisely predicting the PV output under constantly changing weather conditions remains impossible, leading to operational complexities in NZEBs. Numerous studies have tackled the optimal operation of NZEBs under such uncertainties [
21]. For instance, the authors in ref. [
22] have developed a framework combining multi-objective optimization with robustness analysis to design integrated building energy systems, employing two-stage stochastic programming for balancing economic and environmental goals while validating robustness through Monte Carlo simulations. The authors in ref. [
7] have developed a multi-objective optimization process aiming to minimize the operating GHG emissions and the life-cycle cost. The process has been applied to a typical multi-residential building and tested in the four Greek climate zones.
Although existing research studies [
19,
20,
22,
23] have significantly focused on enhancing the accuracy of prediction models or optimizing NZEB operations, more studies are still required to develop comprehensive operational frameworks for building energy management systems with the necessary features. Additionally, developing a user-friendly graphical user interface (GUI) that provides real-time visualization of system status and integrates both predictive and optimization functionalities could greatly assist building operators in managing and controlling building energy systems more effectively.
To address these multifaceted challenges, this study proposes an optimization framework specifically designed for NZEBs. The framework comprises two primary phases: accurately predicting renewable energy outputs, especially from PV systems, and strategically optimizing energy production and consumption. The initial phase utilizes neural network (NN)-based prediction models to forecast the output power of the PV system accurately, taking into account a range of environmental and technical factors. The subsequent phase focuses on optimizing building systems for cooling, heating, and electricity generation using mixed integer linear programming (MILP), aiming to minimize operational costs and maximize efficiency. This approach not only enhances the reliability and performance of NZEBs but also reduces their dependence on external power sources, thereby bolstering the sustainability of building operations. The integration of this model promotes PV as an energy source for buildings, further providing a sustainable approach to powering buildings. The increased use of renewable energy sources like PV will help reduce harmful environmental impacts. This approach provides a feasible environmental solution because it shows building operators that their buildings can efficiently operate without the need for nonrenewable energy as the core energy provider. Additionally, the implementation of a GUI facilitates intuitive and user-friendly interaction with the system, enabling building operators to manage and optimize their energy resources efficiently. The major contributions of this study are listed as follows:
An operation strategy is proposed for NZEBs, including deep neural network-based renewable energy output predictions and a MILP-based optimization for multi-energy balance.
Reliability and operational efficiency are significantly enhanced by accurately forecasting PV output and optimizing building systems for cooling, heating, and electricity, thus reducing dependency on external systems.
A user-friendly GUI is developed for building operators, enabling effective energy resource management and optimizing energy use in real time.
The proposed operation offers a scalable and user-friendly solution that highlights the feasibility of achieving NZEB objectives, further supporting the shift to sustainable building operations.
2. System Models
2.1. System Configuration
Figure 1 shows the typical configuration and energy flow of a building energy system (BES), which integrates various sources of energy to fulfill electric, heat, and cooling energy demands. By combining the energy generated from these sources, the BES helps ensure that the energy supply throughout the building is balanced and efficiently distributed. This integration, which allows the system to harness energy from multiple sources, will increase the reliability of the BES while reducing dependency on a single energy provider. Not only will the system become more reliable, but there is also higher risk mitigation associated with energy supply disruptions (e.g., power outages). The system presents a way to seamlessly obtain energy from other energy sources in the building.
In the test system, the PV systems, distributed generators (DGs), and energy storage systems (ESSs) are used to supply electricity to the building energy system, fulfilling all electrical loads as well as powering other heating and cooling sources, namely the electric heat pump, boiler, and electric chiller. The system is also connected to the utility grid, which can help supply the entire system during periods of power shortage when the output from local resources is insufficient. The utility grid and ESS both support bi-directional power flow, allowing the system to efficiently adapt to fluctuating supply conditions and energy demands. Surplus energy can be given back to these components, or the system can draw energy from them when necessary. The heat generated by the boiler and electric heat pump is used to meet the heat load and the heat energy consumed by the absorption chiller (AC). The cooling load is fulfilled by the electric chiller (EC) and the AC. The operation of the entire building’s energy is managed by a building energy management system.
2.2. Proposal Optimization Framework
The proposed optimization framework includes two major models: a prediction model of PV output power and a multi-objective optimization model for the operation of entire building systems. These models are interdependent, as the output of the prediction model serves as input for configuring the building’s operational optimization. The prediction model produces a forecast of expected output from a PV system based on environmental factors. The detailed input/output for both prediction and optimization models are summarized in
Table 1.
First, three prediction models were assessed and analyzed on their performance on PV generation data from Berlin, Germany, using the PVWatts API [
23]. The prediction models chosen were ARIMA, support vector regression (SVR), and a feedforward neural network (FNN). To maintain consistency and accurate comparisons, the same input data were used across all models. The input data used in the model were beam irradiance, diffuse irradiance, ambient temperature, wind speed, and date and time. The output parameter was the output power of the PV system.
After testing the three chosen models and gathering their actual and predicted output, the following testing error metrics, including mean absolute error (MAE), root mean squared error (RMSE), and normalized root mean squared error (nRMSE), are calculated for each prediction model. To better evaluate the developed models, these metrics are also compared among one-day, three-day, and seven-day predictions. This study will concentrate on the results for the one and three-day models, as the seven-day model was included solely to demonstrate the scalability of the prediction and optimization model over a longer time frame.
Regarding the optimization model, we developed a MILP-based multi-objective optimization model to find the most efficient way to operate the energy system to minimize costs while at the same time ensuring that all energy demands from electricity, heating, and cooling are met. Decision variables such as the generation output of the boiler, heat pump, DGs, and chillers are the quantities that need to be optimized. To ensure that optimal results are achieved by the model, power constraints were implemented. To find the most efficient way to operate, the optimization model will explore many combinations of decision variable values to end up with the smallest possible cost.
The project framework was developed to consider the variability present in environmental parameters across different locations and climate zones, making it adaptable for real-world applications. This adaptability allows the model to take in data specific to an environment, retrain, and produce updated predictions suited to the building or environment’s unique conditions. Despite the uncertainty in climate and renewable energy generation, the option for continuous model retraining helps to increase the reliability of its predictions for both power generation and operational costs. This energy management framework would be particularly beneficial for commercial buildings, ideally the ones equipped with rooftop solar/PV panels. Due to the model’s reasonable basis for scheduling energy coverage, the commercial buildings would gain important insights into efficiently meeting power demands.
2.3. Mathematical Models
In this section, a detailed MILP-based mathematical model is presented with a multi-objective function aimed at minimizing building energy operation costs and reducing dependency on the utility grid. Additionally, the operational constraints of DGs, ESSs, and energy balances, including electrical, heating, and cooling systems, are also presented in detail.
The following multi-objective Equation (1) is utilized in the optimization model for optimal operation of energy building. The first term of the objective function presents the operation cost of the entire building network, and the second term shows the dependence of the building on the external utility grid.
This multi-objective function not only aims to minimize the operation cost of the entire building energy system but also to reduce the building’s dependency on external energy systems. The cost of power produced by DGs and the cost/profit of trading power with the utility grid are calculated at every time step. When the objective function is minimized, the optimal values for the decision variables are determined. This ensures efficient and cost-effective usage of our building energy system, along with encouraging the use of sustainable energy.
There are various constraints that must be fulfilled during the operation of buildings. The given Equations (2)–(6) show the operational constraints and energy balance of a system involving DGs, ESS, and energy flows between various components. The operation boundary of DGs is given in (2), ensuring that their output stays within the minimum and maximum limits. Equations (3) and (4) describe the charging and discharging power constraints of the ESS. Equation (3) ensures that the charging power does not exceed the maximum allowable charging rate considering the current SOC and the charging loss. Similarly, Equation (4) shows the discharging power based on the current SOC and discharging loss. SOC update is given in Equation (5), where the SOC at the next step depends on the current SOC and the actual amount of charging and/or discharging power. Finally, the power balance within the system is ensured by Equation (6), where the total power generated from PVs, DGs, ESS discharging, and grid purchases must meet the total load, including the building load, electric consumption by the heat pump, boiler, and electric chiller, along with the amount of power exported to the utility grid.
Similarly, the heat generated by the HP and boiler should balance the heat load and the heat supplied to the AC, as shown in Equations (7)–(9). The electric-to-heat ratio of the HP and boiler are
and
, respectively.
Finally, the cooling load should always be fulfilled by the cooling generated by the AC and the EC, as expressed in Equations (10)–(12). The heat-to-cooling and electric-to-cooling ratios are selected as
and
, respectively.
3. Numerical Results
In this section, a detailed analysis is provided for dataset correlation calculation, the prediction model, and the optimal operation of the energy building. The BES, previously showcased in
Figure 1, is utilized for the test system in this study. The prediction and optimization model will be applied to a medium-sized office building located in Berlin, Germany. PV generation data obtained for this building is a significant factor in the energy system and will be incorporated into the BES for testing the models. First, we select features that exhibit a high correlation with PV output to improve the accuracy of the PV output prediction model. Next, the predicted output is integrated into the optimization model to schedule the operation of the entire building energy system, aiming to minimize both operational costs and the building’s dependency on external energy systems.
Both
Table 2 and
Table 3 present the variables defined for the key components used in the optimization model. Another critical component in the model is the battery, with a maximum capacity of 1000, initial charge of 0.2, and a minimum and maximum charging state of 0.2 and 0.9, respectively. The parameters associated with the battery, distributed generators, and heating and cooling equipment will be integrated into the optimization model to determine the operational cost of powering the building.
3.1. Input Data
The one-year PV dataset is derived from the output of the building’s PV system, sourced from PVWatts [
23]. Observing the correlations between the variables in the dataset provides valuable insights into which parameters most significantly impact PV system output. This understanding can further assist in predictive modeling, PV system design, and the selection of installation sites. As shown in
Figure 2, beam irradiance—the direct sunlight received by the panels—has the strongest correlation with PV system output (r = 0.89). This indicates that as the amount of direct sunlight increases, the energy output of the system rises.
The second strongest correlation is between diffuse irradiance and PV system output (r = 0.77). Diffuse irradiance refers to sunlight that has been scattered by the atmosphere rather than direct sunlight. Despite this distinction, it still contributes positively to system output. Both irradiance measures demonstrate a positive correlation with output, as shown in
Figure 3, indicating that PV energy production increases with total sunlight exposure, whether direct or indirect.
In contrast, ambient temperature has a weaker correlation with PV system output, with an r value of 0.44 (
Figure 2), suggesting that while temperature may have some influence, it is not a key factor in determining system performance. The weakest correlation is found between wind speed and PV system output, with an r value of 0.058 (
Figure 2), reflecting the minimal impact of wind speed on the system.
Figure 4 further illustrates the lack of correlation between wind speed and output, highlighting its insignificant effect.n
The output power of PVs is obtained by performing the PV prediction model, as illustrated in
Figure 5a. The electric, heat, and cooling loads are taken from a combined cooling, heat, and power system in an office building [
24], as depicted in
Figure 5b–d. Similarly, the data for three-day-ahead optimization are presented in
Figure 6a–d.
3.2. Prediction Models
The chosen prediction model utilizes an NN architecture. This architecture refers to the arrangement of neurons into layers, along with the connection patterns between layers. It depicts how a network transforms the received input into output. The NN model integrated in this project uses Keras, which is a high-level neural network API. The following characteristics of the model and its layers differ slightly among one-day and three-day predictions to account for the different levels of complexity. The input layer of the NN model represents the parameters used to help generate the output layer. The specific input parameters utilized in the model are ambient temperature, beam irradiance, diffuse irradiance, wind speed, and date and time. Both one- and three-day prediction models have densely connected input layers with seven neurons.
The distinguishing factor between the models for one-day versus three-day simulation is the size of the hidden layer. A hidden layer is an intermediary layer between the input and the output. This is where the data received by the model are essentially studied for intricate patterns to produce accurate predictions. The hidden layer size for the one- and the three-day simulations is 7 and 14 neurons, respectively. There are more data to consider for three-day prediction, so having 14 neurons in the hidden layer allows the model to train more efficiently and handle the complexities and size of the data. The output layer for the one- and the three-day model is 24 and 72 neurons, respectively, which corresponds to the number of hours for which we want to obtain predictions. The adaptive moment estimation (Adam) optimizer is utilized during the compilation of each model. This ensures enhanced performance and the minimization of the model’s loss function.
The results from the comparison in
Table 1 show that the NN model produced the most accurate results. It received the lowest values for each testing error metric compared with ARIMA and SVR. This high performance can be attributed to the model’s architecture comprising hidden layers that utilize activation functions, ensuring that complex and non-linear patterns are captured. The results further highlight the advantages of a machine learning approach, as three different prediction models were evaluated, and accurate results were obtained (
Table 4). While an analytical approach may provide predictions through methodical calculations, it was not selected due to the added complexity. Selecting machine learning as a means to obtain predictions proved to be a more feasible alternative, as accurate results are obtainable and varying datasets can be used. This tradeoff allowed for the balance between simplicity and predictive accuracy, making the machine learning approach the more practical option for the project scope.
3.2.1. One-Day Prediction
To further validate the model’s training results, a training and validation loss is presented with the model loss over epochs. Training loss is an indication of how well a model is fitting training data, or how effectively it is learning patterns. Validation loss displays how well the model fits new, unseen data. As shown in
Figure 7, both training and validation loss have an initial decrease. A decreasing trend for training loss indicates that the model is learning and showing improvement in the training data. A decreasing validation loss shows that the model is improving its predictions on unseen data. We can also infer that the model has an optimal fit because both losses decrease and they stabilize at a certain point.
Figure 8 illustrates that the frequency of error for the one-day prediction has a high concentration of values surrounding zero, indicating high levels of model accuracy.
Figure 9 depicts the actual versus predicted results of PV system output over a span of 24 h. The actual results are obtained from PVWatts, while the predicted output comes from the NN model. As depicted in the graph, the predictions shown are highly accurate, proving the effectiveness of the model.
3.2.2. Three-Day Prediction
Similarly to the one-day time frame, the performance of the model was also analyzed over a three-day period. The significance of performing predictions over a wider horizon is to strengthen the validity of how well the model performs over different time ranges. This proves that the model can provide accurate predictions for different time ranges, which will assist in future operational planning and energy management.
In
Figure 10, both training and validation loss also have an initial steep decrease. A decreasing trend for training loss indicates learning and improvement toward the training data. The model is also improving its predictions on unseen data for a three-day range, as evident by the decreasing validation loss.
Figure 11 showcases that the model can still perform at high levels of accuracy over three days because of the high concentration of zeros for the frequency of error. The results shown in
Figure 12 for the three-day predictions are similar to those for the one-day predictions, where the model produces highly accurate results.
3.3. Day-Ahead Scheduling
The results from the optimization model show how the building’s energy demands for cooling, heating, and electricity are met. As shown in
Figure 13, the cooling energy balance is always maintained, with the energy output precisely meeting the building’s cooling requirements. The energy supply is primarily provided by the AC rather than the EC due to the former being more cost-effective.
In
Figure 14, the optimization model ensures that the heating supply from the boiler meets the building’s heat load. The heat pump is not utilized, as the model adopts the most cost-effective approach to meet the building’s energy needs. It is important to distinguish the heating shown in
Figure 14 from that in
Figure 5d. The difference arises because
Figure 14 is not representative of the heat load itself but rather the heat after a portion of the AC’s energy has been added. In the optimization model, the total heat load is calculated by adding the heating demand (
Figure 5d) with a portion of the AC energy output, explaining why the heating demand prior to optimization appears lower.
As given in Equation (6), the electric power provided by the energy sources should equal the power demanded by the building.
Figure 15 depicts this balance, showing that the sum of the building’s energy supply at every time step equals the demand, represented in the graph as the total electric load. To show the effectiveness of the proposed method,
Table 5 presents a comparison with and without the proposed optimization.
3.4. Three-Day-Ahead Scheduling
Similarly to the one-day results, the three-day optimization model demonstrates how the building’s energy demands are met. As shown in
Figure 16, the cooling energy balance is maintained, with no surplus/shortage in energy output. Cost-effectiveness is achieved by sourcing the cooling energy supply from the AC.
In
Figure 17, the optimization model guarantees that the building’s heat load requirements are being met by the boiler’s heating supply. The heat pump is not used, as the model recognizes that it would be a more costly option. The same explanation for the heating load difference applies to the three-day results for the optimization model and the heating demand for three days (
Figure 6d).
Finally, the electric power supplied by the energy sources must match the building’s power demand.
Figure 18 depicts this balance, showcasing that the total supply of energy at every time step is equal to the demand.
3.5. GUI Development
The development of a GUI significantly enhances the user experience by enabling the visualization of data and results. Users can interact with the interface to view both the input and output of the optimization model through graphical representations. In this study, different tabs are designed, as shown in
Figure 19, which allows users to navigate easily through the results of the optimization model for both one-day and three-day data. Additionally, access to a dedicated tab enables users to retrain the neural network model and run the PV predictions for both one-day and three-day models. This tab includes a basic visual representation of the neural network model along with a summary detailing the number of neurons in each layer. To showcase model efficiency, a plot depicting the training and validation loss is displayed along with a histogram of the frequency of error.
The optimization model tabs hold key equations to further facilitate user comprehension of how the system optimizes building energy use. The visual of the project’s BES is also provided, illustrating how power is sourced and distributed throughout the building. The comprehensive design of the GUI ensures that users can interact seamlessly with the optimization and prediction framework and directly view the results. The future development of this GUI will allow for the integration of additional building energy demands, enabling the adaptation to more complex energy systems. The extended functionality will provide the visualization of energy solutions tailored to the unique requirements of each building. This will aim to further enhance the scalability, allowing the GUI to accommodate different building types and energy demands.
Ultimately, the GUI serves as a critical integration point for the prediction and optimization model within the BES. By providing a user-friendly interface, it allows operators to utilize predictive models and algorithms without low-level knowledge and technical expertise. Providing this accessibility is crucial, as it encourages users to engage with energy management tools, fostering a proactive approach to optimizing energy usage through renewable resources.