HOMEWORK02

Multi-Market Battery Dispatch with MPC

A rolling-horizon MPC engine dispatching battery storage across ERCOT’s day-ahead and real-time markets — benchmarked against an LP perfect-foresight ceiling that puts an exact dollar figure on forecast quality.

LIVE DEMO ↗ GITHUB ↗
ROLE Co-founder — Zentus
YEAR 2025
STACK Python · MPC · LP/MILP · Streamlit · Supabase · Plotly
STATUS ● DEMO LIVE · SHADOW MONITOR & DEGRADATION MODELS PRIVATE

PROBLEM

A battery’s revenue is a bet on price spreads it cannot see yet. Operators know their forecasts are imperfect, but rarely know what that imperfection costs — so investment cases get built on either blind optimism or blanket pessimism. The engine answers the question directly: on real market data, what is a better forecast worth in dollars, and which dispatch strategy captures it?

APPROACH

A multi-strategy dispatch engine over one shared physical model: rolling-horizon MPC, a global LP as the theoretical ceiling, and threshold / rolling-window heuristics as references — all subject to the same SOC, round-trip-efficiency, and power constraints. On top of it: solar-plus-storage hybridisation that captures inverter clipping at the point of interconnection, battery sizing over a power-by-duration matrix, a curtailment-elimination frontier, and a revenue-sensitivity sweep of four strategies against eleven forecast-improvement levels. Live on years of ERCOT nodal data through a Streamlit + Supabase stack, with the market-agnostic core built to re-target other power markets by swapping the data layer.

FIG 01 · REVENUE ACCUMULATION — 1,345 REAL HOURS (12–26 NOV 2025)
Cumulative revenue over 1,345 hours for four dispatch scenarios: day-ahead baseline, improved forecast, perfect forecast, and the LP perfect-foresight benchmark

The distance between the baseline (day-ahead only, dashed red) and the LP perfect-foresight ceiling (green) quantifies exactly how much revenue an imperfect forecast leaves on the table.

FIG 02 · REVENUE SENSITIVITY — STRATEGIES VS FORECAST QUALITY
Revenue of threshold, rolling-window, and MPC strategies against the LP benchmark, swept across 0 to 100 percent forecast improvement

Four strategies swept against eleven forecast-improvement levels. MPC with a 10% better forecast turns $82k of baseline into $137k; with a perfect forecast it converges on the $220k LP ceiling.

FIG 03 · STATE OF CHARGE — DISPATCH UNDER FOUR SCENARIOS
Battery state of charge over two weeks for the four dispatch scenarios, cycling between empty and the 110 MWh maximum capacity

The same physical battery model under every strategy: SOC limits, round-trip efficiency, and power constraints are enforced by one shared solver, so the only difference is decision quality.

DEGRADATION

The piece most dispatch tools ignore: every cycle spends the asset. In an industry pilot I built warranty-aware dispatch around a 4-D warranty lookup — ambient temperature × mean SOC × C-rate × daily cycles mapped to capacity and round-trip efficiency per year — integrated as a physical constraint of the optimiser. A year-by-year loop (annual LP, warranty lookup, capacity ratchet) validated over four years of UK market data reached 94.7% of the perfect-foresight optimum with only one day of visibility, benchmarked against the industry’s two-hour BESS index — with revenue confidence intervals from market scenarios crossed with degradation bands.

OUTCOME

A public engine you can drive yourself — the live demo runs the MPC optimiser on real ERCOT data at every interaction. In the 15-day example window a 100 MW × 1.1 h hybrid asset books $63,724 of clipping arbitrage on top of $551,093 of hybrid revenue, and a 10% forecast improvement is worth $55k against an $82k baseline. A private shadow monitor tracks dispatch against the optimum, and the degradation layer prices what every one of those cycles costs the asset.