Skip to main content

Module metering

Module metering 

Source
Expand description

metering’s numbers in this crate’s shapes, behind the metering feature: the § 14a minimum as a Guarantee, and quarter-hour Lastgang energy as average power per ISP, for settle.

use flexibility::metering::{self, wire};
use wire::dec;
use wire::grid::para14a::{Anlage, Para14aConfig, SteuVeFallgruppe, mindestleistung_direktansteuerung, steuerbare_verbrauchseinrichtungen};
let pump = steuerbare_verbrauchseinrichtungen(&[Anlage::new(SteuVeFallgruppe::Waermepumpe, dec!(20.001))]).unwrap();
let minimum = mindestleistung_direktansteuerung(&pump[0], &Para14aConfig::VERMUTUNG);
let rule = Provenance::new("bnetza.de", "BK6-22-300", Timestamp::UNIX_EPOCH);
// 0,4 × 20,001 kW = 8 000,4 W: the minimum is kept to the watt above, never below.
assert_eq!(metering::guarantee(minimum, day, rule)?.power(), w!(8001));

Re-exports§

pub use ::metering as wire;

Functions§

guarantee
The § 14a minimum as a guarantee over window: its whole watts as metering gives them, rounded up, since it is a power that must at least stay allowed (BK6-22-300 Anlage 1 Ziff. 4.5).
power
The average power per ISP of grid from the quarter-hour Lastgang energy of channels: import (1-0:1.29.0) positive, export (1-0:2.29.0) negative, summed exactly and rounded once per ISP as rounding says. Pass the import and the export of one connection point to get its net power.