Expand description
flexpool day-ahead planning: from a forecast to a schedule, water values and limit orders per battery pool, and their paper result.
Pure: a forecast, its error correlation, the storage and the market rules in; a plan out. The
linear programme maximises (1 − β)·E(revenue) + β·CVaR 10 % over Gaussian-copula scenarios
(Rockafellar–Uryasev), solved by Clarabel; the energy-balance duals are the water values the
orders are priced from. f64 stays inside; order volumes and prices leave through
flexpool_core::quantize().
Structs§
- Fill
- An order after the auction.
- Market
- What the market rules say about orders on the day.
- Order
- One day-ahead limit order.
- Outcome
- How a committed plan did against the published prices.
- Pool
Plan - A pool’s plan.
- Revenue
- Revenue across the scenarios, €.
- Schedule
- A solved schedule.
- Step
- One market time unit of a pool’s plan.
- Storage
- One pool’s batteries as one storage.
Enums§
Constants§
- CVAR_
ALPHA - The CVaR tail: the worst 10 % of scenarios.
- SCENARIOS
- Scenarios drawn per day.
- SOC_MAX
- Upper end of the window.
- SOC_MIN
- State of charge window as shares of usable energy.
- SOC_
START - Start (and minimum end) state of charge as a share of usable energy.
Functions§
- draw
SCENARIOSprice paths forforecast(one value per interval), latent AR(1) withrhoper step, clamped to[lo, hi], deterministic forseed.- evaluate
- Executes
planon paper againstpricesand compares it with perfect foresight. - execute
- Paper execution of
ordersagainst publishedprices(one per unit starting atstarts): a sell fills at a price at or above its limit, a buy at or below; the storage’s window holds. Returns the fills and the revenue, €. - inverse_
normal - Φ⁻¹(p) by Acklam’s rational approximation (relative error < 1.2e-9), for p in (0, 1).
- orders
- One limit order per unit with a net flow, for the net volume, with protective limits: a sell at or above the lowest scenario price, a buy at or below the highest. Each order carries the expected price and the water value that explain it.
- plan
- A plan for
storageoverscenarios(one price per unit ofhours, units starting atstarts). - price_
at - The price at normal score
zfor quantilesq: piecewise linear between the knots, linear beyond them with the outer slopes. At the knots it returns the quantiles exactly. - solve
- Solves max (1 − β)·E(R) + β·CVaR₀.₁(R) over
scenarios(each one price per interval ofhours).