Paper summary

Optimizing software defined battery systems for transformer protection

Sonia Martin, Obidike Nnorom Jr., Philip Levis, Ram Rajagopal · Stanford University

Applied Energy, Volume 396, article 126283 (2025) · Elsevier · available online June 12, 2025

This page was written by an AI model to give a high-level overview of the paper. Please check the paper for detail: ScienceDirect.

The big idea

A neighborhood's homes hang off a shared distribution transformer, the pole- or pad-mounted unit that steps grid voltage down to household voltage (general knowledge). Utilities sized many of these before home electric vehicle (EV) chargers were common. A Level 2 charger session adds a large power spike, and when the neighborhood's total draw exceeds the transformer's rating, its windings run hot and its insulation ages faster. Replacing transformers is slow and costly: the paper cites U.S. prices that more than doubled as of 2023 and installation waits of over a year. So it pays to make existing transformers last.

Controlling EV charging directly depends on drivers following the signals. The paper instead uses stationary home batteries (battery energy storage systems, BESSs), which sit on the home's side of the utility meter, charge from midday solar, and discharge during evening peaks. The difficulty is how to run them. If each home optimizes its own battery, some batteries sit underused while a neighbor's peak overloads the transformer. If the neighborhood pools all batteries, it does better, but homeowners give up control (for example, keeping charge in reserve for an outage), and existing pooled schemes are static: once shared, a battery cannot easily go back.

The key idea is battery virtualization, from the authors' earlier software-defined battery work: software treats each physical battery as an abstract battery that can be split into partitions and combined with others. Each homeowner keeps a retained partition (fraction W) for their own use and contributes a shared partition (1 − W) to one neighborhood virtual battery, and the split can change over time. This turns "individual or pooled" into a continuum the controller can optimize over.

The paper compares five schemes, each a convex optimization over four weeks in 30-minute steps: individual control (each home kept under an equal share of the transformer limit), individual control with an optimized uneven split of the limit, joint control (all batteries as one), a hybrid with a fixed retained fraction, and a dynamic scheme whose fraction can change every two hours. Each objective adds time-of-use electricity cost and a squared penalty on power above the transformer limit. Transformer aging is computed afterward with the IEEE thermal model: load drives the oil and winding hottest-spot temperature, which sets how fast the insulation ages. A model predictive controller (MPC) with a simple forecaster tests what happens without perfect foresight.

The case study is simulated: 48 San Jose homes with modeled loads, rooftop solar and EV charging, one Tesla Powerwall 2 per home, and a 25 kVA transformer, over 50 sampled neighborhoods of 6 to 22 homes in July and January 2018. Compared with individual optimization, joint optimization cut total electricity bills by 56% and transformer aging by 48%. Without batteries, almost 25% of July trials exceeded 2% loss of life in one month, a pace that ends the transformer's life in just over four years; with batteries, July aging was negligible under every scheme. Sharing 75% of each battery gave a median cost only 14% above full sharing. Under MPC, costs rose by $5.75 to $18.50 per home over perfect foresight.

One transformer, many batteries, one shared virtual battery
each battery is split into a retained and a shared partition · the schemes differ in that split
utility grid distribution transformer 25 kVA; limit K = 25 kW in the model home 1 loads, EV, solar W = 0.5 home 2 loads, EV, solar W = 0.75 home n loads, EV, solar W = 0.25 shared virtual battery controller keeps the sum of home meters under K retained partition, fraction W: the owner's own use (e.g. outage backup) shared partition, fraction 1 − W: pooled with the neighbors Virtualization software maps both partitions onto one physical battery and can re-split it over time. Five control schemes Individual (W = 1) each home minimizes its own bill; penalized above K/n Uneven allocation (W = 1) per-home limits chosen by the optimizer, summing to K Joint (W = 0) all batteries act as one; aggregate penalized above K Hybrid (fixed W) own-bill and shared terms together; W = 0.5 in the main results Dynamic (varying W) the optimizer also picks W, which can change every two hours
From the paper's Fig. 1 and Sections 2.1 to 2.5. The three W values on the homes are illustrative; the paper's hybrid runs use W = 0.5 for every home, and the dynamic scheme chooses W per home and per two-hour block.

Key takeaways

  • Home EV charging pushes neighborhood load past distribution transformer ratings, which heats them and shortens their life; new transformers are expensive and slow to get.
  • Home batteries can shave those peaks. Run individually they are underused; pooled, they work better but take control away from owners.
  • Battery virtualization lets each battery be split into a retained partition and a shared one, so a neighborhood can pool part of every battery and change the split over time.
  • In simulation (25 kVA transformer, 50 sampled neighborhoods, July and January 2018), joint control cut bills by 56% and transformer aging by 48% versus individual control; with any battery scheme, July aging was negligible.
  • Sharing 75% of each battery came within 14% of the full-sharing median cost. Results held under MPC with imperfect forecasts, lower EV penetration and a battery-wear cost; fair cost allocation is left open.
Mechanism, step by step

From individually run home batteries to a partitioned, shared virtual battery

How transformers age, why home batteries help, the five optimization schemes, the simulation setup, and what the results show.

1 · Background: how a distribution transformer ages

A distribution transformer is the last voltage step before homes: it converts the distribution feeder's medium voltage to the 240/120 V a house uses (general knowledge; the paper's datasheet is for a 25 kVA unit with a 12,470 V primary and 240/120 V secondary). One unit typically serves a handful of homes (general knowledge). The paper models an oil-immersed unit with natural oil and air cooling (ONAN), which it says is common in residential settings.

Load current heats the windings, and heat degrades the paper insulation around them (general knowledge). A transformer's life is tied to its hottest-spot temperature (HST), the hottest point in the coils. Its nameplate rating is the load it can carry continuously without abnormal aging; carrying more pushes the HST up and aging speeds up sharply. The paper follows the IEEE loading guide's thermal model:

  1. Top-oil rise. From the per-unit load, the model computes the steady-state rise of the oil temperature over ambient, and the oil moves toward it with a time constant (Eqs. 32 to 34).
  2. Hot-spot rise. The winding hot spot sits a further load-dependent amount above the oil (Eq. 35). HST = ambient + top-oil rise + hot-spot rise (Eq. 36); ambient is fixed at 25 °C.
  3. Aging rate. An aging acceleration factor FAA = exp(15000/383 − 15000/(HST + 273)) grows exponentially with HST (Eq. 37).
  4. Loss of life. FAA averaged over the period gives an equivalent aging factor; percent loss of life is 100 × that factor × elapsed hours / normal life, with a normal life of 180,000 h (Eqs. 38, 39; Table 3). Loss of life only ever grows; no later loading pattern undoes it.
Aging rate versus hottest-spot temperature
the paper's Eq. 37, plotted on a log scale
above 110 °C: faster than normal aging 1001010.10.010.001 60708090100110120130140 hottest-spot temperature (°C) aging factor (log scale) 70 °C: factor ≈ 0.01 the example July week with batteries stayed below this 110 °C: factor = 1 roughly doubles every 7 °C above
Curve computed from the paper's Eq. 37 (this summary's arithmetic). The 70 °C mark is from Section 5.1 and Fig. 3: in the example trial for the first July week, HST stayed below 70 °C under the individual and joint schemes, while without batteries it often spiked more than 20 °C higher. "Doubles every 7 °C" is this summary's arithmetic (the factor is 2.02 at 117 °C).

For scale (this summary's arithmetic): a four-week month is 672 hours, so running at a constant aging factor of 1 for a month would cost 0.37% of life. A 2% loss in one month means a 20-year design life is used up in about four years, which is the paper's warning for the worst no-battery July trials.

2 · Why home batteries, and why not run them one by one

Each modeled home has loads, rooftop solar, a Level 2 EV charger and one battery (a Tesla Powerwall 2: 13.5 kWh, 5 kW charge and discharge). The battery can absorb midday solar that would otherwise go unused and release it in the evening, when household load and EV charging pile up. This peak shaving lowers the bill under a time-of-use tariff and also lowers the transformer's peak.

ApproachWhat it doesShortcoming the paper names
Control EV chargingShift or curtail charging sessionsDepends on drivers following signals; imperfect response risks unplanned limit violations
One central batteryA single battery protects the transformerDoes not account for individual homeowners' needs
Individual home batteriesEach home minimizes its own costNot cost-optimal: one home's battery can sit idle while another home peaks
Static aggregationPool the batteries as shared infrastructureOwners give up control; once shared, a battery cannot easily return to individual use, which suits changing outages, seasons and EV patterns poorly

3 · Battery virtualization

Virtualization here means the same thing as in computing: software presents virtual resources backed by physical ones and hides the physical details. The paper builds on the authors' software-defined grid energy storage system (BuildSys '22), which treats each physical battery as an abstract battery that can be partitioned into several virtual batteries or aggregated with others.

  1. Split. Each home's battery becomes a retained virtual battery (fraction W of its energy and power limits) and a shared one (fraction 1 − W).
  2. Pool. All shared partitions are treated as one neighborhood virtual battery.
  3. Re-split. W can change over time; the virtualization layer re-partitions the physical batteries while respecting their power limits.
  4. Dispatch. The layer turns virtual battery commands into charge and discharge commands for each physical battery, and recalibrates if a battery drops offline or is added.

4 · The optimization every scheme shares

Each scheme is a convex program over T = 1344 half-hour steps (four weeks). The decision variables are each battery's charge and discharge power. The objective has three kinds of terms:

TermFormNotes
Electricity costtime-of-use price × positive meter reading × ΔtNo net metering: exported power earns nothing. This is the reported cost.
Transformer penaltyλ · max(meter − limit, 0)²λ = 100, chosen to balance cost against the penalty; not included in reported costs
Simultaneity penaltyα · (charge + discharge)α = 0.01; stops the solver from charging and discharging in the same step

Constraints tie the meter to load minus solar plus battery charge minus discharge, evolve each battery's state of charge with a one-way efficiency of 0.9487, and bound energy (0 to 13.5 kWh) and power (0 to 5 kW). Solar and loads are fixed: there is no flexible demand.

5 · The five schemes

SchemeWho is billedWhere the limit appliesBattery split
Individualeach home's metereach home above K/nall retained
Individual, uneven allocationeach home's metereach home above its own limit; the optimizer picks the limits, nonnegative and summing to Kall retained
Jointthe aggregate meterthe sum of all meters above Kall shared
Hybrideach home's meter with its retained partition, plus the aggregate meter with the shared partitionaggregate of home loads, solar and the shared partition above K; the retained partition is not penalizedfixed W (0.5 in the main runs)
Dynamicas hybridas hybridW between 0 and 1, a decision variable that can change every two hours
Why the hybrid gives owners autonomy: the retained partition does not count toward the transformer penalty, so the owner controls it fully, for example to hold charge for an outage or to enroll it in a demand response program. Only the shared partition is steered toward the neighborhood's limit.

6 · Forecasts and model predictive control

The schemes above assume perfect foresight of solar, load and EV charging for the whole month. To test real-time operation, the paper wraps them in moving-horizon MPC:

  1. At each step, forecast the next day of solar and load for each home. The forecaster is naive: the average of the previous four days. EV charging is assumed known one day ahead, since the naive forecaster handles short, sporadic sessions poorly.
  2. Solve the scheme's optimization over that one-day horizon.
  3. Send only the first battery command, advance one step, read the actual state of charge, and repeat.

MPC is tested on the individual, uneven, joint and hybrid schemes. The dynamic scheme is not, because its performance depends on perfect foresight over the whole horizon.

7 · The simulated case study

ItemSetting
Homes48 unique San Jose, California homes, 2018; loads and solar from NREL ResStock; Level 2 EV charging generated with NREL OCHRE; every home has an EV charger in the base case
Neighborhood samplingAdd randomly sampled homes until their summed monthly peak load (excluding EVs) exceeds the transformer limit; 50 trials per month, 6 to 22 homes (January mean 12.6, SD 2.7; July mean 16.1, SD 3.4)
Transformer25 kVA oil-immersed ONAN; power factor assumed 1, so the limit is 25 kW; no power flow analysis
PeriodsFour weeks from Monday January 8 and from Monday July 2, 2018; Δt = 0.5 h
TariffPG&E EV2-A time-of-use rate (April 2024); one experiment mixes EV2-A, EV-B and TOU-D
Cost scopeTotal operational electricity cost for the neighborhood; no capital costs, no per-home split
Battery wear (optional)A cost per cycle: $5550 Powerwall price / 1400 warranty cycles

8 · Main results (July 2018, perfect foresight)

Reductions the paper reports
percent reduction · each bar names its baseline
0%20%40%60%80% Cost versus no battery July · joint 76% January · individual 21% January · joint 30% Versus individual optimization, July cost · joint 56% cost · joint, hybrid and dynamic 27 to 56% transformer aging · joint 48%
Numbers from Sections 5.2 and 5.6 and the abstract (the 56% and 48% joint-versus-individual figures are stated in the abstract and highlights). The dashed segment marks the range the paper gives for the three sharing schemes. Cost is the neighborhood's total over four weeks, over 50 trials.
  1. Any battery protects the transformer. Without batteries, the median July loss of life is 0.36%, but almost 25% of trials exceed 2%. With batteries, July loss of life is negligible under every scheme, because the aggregate meter stays at or below the nameplate limit.
  2. Sharing mainly changes cost. Individual and joint control protect the transformer similarly; joint control is cheapest because it uses the full aggregate battery and captures excess solar the individual scheme cannot. In the example week, the individual scheme exceeded the limit in the first hours, while the joint scheme stayed under it all week.
  3. Uneven limits do not help. Optimizing per-home limits slightly worsens transformer aging (homes run closer to their limits, so the aggregate sits nearer the nameplate) and brings no cost saving without battery sharing.
  4. How much to share. Varying the hybrid's shared fraction from 0% to 100%: sharing 25% does not lower costs, 50% or more lowers them substantially, and 75% sharing has a median cost only 14% above full sharing.
  5. Mixed rate plans. With each home on a random choice of three PG&E plans, the dynamic scheme raises the retained fraction during each plan's peak hours, shares 38% and retains 62% of the battery on average, gives the lowest transformer loss of life of the schemes compared in that experiment (no battery, hybrid, dynamic), and keeps the homes' own-partition costs similar to the individual scheme.
Why operating near the limit still ages the transformer: aging depends on temperature, not only on violations. A scheme that keeps the aggregate meter close to the limit (without exceeding it) runs hotter than one that keeps it well below. The paper uses this to explain the uneven-allocation result and why, by season, sharing is slightly better for the transformer in summer but slightly worse in winter.

9 · Sensitivity checks

CheckWhat changedResult
Imperfect forecasts (MPC)Naive forecasts, one-day horizonSame patterns as perfect foresight. Cost increase about 10% for the individual schemes; under 25% median for sharing schemes, with a wider spread because one home's forecast error affects the whole shared battery. Largest aging increase 5% (joint). Total increase $91.96 (hybrid) to $269.31 (individual), or $5.75 to $18.50 per home
WinterJanuary 2018Loss of life an order of magnitude higher than July but under 0.08% for all schemes; costs 21% (individual) and 30% (joint) below no battery, mainly because there is less excess solar. The worst joint case, 0.07% per month, implies a 119-year life
EV penetration50% of homes with EV chargersCosts lower in every scheme; joint still cheapest
Battery wear costCost per cycle added to the objectiveMedian cost up 15.1% (individual), 2.5% (hybrid), 8.2% (dynamic); 2.5% to 21.2% across schemes, still below no battery
HardwareSmall DC testbed: a 20 Ah LiFePO4 and a 1.6 Ah lithium-ion battery, a supply emulating the grid, an electronic load at 0.8 A, 30 s of setpoint changesAverage response 1.00 s (grid), 0.92 s and 1.44 s (batteries); setpoint RMSE 0.24 A, 0.08 A, 0.06 A. Delays are negligible at the simulation's 30-minute steps

10 · Limitations and open questions the paper states

  1. Fair cost allocation. The paper reports only total neighborhood cost. Splitting savings equally would be unfair to homes that already manage their loads well; scaling by peak power or energy throughput are options for future work.
  2. A new tariff and metering. Shared schemes need a new cost structure: who pays for shared imports and exports, upgrades and maintenance, with a meter per home and possibly a central aggregator talking to the utility.
  3. EV forecasts. EV charging is assumed known a day ahead. Real drivers may not know, and simultaneous unexpected charging could raise aging; shorter MPC steps or a smart charger as backup could help.
  4. Control latency at scale. Latency and setpoint error were measured only on a small DC testbed. Latencies beyond seconds in real battery management systems could degrade performance.
  5. Battery warranty. The batteries complete about one full cycle per day. Use outside solar backup and load shifting (for example grid frequency response) falls under a 1400-cycle limit, which the paper translates to 140 cycles per year, or 38% of capacity per day.
  6. Scale. Larger transformers mean more batteries and variables. The paper argues the convex problem scales and cites a 600-battery simulation of the virtualization software in which it accounted for half of total system latency.
Common questions

FAQ

Q·What makes a battery "software defined"?▾

A virtualization layer sits between the controller and the physical batteries. The controller sees virtual batteries, each with its own energy and power limits, and the layer maps their commands onto the physical units. One physical battery can back several virtual ones (a retained and a shared partition), and several physical batteries can back one virtual battery. The layer comes from the authors' earlier BuildSys '22 system; this paper is about the optimization schemes that use it.

Q·Why not just schedule EV charging around the transformer?▾

The paper notes that drivers may not respond perfectly to charging signals, which risks unplanned limit violations. Stationary batteries protect the transformer without depending on driver behavior. The paper suggests a smart charger could still serve as a backup when EV forecasts are wrong.

Q·If joint control is cheapest, why have hybrid and dynamic schemes at all?▾

Autonomy. Under joint control the owner has no say over their battery. The hybrid and dynamic schemes keep a retained partition that the transformer penalty ignores, so the owner can hold reserve for a blackout or enroll it in demand response. The price is a somewhat higher neighborhood cost; with 75% sharing the median cost is 14% above full sharing, which the paper suggests owners could recoup through demand response with the retained 25%.

Q·How is this different from community batteries or existing aggregation schemes?▾

Prior aggregation work, the paper says, is often static: once batteries are pooled they stay pooled. It has also treated aggregation and cost minimization separately. Here the pooled fraction is a parameter (hybrid) or a decision variable that changes every two hours (dynamic), and the objective combines cost with transformer protection.

Q·Why is the transformer limit a penalty instead of a hard constraint?▾

The schemes penalize the squared excess over the limit with weight λ = 100, set to balance electricity cost against the penalty, so the controller keeps load under the limit "whenever possible" and the problem stays feasible when it cannot. The reported costs exclude the penalty. Aging is then evaluated separately with the IEEE thermal model, so a solution that stays just under the limit still shows its thermal cost.

Q·Why did giving each home its own optimized limit make aging worse?▾

With better-fitting limits, homes use more of their allocations, so the aggregate meter sits closer to the nameplate. Aging depends on temperature, so running near the limit ages the transformer more than running well below it, even without violations. Costs did not improve either, since without sharing the savings are limited by battery availability, not by the limit allocation.

Q·Who gets the savings?▾

The paper does not say. It reports total neighborhood cost only and leaves cost allocation to future work. It notes that an equal split would be unfair to homes that already manage their loads, and names peak power or energy throughput as possible bases. Deployment would also need a new tariff, per-home metering and possibly a central aggregator.

Q·How much do imperfect forecasts hurt?▾

With MPC and a naive forecaster (the average of the previous four days), the patterns stay the same. Costs rise about 10% for the individual schemes and by less than 25% at the median for the sharing schemes, where one home's error spreads across the shared battery. In dollars that is $5.75 to $18.50 per home over the month. The largest July aging increase is 5% (joint). EV charging is still assumed known a day ahead.

Q·Does battery wear cancel the savings?▾

Not in the paper's runs. Adding a per-cycle cost ($5550 per Powerwall over 1400 warranty cycles) raised median costs by 15.1% for the individual scheme but only 2.5% for hybrid and 8.2% for dynamic, and every scheme stayed below the no-battery cost. Beyond that cost term, the paper does not model battery degradation in detail.

Q·Why do results differ between July and January?▾

Mostly solar. January loads are lower (no air conditioning), but there is much less excess solar to store for free and discharge at peak prices. Cost reductions versus no battery drop to 21% (individual) and 30% (joint), and loss of life is an order of magnitude higher than July but still under 0.08% for the month.

Q·Does the model capture voltages and power flow in the neighborhood?▾

No. Power flow analysis is outside the scope; the paper assumes a power factor of 1, treats the 25 kVA rating as 25 kW, and assumes batteries execute commands exactly. The only physical test is a small DC testbed, where the batteries settled in about one second.

Q·Would this work for larger transformers?▾

The paper tests only a 25 kVA residential unit. It argues that larger systems add batteries and variables but the problem stays convex, and that the virtualization software has been simulated with 600 virtual batteries, where it accounted for half of total system latency. Physical tests in homes are future work.

Background terms
Distribution transformerThe transformer that converts the distribution feeder's medium voltage to household voltage for a small group of customers; residential units are often 25 kVA and oil-filled.
kVA and power factorkVA (kilovolt-amperes) measures apparent power, voltage times current, which is what heats a transformer. Power factor is the ratio of real power (kW) to apparent power; the paper assumes 1, so 25 kVA = 25 kW.
ONAN"Oil natural, air natural": a transformer cooled by oil circulating by convection inside the tank and air flowing naturally outside, with no pumps or fans.
Hottest-spot temperature (HST)The highest temperature anywhere in the transformer windings, computed in the model as ambient plus the top-oil rise plus the winding's rise above the oil.
Top-oil temperature riseHow far the oil at the top of the tank is above ambient temperature; it moves toward a load-dependent steady value with a thermal time constant.
Aging acceleration factorA multiplier on the normal insulation aging rate, exponential in HST; it equals 1 at 110 °C in the paper's Eq. 37.
Percent loss of lifeThe share of a transformer's normal insulation life (180,000 h in the paper) consumed over a period, computed from the average aging factor and the elapsed time.
BESS (battery energy storage system)A stationary battery with its inverter and controls; here, one home battery such as a Tesla Powerwall 2 (13.5 kWh, 5 kW).
Behind-the-meterEquipment on the customer's side of the utility meter, such as rooftop solar or a home battery, whose output changes what the meter reads (general knowledge).
State of charge (SOC)The energy currently stored in a battery, between zero and its capacity; the optimization tracks it at each step with a charging and discharging efficiency.
Level 2 EV chargingHome EV charging from a 240 V circuit, typically several kilowatts per car, much more than ordinary household loads (general knowledge).
Time-of-use (TOU) tariffAn electricity price schedule in which the price per kWh depends on the time of day, highest in peak hours; the paper uses PG&E's EV2-A, EV-B and TOU-D plans.
Net meteringA billing rule that credits exported power against imported power. The paper assumes none: only positive meter readings are billed.
Peak shavingUsing stored energy to cut the highest points of a load curve, so less power is drawn from the grid at peak times.
Model predictive control (MPC)A control loop that repeatedly solves an optimization over a short forecast horizon, applies only the first decision, measures the new state, and solves again.
Battery virtualizationA software layer that presents virtual batteries backed by physical ones, so one battery can be split into partitions or several batteries combined into one, with the split changeable over time.
Demand responseA utility program that pays customers to reduce or shift consumption, or discharge storage, when the grid asks (general knowledge).
Summary of S. Martin, O. Nnorom Jr., P. Levis and R. Rajagopal, "Optimizing software defined battery systems for transformer protection," Applied Energy 396 (2025) 126283. Numbers are from the paper unless marked as this summary's arithmetic.