1A. Arbitrage
The battery supports the building by buying cheap and avoiding expensive hours. Demand charges are not part of the optimization.
The longer story behind the cards on the main page: what I asked, how I tried to answer, and what the numbers said.
A plug-in hybrid has two ways to move: the engine and the electric motor. At every instant, a controller called the Energy Management System (EMS) decides how to split the work. That choice decides how much fuel the car burns.
Dynamic Programming (DP) finds the mathematically best split, but it needs to know the whole trip in advance and a lot of computing time, so a car cannot use it live. Simple rule-based controllers run in real time, but they are usually far from optimal. Reinforcement learning (RL) offers a third way: an agent learns by trial and error, then runs in real time. The question of this paper: how close to the DP optimum can it get?
The test vehicle is a state-of-the-art diesel plug-in hybrid sold in Europe, with a parallel P2 architecture: the engine and the electric motor both feed a 9-speed automatic gearbox that drives the rear axle.
Training an agent takes hundreds of simulated cycles, so the original digital twin was simplified to a fast backward-kinematic model in Python and validated against experimental data from the real car.
| Curb weight | 2060 kg |
|---|---|
| Engine | 1950 cm³ turbo diesel, 4 cylinders, 143 kW |
| Electric motor | Permanent-magnet synchronous, 90 kW / 440 Nm |
| Transmission | 9-speed automatic with torque converter |
| Battery | Li-NMC, 13.5 kWh, 365 V |
| Layout | Rear-wheel drive, parallel P2 |
The agent is a Soft Actor-Critic (SAC). It has two parts: an actor that proposes what to do, and a critic that judges how good that was. Its actor is stochastic: for each situation it outputs a bell curve of possible actions, which keeps it exploring instead of getting stuck. After training, the randomness is switched off and the agent acts deterministically.
Trial and error, hundreds of times. Every driving cycle is one episode. The agent tries torque values, receives a reward and slowly learns which ones lead to lower fuel use. The "distance travelled" input needs no connected car: a phone's GPS is enough.
In RL the reward is everything: a poorly designed one gives poor results no matter how long you train. The goal is minimum fuel while ending the cycle with the same battery charge it started with (charge sustaining). RL cannot enforce that as a hard constraint like DP does, so the reward has to do it.
Case 2 lets the agent use the battery freely as long as it stays in the band. In the last third of the cycle the band narrows, nudging the agent to end at the target charge. For each reward, the weight k₃ was swept over five values (200 to 400 with k₂ fixed at 200), giving the 10 trained agents.
All ten agents kept the battery close to the target. The best one, Case 2 with k₃ = 300 (called 2C in the paper), balanced a near-perfect final charge with low fuel use. It was then tested against DP on the training cycle (WLTC) and on two cycles it had never seen: the urban FTP75 and the highway HFET.
Lower is better. DP is the theoretical best for a perfectly charge-sustaining trip.
Fuel difference from DP. The HFET "win" comes with a battery that ended 2% below target, so it is not a real gain.
| Controller | WLTC | FTP75 | HFET |
|---|---|---|---|
| DP (target 0.50) | 0.50 | 0.50 | 0.50 |
| SAC agent | 0.50 | 0.52 | 0.48 |
| Discount factor | 0.99 |
|---|---|
| Hidden layers | 2 × 256 neurons |
| Learning rate | 0.0003 |
| Mini-batch size | 256 |
| Soft-update coefficient | 0.005 |
The hyperparameters were kept fixed on purpose, so that any difference in results comes from the reward and not from tuning. A model was saved every 20 episodes.
Tools: a Python environment built to the Gymnasium standard, the SAC implementation from Stable-Baselines3, and an open-source MATLAB Dynamic Programming code from ETH Zurich for the benchmark.
Tune the hyperparameters of the networks, extend the agent to charge-depleting operation, train it over many driving cycles representing different patterns, and eventually run the approach on a high-fidelity forward-dynamics model of the car.
Long-duration batteries can hold energy for 10 hours or more. They promise to cut electricity bills, back up renewables and help the grid, but they are expensive. Is the investment worth it?
The usual tool to compare storage costs is the Levelized Cost of Storage (LCOS): the price at which each stored kWh must be sold to repay the project. Traditional calculators assume the battery cycles at a constant rate with a constant efficiency and a fixed energy price. Real batteries do not behave like that: they charge when power is cheap and discharge when it is expensive or when the building peaks.
The contribution of this work is to put the optimal control of the battery inside the cost analysis, so the LCOS is computed from how the battery would actually be operated.
A "behind the meter" plant: a commercial building, a wind turbine and a long-duration battery connected to the grid. The building and the wind are uncontrollable; the battery is the only thing the optimizer decides.
The battery is modelled cell by cell with an equivalent circuit built on experimental measurements, including its internal resistance and the efficiency of the converter, so charging and discharging are not "free".
Dynamic Programming looks at the whole year and finds the cheapest sequence of charge and discharge decisions. Demand charges are then computed on the resulting grid power peaks.
| Battery | 752 kWh sodium metal halide, 526 kWh usable (SoC 10 to 80%), up to 10 h discharge |
|---|---|
| Wind turbine | 250 kW, wind data for 2022, power bought through a PPA |
| Building | Research building at Ohio State, 882 MWh of grid energy per year |
| Electricity price | Hourly real-time market price for 2022 |
| Demand charge | $7.01 per kW of monthly peak, 150 kW threshold |
| Project life | 20 years, with a cell replacement after 15 |
The battery supports the building by buying cheap and avoiding expensive hours. Demand charges are not part of the optimization.
As 1A, but the optimizer also caps the power drawn from the grid to cut demand charges.
As 1B, plus power from a wind turbine under a Power Purchase Agreement.
No building: the battery only trades energy with the grid, as a pure arbitrage business.
The battery delays the wind farm's sales to the hours when the price is higher.
The optimizer charges when electricity is cheap, discharges when it is expensive, and shaves the building's power peaks. It also plans across days. In the April 2022 example of the paper, it keeps storing energy from day 14 to day 17 so that on day 18 the battery can cover most of the building's demand, avoiding a costly day.
That is the point of long duration: the value is not only in the instant price, but in moving energy through time, and in the demand charge it saves on the way.
Savings: 6.3% in 1A, 20.4% in 1B and 32.4% in 1C. Wind alone accounts for 16.9 points of the last one. Note: in the paper's table the 1B parts add up to $70,203, while its stated total is $71,413; the totals shown here are the stated ones.
With the operation known hour by hour, the LCOS can be computed properly: $0.23 to $0.26 per kWh for the building scenarios. Multiplying it by the energy the battery handles in a year gives what it costs to store that energy. Comparing that with what the battery earns or saves tells you whether the investment pays back.
Green is what the battery brings; red is what storing that energy costs. In every scenario the cost is higher. Scenario 1C comes closest ($29,091 against $35,861), and it assumes the wind turbine is already there for free.
The same optimal control was applied to the cost data of other battery types for Scenario 2. Lithium-ion (LFP) is the cheapest to store with, at $0.1726 per kWh. But for that scenario to break even, the LCOS would need to fall to about $0.1173 per kWh, roughly half of today's value, and the DOE target for 2030 is lower still.
Dollars per stored kWh. No chemistry reaches the break-even line, so pure arbitrage still does not repay the investment.
I enjoy talking about the details, and about what I would do differently today.