pub struct StorageParams {Show 18 fields
pub charge_efficiency: f64,
pub discharge_efficiency: f64,
pub energy_capacity_mwh: f64,
pub soc_initial_mwh: f64,
pub soc_min_mwh: f64,
pub soc_max_mwh: f64,
pub variable_cost_per_mwh: f64,
pub degradation_cost_per_mwh: f64,
pub dispatch_mode: StorageDispatchMode,
pub self_schedule_mw: f64,
pub discharge_offer: Option<Vec<(f64, f64)>>,
pub charge_bid: Option<Vec<(f64, f64)>>,
pub max_c_rate_charge: Option<f64>,
pub max_c_rate_discharge: Option<f64>,
pub chemistry: Option<String>,
pub discharge_foldback_soc_mwh: Option<f64>,
pub charge_foldback_soc_mwh: Option<f64>,
pub daily_cycle_limit: Option<f64>,
}Expand description
Storage-specific parameters for generators with energy storage capability.
Present on generators that are batteries (BESS), pumped hydro acting as
storage, or any other energy-limited bidirectional resource.
When Some, Generator.pmin is negative (= -charge_mw_max) and
Generator.pmax is the discharge power limit.
Fields§
§charge_efficiency: f64Charge-side efficiency (0 < eta <= 1): fraction of metered charge MW that reaches the SoC reservoir. Typical lithium-ion batteries lose most of their round-trip on this leg (~90%).
discharge_efficiency: f64Discharge-side efficiency (0 < eta <= 1): fraction of SoC draw that reaches the grid as metered discharge MW. Typically higher than the charge-side (~98% for modern inverters).
energy_capacity_mwh: f64Usable energy capacity (MWh).
soc_initial_mwh: f64Initial state of charge (MWh). Must be in [soc_min_mwh, soc_max_mwh].
soc_min_mwh: f64Minimum allowable SoC (MWh).
soc_max_mwh: f64Maximum allowable SoC (MWh). Typically equal to energy_capacity_mwh.
variable_cost_per_mwh: f64Variable cost per MWh discharged ($/MWh). Used in CostMinimization mode.
degradation_cost_per_mwh: f64Degradation cost per MWh throughput ($/MWh), applied to both charge and discharge.
dispatch_mode: StorageDispatchModeHow the optimizer dispatches this unit.
self_schedule_mw: f64Pre-committed net dispatch (MW). SelfSchedule mode only.
discharge_offer: Option<Vec<(f64, f64)>>Discharge offer curve: cumulative (MW, $/hr) breakpoints with an
explicit (0.0, 0.0) origin. OfferCurve mode only.
charge_bid: Option<Vec<(f64, f64)>>Charge bid curve: cumulative (MW, $/hr) breakpoints with an explicit
(0.0, 0.0) origin. OfferCurve mode only.
max_c_rate_charge: Option<f64>Max charge C-rate (e.g. 0.25 for 4-hr battery). None = inverter-limited.
max_c_rate_discharge: Option<f64>Max discharge C-rate. None = inverter-limited.
chemistry: Option<String>Battery chemistry (informational): “LFP”, “NMC”, “flow”, “sodium”.
discharge_foldback_soc_mwh: Option<f64>Discharge-side foldback threshold (MWh of SoC). Above this, the
battery can reach its full discharge MW cap; below, the cap
derates linearly to 0 MW at soc_min_mwh. None disables
the foldback cut entirely. Typical lithium-ion value: a few
percent of energy capacity above soc_min_mwh.
charge_foldback_soc_mwh: Option<f64>Charge-side foldback threshold (MWh of SoC). Below this, the
battery can reach its full charge MW cap; above, the cap
derates linearly to 0 MW at soc_max_mwh. None disables
the foldback cut. Typical lithium-ion value: a few percent of
energy capacity below soc_max_mwh.
daily_cycle_limit: Option<f64>Maximum full equivalent cycles per 24-hour window. One FEC =
one full charge + one full discharge, i.e. throughput of
2 × energy_capacity_mwh. The dispatch enforces it as a
linear cap on Σ_t (charge_mw[t] + discharge_mw[t]) · dt
inside each 24-hour bucket of the horizon (partial days are
pro-rated). Only the time-coupled SCUC build honours this —
in period-by-period SCED there is no inter-period coupling
to enforce against. None disables the cap.
Implementations§
Source§impl StorageParams
impl StorageParams
Sourcepub fn with_energy_capacity_mwh(energy_capacity_mwh: f64) -> Self
pub fn with_energy_capacity_mwh(energy_capacity_mwh: f64) -> Self
Construct with sensible defaults for a storage resource with the given energy capacity.
Power limits live on the parent Generator:
Generator::pmin = -charge_mw_max and
Generator::pmax = discharge_mw_max.
Sourcepub fn round_trip_efficiency(&self) -> f64
pub fn round_trip_efficiency(&self) -> f64
Round-trip efficiency implied by the charge/discharge pair. Useful for reporting and tests where a single figure is expected.
Sourcepub fn from_round_trip(energy_capacity_mwh: f64, round_trip: f64) -> Self
pub fn from_round_trip(energy_capacity_mwh: f64, round_trip: f64) -> Self
Construct a symmetric split from a single round-trip figure. Convenience for callers that only have a nameplate round-trip number and want the legacy sqrt-per-leg behaviour.
Sourcepub fn validate(&self) -> Result<(), StorageValidationError>
pub fn validate(&self) -> Result<(), StorageValidationError>
Validate storage parameters.
Sourcepub fn validate_market_curve_points(
points: &[(f64, f64)],
curve_label: &str,
) -> Result<(), String>
pub fn validate_market_curve_points( points: &[(f64, f64)], curve_label: &str, ) -> Result<(), String>
Validate a market bid/offer curve used by storage dispatch.
Curves must include an explicit (0.0, 0.0) origin followed by at
least one additional strictly increasing MW breakpoint.
Trait Implementations§
Source§impl Clone for StorageParams
impl Clone for StorageParams
Source§fn clone(&self) -> StorageParams
fn clone(&self) -> StorageParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more