The Unexpected Power of Billing Math: How Energy Communities Can Solve the Solar Surplus Problem

On a sunny May afternoon in 2020, something peculiar happened across a cluster of homes in Barcelona. As rooftop solar panels crested their midday output, electricity began flowing backward through the neighborhood's power lines—not toward the homes that needed it, but toward the broader grid. The cause wasn't a fault or a storm. It was a mismatch in timing: too much solar electricity being generated precisely when fewer people were home to use it, and the local network structurally incapable of routing that surplus efficiently to the neighbors who could have used it an hour later. This phenomenon, known as reverse power flow, is becoming increasingly common as solar panels proliferate on rooftops across Europe. It stresses local grids, forces utilities to invest in expensive infrastructure upgrades, and ultimately wastes clean energy that could have displaced fossil generation elsewhere. Now, researchers at the Catalonia Institute for Energy Research have demonstrated a surprisingly elegant solution: using the same accounting numbers that communities already calculate for billing—sharing coefficients—as dynamic price signals that convince households, automatically and individually, to shift when they use electricity. The results are striking: a 69% reduction in reverse energy over a full year, achieved not with new infrastructure or battery storage, but by reshaping human behavior through better information.
The Science
The paper, published by Alireza Shooshtari, Antonio Pepiciello, and José Luis Domínguez-García of IREC in Barcelona, addresses one of the central tensions in the clean energy transition. Solar panels generate electricity when the sun shines, not necessarily when people need it. Communities of households sharing solar generation—known in European regulatory frameworks as renewable energy communities—have emerged as a way to improve local utilization of clean electricity. By pooling surplus generation and allocating it among members, these communities can reduce everyone's grid imports and electricity bills. But here's the catch: the allocation mechanisms currently in use, known as sharing coefficients, are backward-looking accounting tools. They tell households after the fact how much solar energy they received and how much they owe or are owed. They don't guide consumption choices in advance. Households don't know, when deciding whether to run the dishwasher at 2 PM or 6 PM, whether one choice will let them capture more of their neighbor's solar surplus and one will not.
The researchers' core insight is that the same proportional allocation logic used for billing can be inverted and embedded in day-ahead price signals. If a household knows that electricity at a particular hour will come from nearby solar (cheap and locally generated) versus from the broader grid (more expensive), they have an incentive to shift flexible loads accordingly. The price signal isn't arbitrary—it's derived directly from the community's energy sharing mathematics. Run the dishwasher at 2 PM and you might draw energy shared from a neighbor's excess solar on the same street. Run it at 8 PM and you'll pay the full grid rate. The households in the study didn't manually respond to these signals; instead, each home ran an optimization algorithm that reshaped their daily load profile within their comfort range to minimize cost, given the household-specific prices calculated for each hour.
The researchers built their framework around two fundamentally different allocation strategies. The first, called feeder-aware, respects the physical geography of the low-voltage network. A feeder is the physical cable connecting a subset of homes to the local transformer. In the feeder-aware approach, the algorithm first tries to match solar surplus with demand within the same feeder—neighbors on the same wire. Only surplus that can't be consumed locally gets allocated to members on other feeders. This matters because energy that travels shorter electrical distances puts less strain on the network and is more efficient to route. The second strategy, called feeder-agnostic, ignores this geography. It pools all surplus at the community level and allocates it proportionally across all members regardless of where they're connected. Both strategies use the same underlying proportional sharing logic; they differ in whether they account for network topology.
The framework operates through an iterative coordination process between an energy community manager (ECM)—a central coordinator representing the community—and individual households. In the day-ahead stage, households submit their expected demand and solar generation forecasts to the ECM. The ECM computes the sharing allocation for each household, decomposes it into component parts (same-feeder shared energy, inter-feeder shared energy, and direct grid import), and converts these into a household-specific price for each hour of the coming day. The price isn't a single number; it reflects the weighted average cost of the energy mix that household will draw upon, with cheaper prices for energy sourced from close solar surplus and higher prices for grid imports. Households then solve their individual optimization problems—minimizing electricity cost while keeping total daily consumption unchanged and staying within their minimum and maximum hourly demand range—and submit revised demand profiles back to the ECM. The ECM recomputes prices from these new profiles, households re-optimize, and the process repeats until prices stabilize. This sounds computationally intensive, but the researchers used convex optimization throughout, guaranteeing that solutions are found efficiently and that the final outcome is optimal for all participants given the community's shared resources.
To test their framework, the researchers built a detailed simulation using real data from 15 households in the Barcelona area over a full year, including measured solar generation and demand profiles. They mapped these households onto a three-feeder low-voltage network and conducted full AC power flow analysis to verify that the demand shifts produced by their optimization actually improved grid operation, not just economics. They focused particular attention on days when reverse power flow was most severe—the periods when daytime solar surplus was largest relative to local demand—because these are the moments when the grid is most stressed and the potential value of demand shifting is highest.
The pricing model reflects how European electricity tariffs are structured. The retail price that households pay for grid electricity includes three components: the energy commodity cost (what power generators receive), the network use charge (the cost of wires and infrastructure), and regulated levies. When households draw energy from the community's shared solar pool rather than the grid, the network charge is discounted because that electricity doesn't use the broader transmission and distribution system. In the feeder-aware framework, same-feeder sharing receives the largest discount (because the electricity barely leaves the local cable), inter-feeder sharing receives a smaller discount (because it travels across the network), and grid import is paid at the full rate. The feeder-agnostic framework doesn't distinguish between same-feeder and inter-feeder sharing, applying an intermediate discount to all shared energy. These discounts are calibrated to reflect real network cost differences and are consistent with how European energy communities are typically regulated.
What They Found
The framework delivered substantial reductions in feeder reverse energy—the amount of electricity flowing backward from the local network into the upstream grid. On five selected high reverse energy days, including a representative sunny day in May, the feeder-aware allocation reduced reverse energy by 45.0%, while the feeder-agnostic allocation reduced it by 44.6%. Both approaches performed nearly identically during these peak-surplus periods, suggesting that when the grid is most stressed, the broad community pool is almost as effective as the geographically targeted approach.
The picture shifted meaningfully, however, when the researchers expanded their analysis to the full annual window. Here, the feeder-aware design reduced reverse energy by 69.0% compared to the baseline scenario with no demand response, while the feeder-agnostic design achieved a 66.3% reduction. The three-percentage-point gap between the two strategies is modest but statistically meaningful—and it comes essentially for free, since both approaches use the same underlying sharing coefficient logic. The feeder-aware design simply adds a network topology layer on top. The additional benefit arises because, over the full year, the timing and geographic distribution of solar surplus and demand mismatch vary enough that accounting for feeder locations creates incremental value. Some feeders consistently have more surplus than they can consume locally; others consistently have more demand than local solar can meet. The feeder-aware approach routes surplus more precisely, reducing the amount of energy that travels long electrical distances unnecessarily.
The chart below illustrates the reverse energy reduction across both timeframes and both allocation strategies, showing the clear improvement over the annual horizon and the modest but consistent edge of the feeder-aware design.
Reduction in Feeder Reverse Energy by Scenario
Comparison of feeder reverse energy reduction between feeder-aware and feeder-agnostic allocation strategies across high reverse energy days and the full annual window.
| Label | Value |
|---|---|
| High Reverse Energy Days | 45 |
| High Reverse Energy Days | 44.6 |
| Annual Window | 69 |
| Annual Window | 66.3 |
The economic benefits followed a similar pattern. Households reduced their electricity bills by shifting consumption toward hours when shared solar was abundant and away from evening hours when they'd otherwise pay full grid rates. The magnitude of savings depended on how much flexibility each household had—the range between their minimum and maximum hourly demand in the baseline profile—and on their individual solar generation. Households with more solar panels had lower effective prices because more of their demand was covered by their own generation before any sharing occurred. The framework preserved total daily energy consumption for all households; no one was incentivized to use more or less electricity overall, only to use it at different times.
The iterative coordination process converged reliably across all test scenarios. The researchers found that an update factor—controlling how much the ECM incorporated each household's revised demand into the next price calculation—needed to be tuned for best performance. Setting it too high caused prices to oscillate without stabilizing; setting it too low led to slow convergence. In practice, an update factor between 0.5 and 0.7 provided a good balance, achieving convergence within a reasonable number of iterations while maintaining solution quality. The number of iterations required varied with the day and the scenario but was generally in the range of 10 to 20 for the tested conditions.
The sensitivity analysis revealed that the discomfort coefficient—a parameter controlling how strongly households penalized deviations from their preferred baseline demand profile—played a critical role in determining how much load shifting actually occurred. As the coefficient increased (meaning households were less willing to deviate from their baseline), the reduction in reverse energy diminished. As it decreased (households more flexible), reverse energy dropped further. At the most aggressive flexibility settings, reverse energy reductions approached 80% on high-surplus days. This underscores that the framework's effectiveness depends not just on its design but on how willing households are to adjust their routines. In practice, this parameter would be set by each household based on their personal tolerance for inconvenience, either explicitly or learned over time through experience with the system.
Demand Flexibility vs Reverse Energy Reduction
Trade-off between feeder reverse energy reduction and household flexibility, showing how discomfort coefficient settings affect outcomes on high reverse energy days.
| Label | Value |
|---|---|
| Low (high flexibility) | 80 |
| Medium | 60 |
| High (low flexibility) | 40 |
The power flow analysis confirmed that the demand shifts produced by the optimization translated into genuine network benefits. Voltage levels in the low-voltage network stayed within acceptable bounds under both allocation strategies, even as demand profiles shifted substantially from their baseline shapes. Line loading—the amount of current flowing through the distribution cables—remained manageable. The reduction in reverse power flow meant that the local network was less stressed during midday hours, potentially delaying or avoiding the need for infrastructure upgrades like larger transformers or reconductoring of cables. These infrastructure benefits aren't quantified in monetary terms in the paper, but they represent a significant real-world value for utility companies and, ultimately, for all electricity ratepayers who fund grid investments through network charges.
Why This Changes Things
The clean energy transition faces a fundamental paradox. Solar panels are cheapest when installed on individual rooftops, close to where electricity is consumed. But the economic logic of rooftop solar—generate during the day, consume or export—increasingly conflicts with how modern grids are designed to operate. Electricity systems were built around large central power plants pushing electrons in one direction: from generator to consumer. They weren't designed for millions of small generators pushing power back the other way during the middle of the day. The result is exactly what the researchers observed in Barcelona: on sunny days, surplus solar exceeds what the local network can absorb, electricity reverses direction, and grid operators must scramble to manage voltage swings and thermal limits.
The conventional solutions to this problem are expensive. Utility-scale batteries can store midday solar and discharge it in the evening, but they cost hundreds of dollars per kilowatt-hour and require significant land and permitting. Upgrading local distribution networks to handle higher bidirectional flows costs millions per kilometer of cable. Smart inverters and advanced grid sensors can help optimize voltage and power quality, but they address symptoms rather than the underlying mismatch between when solar is generated and when it's consumed. These solutions treat the grid as a passive recipient of whatever generation and demand patterns the world throws at it.
The framework Shooshtari and colleagues propose operates upstream of these problems, at the level of when people choose to use electricity. It doesn't require new hardware on the grid, new batteries in basements, or expensive smart appliances. It requires only that the accounting system already used to settle energy community bills be extended backward in time, from an after-the-fact allocation tool to a predictive price signal. Households need energy management systems that can run the optimization—essentially, a smart thermostat or home energy controller that can shift a dishwasher or water heater by a few hours—but these devices already exist and are becoming increasingly common.
What makes this approach particularly powerful is that it's endogenous to the community. The price signals aren't imposed by a regulator or set by a market exchange; they emerge from the sharing mathematics that already govern how the community allocates its surplus. When the sun is abundant and everyone's solar panels are cranking, prices drop because there's plenty of cheap local energy to share. When it's cloudy or everyone's home cooking dinner, prices rise because surplus is scarce and grid imports dominate. This dynamic pricing reflects the actual availability of shared solar in real time, giving households accurate information about the cost of their choices without requiring centralized coordination of everyone's preferences.
The comparison between feeder-aware and feeder-agnostic allocation is particularly instructive for policymakers and community designers. The feeder-aware approach—routing surplus first to neighbors on the same physical feeder before spreading it across the broader community—provides a modest but consistent additional benefit over the simpler approach that ignores network geography. The three-percentage-point improvement in reverse energy reduction over the annual window may sound small, but in the context of grid planning, every reduction in reverse flow delays infrastructure investment. And the feeder-aware approach comes at no additional computational cost; it simply requires the algorithm to know which feeder each household is connected to and to allocate in two stages rather than one. For communities designing their internal rules, this suggests that accounting for network topology is worthwhile, especially as communities grow larger and the geographic dispersion of members increases.
The framework also has implications for the design of energy community regulations across Europe. The EU's Clean Energy Package, formalized in directives 2018/2001 and 2019/944, established the legal framework for citizen energy communities and renewable energy communities, but left many implementation details to member states. One of the key design choices is how sharing coefficients are determined and whether they must be fixed or can be dynamic. The paper demonstrates that dynamic coefficients—which change over time to reflect the actual flow of energy—do more than just improve fairness in billing. When converted into price signals, they actively shape demand to better utilize local solar, providing grid benefits that go beyond the economic interests of community members. Regulators who have been cautious about dynamic sharing coefficients, worried about complexity or the potential for gaming, can take comfort that these mechanisms can serve dual purposes: allocating surplus and coordinating consumption.
The Barcelona context matters here. Spain has among the highest rates of residential solar adoption in Europe, driven by generous net metering policies that have since been curtailed. As more households install panels, the problem the researchers identified—midday surplus overwhelming local networks—will become more acute in Spain and in other sun-drenched countries like Italy, Greece, and Portugal that are also seeing rapid solar growth. The framework is directly applicable to these contexts, using the same network topology and household profiles that characterize real European neighborhoods. The measured data from 15 Barcelona households gives the results credibility that purely synthetic simulations often lack.
There's also a social equity dimension worth noting. Energy communities are often promoted as a way to include renters, lower-income households, and people who can't install panels on their own roofs in the benefits of the clean energy transition. A household that can't afford solar panels can still join an energy community and receive a share of the collective surplus, paying reduced rates for electricity sourced from neighbors' panels. The demand response framework extends this logic: by shifting flexible loads toward surplus hours, community members effectively earn a discount on electricity that would otherwise be more expensive. The more flexible the load (dishwasher, washing machine, electric vehicle charging, water heating), the more savings are available. For a household that charges an EV overnight on cheap grid electricity, shifting even part of that charging to a sunny midday could meaningfully reduce their fuel costs. The framework doesn't require expensive batteries or smart appliances; it requires only that the household's energy management system be willing to run an optimization.
What's Next
The paper's results are compelling, but several questions remain before the framework can move from simulation to real-world deployment. First, the study assumes that households submit accurate day-ahead forecasts of their demand and solar generation. In reality, forecasts are imperfect. A household might plan to run the dishwasher at 2 PM but get delayed by an unexpected phone call, or a cloudy morning might clear into a sunny afternoon, dramatically increasing solar output beyond what was predicted. The researchers acknowledge that forecast errors could cause the actual allocation to deviate from the planned allocation, potentially making the price signals less accurate and reducing the demand response benefit. How robust the framework is to realistic forecast errors—and whether iterative re-optimization during the day can correct for them—is an important open question.
Second, the household optimization treats each home as an independent agent minimizing its own electricity cost, given the prices it faces. This is a reasonable assumption for individual households, but it raises questions about whether the collective outcome is socially optimal. There's no mechanism in the current framework to ensure that the total community benefit is maximized or that benefits are distributed equitably. Some households have more solar panels and therefore generate more surplus to share; others have more flexible loads and therefore can shift more consumption. An extension could incorporate fairness constraints or community-level optimization objectives, though this would add complexity to the coordination process.
Third, the paper focuses on a single community of 15 households. Real energy communities could be much larger—hundreds or thousands of members—and could span multiple voltage levels and geographic areas. The computational approach used here—a central energy community manager solving convex optimization problems—scales reasonably well, but the communication and coordination requirements of an iterative process with thousands of participants could be challenging. Distributed optimization approaches, where households solve local problems and share only prices (rather than full demand profiles), might be necessary at scale.
Fourth, the regulatory and tariff assumptions in the paper—specifically the network charge discounts for same-feeder and inter-feeder sharing—depend on how European energy community regulations evolve. The paper uses illustrative discount fractions (0.5 for same-feeder, 0.8 for inter-feeder) that reflect plausible cost differentials but aren't calibrated to any specific regulatory jurisdiction. In practice, network charge discounts would need to be approved by national regulators, and the political and economic negotiations around these values could substantially affect the framework's attractiveness. If network discounts are too small, households have little incentive to shift demand; if they're too large, network operators lose revenue that funds grid maintenance.
Fifth, the paper's power flow analysis is conducted on a relatively small and simplified network model. Real low-voltage networks are more complex, with unbalanced phases, voltage regulators,tap changers, and interconnection to other networks. The assumption that reduced reverse power flow translates cleanly into network benefits needs to be verified on a broader set of network topologies and loading conditions. Some networks might be voltage-limited rather than thermal-limited, in which case the value of reducing reverse flow is different.
Finally, there's the human dimension. The framework treats households as rational agents solving optimization problems, but real people don't always behave like economists' models. They might resist automated control of their appliances, even if the financial savings are real. They might not understand why prices vary throughout the day, leading to frustration or disengagement. They might value the certainty of a consistent schedule over the modest savings available from demand shifting. The paper's discomfort coefficient parameterizes this behavioral resistance, but quantifying it for real populations—and designing user interfaces and incentive programs that make participation appealing—will require behavioral research beyond the optimization framework.
Despite these open questions, the paper represents a significant step toward integrating energy sharing, demand response, and grid operation in a coherent framework. The insight that sharing coefficients can serve double duty—as billing allocations and as price signals—exploits a natural synergy that had gone largely unexploited. By showing that the same mathematical machinery used to settle accounts at the end of the month can also shape behavior at the start of the day, the researchers have opened a design space that existing frameworks hadn't considered. The 69% reduction in reverse energy is a striking headline number, but the deeper contribution is methodological: demonstrating that local energy markets and demand response can be unified under a single allocation logic, rather than bolted together as separate systems with separate prices and separate objectives.
As solar panels continue to spread across European rooftops, the challenge of managing midday surplus will intensify. The question isn't whether the problem will emerge—it's whether we'll have tools to address it that are as elegant as the problem itself. Shooshtari and colleagues have shown that some of the most powerful tools may already be hiding in the billing spreadsheets of energy communities, waiting to be repurposed.
ECM Update Factor vs Convergence Iterations
Relationship between ECM update factor and average number of coordination iterations required for convergence.
| Label | Value |
|---|---|
| 0.3 | 25 |
| 0.5 | 18 |
| 0.7 | 15 |
| 0.9 | 22 |