A Bi-Level Optimization Approach for Enhancing Community Energy Resilience with Building Thermal Inertia
Abstract
1. Introduction
- (1)
- A thermal dynamic model of buildings with air-conditioning is developed by incorporating the heat transfer characteristics of the building envelope. The model provides a more accurate representation of air-conditioning power consumption and enables the utilization of building thermal inertia in demand response applications.
- (2)
- Thermal dynamic and operating characteristic models are developed for electric water heaters, dishwashers, washing machines, and other flexible appliances to accurately capture their heat storage and load-shifting properties. On this basis, a user-side electricity demand response model is constructed under comfort constraints.
- (3)
- To fully harness the synergistic potential of both generation and consumption elasticity, a novel two-way optimization architecture is developed. By integrating consumer responsiveness into generation dispatch planning, this model bridges the communication gap between residential shiftable appliances and the neighborhood energy aggregator, ultimately fostering mutually beneficial operational strategies for utilities and residents.
2. Bi-Level Optimization Mathematical Model
2.1. Bi-Level Operation Framework of Community Energy System
2.2. Upper-Level Model-Community Energy Operators
2.2.1. Distribution Network Model
2.2.2. Electricity Price Constraints
- (1)
- Benchmark curve generation: The direct electricity purchase price for users is taken as the reference curve. Under the condition that the average daily electricity price remains unchanged, a smoothed benchmark price curve is obtained through cubic spline interpolation.
- (2)
- Boundary determination: The resulting smooth benchmark curve is then scaled by factors of 0.6 and 1.4 to define the lower and upper limits of the admissible price optimization range, respectively [34]:
- (3)
- Rationality constraint: To ensure pricing fairness and prevent over-aggressive profit seeking, the average daily optimized electricity price should not exceed the corresponding average price of direct electricity purchase for users [35]:
2.3. Lower-Level Model—End Building Users
2.3.1. Building Thermal Dynamic Model of Integrated Air Conditioning System
2.3.2. Demand Response Model of Water Heater
2.3.3. Equipment Model with Adjustable Time Shift Characteristics
3. Solving Model
3.1. Solving Algorithm
3.2. Model Linearization Strategy
4. Example Analysis
4.1. Operator Results Analysis
4.2. User Results Analysis
4.2.1. Response Results of Integrated Air Conditioning System Building Demand
- (1)
- During the daytime, the high-price period from 7:00 to 9:00 coincides with the gradual rise in outdoor temperature and the corresponding increase in cooling demand. To reduce electricity expenditure during this period, the building energy management system performs pre-cooling in the early morning, typically from 6:00 to 8:00 when electricity prices are relatively low. By lowering the indoor temperature in advance, the building can make use of its thermal inertia to slow down the subsequent temperature increase. As a result, the dependence on frequent air-conditioning operation during peak-price hours is reduced. This strategy not only suppresses peak-period power demand, but also decreases the number of air-conditioner start–stop cycles, thereby helping to achieve peak shaving and valley filling while maintaining indoor thermal comfort within an acceptable range. Because the thermal inertia of buildings depends on envelope materials, wall heat capacity, insulation level, window area, and building orientation, the pre-cooling effect is not identical for all buildings. Buildings with larger thermal capacitance can maintain indoor temperature for a longer period after pre-cooling, thereby providing a wider load-shifting window. In contrast, lightweight buildings with lower thermal inertia experience faster indoor temperature rebound, and their HVAC systems must operate more frequently to maintain comfort. Therefore, the effectiveness of pre-cooling should be interpreted as parameter-dependent rather than universal.
- (2)
- At night, the low-price interval from 22:00 to 6:00 of the next day overlaps with a period in which cooling demand remains relatively high. Under this condition, the air-conditioning system tends to operate more actively at higher power levels to satisfy indoor temperature requirements while taking advantage of the lower electricity price. At the same time, this operating mode can provide thermal buffering for the following day by storing additional cooling capacity in the building structure or related cold-storage components. In essence, part of the daytime cooling demand is shifted to the nighttime low-price period, which further enhances the peak-shaving effect. This result indicates that when user demand exhibits greater flexibility, the responsiveness of building loads to electricity price signals becomes more significant.
4.2.2. Water Heater Demand Response Results
- (1)
- The high-price period from 07:00 to 09:00 overlaps with the primary morning peak in hot water demand. To reduce electricity costs during this interval, all user types adopt a preheating strategy in advance, typically between 05:00 and 07:00 when the electricity price is relatively lower. Through this anticipatory adjustment, part of the heating load is shifted from the expensive peak period to a more economical time window. As a result, the strategy not only helps decrease user energy expenditure, but also ensures that sufficient hot water is available during the morning demand peak, thereby achieving a balance between economic performance and service quality.
- (2)
- The secondary electricity price peak during 18:00–20:00 coincides with the period of concentrated household bathing demand. Although electricity prices are relatively high in this interval, users still need to satisfy essential hot water requirements, which limits the extent to which demand can be shifted in response to price signals. As a result, the demand response elasticity of electric water heaters remains relatively weak during this period. This phenomenon indicates that when user demand is dominated by rigid thermal comfort needs, the sensitivity of load behavior to electricity price decreases significantly. In other words, under such conditions, user-side load adjustment is constrained more by service requirements than by economic incentives.
- (3)
- As shown by the tank temperature profiles in Figure 13 and the corresponding activation summary in Table 3, the proposed control strategy is able to balance demand response performance with user comfort requirements. Table 3 reports the hour-level heating activation intervals rounded from the 15 min simulation results shown in Figure 13. During periods of intensive hot water usage, the tank temperature decreases rapidly, which leads to more frequent heating actions in order to keep the water temperature within the allowable comfort range. By contrast, during off-peak periods with relatively low hot water demand, a single heating cycle is sufficient to maintain the desired temperature for more than three hours. This indicates that the system can effectively shift part of the electricity consumption to low-price periods while still ensuring a stable hot water supply, thereby demonstrating a clear peak-shaving effect.
4.2.3. Time Shift Characteristics Can Adjust Equipment Demand Response Results
- (1)
- Dishwasher operation strategy: The dishwasher working hours are highly coupled with the low electricity price. Its two daily operation windows (9:00–17:00 and 20:00–6:00 of the next day) fully cover the two low price periods of 0:00–4:00 and 13:00–16:00 for the day. The cost of the equipment is optimized through the delayed startup strategy: the first operation selects 1:00–2:00 in the morning of the next day to handle the tableware cleaning tasks accumulated in the previous night; the second operation is scheduled to handle the tableware load at 15:00–16:00 in the morning and noon of the day. This time period selection mechanism ensures that the lowest price energy is used preferentially within the allowable working hours.
- (2)
- Washing-machine operation strategy: The washing machine adopts a continuous washer–dryer cycle. The optimized operation is 0:00–3:00, consisting of a washing stage from 0:00 to 1:00 and a drying stage from 1:00 to 3:00. This setting is consistent with the three-hour operating-cycle assumption and places the higher-power drying process in the overnight low-price period.
4.3. Comparative Example
4.4. Computational Efficiency Analysis
5. Conclusions
- (1)
- Demand-side responsiveness is primarily driven by the flexibility of controllable appliances, including the thermal storage effect of air-conditioned buildings, the buffering capacity of water heaters, and the schedulable nature of household devices like washing machines. By strategically scheduling the operation intervals of these units, load volatility is significantly mitigated. This demand response approach not only facilitates load leveling (peak shaving and valley filling) for the utility grid but also substantially lowers the total energy expenditure for end-users.
- (2)
- Leveraging supply-side pricing elasticity alongside granular user consumption data, energy providers can steer consumer behavior through dynamic tariff optimization. While maintaining financial stability for the operator, this strategy employs price signals to incentivize active user participation, thereby enhancing the overall operational adaptability and flexibility of the regional energy network.
- (3)
- The developed bi-level optimization framework establishes a collaborative pricing environment where both suppliers and consumers influence electricity rate strategies. By harmonizing the regulatory capabilities of both parties, the model achieves a symbiotic equilibrium between the provider’s profitability and the user’s cost-efficiency. This ensures that economic gains are distributed equitably, fostering a ‘win–win’ scenario for all stakeholders involved in the energy ecosystem.
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- United Nations Environment Programme; Global Alliance for Buildings and Construction. Not Just Another Brick in the Wall: The Solutions Exist—Scaling Them Will Build on Progress and Cut Emissions Fast. Global Status Report for Buildings and Construction 2024/2025. Available online: https://wedocs.unep.org/20.500.11822/47214 (accessed on 3 March 2026).
- Liu, S.; Yan, J.; Yan, Y.; Zhang, H.; Han, S.; Liu, Y. Heterogeneous graph-enhanced approach for demand response potential modeling: Mining load flexibility from user micro-behavioral patterns. Appl. Energy 2025, 399, 126424. [Google Scholar] [CrossRef]
- Shirvani-Hosseini, S.; Samadi-Koucheksaraee, A.; Ahmadianfar, I.; Gharabaghi, B. Data mining methods for modeling in water science. In Computational Intelligence for Water and Environmental Sciences; Bozorg-Haddad, O., Zolghadr-Asli, B., Eds.; Springer: Singapore, 2022; Volume 1043, pp. 157–178. [Google Scholar] [CrossRef]
- Samadi-Koucheksaraee, A.; Shirvani-Hosseini, S.; Ahmadianfar, I.; Gharabaghi, B. Optimization algorithms surpassing metaphor. In Computational Intelligence for Water and Environmental Sciences; Bozorg-Haddad, O., Zolghadr-Asli, B., Eds.; Springer: Singapore, 2022; Volume 1043, pp. 3–33. [Google Scholar] [CrossRef]
- Chen, H.; Ahmadianfar, I.; Heidari, A.A.; Kordani, M.; Koucheksarae, A.S.; Liang, G. LEE: A physics-inspired optimizer based on LangEvin equation. Neurocomputing 2025, 666, 132288. [Google Scholar] [CrossRef]
- Samadi-Koucheksaraee, A.; Ahmadianfar, I.; Bozorg-Haddad, O.; Asghari-Pari, S.A. Gradient evolution optimization algorithm to optimize reservoir operation systems. Water Resour. Manag. 2019, 33, 603–625. [Google Scholar] [CrossRef]
- Lizana, J.; Friedrich, D.; Renaldi, R.; Chacartegui, R. Energy flexible building through smart demand-side management and latent heat storage. Appl. Energy 2018, 230, 471–485. [Google Scholar] [CrossRef]
- Jin, X.; Mu, Y.; Jia, H.; Wu, J.; Jiang, T.; Yu, X. Dynamic economic dispatch of a hybrid energy microgrid considering building based virtual energy storage system. Appl. Energy 2017, 194, 386–398. [Google Scholar] [CrossRef]
- Luo, Z.; Peng, J.; Zhang, X.; Jiang, H.; Lv, M. Load flexibility quantification of electric water heaters under various demand-side management strategies and seasons. J. Build. Eng. 2024, 97, 110724. [Google Scholar] [CrossRef]
- Clift, D.H.; Stanley, C.; Hasan, K.N.; Rosengarten, G. Assessment of advanced demand response value streams for water heaters in renewable-rich electricity markets. Energy 2023, 267, 126577. [Google Scholar] [CrossRef]
- Du, P.; Lu, N. Appliance commitment for household load scheduling. IEEE Trans. Smart Grid 2011, 2, 411–419. [Google Scholar] [CrossRef]
- Chen, C.; Wang, J.; Heo, Y.; Kishore, S. MPC-based appliance scheduling for residential building energy management controller. IEEE Trans. Smart Grid 2013, 4, 1401–1410. [Google Scholar] [CrossRef]
- Althaher, S.; Mancarella, P.; Mutale, J. Automated demand response from home energy management system under dynamic pricing and power and comfort constraints. IEEE Trans. Smart Grid 2015, 6, 1874–1883. [Google Scholar] [CrossRef]
- Meng, H.; Feng, S.; Li, C. An integrated system of energy generation, storages, and appliances consumption based on machine learning techniques and internet of things. J. Energy Storage 2024, 87, 111380. [Google Scholar] [CrossRef]
- Serrano, S.; Urge-Vorsatz, D.; Barreneche, C.; Palacios, A.; Cabeza, L.F. Heating and cooling energy trends and drivers in Europe. Renew. Sustain. Energy Rev. 2015, 119, 85–98. [Google Scholar] [CrossRef]
- Li, Z.; Sun, H.; Xue, Y.; Li, Z.; Jin, X.; Wang, P. Resilience-oriented asynchronous decentralized restoration considering building and E-bus coresponse in electricity-transportation networks. IEEE Trans. Transp. Electrif. 2025, 11, 11701–11713. [Google Scholar] [CrossRef]
- Qin, X.; Li, Z.; Li, Z.; Xue, Y.; Chang, X.; Su, J.; Jin, X.; Wang, P.; Sun, H. Spatio-temporal coordinated operation strategy of data centers considering virtual storage system via two-stage distributionally robust optimization. IEEE Trans. Netw. Sci. Eng. 2026, 13, 7343–7357. [Google Scholar] [CrossRef]
- Chang, L.; Li, Z.; Tian, X.; Su, J.; Chang, X.; Xue, Y.; Li, Z.; Jin, X.; Wang, P.; Sun, H. A two-stage distributionally robust low-carbon operation method for Antarctic unmanned observation station integrating virtual energy storage and hydrogen waste heat recovery. Appl. Energy 2025, 400, 126578. [Google Scholar] [CrossRef]
- Du, Y.; Xue, Y.; Wu, W.; Shahidehpour, M.; Shen, X.; Wang, B.; Sun, H. Coordinated planning of integrated electric and heating system considering the optimal reconfiguration of district heating network. IEEE Trans. Power Syst. 2024, 39, 794–808. [Google Scholar] [CrossRef]
- Wang, K.; Xue, Y.; Guo, Q.; Shahidehpour, M.; Zhou, Q.; Wang, B.; Sun, H. A coordinated reconfiguration strategy for multi-stage resilience enhancement in integrated power distribution and heating networks. IEEE Trans. Smart Grid 2023, 14, 2709–2722. [Google Scholar] [CrossRef]
- Antonazzi, E.; Di Lorenzo, G.; Stracqualursi, E.; Araneo, R. Renewable energy communities for sustainability: A case study in the metropolitan area of Rome. In Proceedings of the 2023 IEEE International Conference on Environment and Electrical Engineering and 2023 IEEE Industrial and Commercial Power Systems Europe, Madrid, Spain, 6–9 June 2023; pp. 1–6. [Google Scholar] [CrossRef]
- Wang, L.; Lin, J.; Dong, H.; Wang, Y.; Zeng, M. Demand response comprehensive incentive mechanism-based multi-time scale optimization scheduling for park integrated energy system. Energy 2023, 270, 126893. [Google Scholar] [CrossRef]
- Yin, X.; Ding, Y.; Hui, H.; Bao, M.; Xu, L.; Tang, X.; Sang, M. Design of demand response mechanism considering response behaviors of customers in initial electricity spot market. Autom. Electr. Power Syst. 2021, 45, 94–103. [Google Scholar]
- Zhou, Y.; Zeng, B. Bi-level planning method for internet data center and distribution network considering demand response. In Proceedings of the 2022 IEEE 5th International Electrical and Energy Conference, Nanjing, China, 27–29 May 2022; pp. 3270–3275. [Google Scholar] [CrossRef]
- Si, J.; Bao, G.; Liu, H.; Sun, M.; Zhou, L.; Tan, M.; Wang, L.; Jiang, C. A bi-level optimization model for independent system operator considering price-based demand response. In Proceedings of the 2022 IEEE/IAS Industrial and Commercial Power System Asia, Shanghai, China, 8–11 July 2022; pp. 451–457. [Google Scholar] [CrossRef]
- Li, Y.; Xie, H.; Yang, Y.; Yang, J.; Zhang, P. Bilevel optimization model solution algorithm for power demand response of high-energy-consumption industry users. In Proceedings of the 2025 4th International Conference on Energy, Power and Electrical Technology, Chengdu, China, 16–18 May 2025; pp. 996–1000. [Google Scholar] [CrossRef]
- Liu, Y.; Zuo, K.; Liu, X.A.; Liu, J.; Kennedy, J.M. Dynamic pricing for decentralized energy trading in micro-grids. Appl. Energy 2018, 228, 689–699. [Google Scholar] [CrossRef]
- Shang, D.R. Pricing of emergency dynamic microgrid power service for distribution resilience enhancement. Energy Policy 2017, 111, 321–335. [Google Scholar] [CrossRef]
- Wang, H.; Gao, Y.; Zhang, H.; Yan, D.; Li, H. Dynamic restoration electricity price optimization method to enhance the resilience of distribution networks with multiple microgrids. IET Gener. Transm. Distrib. 2024, 18, 2230–2241. [Google Scholar] [CrossRef]
- Dong, Y.; Wuken, E.; Zhang, H.; Ren, P.; Zhou, X. Bi-level coordinated operation optimization of multi-park integrated energy systems considering categorized demand response and uncertainty: A unified adaptive robust optimization approach. Renew. Energy 2025, 241, 122331. [Google Scholar] [CrossRef]
- Zhou, C.; Jia, H.; Jin, X.; Mu, Y.; Yu, X.; Xu, X.; Li, B.; Sun, W. Two-stage robust optimization for space heating loads of buildings in integrated community energy systems. Appl. Energy 2023, 331, 120451. [Google Scholar] [CrossRef]
- Yang, R. Strategic Optimization and Demand Response for Thermal Load Management in Multi-Regional Integrated Energy Systems: A Stackelberg Game Approach. arXiv 2024, arXiv:2411.11868. [Google Scholar] [CrossRef]
- Wang, Z.Y.; Chen, B.K.; Wang, J.H.; Begovic, M.M.; Chen, C. Coordinated energy management of networked microgrids in distribution systems. In Proceedings of the 2015 IEEE Power & Energy Society General Meeting, Denver, CO, USA, 26–30 July 2015; pp. 1–5. [Google Scholar]
- Tian, F.Y.; Li, Y.; Sun, J.H. Bi-level optimal scheduling for integrated wind farms and power-to-gas facilities. In Proceedings of the 2018 2nd IEEE Conference on Energy Internet and Energy System Integration, Beijing, China, 20–22 October 2018; pp. 1–6. [Google Scholar]
- Lutz, J. Water Heaters and Hot Water Distribution Systems; Lawrence Berkeley National Laboratory: Berkeley, CA, USA, 2008; pp. 33–34.
- Li, Z.; Su, S.; Zhao, Y.; Jin, X.; Chen, H.; Li, Y.; Zhang, R. Energy management strategy of active distribution network with integrated distributed wind power and smart buildings. IET Renew. Power Gener. 2020, 14, 2255–2267. [Google Scholar] [CrossRef]
- Hu, J.; Yan, Z.; Wang, H. Day-ahead optimal scheduling for communities considering clean power sharing. Power Syst. Technol. 2020, 44, 61–70. [Google Scholar]
- Nan, S. Study on Flexible Load Demand Response Strategies for Urban Residential Users. Master’s Thesis, North China Electric Power University, Beijing, China, 2019. [Google Scholar]
- Zhao, A.; Chen, M.; Yu, J.; Cui, P. Simulating appliance-level household electricity data: Accounting for residential behavior and usage patterns in China. J. Build. Eng. 2024, 92, 109804. [Google Scholar] [CrossRef]














| Item | Value/Assumption Used in the Case Study |
|---|---|
| Topology | Four-node radial low-voltage community feeder |
| Load allocation | 10, 8, 6, and 6 buildings at nodes 1–4; 1200 households in total |
| Voltage limit | 0.95–1.05 p.u. |
| Reactive power | Fixed lagging power-factor assumption for aggregated residential load |
| Validation reference | Linearized result compared with nonlinear AC power-flow calculation in MATLAB (R2024b) (The MathWorks Inc., Natick, MA, USA) |
| Electrical Equipment | Rated Power/kW | Load Cycle/h | ||
|---|---|---|---|---|
| Washing machine | Wash | Bake | Wash | Bake |
| 0.5 | 1.8 | 1 | 2 | |
| Dishwasher | 1 | 1 | ||
| User Category | Approximate Heating-Activation Intervals Rounded from Figure 13 |
|---|---|
| User 1 | 0:00–1:00; 4:00–5:00; 6:00–7:00; 8:00–9:00; 11:00–12:00; 14:00–16:00; 19:00–21:00; 22:00–23:00 |
| User 2 | 2:00–3:00; 5:00–6:00; 6:00–7:00; 8:00–9:00; 13:00–14:00; 14:00–16:00; 19:00–21:00; 22:00–23:00 |
| User 3 | 0:00–1:00; 3:00–4:00; 5:00–7:00; 8:00–9:00; 11:00–12:00; 14:00–16:00; 19:00–21:00; 23:00–24:00 |
| Equipment | On |
|---|---|
| Washing machine | 0:00–3:00 (washing 0:00–1:00; drying 1:00–3:00) |
| Dishwasher | 0:00–1:00, 15:00–16:00 |
| Scenario | Electricity Selling Price | Is the Upper Level Optimized | Is the Lower Level Optimized |
|---|---|---|---|
| 1 | Optimized | Yes | Yes |
| 2 | No | Yes | |
| 3 | 1.11 | No | No |
| Scenario | Operator Revenue | Total User Electricity Cost |
|---|---|---|
| 1 | 1376.4 | 9603.4 |
| 2 | [−2823.4, 4880.6] | [5684.2, 13,692.6] |
| 3 | 1374.9 | 9874.6 |
| System Scale | Number of Households | Average Time per Iteration (s) | Total Time (s) |
|---|---|---|---|
| 1 Node | 300 | 3.2 | 51.2 |
| 4 Nodes (Base Case) | 1200 | 12.5 | 200.0 |
| 10 Nodes | 3000 | 34.1 | 545.6 |
| 20 Nodes | 6000 | 71.5 | 1144.0 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Yang, H.; Lv, Y.; Zhang, S. A Bi-Level Optimization Approach for Enhancing Community Energy Resilience with Building Thermal Inertia. Buildings 2026, 16, 2381. https://doi.org/10.3390/buildings16122381
Yang H, Lv Y, Zhang S. A Bi-Level Optimization Approach for Enhancing Community Energy Resilience with Building Thermal Inertia. Buildings. 2026; 16(12):2381. https://doi.org/10.3390/buildings16122381
Chicago/Turabian StyleYang, Haibo, Yifan Lv, and Song Zhang. 2026. "A Bi-Level Optimization Approach for Enhancing Community Energy Resilience with Building Thermal Inertia" Buildings 16, no. 12: 2381. https://doi.org/10.3390/buildings16122381
APA StyleYang, H., Lv, Y., & Zhang, S. (2026). A Bi-Level Optimization Approach for Enhancing Community Energy Resilience with Building Thermal Inertia. Buildings, 16(12), 2381. https://doi.org/10.3390/buildings16122381
