Next Article in Journal
Deformation-Based Protective Performance Assessment of the Entrance-Side Front Wall of a Double-Door-Type RC Covered Artillery Position Under Frontal Standoff Blast Loading
Previous Article in Journal
An Integrated Conceptual Framework for Low-Carbon and Cost-Effective Building Design Optimisation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Bi-Level Optimization Approach for Enhancing Community Energy Resilience with Building Thermal Inertia

1
School of Energy and Architectural Engineering, Shandong Huayu University of Technology, Dezhou 253000, China
2
School of Electrical Engineering, Northeast Electric Power University, Jilin 132012, China
*
Author to whom correspondence should be addressed.
Buildings 2026, 16(12), 2381; https://doi.org/10.3390/buildings16122381 (registering DOI)
Submission received: 31 March 2026 / Revised: 3 June 2026 / Accepted: 11 June 2026 / Published: 15 June 2026
(This article belongs to the Section Building Energy, Physics, Environment, and Systems)

Abstract

This paper develops a bi-level optimization framework for community energy systems to improve grid stability and strengthen resilience against supply–demand mismatches, with potential applicability to weather-driven operational stress. By incorporating demand-side response resources, with particular emphasis on the thermal storage potential of buildings, the proposed framework enhances the operational security and regulation capability of the system. At the upper level, energy operators determine dynamic electricity pricing strategies aimed at not only maximizing economic returns but also shaping load profiles toward smoother and more stable operation. At the lower level, a building thermal dynamic model is established, and the schedulable characteristics of flexible appliances, including electric water heaters, dishwashers, and washing machines, are exploited to reduce user-side energy costs while supporting peak load mitigation. Through iterative coordination between the two levels, the proposed method enables effective joint optimization of supply and demand. Simulation results indicate that the framework increases operator revenues through differentiated pricing and, at the same time, substantially lowers users’ electricity expenditures. In addition, by aggregating distributed flexible resources as a virtual buffering capacity, the proposed strategy helps reconcile the interests of both operators and users and further improves the resilience of the local power community energy system.

1. Introduction

Amid growing energy and environmental pressures, improving building-sector flexibility has become an important pathway for reducing carbon emissions and mitigating grid supply–demand mismatches. According to the 2024–2025 Global Status Report for Buildings and Construction, buildings account for 32% of global energy consumption and 34% of energy-related carbon emissions [1]. Residential communities contain abundant flexible resources, but their value depends on whether heterogeneous household loads can be coordinated without violating comfort and appliance-use requirements. Recent work on demand response potential modeling further shows that user micro-behavioral patterns are essential for identifying practical load flexibility [2]. Therefore, the key problem addressed in this study is how to transform distributed residential flexibility into an operational resource that can be used by a community energy operator through transparent pricing and scheduling decisions.
From a methodological perspective, recent studies emphasize the importance of interpretable model construction, transparent algorithmic assumptions, and reproducible optimization procedures. Data-mining methods in water science illustrate how representative patterns can be extracted from large-scale behavioral and environmental data [3]. In addition, metaphor-free optimization algorithms [4], the Langevin-equation-based LEE optimizer [5], and the gradient evolution optimization algorithm for reservoir operation [6] all highlight the need to report search logic, parameter settings, and convergence behavior clearly. These studies motivate the present work to provide explicit physical constraints, information-exchange rules, and iterative solution details for the proposed community energy management framework.
Flexible building loads are an important source of demand-side regulation. Air-conditioning systems can adjust indoor thermal conditions within acceptable comfort limits, while building envelopes provide thermal inertia that delays the influence of outdoor temperature variations on indoor temperature. In this study, indoor temperature is used as the main comfort-state variable, and humidity dynamics are not explicitly modeled; the coupling of latent cooling load and humidity will be considered in future extensions. Previous studies have demonstrated that smart demand-side management and building thermal storage can shift building loads and improve operational flexibility [7], and that building thermal inertia can be represented as a virtual energy storage resource in energy scheduling problems [8]. These findings provide the physical basis for using residential buildings as flexible resources.
In addition to air-conditioning systems, electric water heaters and time-shiftable appliances also provide considerable residential flexibility. Electric water heaters can store thermal energy and adjust heating periods under demand response strategies [9,10]. Washing machines, dishwashers, and other household appliances do not provide physical energy storage, but their operating times can be shifted within allowable windows while maintaining user requirements [11,12,13]. With the development of smart home technologies, these appliances can respond to dynamic electricity prices and help reduce user costs and peak load pressure [14,15]. However, most existing studies focus on a single flexible load or analyze different devices separately, while coordinated scheduling of air-conditioning thermal inertia, water-heater heat storage, and shiftable appliances at the community level remains insufficiently studied.
The flexibility potential of building thermal dynamics has also been validated in broader resilience-oriented applications. Li et al. [16] proposed an asynchronous decentralized restoration method for electricity-transportation networks and showed that building thermal inertia can coordinate with the spatial–temporal flexibility of electric buses to improve critical load restoration. Qin et al. [17] further demonstrated that the dynamic thermal network of data-center buildings can be modeled as a virtual storage system and coordinated with cloud–user loads through two-stage distributionally robust optimization. These studies indicate that building thermal inertia can provide operational flexibility beyond conventional residential energy management. In addition, virtual energy storage and hydrogen waste-heat recovery have been integrated for low-carbon operation in isolated energy systems [18], and coordinated reconfiguration of electricity and heating networks has been used to enhance system resilience [19,20].
Community energy systems provide a practical platform for aggregating distributed flexible loads and coordinating supply–demand interaction. Renewable energy communities and park-level integrated energy systems have shown that coordinated demand response can improve local energy utilization and economic performance [21,22]. Nevertheless, as user participation expands, direct centralized control becomes increasingly difficult, and price-based mechanisms are needed to guide user-side response while maintaining the operator’s economic benefit [23]. Bi-level optimization is well suited to this problem because the upper-level operator can determine electricity prices and procurement decisions, while lower-level users optimize their flexible-load schedules according to the released price signals [24,25,26]. Dynamic pricing and robust bi-level scheduling have also been applied to microgrids, distribution resilience, multi-park integrated energy systems, building heating loads, and thermal load management [27,28,29,30,31,32].
However, existing studies still rarely integrate multiple residential flexible loads with building thermal inertia into a unified community-level bi-level optimization framework. To bridge this gap, this paper develops a bi-level optimization method for community energy systems under deterministic forecast inputs. At the upper level, the community energy operator optimizes dynamic electricity prices and power-purchasing decisions to improve economic performance. At the lower level, users respond to price signals by scheduling air-conditioning systems, electric water heaters, washing machines, and dishwashers under comfort and operating constraints. Through iterative coordination between the two levels, the proposed method reduces user electricity costs, improves operator revenue, and smooths the community load profile. Accordingly, the contribution is framed as deterministic operational flexibility and supply–demand balancing; explicit resilience evaluation under extreme-weather uncertainty is reserved for future stochastic and robust extensions. The main contributions of this study are summarized as follows:
(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.
In the proposed bi-level framework, community energy operators in the upper level aim to maximize their economic benefits by determining dynamic electricity pricing strategies. At the lower level, users respond to these price signals by adjusting the operating schedules and on/off states of flexible household loads, with the goal of minimizing their electricity expenses while maintaining acceptable usage requirements. Specifically, the proposed method simultaneously models the thermal dynamic behavior of air conditioners and electric water heaters, together with the time-shiftable operating characteristics of washing machines and dishwashers. On this basis, corresponding operational models are established to realize coordinated optimization between the energy supply side and the user demand side through an iterative solution process. The simulation results demonstrate that the proposed strategy is capable of improving the pricing adaptability of community energy operators and strengthening the interaction between price-based control and user-side load response. Meanwhile, it effectively reduces household electricity costs, smooths the load profile, and contributes to a more balanced distribution of grid demand. These findings indicate that the proposed method provides a practical and effective solution for enhancing the operational efficiency of community energy systems and also offers valuable support for their sustainable and intelligent development. It should be noted that the primary focus of the proposed framework is to establish the deterministic coordinated scheduling mechanism between supply-side pricing and demand-side thermal inertia. Severe stochastic uncertainties inherently caused by extreme weather—such as unpredictable outdoor temperature drops and intermittent renewable generation—are simplified as deterministic forecast inputs in this current stage.

2. Bi-Level Optimization Mathematical Model

2.1. Bi-Level Operation Framework of Community Energy System

As illustrated in Figure 1, the proposed bi-level operational framework of the community energy system involves three key entities: community energy operators at the upper level, distribution network infrastructure at the intermediate level, and end-user buildings at the lower level. Within this framework, the operators dynamically determine the electricity selling price ( C O C ) and power purchasing strategy ( P b ) according to the upstream grid price signals and the load characteristics of users, with the objective of maximizing their economic benefits. Meanwhile, end users respond to the pricing strategy released by the operators by adjusting the operating states of flexible electrical loads ( P b , L ), thereby reducing their electricity expenditure. Through this bidirectional interaction, a closed-loop mechanism for coordinated optimization between the supply side and the demand side is established. In each iteration of the proposed closed-loop mechanism, the information exchange is performed over the full scheduling horizon rather than only at the current time step. Specifically, the upper-level operator broadcasts the complete dynamic electricity price vector for the day-ahead horizon to the lower-level users. Based on this price vector, users optimize the operating schedules and on/off states of flexible loads, including air-conditioning systems, electric water heaters, washing machines, and dishwashers. After the lower-level optimization is completed, the optimized aggregated load profile and appliance operating-state information are fed back to the upper level. The operator then updates the electricity selling price and power purchasing strategy according to the returned load profile. This iterative process continues until the changes in the price vector and the aggregated load profile satisfy the convergence criterion.
The coupling between the two levels is realized through two information channels. First, the operator sends the complete day-ahead price vector to the users. Second, after solving the lower-level scheduling problem, users return the aggregated load profile and representative appliance-state information to the operator. Feasibility is enforced by hard constraints: schedules that violate thermal comfort, hot-water service, appliance deadlines, voltage limits, or price bounds are not accepted by the solver. Therefore, the iterative process searches for a mutually consistent price-load fixed point within the deterministic feasible region.
For clarity, the complete deterministic bi-level model is summarized here. The upper-level decision variables are the retail price vector, the power-purchasing vector, and the network operating variables associated with feeder power flow and voltage constraints. The upper-level objective is to maximize operator profit, defined as retail revenue minus upstream procurement cost, subject to power balance, distribution-network operating limits, retail-price bounds, and the daily average-price rationality constraint. The lower-level decision variables are the on/off states and operating schedules of air-conditioning systems, electric water heaters, washing machines, and dishwashers. The lower-level objective is to minimize user electricity expenditure subject to indoor-temperature limits, water-temperature limits, appliance start-time and completion-deadline constraints, and continuous-cycle requirements for shiftable appliances.

2.2. Upper-Level Model-Community Energy Operators

max   = t = 1 T n = 1 N C t O B P n , t b , L Δ t C t U O P t b Δ t
Within this profit maximization objective, the retail electricity tariff applied by the operator to end-users during a specific interval t is denoted as C t O B . Correspondingly, the aggregated electrical demand of the building consumers in the same interval is represented by P n , t b , L . On the supply side, the wholesale market price at which the community operator procures power from the superior grid is defined as C t U O . The total volume of electrical energy imported from this higher-level network over the interval is quantified by P t b Δ t . Additionally, N designates the total count of participating users. For the temporal resolution of this study, the scheduling step Δ t is fixed at 15 min, yielding a total of T = 96 operational periods over a complete daily cycle.
All power variables in the upper-level objective are expressed in kW and are converted into energy by multiplying by Δ t . The first term represents the operator’s retail revenue, calculated by multiplying the selling price C t O B by the aggregated user electricity consumption. The second term represents the upstream procurement cost, calculated by multiplying the upstream purchase price C t U O by the electricity purchased from the upper grid. Therefore, the objective follows the sign convention of revenue minus cost.
To maintain real-time power equilibrium in the community energy system, the energy balance constraint should be satisfied in each time period, namely, the active power procured by the operator from the upstream grid must equal the sum of users’ total electricity consumption and the distribution network losses.
P t b = n = 1 N P n , t b , L + P t s s
P t s s = n r f , n P n 2 + Q n 2 V n 2
To account for the physical inefficiencies within the local grid, the variable P t S S is introduced to quantify the active power dissipation experienced across the community distribution network at any given moment t.

2.2.1. Distribution Network Model

In formulating the power flow constraints, the sending and receiving ends of a specific line segment are indexed as bus n and bus n + 1, respectively. The apparent power injected at the upstream node is denoted by the complex expression P n + i Q n , whereas the electrical demand drawn by the downstream node is captured by P n + 1 l o a d + i Q n + 1 l o a d . The physical characteristics of the distribution feeder connecting these two buses are modeled via its complex impedance, r f + i x f . Finally, the nodal voltage magnitude at the sending bus is specified as V n .
The simulated feeder is a radial low-voltage feeder with four nodes, and the node-load allocation is consistent with the case description in Section 4. The slack/source node is node 1, and nodes 2–4 are downstream residential load nodes. Reactive power is represented through a fixed lagging power-factor assumption for aggregated residential demand, so that the reactive load follows the active-load schedule proportionally during each interval. This assumption is suitable for the present flexibility study because the optimization focus is on active-power price response, while detailed inverter-level reactive-power control is outside the model scope. And detailed feeder parameters and power-flow validation assumptions for the case study are listed in Table 1.
P n + 1 = P n r f P n 2 + Q n 2 V n 2 P n + 1 l o a d
Q n + 1 = Q n x f P n 2 + Q n 2 V n 2 Q n + 1 l o a d
V n + 1 2 = V n 2 2 r f P n + x f Q n + r f 2 + x f 2 P n 2 + Q n 2 V n 2
And the voltage change on the line meets the following requirements:
1 ε V n * 1 + ε
To ensure operational security, the per-unit voltage magnitude at any given node, designated as V n * , must remain strictly within permissible limits. For this analysis, the maximum allowable voltage deviation, ϵ , is constrained to 0.05.

2.2.2. Electricity Price Constraints

When determining electricity selling prices, operators must simultaneously consider users’ price responsiveness and their own objective of revenue maximization. Since the electricity purchase price from the upstream grid is generally lower than the retail price paid by end users [33], the operator’s tariff strategy should be optimized dynamically within a predefined scheduling horizon. The construction of the optimization interval is described as follows:
(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]:
C t O B , m i n C t O B C t O B , m a x
(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]:
The price bounds scaled by 0.6 and 1.4 are not treated as unique calibrated constants. They are used as a moderate engineering price-adjustment interval: the lower bound remains high enough to avoid uneconomic retail prices for the operator, while the upper bound limits abrupt tariff increases and protects user participation. Economically, the interval provides a visible incentive for load shifting without allowing the price signal to dominate user comfort and appliance-use requirements. From a regulatory and participation perspective, the additional daily average-price constraint prevents the optimized tariff from exceeding the direct-purchase benchmark on average.
The rationality constraint is introduced as a fairness and participation constraint. It prevents the optimized tariff from raising the daily average retail price above the direct-purchase benchmark available to users, thereby ensuring that users have an incentive to participate in demand response. This constraint may reduce the operator’s maximum attainable profit, but it improves acceptability and avoids solutions in which user flexibility is exploited only through higher prices. In the numerical study, the feasible region remains nonempty under all three comparison scenarios, indicating that the constraint does not prevent the proposed coordination mechanism from operating.
t = 1 T C t O B / T t = 1 T C t U B / T
This mechanism broadens the feasible price optimization range to ±40%, thereby improving the incentive for users to respond to price signals. Meanwhile, it imposes restrictions on operators’ pricing decisions so as to avoid excessively high tariffs that could undermine users’ willingness to participate in demand response.

2.3. Lower-Level Model—End Building Users

In residential building load classification, electricity demand can generally be grouped into two types according to consumption characteristics. The first type is rigid load, which is insensitive to electricity pricing policies and therefore cannot be actively adjusted. The second type is flexible load, whose operating behavior can be regulated under electricity price signals. Flexible loads can be further categorized into two groups: loads with energy storage potential, such as air conditioners and electric water heaters, and schedulable appliances with time-shifting capability. In this study, washing machines and dishwashers are taken as representative examples of the latter category for analysis.
Rigid load mainly comprises lighting systems, entertainment appliances, cooking equipment, and other conventional household electrical devices. Since this portion of demand is not directly responsive to electricity price incentives, it is typically treated as uncontrollable in the load scheduling framework. In engineering practice, the forecasting of rigid load is commonly performed by combining the building area with the hourly utilization factor, together with an error-correction component to better reflect actual consumption characteristics. Accordingly, for an individual residential user, the predicted uncontrollable rigid load power at time t can be formulated as follows:
P 1 , t b , L _ f = p e , t × L 1 + E 1 × S 1
For uncontrollable rigid loads, the actual operational probability during interval t, incorporating forecast uncertainties, is reflected by the hourly utilization factor p e , t . The spatial energy intensities are defined by the power density parameters L 1 for illumination systems and E 1 for miscellaneous household appliances, both expressed in k W / m 2 . These intensity metrics are subsequently scaled by S 1 , which corresponds to the effective usable floor area of the residential unit in square meters.

2.3.1. Building Thermal Dynamic Model of Integrated Air Conditioning System

Heat exchange between buildings and the external environment mainly occurs through three processes, namely conduction, convection, and radiation. The corresponding heat transfer modes are presented in Figure 2.
The resistance–capacitance (RC) network model has been widely applied in building thermal analysis because it can effectively characterize thermal dynamic behavior while maintaining sufficient modeling accuracy [36]. By using the RC framework, the thermal resistance and heat storage properties of buildings can be incorporated into the mathematical model of the indoor thermal zone. Specifically, walls and indoor air are modeled as thermal energy storage units, whose stored heat is determined by their respective mass and specific heat capacity. At the same time, heat exchange between the building and the outdoor environment occurs through these storage units, and the indoor temperature is mainly governed by conduction, radiation, and convection processes associated with the internal and external air environments.
Figure 3 presents the wall structure of the building. In the RC network framework, a single-sided wall without windows is modeled by three thermal nodes, corresponding to indoor air, outdoor air, and the wall itself. Under this condition, heat transfer is primarily governed by the thermal resistance of the wall. When windows are present, the effective wall area should be reduced by the corresponding window area. Moreover, for a wall with windows, heat exchange takes place through two parallel paths: one through the thermal resistance of the wall itself and the other through the thermal resistance of the window.
Based on the RC network approach, a more detailed building thermal dynamic model that accounts for building thermal inertia can be established, as illustrated in Figure 4. Each indoor zone is treated as an independent thermal unit, where heat transfer is represented by thermal resistance and heat storage is described by thermal capacitance. An air-conditioning system is incorporated into each zone to maintain the indoor temperature within the required comfort range. Although the zones are assumed to have similar envelope parameters for model simplification, their cooling demands are calculated at each discrete time interval according to their own indoor thermal states and boundary conditions. Therefore, the total air-conditioning load is obtained by summing the time-synchronized zone loads at interval t, rather than by directly summing the individual peak loads of all zones. This treatment avoids the overestimation caused by assuming that all indoor zones reach peak cooling demand simultaneously. In practical applications, a zone-level diversity factor can be further introduced when more detailed occupancy and orientation data are available.
According to the mathematical model of the indoor zone, the thermal balance equations for the wall located between nodes is given as follows:
C w a l l , i j ( T w a l l , i j , t + 1 T w a l l , i j , t ) = Δ t ( j N w a l l T j , t T w a l l , i j , t R w a l l , i j + q i j v i j A w a l l , i j Q r a d , i j , t )
Within this thermal balance constraint, the inherent thermal storage capability of the building envelope is captured by the wall’s heat capacity, C w a l l , i j . This parameter must be dynamically assessed depending on whether the structural segment incorporates fenestration. The set of nodes physically adjacent to the wall is grouped under N w a l l . The real-time temperature of the wall entity itself is specified as T w a l l , i j , t , while the corresponding temperature of the neighboring node is defined as T j , t . The impedance to heat transfer across the envelope is denoted by R w a l l , i j , a variable whose magnitude also fundamentally depends on the presence or absence of windows. To account for environmental heat gains, the binary indicator q i j determines solar exposure, activating with a value of 1 under direct sunlight and remaining 0 otherwise. The solar-radiation correction coefficient of the wall is denoted by v i j , which reflects the effective absorption of incident solar radiation by the corresponding envelope surface. The physical area of the wall surface irradiated is designated as A w a l l , i j , serving as the effective absorption plane. Consequently, the solar irradiance striking this specific orientation is quantified by Q r a d , i j , t .
The selection of thermal resistance and capacitance parameters is critical for accurately characterizing the building’s thermal inertia. In this model, the thermal resistance R w a l l , i j is determined by the ratio of the envelope structure’s thickness to the product of its thermal conductivity and surface area. The thermal capacitance C w a l l , i j is calculated as the product of the material’s density, specific heat capacity, and volume. These physical parameters are selected according to the standard thermal design codes for civil buildings, ensuring that the simulation reflects the realistic heat transfer delays and storage capabilities of the building envelope.
The thermal resistance and capacitance parameters are adopted from the RC-network modeling framework for intelligent buildings [36]. In this framework, the building envelope and indoor air are represented by thermal storage nodes, while wall/window heat-transfer paths are represented by thermal resistance. The window-related heat-transfer term and solar-radiation term are also retained following the same RC model structure. Therefore, the parameters in the thermal balance equations are used as representative simulation parameters to describe building thermal inertia, rather than case-specific calibrated parameters. As a validation check, the simulated indoor-temperature trajectory is required to remain within the prescribed comfort band, and the qualitative load-shifting behavior is compared with published RC-model demand response results. Case-specific calibration against measured indoor temperature or EnergyPlus (U.S. Department of Energy, Washington, DC, USA) simulation is not performed in this study and is identified as a limitation.
The thermal balance constraint for indoor zone can be expressed as follows:
C r o o m , k ( T r o o m , k , t + 1 T r o o m , k , t ) = Δ t [ j N r o o m T w a l l , i j , t T r o o m , k , t R w a l l , i j + Q i n t , k , t + π i j j N w a l l T j , t T r o o m , k , t R w i n , i j + π i j w i j A w i n , i j Q r a d , k , t + m r o o m , k , t C p ( T s u p p l y , k , t T r o o m , k , t ) ]
For the indoor thermal dynamic equilibrium, the aggregated heat capacity of the specific room k is represented by C r o o m , k . The instantaneous indoor air temperature is tracked via T r o o m , k , t . The spatial connectivity is modeled using N r o o m , which contains all adjacent thermal nodes. Regarding the active cooling or heating intervention, the mass flow rate of the conditioned air delivered by the HVAC unit is given as m r o o m , k , t , possessing a specific heat capacity of C p . The temperature of this supply air stream is designated as T s u p p l y , k , t . To model structural variations, the existence of fenestration is controlled by the binary parameter π i j , which equals 1 if a window is present and 0 otherwise. The physical properties of these windows are defined by their optical transmittance, w i j , and their total effective surface area, A w i n , i j . Solar heat gains entering through these transparent surfaces are driven by the directional light intensity, Q r a d , k , t . Internal thermal disturbances generated by occupants or appliances are consolidated into the variable. Finally, the concluding composite term in the equality mathematically resolves the net sensible heating or cooling capacity injected into the space by the air conditioning system.
The indoor comfort bounds are imposed as hard constraints in the lower-level optimization. No slack variables or comfort-violation penalties are introduced in the deterministic model. If the forecasted outdoor temperature or load condition would make these bounds infeasible, the corresponding schedule is rejected by the solver rather than accepted with a penalty. Thus, constraint violations are prevented under the deterministic forecasts used in this paper, while uncertainty-aware feasibility is left for future robust optimization work.
The present RC model describes sensible heat balance only. Latent load and humidity dynamics are not explicitly represented. If humidity is high or if occupants require a narrower comfort band, the available pre-cooling margin will decrease because additional HVAC operation may be needed for dehumidification or tighter temperature control. Consequently, the demand response potential reported here should be interpreted as an upper-bound flexibility estimate under the specified sensible-temperature comfort constraints.
Physically, Equation (12) establishes the thermodynamic equilibrium for indoor zone k . The left-hand side of the equation quantifies the heat accumulation within the indoor air mass over the time step. The right-hand side decomposes the influential heat fluxes into five distinct components: the first term represents the convective heat transfer exchanged with the inner surfaces of adjacent walls; the second term accounts for thermal conduction through window glass (applicable where π i j = 1); the third term calculates the solar heat gain transmitted directly through transparent fenestration; the fourth term ( Q i n t , k , t ) aggregates internal heat loads generated by occupants and equipment; and the final term corresponds to the active cooling or heating power supplied by the air conditioning system to regulate the indoor temperature.
According to the thermal dynamic model established for an individual indoor zone, the operating power of the air-conditioning system in that zone can be determined. The total air-conditioning load of the building, denoted as n = 1 N P n , t b , L _ a , is then obtained by aggregating the air-conditioning loads of all indoor zones. On this basis, the flexibility of the user comfort temperature range can be effectively utilized to further enhance the demand response capability of the building air-conditioning system.

2.3.2. Demand Response Model of Water Heater

Residential hot water demand exhibits evident uncertainty and strong time-varying characteristics. Due to differences in daily routines, occupancy patterns, and living habits, the timing and intensity of household hot water use often fluctuate significantly over the course of a day. In [37], the daily water-use frequency of 2004 households was statistically analyzed to extract representative group-level water-use behaviors, providing an empirical basis for describing residential water consumption patterns and hot water demand characteristics. The results showed that household hot water usage is mainly concentrated in two periods, namely 6:00–8:00 in the morning and 19:00–22:00 in the evening. Moreover, the deviation between the actual water-use time and the corresponding peak period is generally within 1 h, indicating a certain degree of regularity despite the randomness of individual behavior. Based on these findings, this study further constructs hot water demand curve models for three representative categories of users, as illustrated in Figure 5, so as to more accurately reflect the diversity of residential hot water consumption in the subsequent optimization analysis.
According to the graphical results, the hot water demand characteristics of the three representative user groups can be summarized as follows. Type 1 users generally remain at home for most of the day, and their peak hot water usage in the morning and evening appears relatively early, which is in line with the lifestyle of elderly residents. Type 2 users show almost no obvious hot water demand during 9:00–16:30, reflecting the typical daily routine of office workers. Type 3 users exhibit a combined pattern of the first two groups, representing a mixed demand profile associated with both home-staying and working residents.
Within the bi-level optimization framework, the diversity in electricity price responsiveness among different categories of hot water users is further taken into account. Accordingly, the lower-level model is established with the objective of minimizing the total energy cost of residential building clusters. Specifically, by describing the price sensitivity characteristics of each user type, an objective function aimed at minimum overall energy expenditure is formulated, which enables a more refined representation of user electricity consumption behavior and supports cost-effective optimization for residential building clusters.
min π = t = 1 T C t O B n = 1 N P n , t b , L Δ t
A storage-type electric water heater is equipped with an autonomous temperature control function. When the water temperature decreases because of hot water consumption or heat loss to the surrounding environment, the heater is activated automatically. Specifically, once the water temperature falls to the lower limit of the user-defined comfort range, the unit is switched on and operates at rated power until the temperature reaches the upper preset limit, after which it enters the heat-preservation mode. During this stage, the electricity consumption can be considered negligible. Through this cyclic operation, the water temperature is maintained within the desired comfort interval.
In this study, the thermal dynamic behavior of the electric water heater is characterized by the following assumptions. The heating stage is powered by the main circuit at rated power, whereas the heat-preservation stage is treated as a low-power standby condition. The temporal evolution of water temperature is described by a first-order differential equation, which can be expressed as follows:
T t + 1 e w h = T t e n ( T t e n T t e w h ( W w t ) + T t e n w t W ) e Δ t / R e w h C e w h + μ t ewh P e w h R e w h ( μ t ewh P e w h R e w h ) e Δ t / R e w h C e w h
Tracking the thermal state of the electric water heater, the instantaneous temperature of the stored water at interval t is denoted by T t e w h . The external environment surrounding the appliance exhibits an ambient temperature of T t e n . The unit’s rated electrical heating capacity is defined by P e w h . The thermodynamic insulation and storage properties of the tank are governed by its structural thermal resistance, R e w h , and its heat capacity, C e w h . The total volumetric water capacity of the internal tank is specified as W, while the actual volume of hot water extracted by the user during the time step is quantified as w t . To regulate the active heating cycle, the binary variable μ t e w h is implemented; assigning a value of 0 transitions the equipment into a passive insulation phase, whereas a value of 1 triggers the active heating mechanism.
Here, w t denotes the extracted hot-water volume at interval t. In the case study, w t is obtained by discretizing the representative hot-water demand curves in Figure 5 according to the 15 min scheduling interval.
To avoid unrealistic high-frequency actuation, the binary heating variable is updated only on the 15 min scheduling grid and a minimum dwell time of two consecutive intervals is imposed after a state transition. This filtering rule suppresses isolated one-period on/off oscillations while preserving the ability of the water heater to respond to morning and evening hot-water peaks.
To ensure a satisfactory user experience during hot water usage, the internal water temperature of the storage-type electric water heater should be maintained within a predefined comfort range. In practical operation, this requirement means that the water heater must continuously satisfy the user’s temperature comfort constraints while responding to external control signals. Specifically, the device regulates its heating process in a dynamic manner so that the stored water temperature remains within the preset acceptable interval at all times, thereby achieving a balance between user comfort and operational flexibility:
T e w h , m i n T e w h T e w h , m a x
To guarantee user satisfaction, the operational limits of the stored water are strictly bounded by a lower thermal comfort threshold, T e w h , m i n , and an upper permissible temperature boundary, T e w h , m a x . Mathematically, the impact on user thermal comfort is strictly bounded by Equation (15). This inequality acts as a hard constraint in the lower-level optimization, ensuring that the water temperature T tan k , t never drops below the user-defined comfort threshold T min nor exceeds the safety limit T max during the load-shifting process. Thus, economic optimization is only executed within this guaranteed comfort tolerance.
Once the storage electric water heater is activated, it operates under the rated heating power. Therefore, based on the operating state of the device at time t, the power consumption of an individual electric water heater, denoted as P 1 , t e , e w h is formulated as follows:
P 1 , t e , e w h = μ t e w h P e w h
For the community-scale residential cluster, the modeling framework categorizes the hot water consumption patterns into three distinct user profiles. Consequently, the real-time electrical power drawn by individual water heaters corresponding to these profiles is designated as P n , t e , e w h , 1 , P n , t e , e w h , 2 , and P n , t e , e w h , 3 . The population distribution across these behavioral groups is represented by the sub-totals N 1 , N 2 , and N 3 , which cumulatively sum to the aggregate community user base, N.

2.3.3. Equipment Model with Adjustable Time Shift Characteristics

For transferable electric loads, the scheduling characteristics of washing machines and dishwashers differ. The operating time of washing machines is generally determined flexibly by users and is not subject to strict time constraints. In contrast, the operation of dishwashers is closely associated with meal times: they are typically started after meals and must complete the entire washing cycle before the next meal. In residential settings, users can define both the start time and the completion deadline of these appliances according to their actual needs. Within this allowable time window, the equipment may be activated at any moment, provided that the full operating cycle can be completed. On this basis, Ref. [38] establishes the following operating constraints:
t = t s d w t e d w 1 u 1 , t d w = T d w
t = t s w m t e w m 1 u 1 , t w m = T w m
t = k + 1 k + T d w u 1 , t d w T d w u 1 , k + 1 d w u 1 , k d w , k t s d w 1 , t e d w T d w 1
t = k + 1 k + T w m u 1 , t w m T w m u 1 , k + 1 w m u 1 , k w m , k t s w m 1 , t e w m T w m 1
Similarly, the delay tolerance for shiftable appliances is explicitly formulated through the temporal boundaries in Equations (17)–(20). For each appliance, the earliest allowable start time and latest completion time define the user-approved service window. The start variable can be selected only if the complete operating cycle can finish before the deadline, and the corresponding binary running-state variables enforce continuous operation once the appliance is activated. Therefore, the optimization shifts appliance use only within the user’s declared tolerance and does not split or truncate a required cycle.
For each transferable appliance, the user submits an earliest allowable start time, a latest completion time, and a required operating duration τ a . The start variable s a , n can take any discrete value in the interval from the earliest start to the latest start that still allows the full operation to finish before the deadline. Once started, the appliance must run continuously for τ a intervals. Therefore, the constraints enforce the rule ‘start anytime within the user-approved window, but complete the full task before the deadline’ rather than allowing fragmented or unfinished operation.
The active execution status of the flexible appliances is tracked using discrete operational flags. Specifically, u 1 , t d w dictates the running state of the dishwasher, while a parallel binary variable u 1 , t w m controls the washing machine. For both indicators, an assignment of 1 confirms active operation and 0 denotes an idle state. The total uninterrupted duration required to fulfill their respective cleaning tasks is defined by the fixed operating cycles T d w for the dishwasher and T w m for the washing machine. Furthermore, user-defined scheduling windows impose strict temporal boundaries: t s establishes the earliest permissible activation time, and t e acts as the absolute deadline by which the appliance must complete its cycle.
When the washing machine and dishwasher are started, the equipment will maintain rated power for continuous operation. Based on the start and stop state of the equipment at time t, the comprehensive electrical load of the user’s washing machine and dishwasher at time t can be described as
P 1 , t b , L _ c = u 1 , t d w P d w + u 1 , t w m P w m , t [ t s , t e 1 ]
When these appliances are activated, they draw a constant electrical load, which is quantified by the nominal operating power parameters P d w for the dishwasher and P w m for the washing machine.
The composite power profile of the residential community is mathematically formulated by aggregating the device-specific behavioral models and their scheduling boundaries established in the preceding sections. By integrating rigid loads, thermally flexible loads, and time-shiftable appliance loads into a unified framework, the total electricity demand of the residential building cluster can be expressed by the following mathematical relationship:
n = 1 N P n , t b , L = ( n = 1 N 1 P n , t e , e w h , 1 + n = 1 N 2 P n , t e , e w h , 2 + n = 1 N 3 P n , t e , e w h , 3 ) + n = 1 N P n , t b , L _ a + n = 1 N P n , t b , L _ f + n = 1 N P n , t b , L _ c

3. Solving Model

3.1. Solving Algorithm

This study develops a hierarchical bi-level optimization framework designed to coordinate the conflicting objectives between a community energy operator and its residential users. The upper-level model represents the operator’s decision-making process, where the primary goal is to maximize profit by formulating dynamic retail electricity prices. These prices are adjusted in real-time based on the volatility of the wholesale market procurement costs and the forecasted aggregate load of the community.
Conversely, the lower-level model characterizes the demand-side response. In this layer, individual users act as rational economic agents who receive the price signals from the operator and subsequently reconfigure their energy consumption patterns. By shifting flexible loads or modulating the duty cycles of thermal appliances, users aim to minimize their total energy expenditure while maintaining a baseline level of thermal comfort and lifestyle convenience.
C t O B k C t O B k 1 C t O B k σ
Within the algorithmic convergence criteria, the acceptable margin of error determining equilibrium is defined by the tolerance parameter σ . The progression of the decoupled solving process is tracked by the iteration counter, k .
The algorithm proceeds iteratively as outlined below:
Step 1: Parameter initialization. The upper-level decision variable is first initialized at the lower bound of the predefined optimization interval. Based on this initial price setting, the lower-level problem is solved with the objective of minimizing user energy expenditure, thereby obtaining the corresponding initial power load. Meanwhile, the iteration counter is initialized as k = 1 .
Step 2: Upper-level optimization. Using the initial load profile returned by the lower level, the upper-level objective function is solved to obtain an updated decision variable. This step represents the process by which the energy operator adjusts its supply-side strategy according to the load response characteristics of users.
Step 3: Lower-level response update. The updated upper-level decision variable is then transmitted to the lower-level model as a new price signal. In response, users optimize their electricity consumption behavior under the revised pricing parameters, yielding an updated load profile. This step reflects the dynamic adjustment process of user demand response under changing price incentives.
Step 4: Convergence check. The convergence condition is subsequently examined. Specifically, it is checked whether the iteration number has reached the preset maximum value, or whether the variations in the upper- and lower-level variables satisfy the convergence criterion, such as the difference between two consecutive iterations falling below a specified threshold. If either condition is met, the iterative procedure is terminated and the bi-level equilibrium solution is obtained. Otherwise, the iteration counter is updated as k = k + 1 , and the process returns to Step 2 until convergence is achieved. The convergence of the nested iterative algorithm is evaluated using the change in the operator’s electricity selling price vector between two consecutive iterations. Specifically, after the lower-level users update their demand response schedules and the upper-level operator obtains a new price vector, the relative change in the price vector is calculated as C t O B k C t O B k 1 / C t O B k . The iteration terminates when this relative change is smaller than the preset tolerance threshold, or when the maximum number of iterations is reached. In the implemented program, the maximum iteration number is set to 1000. The aggregated load profile is recalculated and fed back to the upper level in each iteration, but the stopping criterion is based on the stability of the electricity selling price vector, which is the main coupling decision variable between the two levels.
Through the iterative interaction between the upper- and lower-level models, together with continuous information exchange, the proposed algorithm achieves coordinated optimization between the economic objectives of energy operators and the energy-use requirements of users, ultimately yielding an optimal strategy combination that balances the benefits of both parties.
Because the lower-level problem contains binary appliance-state variables and the upper-level price decision is updated iteratively, the reported solution should be interpreted as a converged price-load fixed point of the implemented Stackelberg-type iterative scheme. It is not claimed to be a globally unique Stackelberg equilibrium for all possible initializations. In the deterministic case study, convergence of both the price vector and the returned aggregate load profile indicates that neither level changes its decision under the final exchanged information, so the result represents a locally consistent operational solution for the stated model assumptions.
The solution process is shown in Figure 6.

3.2. Model Linearization Strategy

To improve the computational efficiency of the distribution network optimization model, this study adopts a linearization method to deal with the nonlinear quadratic terms appearing in the power flow equations. For the distribution network power flow constraints given in (24)–(26), the nonlinear components are simplified based on two engineering approximation assumptions. First, since the line loss term is generally much smaller than the nodal active power and reactive power under practical operating conditions, this nonlinear term is neglected. While this simplification introduces a minor truncation error regarding the total power consumption accuracy, the trade-off is justified for the following reasons: (1) in low-voltage community distribution networks, the network loss typically accounts for a very small proportion of the total power flow, having minimal impact on voltage magnitude; and (2) retaining the quadratic term would make the constraints non-convex. By linearizing the model, the non-convex optimal power flow (OPF) problem is transformed into a convex Second-Order Cone Programming (SOCP) or Linear Programming (LP) problem. This convexity ensures the stability and rapid convergence of the iterative algorithm in the proposed bi-level framework. Second, considering that voltage fluctuations in distribution networks are usually limited within a small range, the nodal voltage deviation is assumed to satisfy. Under this assumption, the quadratic voltage term can be approximated, thereby converting the second-order term into a linear form. Through the above approximations, the original nonlinear power flow constraints of the distribution network can be reformulated into linear expressions, which substantially improves the computational efficiency of the model while preserving its main physical characteristics.
The linearization is applied to a radial low-voltage community distribution network. In the simulated four-node case, the feeder is modeled as a single-direction radial structure, which is consistent with the power-flow equations used in Section 2.2.1. Under the tested load levels, voltage deviations remain within the prescribed limit, and the line-loss term is small relative to the nodal active and reactive power. Therefore, neglecting the nonlinear loss term and approximating the quadratic voltage term introduce only limited error while improving computational tractability. Meshed-network operation and severe voltage-instability conditions are beyond the scope of the present model and are discussed as limitations.
P n + 1 = P n P n + 1 l o a d
Q n + 1 = Q n Q n + 1 l o a d
V n + 1 = V n r f P n + x f Q n V 0
To validate the technical soundness of these linear approximations, the proposed linearized formulation was benchmarked against a nonlinear AC power-flow calculation in MATLAB (R2024b) using the same radial feeder topology, load allocation, and reactive-power assumption. The error analysis showed that the maximum nodal-voltage discrepancy remained below 0.005 p.u. across the evaluated operating conditions. In addition, neglecting the line-loss term introduced a relative error of less than 1.5% in the calculation of the operator’s aggregate active-power procurement. These results support the use of the linearized power-flow model for the present community-level scheduling study, while detailed validation under meshed feeders, inverter reactive-power control, and severe voltage-instability conditions is left for future work.

4. Example Analysis

The community energy system network architecture is illustrated in Figure 7. The distribution network consists of four nodes, with nodes 1 through 4 serving 10, 8, 6, and 6 buildings, respectively, encompassing a total of 1200 households. Following the scenario assumption adopted in the original model, the proportions of Type 1, Type 2, and Type 3 users are set as 25%, 35%, and 40%, respectively. These proportions are used to represent three typical residential hot-water demand patterns and to test the response characteristics of heterogeneous users, rather than census-calibrated demographic statistics. To facilitate operator profitability, the electricity procurement price from the superior grid is set slightly below the standard benchmark price offered to end-users, as detailed in the price structure shown in Figure 8.
The four-node feeder is used as a transparent test system for the bi-level scheduling mechanism. The validation calculation uses the same topology and load allocation as the optimization model, with the source node supplying the downstream residential nodes through radial branches. Active-power schedules are produced by the demand response optimization, and reactive power is calculated from the fixed power-factor assumption described in Section 2.2.1.
In this study, the base scheduling grid is 15 min, yielding 96 intervals per day. The dynamic electricity price is optimized as an hourly piecewise-constant signal: one price value is assigned to each hour and applied unchanged to the four 15 min intervals within that hour. User-side devices, including electric water heaters and HVAC systems, can still update their operating states every 15 min. Therefore, no interpolation is used between hourly price values; the price vector is expanded from 24 hourly values to 96 interval values before it is passed to the lower-level optimizer. The predicted rigid electrical load of the system is shown in Figure 9. Regarding user-side flexible loads, each household is assumed to be equipped with one washer–dryer and one dishwasher. The washer–dryer is permitted to run once per day without a fixed start time, allowing its operation to be arranged within the optimization framework. The dishwasher, however, is constrained to operate twice daily, with admissible time windows of 9:00–17:00 and 20:00–6:00 on the next day. These assumptions are introduced to approximate realistic residential appliance usage patterns and to provide a practical basis for evaluating the coordinated scheduling performance of the proposed demand response strategy. The rated power specifications and representative operating cycles of these appliances are listed in Table 2. These parameter settings are determined with reference to the operating characteristics of typical residential appliances reported in [39], so as to ensure that the simulation remains consistent with realistic household electricity consumption patterns. After the washing process is completed, the washing machine automatically enters the drying stage.
The operator optimizes on the basis of category-level aggregated flexibility rather than detailed private schedules of every individual household. The three demographic categories provide representative hot-water and appliance-use patterns, and their optimized responses are scaled by the number of households in each category. This aggregation protects user privacy and reduces computation time, but it may smooth individual heterogeneity and weaken the precision of the price signal. The effect is acceptable for community-level scheduling, whereas individual-level behavioral learning is reserved for future work.

4.1. Operator Results Analysis

The proposed dynamic pricing mechanism achieves supply–demand equilibrium by synchronizing operator responses with user consumption patterns and wholesale grid prices. As illustrated in Figure 9 and Figure 10, operators benefit from lower procurement costs during off-peak windows (09:00–16:00 and 00:00–04:00), coinciding with reduced user demand. During these intervals, the sale price is set at the lower optimization bound to stimulate demand while maintaining profitability. Conversely, during morning (06:00–08:00) and evening (18:00–22:00) peaks—where electric water heater usage and rigid loads surge—the price is adjusted toward the upper optimal limit. This time-of-use strategy offsets off-peak revenue gaps and ensures operator profitability while remaining within government-mandated average price constraints.

4.2. User Results Analysis

The intelligent controller for flexible loads utilizes a combination of user consumption habits and dynamic pricing curves provided by the system operator. By applying optimization algorithms, the controller determines the ideal operational periods for household appliances. While adhering to the users’ fundamental living requirements, the system autonomously modulates the duty cycles of interruptible loads based on time-of-use (TOU) signals. This dual-objective approach minimizes individual energy expenditures while simultaneously facilitating peak shaving and valley filling for the broader grid.

4.2.1. Response Results of Integrated Air Conditioning System Building Demand

Under the combined effects of dynamic electricity pricing and ambient temperature variation, the operation of air-conditioned buildings exhibits clear temporal and operational flexibility, as illustrated in Figure 11 and Figure 12. Specifically, the building cooling load can be adjusted in advance or delayed within an acceptable comfort range, so that the air-conditioning system is able to respond to price signals while taking advantage of the thermal inertia of the building envelope. This feature provides important support for load shifting and demand-side optimization:
(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.
Overall, the results demonstrate that price-guided building-side response can effectively improve load allocation and optimize the temporal distribution of electricity consumption. Nevertheless, during periods dominated by rigid comfort demand, load adjustment capability remains limited, and priority must still be given to maintaining the thermal comfort requirements of critical indoor zones. Therefore, the coordinated control strategy should balance economic objectives with user comfort constraints to ensure both operational efficiency and practical applicability.
The temperature range shown in Figure 11 represents the allowable control band used in the simulation. Although the full plotted range extends from approximately 18 °C to 28 °C, the optimized indoor temperature is constrained within the predefined comfort limits during occupied periods. The lower values mainly occur during pre-cooling intervals, while the upper values occur near the relaxation boundary before HVAC operation is triggered. In practical operation, the comfort band can be narrowed according to local standards or occupant preferences, for example, to 24–26 °C in cooling-dominated conditions.
Furthermore, the robustness of the proposed model against variations in building physical parameters was analyzed. Thermal inertia, represented by the wall heat capacity ( C w a l l ), is a key factor influencing demand response potential. In scenarios with higher thermal inertia, the building can store more thermal energy, allowing the HVAC system to remain off for longer durations during peak price periods without violating comfort constraints ( T r o o m ). This leads to greater load shifting flexibility and lower user costs. Conversely, in buildings with lower thermal inertia, the indoor temperature fluctuates more rapidly, forcing the HVAC system to operate more frequently to maintain comfort, thereby narrowing the flexible scheduling window. Crucially, the proposed lower-level optimization model (Equation (12)) dynamically adapts to these parameter variations. Regardless of whether the thermal inertia is high or low, the algorithm effectively solves for the optimal on/off strategy that minimizes cost while strictly satisfying the temperature constraints, thereby verifying the model’s robustness and adaptability to different building types.
To discuss the robustness of the proposed demand response mechanism with respect to building thermal characteristics, we added a qualitative sensitivity analysis based on the role of thermal inertia in the RC model and the comfort-temperature interval. Buildings with larger thermal capacitance can maintain indoor temperature for a longer period after pre-cooling, thereby providing a wider load-shifting window. Conversely, buildings with lower thermal inertia experience faster indoor temperature rebound and require more frequent HVAC operation. In addition, the comfort-temperature interval affects the available flexibility: a wider comfort interval provides more scheduling freedom, while a narrower interval reduces the adjustable HVAC load. A quantitative parameter-calibration-based robustness experiment will be conducted in future work when measured building thermal data are available.

4.2.2. Water Heater Demand Response Results

Under the combined influence of dynamic pricing and hot water demand, the operational strategies for the three user categories exhibit distinct temporal patterns:
(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.
The results indicate that price-signal-driven demand response on the user side can effectively mitigate peak load. However, during periods dominated by rigid demand, priority should still be given to maintaining service quality.

4.2.3. Time Shift Characteristics Can Adjust Equipment Demand Response Results

Driven by the dynamic electricity price mechanism, the operation strategies of washing machines and dishwashers show clear time-shifting characteristics, as summarized in Table 4. The dishwasher is scheduled twice within its admissible windows: one cycle is arranged at 0:00–1:00 during the overnight low-price period, and the other is arranged at 15:00–16:00 during the daytime low-price period. The washing machine is modeled as a continuous washer–dryer task with a three-hour cycle. To remove ambiguity, the optimized cycle is reported as 0:00–3:00: the washing stage operates from 0:00 to 1:00, and the drying stage operates from 1:00 to 3:00. This schedule is fully consistent with the stated operating cycle and ensures that the high-power drying process is placed in the lowest-price interval.
(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.
The research shows that the user-side adjustable load can effectively realize the dual optimization of demand response and economy under the premise of ensuring the quality of life service through the time–space coupling with dynamic electricity price.

4.3. Comparative Example

This paper constructs three comparative examples to verify the effectiveness of the two-level optimization method (Table 5):
Scenario 1: Bi-level optimization. Using the two-tier optimization framework proposed in this paper, the pricing strategy of operators and the response of users’ electricity demand form a dynamic interaction. Operators fully consider the response ability of the user side to the price signal when setting the electricity selling price, and steer users to modify their electricity consumption patterns via pricing signals. Users dynamically optimize the operation time of water heaters, washing machines and other equipment according to the real-time electricity price, so as to realize the collaborative optimization of demand side resources and supply side prices.
Scenario 2: fixed price range. The operators set the selling price as a fixed range [ 0.6 C t U C ~ 1.4 C t U C ] , but a quantitative analysis of users’ demand response ability was not included in the pricing process. Although users can still adjust their electricity consumption behavior according to the electricity price, the pricing decision of operators is completely based on the upper power purchase cost and historical data, and the price load feedback mechanism is not established, forming a one-way decision-making mode.
Scenario 3: no response from fixed price. The operator adopts a constant electricity selling price ( 1.11 C t U C ) , and the user side completely loses its demand response ability. The electric water heater is mechanically started and stopped according to the water demand. The operation period of the washing machine and dishwasher is completely determined by the user subjectively. The equipment cannot transfer the load according to the electricity price signal, showing the typical characteristics of rigid load. This scenario is a traditional benchmark comparison model without an interactive mechanism.
Through the comparative analysis of three examples, the system verifies the effectiveness of the bi-level optimization model in balancing the revenue of operators and the energy cost of users, and tapping the potential of demand-side response.
Table 6 systematically presents the quantitative comparison results of the economic benefits of energy operators and the total cost of electricity at the user side under three comparison scenarios. Figure 14 further reveals the dynamic response relationship between operators’ revenue and users’ electricity costs through sensitivity analysis of 18 groups of different pricing strategies within the electricity sales price range [ 0.6 C t U C ~ 1.4 C t U C ]
To validate the advantages of residential participation in electricity pricing, this study employs a comparative scenario analysis. Quantitative data from Table 5 and Figure 14 reveal a distinct negative correlation between user energy expenditures and operator profitability; specifically, higher costs for users correspond to increased income for the operator. In Scenario 2, pricing is inversely tied to the primary interests of each stakeholder, where higher rates favor the operator and lower rates benefit the consumer. Conversely, the mechanism in Scenario 1 harmonizes the demands of both parties. By utilizing a bi-level optimization model, Scenario 1 identifies an equilibrium within the fluctuations of Scenario 2, effectively balancing benefit distribution and achieving a mutually beneficial outcome for both operators and users.
The sensitivity analysis in Figure 14 uses 18 deterministic price-setting cases within the 0.6–1.4 admissible range. When the range is narrowed, the model still converges but the peak-shifting effect becomes weaker because the price signal provides less incentive. When the range is widened, flexible loads respond more strongly, but the dispersion of user costs and operator revenues increases. Therefore, the qualitative conclusion does not depend on the exact 0.6/1.4 factors, although those factors influence the economic distribution between the two parties. Because the present study uses deterministic load and weather inputs, random-seed variance is not reported; stochastic variance analysis is identified as future work.
The negative correlation between user expenditure and operator profitability is mainly driven by the admissible retail-price bounds, while load-shifting flexibility determines how much of this price incentive can be converted into actual demand redistribution. Under Scenario 2, the absence of a feedback mechanism makes the relationship more direct: higher tariff levels increase operator revenue and user cost simultaneously. Under Scenario 1, the lower-level response partially offsets this effect by shifting flexible demand toward low-price periods, so the bi-level equilibrium is located between the extreme points of Scenario 2.
To evaluate the specific benefits of demand response participation, this study compares the operational outcomes of Scenario 1 and Scenario 3. Utilizing a control variable approach to maintain consistent operator revenue across both cases, the results indicate a significant increase in user-side energy costs within Scenario 3. This spike is attributed to the lack of demand response capabilities, forcing users to maintain equipment operation during peak-price periods. Without the ability to dynamically adjust consumption behavior in response to price signals, users in Scenario 3 inevitably incur higher expenses. This contrast underscores the efficacy of demand response mechanisms in optimizing user-side energy costs.
In summary, this multi-scenario comparative analysis confirms that integrating user participation into electricity pricing—facilitated by a bi-level optimization model—effectively balances the interests of all market participants. Furthermore, the incorporation of demand response mechanisms significantly lowers user energy expenditures. Together, these strategies establish a highly efficient market environment characterized by a dynamic and synergistic interaction between supply and demand.

4.4. Computational Efficiency Analysis

The practical viability of the proposed framework was evaluated on a workstation equipped with an Intel Core i7-10700 CPU (2.90 GHz) (Intel Corporation, Santa Clara, CA, USA) and 16 GB RAM. In a standard scenario involving 1200 households across four nodes, the model achieved convergence in approximately 200 s over 16 iterations, with an average of 12.5 s per iteration. Given that this duration is well within the 15 min dispatch window, the approach is highly suitable for real-time scheduling. Scalability tests, spanning from 300 to 6000 households (1 to 20 nodes), demonstrate a near-linear increase in computational demand, as detailed in Table 7. This efficiency is primarily due to the linearization of distribution network constraints detailed in Section 3.2, which allows the resulting convex model to be solved rapidly via Gurobi (Gurobi Optimization, LLC, Beaverton, OR, USA).
The optimization model was implemented in MATLAB (R2024b) using YALMIP (Linköping University, Linköping, Sweden) and solved using Gurobi. In the program, the maximum number of nested iterations is set to 1000, and the absolute MIP gap parameter is set to 0.001. The number of binary variables increases with the number of representative users, appliance operating states, and scheduling intervals. Specifically, binary variables are used to describe the on/off states of the electric water heaters and shiftable appliances over the 96 time intervals.

5. Conclusions

A two-stage optimization approach is proposed to enhance community energy efficiency by integrating building thermal storage capacities with user-side demand response. This cooperative strategy aligns operator objectives with user requirements to streamline energy distribution. Based on the simulation analysis, the key findings are summarized below:
(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.
Although the bi-level framework demonstrates clear advantages, certain constraints persist. One primary limitation is the reliance on deterministic parameters for environmental factors and user habits, which may not adequately account for the inherent stochasticity of green energy output or load prediction inaccuracies. Furthermore, while the use of a linearized radial network model ensures rapid computation, it might oversimplify the intricate power flow dynamics found in complex meshed grids or under conditions of severe voltage instability.
Although the proposed framework is motivated partly by resilience enhancement under weather-driven supply–demand stress, the numerical case in this paper uses deterministic weather and load inputs and does not explicitly simulate extreme-weather events. Therefore, the current results should be interpreted as demonstrating deterministic operational flexibility rather than full stochastic resilience under extreme weather. Future work will introduce extreme-temperature scenarios, renewable-output uncertainty, and robust/stochastic optimization to evaluate resilience more comprehensively.
Future work will further improve the proposed framework by explicitly incorporating uncertainty into resilience-oriented operation.
The current framework’s reliance on deterministic parameters represents a fundamental limitation when evaluating true operational resilience. The present results demonstrate deterministic operational flexibility and supply–demand balancing under forecast inputs, but they should not be interpreted as a complete resilience assessment under extreme-weather uncertainty. Future iterations of this bi-level framework will integrate stochastic programming and robust optimization to account for worst-case extreme-weather scenarios, renewable-output uncertainty, and highly nonlinear user behavioral shifts.

Author Contributions

Conceptualization, H.Y., Y.L. and S.Z.; Methodology, H.Y., Y.L. and S.Z.; Validation, H.Y., Y.L. and S.Z.; Investigation, H.Y. and Y.L.; Resources, H.Y. and S.Z.; Writing—original draft, H.Y. and Y.L.; Writing—review and editing, H.Y., Y.L. and S.Z.; Supervision, H.Y.; Project administration, H.Y.; Funding acquisition, H.Y. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Scientific Research Project of Characteristic Laboratories in Colleges and Universities in Shandong Province: Green and Low-carbon Smart Heating and Cooling Technology Characteristic Laboratory (PT2022TS01).

Data Availability Statement

Data Availability Statement: The original contributions presented in this study are included in the article; further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as potential conflicts of interest. The original contributions presented in this study are included in the article; further inquiries can be directed to the corresponding author.

References

  1. 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).
  2. 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]
  3. 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]
  4. 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]
  5. 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]
  6. 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]
  7. 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]
  8. 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]
  9. 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]
  10. 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]
  11. Du, P.; Lu, N. Appliance commitment for household load scheduling. IEEE Trans. Smart Grid 2011, 2, 411–419. [Google Scholar] [CrossRef]
  12. 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]
  13. 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]
  14. 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]
  15. 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]
  16. 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]
  17. 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]
  18. 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]
  19. 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]
  20. 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]
  21. 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]
  22. 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]
  23. 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]
  24. 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]
  25. 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]
  26. 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]
  27. 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]
  28. Shang, D.R. Pricing of emergency dynamic microgrid power service for distribution resilience enhancement. Energy Policy 2017, 111, 321–335. [Google Scholar] [CrossRef]
  29. 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]
  30. 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]
  31. 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]
  32. 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]
  33. 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]
  34. 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]
  35. Lutz, J. Water Heaters and Hot Water Distribution Systems; Lawrence Berkeley National Laboratory: Berkeley, CA, USA, 2008; pp. 33–34.
  36. 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]
  37. 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]
  38. 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]
  39. 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]
Figure 1. Framework of the bi-level optimization model.
Figure 1. Framework of the bi-level optimization model.
Buildings 16 02381 g001
Figure 2. Heat exchange mode.
Figure 2. Heat exchange mode.
Buildings 16 02381 g002
Figure 3. Wall structure of buildings.
Figure 3. Wall structure of buildings.
Buildings 16 02381 g003
Figure 4. Schematic diagram of the thermal dynamic model for an indoor zone with an integrated air-conditioning system.
Figure 4. Schematic diagram of the thermal dynamic model for an indoor zone with an integrated air-conditioning system.
Buildings 16 02381 g004
Figure 5. Water demand curve of three users.
Figure 5. Water demand curve of three users.
Buildings 16 02381 g005
Figure 6. Solution flow chart.
Figure 6. Solution flow chart.
Buildings 16 02381 g006
Figure 7. Schematic diagram of the community energy system network structure.
Figure 7. Schematic diagram of the community energy system network structure.
Buildings 16 02381 g007
Figure 8. Comparison of electricity purchase prices for operators and users in the energy network.
Figure 8. Comparison of electricity purchase prices for operators and users in the energy network.
Buildings 16 02381 g008
Figure 9. Operator power purchase plan.
Figure 9. Operator power purchase plan.
Buildings 16 02381 g009
Figure 10. Optimized electricity selling price of operators.
Figure 10. Optimized electricity selling price of operators.
Buildings 16 02381 g010
Figure 11. Indoor temperature and air-conditioning power of representative rooms under price-guided pre-cooling.
Figure 11. Indoor temperature and air-conditioning power of representative rooms under price-guided pre-cooling.
Buildings 16 02381 g011
Figure 12. Aggregated indoor-temperature and air-conditioning power profiles showing the thermal buffering effect of buildings.
Figure 12. Aggregated indoor-temperature and air-conditioning power profiles showing the thermal buffering effect of buildings.
Buildings 16 02381 g012
Figure 13. Water-tank temperature profiles of the three representative user categories under dynamic-price response.
Figure 13. Water-tank temperature profiles of the three representative user categories under dynamic-price response.
Buildings 16 02381 g013
Figure 14. Relationship between operator revenue and user electricity cost under Scenario 1 and Scenario 2.
Figure 14. Relationship between operator revenue and user electricity cost under Scenario 1 and Scenario 2.
Buildings 16 02381 g014
Table 1. Feeder parameters and power-flow validation assumptions for the case study.
Table 1. Feeder parameters and power-flow validation assumptions for the case study.
ItemValue/Assumption Used in the Case Study
TopologyFour-node radial low-voltage community feeder
Load allocation10, 8, 6, and 6 buildings at nodes 1–4; 1200 households in total
Voltage limit0.95–1.05 p.u.
Reactive powerFixed lagging power-factor assumption for aggregated residential load
Validation referenceLinearized result compared with nonlinear AC power-flow calculation in MATLAB (R2024b) (The MathWorks Inc., Natick, MA, USA)
Table 2. Typical power and operating cycle parameters of the washing machine and dishwasher.
Table 2. Typical power and operating cycle parameters of the washing machine and dishwasher.
Electrical EquipmentRated Power/kWLoad Cycle/h
Washing machineWashBakeWashBake
0.51.812
Dishwasher11
Table 3. Approximate heating-activation intervals of the three water-heater user categories corresponding to Figure 13.
Table 3. Approximate heating-activation intervals of the three water-heater user categories corresponding to Figure 13.
User CategoryApproximate Heating-Activation Intervals Rounded from Figure 13
User 10: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 22: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 30: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
Table 4. The status of the user’s dishwasher and washing machine.
Table 4. The status of the user’s dishwasher and washing machine.
EquipmentOn
Washing machine0:00–3:00 (washing 0:00–1:00; drying 1:00–3:00)
Dishwasher0:00–1:00, 15:00–16:00
Table 5. Comparisons between three scenarios.
Table 5. Comparisons between three scenarios.
ScenarioElectricity Selling PriceIs the Upper Level
Optimized
Is the Lower Level
Optimized
1OptimizedYesYes
2 0.6 C t U B ~ 1.4 C t U B NoYes
31.11 C t U B NoNo
Table 6. Profits of the operator and costs of consumers.
Table 6. Profits of the operator and costs of consumers.
ScenarioOperator RevenueTotal User Electricity Cost
11376.49603.4
2[−2823.4, 4880.6][5684.2, 13,692.6]
31374.99874.6
Table 7. Computation time under different system scales.
Table 7. Computation time under different system scales.
System ScaleNumber of HouseholdsAverage Time per Iteration (s)Total Time (s)
1 Node3003.251.2
4 Nodes (Base Case)120012.5200.0
10 Nodes300034.1545.6
20 Nodes600071.51144.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.

Share and Cite

MDPI and ACS Style

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

AMA Style

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 Style

Yang, 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 Style

Yang, 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

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

Article Metrics

Article metric data becomes available approximately 24 hours after publication online.
Back to TopTop