Plan
From the forecast to a day-ahead plan per battery pool: scenarios, an optimiser with a risk knob, the water value behind every order, and the result against perfect foresight. Paper only.
The forecast says what prices to expect. The plan says what to do about it: for every battery pool, when to charge and discharge, how full the storage is through the day, what that should earn — and the orders that would go to the day-ahead auction. Nothing is sent to a market: the plan is paper until flexpool has a market connection.
In the desk🔗

Plan (g p) shows each pool with batteries:
- Figures — expected revenue, the range 80 % of scenarios fall in, and the mean of the worst 10 %. After publication: what the orders earned on paper, the perfect-foresight revenue, and the share captured.
- One sentence why — Lädt 02:45–04:45, 12:00–14:00 bei erwartet 60 €/MWh, entlädt 07:15–09:00 und 18:30–20:00 bei 128 €/MWh. Wasserwert 98 €/MWh.
- Three aligned charts — expected (and published) price, charge and discharge power, state of charge.
- The orders as a table: quarter hour, side, MW, limit, expected price, water value; after publication the price and whether each was filled — and Warum? on each (Begründung).
The risk (neutral, ausgewogen, vorsichtig) and the forecast model are in the URL (?view=plan&risk=cautious&model=naive-week). Above the pools, Letzte 14 Tage says how much of perfect foresight the same planning earned on the past fortnight.
How it is made🔗
- Scenarios. 200 price paths for the day from the forecast's five quantiles — each quarter hour's distribution exactly as forecast, and the quarters correlated as the forecast's own errors have been (a Gaussian copula; the correlation is shown with the plan).
- The optimiser. One linear programme per pool — its batteries summed to one storage — maximises (1 − β) × expected revenue + β × the mean of the worst 10 % of scenarios (CVaR). β is 0 for neutral, 0.5 for ausgewogen, 0.9 for vorsichtig. Hard limits, never traded for money: rated power (charge plus discharge), 10–90 % of usable energy, round-trip losses, start at half full and end at least as full. Solved by Clarabel, an interior-point solver.
- The water value — what one more stored MWh is worth at each moment — comes straight from the optimiser (the dual of the energy balance). Charging pays where the price is below it, discharging where above: that is the reason sentence.
- The orders. One per quarter hour with a planned flow, for the net volume (0.1 MW, rounded toward zero), with a protective limit: buy up to the highest price any scenario thought possible, sell down to the lowest. Volume and price steps are dated market rules.
- Committed at the gate. Before 12:00 the plan follows the latest forecast; from the gate on, the plan made at the gate is the one shown and judged.
- Judged on paper. Once prices are published, each order is filled if the price meets its limit (the storage's limits still hold), and the result is compared with the best schedule had the prices been known. Energy left above or below the start is valued at the day's mean price.
Why protective limits🔗
Limits at the water value look elegant but split the two legs of an arbitrage: on a day slightly below forecast, the cheap buys fill and the expensive sells miss. Over 8 market histories × 14 days:
| Limits | Share of perfect foresight |
|---|---|
| water value | 41–46 % |
| 80 % band of the scenarios | 79–80 % |
| protective (scenario range) | 94 % |
| price-taking (any price) | 95–96 % |
Protective limits give up 1.6 points against price-taking for never buying a price spike blind.
Settings🔗
| Setting | Default | Meaning |
|---|---|---|
plan.round_trip_percent | 88 | Round-trip efficiency at the grid connection, 50–100 % |
plan.cycle_cost | 0 | Cost of discharging one MWh (wear, warranty), 0–1,000 €/MWh |
Both are shown under the plan.
API🔗
curl -s 'localhost:8080/api/v1/plan/day-ahead?risk=cautious&model=blend'
curl -s 'localhost:8080/api/v1/plan/day-ahead/backtest?risk=balanced'Identical requests are served from a cache (x-flexpool-cache: hit); one plan is solved at a time. An unknown risk is a 400, an unknown model or a day without forecast a 404. See the API.
Limits🔗
Day-ahead only, per pool, batteries only; units in a pool are dispatched together. One day at a time: the storage starts at half full and ends at least as full instead of valuing tomorrow. There is no intraday, no linked order and no split per unit.