Residential prosumers with rooftop photovoltaic systems and behind-the-meter batteries are changing the operating conditions of low-voltage and medium-voltage distribution feeders. When these resources respond independently to retail tariffs, their aggregate behavior can intensify reverse power flows, transformer loading, and voltage excursions. This paper proposes a bilevel optimization model that coordinates residential demand response, rooftop photovoltaic generation, and battery storage under distribution-feeder congestion constraints. The objective is to align prosumer economic decisions with distribution system operator requirements for congestion relief and voltage compliance. The upper-level problem represents the distribution system operator and minimizes feeder congestion, voltage deviations, and coordination costs. The lower-level problem represents residential prosumers that minimize their individual energy costs through load shifting, photovoltaic self-consumption, and battery dispatch. The proposed formulation produces coordinated schedules that reduce peak feeder loading and voltage violations relative to uncoordinated operation. Battery arbitrage and flexible demand are redirected from purely price-driven operation toward feeder-aware congestion mitigation. The bilevel coordination framework provides an operational method for managing residential distributed energy resources without replacing prosumer autonomy. It enables distribution system operators to procure flexibility while maintaining economically rational prosumer behavior.
Residential distribution feeders are increasingly populated by rooftop photovoltaic generation, controllable appliances, thermostatically controlled loads, and behind-the-meter batteries. These technologies allow households to reduce electricity bills through self-consumption, energy arbitrage, and demand response, but they also introduce new coordination challenges for distribution system operators. Prior work on coordinated prosumer energy management has shown that local economic optimization can interact strongly with network congestion when many households act simultaneously [1]. This paper treats that interaction as an explicit leader-follower optimization problem rather than as an exogenous operating condition.
Distribution-level coordination is difficult because the operator observes feeder constraints, whereas prosumers control the flexible assets that can relieve those constraints. Bilevel and transactive energy formulations have therefore become attractive for representing asymmetric decision authority between grid operators and price-responsive users [2]. Distribution locational marginal pricing has also been used to reflect congestion and voltage support needs in distribution networks [3]. However, a complete residential coordination model must link such price or incentive signals to the detailed operating constraints of photovoltaic systems, batteries, and flexible loads.
Uncoordinated residential batteries can flatten individual bills while producing feeder-level stress if many households charge during low-price periods or export during high-solar periods. Dynamic operating limits and grid-aware prosumer constraints have been proposed to preserve distribution network integrity under high distributed energy resource penetration [4]. Similarly, peer-to-peer and probabilistic distribution pricing studies show that prosumer transactions must remain compatible with network feasibility [5]. These findings motivate an optimization framework that embeds feeder congestion constraints directly into the coordination mechanism.
This article develops an original bilevel optimization model in which the distribution system operator acts as the upper-level leader and residential prosumers act as lower-level followers. The upper level minimizes congestion, voltage deviations, and flexibility procurement costs, while the lower level minimizes household energy costs under photovoltaic, storage, and comfort constraints. The structure follows the economic logic of demand response scheduling and residential energy management models, where appliance shifting and battery operation are optimized in response to prices [6]. The resulting mathematical program with equilibrium constraints is reformulated into a mixed-integer linear program suitable for computational validation on standard feeders.
Existing distribution optimization models often emphasize either network feasibility or prosumer economics, but not both within a single strategic formulation. Decentralized resource coordination frameworks can allocate distributed energy resources efficiently, yet they may not fully represent the strategic cost-minimizing response of residential households to operator signals [7]. Conversely, residential demand response models commonly capture flexible appliances and local energy costs, but they may simplify feeder congestion as a tariff effect rather than enforcing thermal and voltage constraints [8]. This separation limits their usefulness for operational congestion management.
A second gap concerns the treatment of rooftop photovoltaic generation and residential batteries under feeder constraints. Photovoltaic-battery studies have developed detailed sizing and operational models for self-consumption and arbitrage, but such models usually focus on household-level value rather than coordinated feeder relief [9]. Policy-oriented analyses of residential solar-plus-storage profitability similarly identify economic drivers without embedding distribution-network congestion constraints [10]. Therefore, a feeder-aware bilevel formulation is needed to determine when private storage schedules should be modified by operator incentives.
A third gap is methodological: bilevel distribution models must be computationally tractable while preserving the physics and economics that drive operational decisions. Previous transactive energy mechanisms have used bilevel structures and fairness regularization to coordinate distributed resources, demonstrating that operator-user interactions can be formalized mathematically [11]. Other work has applied trust-region and decomposition methods to compute distribution locational marginal prices under network constraints [12]. This article contributes a compact mixed-integer reformulation that integrates residential demand response, rooftop photovoltaic output, battery state dynamics, voltage bounds, and feeder congestion penalties in one model.
The system is a radial distribution feeder represented by a set of buses, lines, transformers, and residential prosumers connected at selected nodes. Each prosumer may own rooftop photovoltaic generation, a battery energy storage system, nonflexible demand, shiftable appliances, and thermostatically constrained demand. Distribution feeder constraints are modeled using a linearized branch-flow approximation consistent with congestion-management and voltage-support studies in distribution systems [3]. The operator coordinates these assets over a day-ahead scheduling horizon with subhourly or hourly time intervals.
The distribution system operator announces a feeder-aware incentive or congestion price to prosumers before they schedule controllable loads and battery operation. Prosumers respond by minimizing their own net energy cost, including grid imports, export compensation, battery degradation cost, and discomfort penalties, as in residential energy management and dynamic pricing formulations [6]. The DSO anticipates this response and chooses incentives that reduce line loading and voltage deviations while respecting budget or price bounds. This Stackelberg structure is consistent with transactive energy mechanisms in which operator-level prices coordinate self-interested distributed resources [2].
The model assumes that forecasts of baseline demand, photovoltaic availability, and wholesale energy prices are available for the scheduling horizon. Residential prosumers are price-responsive and solve convex lower-level scheduling problems, allowing the DSO to replace their optimality conditions with Karush-Kuhn-Tucker conditions in the single-level reformulation. Battery charging and discharging efficiencies, inverter ratings, and comfort limits are treated as known parameters derived from residential photovoltaic-battery scheduling studies [13]. Table 1 defines the notation used in the bilevel formulation and aligns the network, distributed energy resource, storage, comfort, and congestion variables used throughout the model.
Table 1. Nomenclature: Sets, Parameters, and Decision Variables
Category | Symbol | Description |
Sets and indices | Distribution buses and bus indices | |
Sets and indices | Distribution feeder lines or branches | |
Sets and indices | Residential prosumers | |
Sets and indices | Scheduling time intervals | |
Sets and indices | Shiftable appliances owned by prosumer (n) | |
Sets and indices | Bus at which prosumer (n) is connected | |
Network parameters | Resistance and reactance of line ((i,j)) | |
Network parameters | Apparent power rating of line ((i,j)) | |
Network parameters | Minimum and maximum squared voltage magnitude at bus (i) | |
Network parameters | Nonresidential active and reactive demand at bus (i) | |
Network parameters | Squared voltage magnitude at the substation bus | |
Price and penalty parameters | Retail import energy price | |
Price and penalty parameters | Export compensation price | |
Price and penalty parameters | DSO congestion incentive offered to prosumer (n) | |
Price and penalty parameters | Maximum allowable congestion incentive | |
Price and penalty parameters | Penalty coefficient for line congestion on ((i,j)) | |
Price and penalty parameters | Penalty coefficient for bus-voltage deviation | |
Price and penalty parameters | Battery degradation cost coefficient for prosumer (n) | |
Demand parameters | Nonflexible residential demand of prosumer (n) | |
Demand parameters | Required energy of appliance (a) for prosumer (n) | |
Demand parameters | Minimum and maximum appliance power | |
Demand parameters | Permitted operating window for appliance (a) | |
Comfort parameters | | Indoor temperature of prosumer (n) |
Comfort parameters |
| Comfort temperature bounds |
Comfort parameters | Heating, ventilation, and air-conditioning efficiency parameter | |
PV parameters | Available rooftop photovoltaic generation | |
PV parameters | Photovoltaic inverter apparent power rating | |
Storage parameters | Maximum battery charging and discharging power | |
Storage parameters | Minimum and maximum battery state of charge | |
Storage parameters | Battery charging and discharging efficiencies | |
Storage parameters | Initial and terminal battery state of charge | |
Upper-level variables | Active and reactive power flow on line ((i,j)) | |
Upper-level variables | Squared voltage magnitude at bus (i) | |
Upper-level variables | | Congestion slack above the line limit |
Upper-level variables | Positive and negative voltage deviation slacks | |
Upper-level variables | Congestion incentive selected by the DSO | |
Lower-level variables | Grid import and export power of prosumer (n) | |
Lower-level variables | Utilized and curtailed photovoltaic power | |
Lower-level variables | Battery charging and discharging power | |
Lower-level variables | Battery state of charge | |
Lower-level variables | Power assigned to shiftable appliance (a) | |
Lower-level variables | Thermostatically controlled load power | |
Lower-level variables | Binary variables preventing simultaneous charging and discharging | |
Coupling variables | Net active power injection or withdrawal of prosumer (n) | |
Coupling variables | Feeder-supporting flexible response delivered by prosumer (n) | |
Dual variables | Generic dual variables associated with lower-level equality, inequality, storage, and comfort constraints |
The proposed model is a Stackelberg game in which the DSO is the leader and the prosumers are followers. The DSO selects congestion incentives and network operating variables while anticipating the optimal schedules chosen by prosumers in response to those incentives. Similar leader-follower structures have been applied in distribution systems where operators use prices or allocation mechanisms to coordinate hidden or privately controlled user flexibility [2]. Here, the leader’s objective is explicitly network-oriented, whereas the followers’ objectives remain household-cost-oriented.
The bilevel problem is written compactly as minx,π
Figure 1 illustrates the proposed leader–follower coordination structure in which the distribution system operator designs feeder-aware incentives and anticipates residential prosumer responses from demand response, rooftop PV, and battery storage schedules.

Figure 1. Bilevel feeder-aware coordination architecture for residential demand response, rooftop PV, and battery storage
The DSO minimizes a weighted sum of feeder congestion, voltage deviations, active power losses, and incentive payments. The objective is formulated as min ∑
The feeder is modeled with a linearized radial branch-flow representation in which
The upper-level decision vector is
Each prosumer minimizes the total household operating cost over the scheduling horizon after observing the DSO incentive signal. For prosumer (n), the objective is min ∑(
The lower-level decision vector is
The coupling between the DSO and prosumers occurs through incentive prices
The network constraints include nodal active and reactive power balances, voltage limits, feeder thermal limits, and transformer loading constraints. Voltage compliance is enforced as (
Rooftop photovoltaic generation is constrained by available irradiance, inverter rating, and the distinction between utilized and curtailed energy. The model imposes (0≤
Battery operation is governed by charging limits, discharging limits, state-of-charge bounds, efficiency losses, terminal state requirements, and non-simultaneous charging and discharging. The state equation is
Flexible demand includes shiftable appliances and thermostatically controlled loads, each with a different representation of household service quality. Appliance constraints require that (∑
Congestion-specific constraints define when feeder loading becomes operationally unacceptable and how flexibility is credited for relieving it. The model introduces
The lower-level problem is convex after fixing the upper-level incentive variables and relaxing binary appliance-start variables through standard time-window formulations or representing them directly in the final mixed-integer model. For the continuous lower-level subproblem, the Lagrangian is formed using dual variables for power balance, storage dynamics, photovoltaic bounds, appliance-energy requirements, and comfort constraints. Bilevel energy-allocation mechanisms have used this approach to replace follower optimization with optimality conditions while preserving the leader’s anticipation of user response [2]. The lower-level optimality conditions consist of primal feasibility, dual feasibility, stationarity, and complementarity.
The mathematical program with equilibrium constraints is transformed into a mixed-integer linear program by linearizing complementarity conditions with binary variables and sufficiently tight Big-M constants. A generic complementarity pair (
The resulting MILP is implemented with indexed variables over buses, lines, prosumers, appliances, and time periods, and solved using a commercial mixed-integer solver such as Gurobi or CPLEX. Solver tolerances are set to enforce primal feasibility for voltage and thermal constraints, while the mixed-integer optimality gap is chosen small enough to avoid materially different congestion decisions. Multi-microgrid and retailer bilevel scheduling studies demonstrate that such reformulations are computationally viable for day-ahead operational studies when the network and resource models are structured carefully [21]. For larger feeders, decomposition by feeder zones or prosumer clusters can be introduced without changing the leader-follower interpretation.
The validation protocol uses a standard radial distribution test feeder, such as an IEEE distribution feeder, populated with residential load, rooftop photovoltaic, and battery profiles. Baseline demand is decomposed into nonflexible demand, shiftable appliances, and thermostatically controlled demand, while photovoltaic availability is generated from time-aligned solar profiles and inverter ratings. Active distribution network studies commonly use benchmark feeders to assess voltage control, congestion, and distributed resource coordination under repeatable operating conditions [22]. Because this manuscript specifies an original optimization formulation rather than reporting a particular numerical experiment, no unverified numerical performance values are fabricated.
The bilevel coordination scenario is compared against an uncoordinated benchmark in which prosumers minimize household cost under retail tariffs without DSO congestion incentives. A second optional benchmark is a centralized dispatch in which the DSO directly controls all flexible resources, providing a lower bound on congestion and voltage deviations but not preserving prosumer autonomy. Strategic participation studies of active distribution networks show that comparing decentralized, coordinated, and benchmark cases is necessary to isolate the value of operator-prosumer interaction [23]. The key reported metrics are maximum feeder loading, duration of overload, voltage-limit violations, photovoltaic curtailment, battery cycling, prosumer cost, and DSO incentive expenditure.
The expected operational outcome is that the bilevel model shifts flexible demand and battery charging away from periods in which feeder loading or reverse power flow is binding. Relative to the uncoordinated benchmark, feeder-aware incentives should reduce congestion slacks
The lower-level schedules preserve prosumer rationality because each household minimizes its own cost after receiving the DSO incentive signal. In periods when congestion relief requires deviation from the prosumer’s privately optimal schedule, the incentive payment compensates the household for additional degradation, discomfort, or reduced arbitrage opportunity. Bilevel real-time pricing models for aggregating distributed generation and battery storage systems show that coordinated price design can balance community-level operation and participant-level economics [24]. The resulting cost analysis should report both gross electricity bills and net bills after incentive payments to avoid overstating or understating the economic effect.
Battery schedules reveal whether congestion relief is provided by delayed charging, reduced export during photovoltaic peaks, or discharge during local demand peaks. Demand response schedules show whether appliance operation moves into uncongested periods without violating time-window or comfort requirements. Game-theoretic energy management studies with storage, renewable generation, and demand response indicate that coordinated schedules can substantially change the timing of local resource use even when total daily energy consumption remains similar [25]. In this model, operational insight is obtained by comparing the time series of
Sensitivity analysis varies photovoltaic penetration, battery capacity, inverter rating, and the fraction of households enrolled in the coordination program. As photovoltaic penetration increases, voltage-rise and reverse-flow constraints become more likely to bind, making storage and flexible demand more valuable for absorbing midday generation. Residential solar-plus-storage profitability studies show that the economic value of batteries is strongly affected by tariff structure, export compensation, and available photovoltaic surplus [10]. The bilevel model adds a feeder-security dimension by measuring how those same parameters change congestion slacks and voltage deviations.
A second sensitivity analysis varies branch loading thresholds, transformer capacity, voltage penalty weights, incentive caps, and export compensation levels. Tighter feeder limits increase the marginal value of flexibility, but overly restrictive incentive caps may prevent the DSO from inducing sufficient prosumer response. Strategic distribution-network decision models show that operator outcomes depend strongly on how demand response programs and local resource incentives are parameterized [26]. The analysis should therefore report whether infeasibility, curtailment, or high incentive expenditure becomes the dominant response under stressed operating conditions.
This article formulated a bilevel optimization model for coordinating residential demand response, rooftop photovoltaic generation, and battery storage under distribution-feeder congestion constraints. The upper-level model represents the distribution system operator and minimizes congestion, voltage deviations, losses, and incentive payments. The lower-level model represents residential prosumers that minimize net energy cost while respecting photovoltaic, storage, appliance, and comfort constraints.
The proposed formulation is operationally meaningful because it preserves the separation between DSO authority and household autonomy. The DSO does not directly control behind-the-meter assets; instead, it designs feeder-aware incentives and anticipates economically rational prosumer responses. This structure is well suited to distribution systems in which flexible resources are privately owned but network constraints remain the responsibility of the operator.
The solution method reformulates the lower-level optimality conditions into a mathematical program with equilibrium constraints and then into a mixed-integer linear program. This makes the model compatible with commercial optimization solvers while retaining explicit network, storage, demand response, and comfort constraints. The formulation also allows comparison against uncoordinated and centralized benchmarks without changing the physical representation of the feeder.
Future work should extend the model to stochastic photovoltaic and demand forecasts, three-phase unbalanced power flow, privacy-preserving distributed implementations, and real-time receding-horizon control. Additional extensions may include explicit reactive power control from smart inverters, uncertainty-aware incentive design, and field validation with measured residential feeder data. These developments would further improve the practical value of bilevel coordination for high-penetration residential distributed energy resource systems.
None
None
None
None
Open Access The author(s) retain copyright. This article is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. It may be shared and adapted for non-commercial purposes with appropriate attribution, an indication of changes, and distribution of adaptations under the same license. Third-party material may be subject to separate terms identified in its credit line. View the license at https://creativecommons.org/licenses/by-nc-sa/4.0/.