Documentation

flexibility computes what a grid operator and an aggregator have to agree on: the power a site may use in each quarter hour, the baseline it is measured against, and the flexibility it delivered. Everything is whole watts and watt-seconds, and the crate reads no clock and does no I/O, so the same inputs give the same bytes on every machine.

New to the domain? The glossary explains every term in a sentence or two.

The API may change before 1.0. What a method id or a canonical text computes does not: see Design.

Everything in this section

  • Getting started — Add flexibility, run the examples, and settle an order against a baseline in one short program.
  • Units and sign — Power in whole watts with consumption positive, compile-time literals, Deviation relative to a baseline, Energy in watt-seconds, and named rounding.
  • Time and ISPs — Grids of imbalance settlement periods in a time zone, DST days with 92 or 100 quarter hours, windows from local times, ISP labels, slices and series.
  • Limits and envelopes — Caps over a window, envelopes that only get stricter, provenance on every bound, schedules checked ISP by ISP, explain, headroom, and § 14a guarantees.
  • Storage and pools — Energy envelopes for batteries, cars and heat buffers: level bounds at every ISP boundary, steady headroom, pools that say whether they are exact, split checks.
  • Baselines — The four baseline methods dprognosis@1, schedule@1, mbma@1 and xofy@1: parameters, rounding, derivation, method cards, and how each can be gamed.
  • Settlement — Delivered flexibility and power deficiency per ISP exactly as UFTP 3.1 § 2.6 computes them, with a canonical text, a sha256 digest and diff.
  • Verifying a settlement — Check another party's flexibility settlement: recompute its sha256 digest outside Rust, read it back, diff it, and check a UFTP settlement.
  • Accuracy — Score a baseline method on non-event days: bias, RMSE and relative RMSE in basis points, computed exactly with integers.
  • Protocols — How flexibility maps UFTP, EEBUS, S2, OpenADR 3, CSIP-AUS, IEC 104 and CLS.EEDI into limits and settlements: lossless or refusing.
  • UFTP — UFTP 3.1 (Shapeshifter) in Rust: FlexRequests as deviation envelopes, orders as deviations, FlexOrderSettlement items, and checking a received one.
  • EEBUS and metering — EEBUS LPC and LPP limits to and from power caps, and the § 14a minimum and Lastgang energy from German metering, in exact watts.
  • S2 and OpenADR — S2 power envelopes and sequences, OpenADR 3 capacity limits both ways, and usage reports, as exact limits and schedules in Rust.
  • IEC 104, CLS and CSIP-AUS — IEC 104 set points, CLS.EEDI control-box limits and CSIP-AUS operating envelopes as exact power caps in Rust, with the § 14a guarantee.
  • Design — What the crate guarantees and why: pure functions, exact integers, one sign, no defaults, method ids that never change meaning, and refusal over invention.
  • Glossary — Grid flexibility terms explained: ISP, DSO, aggregator, baseline, delivered flexibility, deficiency, envelope, § 14a, rebound, digest, protocols.