Great Britain (GB): real-data BESS model¶
The GB module values a battery in Great Britain's 30-minute market on public data: within-day wholesale trading (priced at the BMRS Market Index Price as a traded-price proxy), NIV chasing on the single imbalance price, the NESO dynamic frequency-response services (Dynamic Containment, Moderation and Regulation, low and high) bought in the day-ahead EAC auctions, and a combined stack of all three. Every decision uses only information that was published at the decision time; perfect-foresight oracles give the upper bounds used for capture rates.
Results: reports/great_britain.md (regenerated by
scripts/research/gb_backtest.py). Code: euroflex_bess_lab.public_data.gb (data) and
euroflex_bess_lab.markets.gb (market model and strategies).
Data¶
All GB tables are committed under data/public/gb (about 10 MB), each with a .meta.json sidecar (source,
URLs, licence, attribution, coverage, rows, sha256, validation). Coverage starts on 2023-12-01 (one month of
warm-up history for the forecasts) and ends at the latest Europe/London midnight of the snapshot. Raw downloads
are cached under data/raw/gb (gitignored).
| Table | Source | Content |
|---|---|---|
gb/system_prices.parquet |
Elexon BMRS, DISEBSP (/balancing/settlement/system-prices/{date}) |
single cash-out price, NIV, price-stack summary and publication time per SP |
gb/market_index.parquet |
Elexon BMRS, MID (/datasets/MID/stream) |
APX (EPEX) and N2EX market index prices and volumes; mid_price_gbp_mwh is the volume-weighted price of providers that traded |
gb/frequency_15s_<year>.parquet |
Elexon BMRS, FREQ (/system/frequency/stream) |
15-second system frequency as int16 deviation from 50 Hz in mHz (lossless) |
gb/response_energy.parquet |
derived from FREQ | MWh delivered per MW of DCL/DCH/DML/DMH/DRL/DRH per SP (delivery curves below) |
gb/response_auctions.parquet |
NESO data portal, EAC auction results summary | DC/DM/DR clearing price (GBP/MW/h, pay-as-clear) and cleared volume per EFA block |
gb/reserve_auctions.parquet |
NESO data portal, EAC auction results summary | Quick, Slow and Balancing Reserve clearing prices (context only) |
gb/ecb_gbp_per_eur.parquet |
ECB data portal, EXR.D.GBP.EUR.SP00.A |
GBP per EUR reference rate (daily) |
Licences and attribution (all three allow redistribution with attribution, so the tables are committed):
- Elexon BMRS: Licence to use BMRS open data (worldwide, royalty-free, perpetual; copy, publish, adapt and exploit commercially). Attribution: "Contains BMRS data © Elexon Limited copyright and database right 2023-2026". MID values are calculated by the Market Index Data Providers and published on BMRS; they are redistributed as BMRS data.
- NESO: NESO Open Data Licence v1.0 (based on the Open Government Licence v3.0). Attribution: "Supported by National Energy SO Open Data".
- ECB: ECB terms of use - free reuse if the ECB is cited as the source and modifications are stated (here: as-of join of daily rates onto delivery dates).
Rebuild or extend the tables (about five minutes; no API key needed):
.venv/bin/python scripts/research/gb_fetch_data.py --target all
.venv/bin/python scripts/research/gb_fetch_data.py --target system-prices --offline # from the raw cache
The same builder is exposed as a Typer app (euroflex_bess_lab.public_data.gb.cli:gb_app, commands fetch and
list). Loaders take half-open [start, end) bounds and raise FileNotFoundError naming the fetch command:
from euroflex_bess_lab.public_data.gb import load_gb_market_index, load_gb_response_auctions, load_gb_system_prices
prices = load_gb_system_prices("2025-06-10", "2025-06-13")
mid = load_gb_market_index("2025-06-10", "2025-06-13", ["mid_price_gbp_mwh"])
dc = load_gb_response_auctions("2025-06-10", "2025-06-13", products=["DCL", "DCH"])
Market rules encoded¶
| Rule | Value in the model | Source |
|---|---|---|
| Settlement | 30-minute SPs on Europe/London settlement days (46/50 SPs on clock changes) | BSC |
| Imbalance price | single price: system sell = system buy price (verified for every SP of the data) | BSC P305 |
| NIV sign | NIV > 0 = system short | BMRS |
| Publication of system prices | first publication a median 22 minutes (p95 23) after the SP end in the snapshot; the model uses a price only from 30 minutes after the SP end. BMRS re-issues most SPs about 24 hours later; the stored values are the latest run. | BMRS createdDateTime (gb/system_prices.meta.json) |
| Gate closure | 60 minutes before the SP; Physical Notifications / operational baselines are fixed then | NESO Provider Guidance |
| MID | volume-weighted price of half-hour, 1-, 2- and 4-hour products traded within 8 hours before gate closure (day-ahead auction excluded) | MIDS review 2024 |
| EAC response auction | day-ahead, gate closure 14:00 UK, results 15:00, delivery 23:00-23:00, pay-as-clear per product and 4-hour EFA block; prices can be negative | EAC auction timing, results |
| Availability payment | clearing price x contracted MW x 0.5 h per SP, withheld in SPs with unavailability | Provider Guidance, Service Terms Schedule 3 |
| Delivery duration | DC 15 min, DM 30 min, DR 60 min; Response Energy Volume = MW x duration per direction | NESO Dynamic Services |
| State of Energy (6.11) | the volume must be held from the first SP of each contracted block, relaxed by delivered energy and recovered by up to 20 % of the volume per SP, the first increase applying in the fifth SP after a delivery (worked example in 6.11); SOE may not be managed by deviating from the baseline | Service Terms v6 |
| Reserved Capacity | 10 / 20 / 40 % of the offered MW (DC / DM / DR) left unoffered; offered + reserved MW of all stacked products within the unit's registered capacity | Procurement Rules v5 |
| Response energy | not paid; applied in ABSVD, so it creates no imbalance, but it moves the SOC | Provider Guidance (Settlements) |
| One MW, one service | per direction, response MW + baseline power within the 1 MW rating; response energy volumes inside the SOC window along the baseline path | Service Terms, Procurement Rules |
Reading of the stacking cap. For a battery we read the registered capacity as export plus import capability. In 506 sampled 2026 battery unit-blocks of the EAC results by unit (joined with BMRS unit capacities), offered plus reserved MW exceed export plus import capability in 1 % of cases but the export capability alone in 64 %, so the literal export-only reading does not describe how batteries contract. The strategies apply a stricter, self-imposed limit (offered plus reserved MW within 1 MW per direction, chosen on the development window); the report shows the market cap alone and the export-only reading as sensitivities.
Delivery curves (Service Terms Schedule 2 Table 1; linear interpolation, saturation beyond the end points):
| Frequency (Hz) | 49.5 | 49.8 | 49.9 | 49.985-50.015 | 50.1 | 50.2 | 50.5 |
|---|---|---|---|---|---|---|---|
| DC | 100 % | 5 % | 2.3 % | 0 | -2.3 % | -5 % | -100 % |
| DM | 100 % | 100 % | 5 % | 0 | -5 % | -100 % | -100 % |
| DR | 100 % | 100 % | 45.95 % | 0 | -45.95 % | -100 % | -100 % |
The response energy table applies these curves to each 15-second BMRS frequency sample (held for 15 seconds). Averaged over the data, one MW of DR delivers about 0.07 MWh per SP in each direction, DM about 0.019 and DC about 0.0035 - consistent in magnitude with Modo Energy's 2022 modelling on 2020 1-second data (about 2.8 cycles per day for DR and 0.14 for DC on a 1 MW / 1 MWh unit; https://modoenergy.com/research/en/energy-delivery-new-frequency-response-services). Sampling at 15 seconds misses shorter excursions, which mostly matters for DC.
Model¶
Battery. euroflex_bess_lab.realtime.BatteryParams(power_mw=1, energy_mwh=2): SOC window 5-95 %, start at
50 %, charge and discharge efficiency 0.95, degradation 8 EUR per MWh discharged (baseline discharge plus
low-frequency response export). Degradation is converted to GBP at the ECB rate of the delivery day (decisions use
the previous day's rate); EUR results divide GBP results by the same daily rate.
Decision timeline (decision for settlement period j starting at T_j):
| Decision | Time | Information used |
|---|---|---|
| Response MW per EFA block and product for EFA day E | 14:00 UK on E-1 (EAC gate closure) | EAC prices of E-1 (published 15:00 on E-2), MID / system prices published by 14:00, frequency history |
| Acceptance of those offers | 15:00 UK on E-1 | realised clearing price >= offer price |
| Wholesale position of SP j (MID proxy) | T_j - 9 h (opening of the MID window) |
MID up to SP j-19, system prices up to SP j-20 |
| Physical baseline of SP j (NIV chasing, SOC recovery) | T_j - 60 min (gate closure) |
MID up to SP j-3, system prices up to SP j-4 |
Forecasts (fixed on the development window, December 2023 - June 2024): MID forecast for a target SP = 50 % of the latest published day's value in the same slot + 50 % of the mean of the latest 7 published days, plus a level correction (latest published SP minus the same slot one day earlier) decaying by 0.9 per SP of lead. System-price forecast = MID forecast + a spread term: trailing 28-day slot means of (system price - MID) plus the latest published spread deviation times its trailing autocorrelation at the forecast lead (spreads clipped at +/-200 GBP/MWh). EAC price forecast = same block on the latest published EFA day. Expected response energy = trailing 28-day mean per product and EFA block.
Optimisation. Rolling 24-hour LPs (HiGHS via highspy, rebuilt only once and re-solved with new costs and
bounds) choose discharge/charge per SP subject to SOC dynamics, the power headroom left by contracted response,
the SOC band required by the contracted energy volumes (soft, with a 0.1 MWh planning margin), the expected SOC
drift from response delivery and a terminal value for stored energy; a planning hurdle of 5 GBP/MWh is added to
the degradation cost inside the LPs (not in settlement). Only the first SP of each plan is committed. The SP LP
reproduces the repository's quarter-hour LP (realtime.strategies.solve_qh_arbitrage) exactly on duplicated
prices (unit test).
Response allocation. Response-only: per EFA block, an LP over the six products maximises forecast clearing
price minus expected energy cost, subject to the procurement rows (markets.gb.rules.StackingRules) and the energy
volumes fitting in the SOC window minus a margin. Combined stack: one LP per EFA day chooses the six products per
block jointly with a forecast-MID baseline plan. The expected energy cost prices delivered energy at the
system price a few SPs after delivery (energy-weighted, trailing 28 days): low-frequency delivery tends to
coincide with a short system, so the SOC is restored at above-average prices, and high-frequency imports are
sold below average. Offers are submitted at that expected energy cost (rounded to pence) and are accepted when
the clearing price is at or above it.
Simulation and settlement (one step per SP, markets.gb.engine.GBSimulator): response energy from frequency
moves the SOC; the baseline is curtailed if it would leave the SOC window; availability payments are withheld in
SPs where the State of Energy requirement is not met; wholesale positions settle at the realised MID (system
price in the 0.04 % of SPs without traded MID volume), deviations of the physical baseline from the wholesale
position at the system price, response availability at the clearing price.
Strategies (markets.gb.strategies):
| Name | What it does | Oracle for capture |
|---|---|---|
wholesale_forecast |
MID arbitrage, positions fixed 9 h ahead | wholesale_oracle (perfect foresight on MID) |
niv_chasing |
physical position at gate closure on system-price forecasts, all energy settled at the system price | imbalance_oracle |
fr_stack |
DC/DM/DR allocation at 14:00 + SOC steering into the required band at gate closure | fr_oracle (realised clearing prices and energy) |
combined_stack |
response allocation planned with a MID baseline, wholesale at 9 h, NIV chasing and SOC recovery at gate closure | combined_oracle (realised MID, system price, clearing prices and frequency; each SP settled at the better of MID and system price) |
Oracles violate the publication rules by design and are upper bounds, not achievable revenue. Unit tests check that every causal strategy's decisions before a cut are unchanged when all data published after the cut are replaced, and that each forecast input ignores unpublished values.
from euroflex_bess_lab.markets.gb import GBMarket, run_strategy
market = GBMarket.from_public("2025-06-01", "2025-07-01")
ledger = run_strategy("combined_stack", market).ledger
ledger[["revenue_wholesale_gbp", "revenue_imbalance_gbp", "revenue_response_gbp", "degradation_gbp", "pnl_gbp"]].sum()
Outputs¶
reports/great_britain.md,reports/figures/gb_*.png.reports/ledgers/gb_<strategy>.parquet(+.json) for the four causal strategies: one row per SP from 2024-01-01 with positions, response MW per product, energy, SOC, prices, revenue per stream and product, degradation and net revenue in GBP and EUR, plusstrategy,market,mechanism,fleet_mw.reports/ledgers/gb_daily.parquet: one row per strategy (including oracles and sensitivities) and UK day.reports/ledgers/gb_summary.json: every reported number and the run diagnostics.
Scope¶
Simulated money for a price-taking battery; within-day trading is valued at MID (no bid-ask, no day-ahead auction, no Balancing Mechanism); response delivery is perfect apart from SOE unavailability; Quick, Slow and Balancing Reserve and the Capacity Market are not in the strategies; no network charges, BSUoS, levies or taxes.