Skip to main content

StorageParams

Struct StorageParams 

Source
pub struct StorageParams {
Show 17 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>,
}
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: f64

Charge-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: f64

Discharge-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: f64

Usable energy capacity (MWh).

§soc_initial_mwh: f64

Initial state of charge (MWh). Must be in [soc_min_mwh, soc_max_mwh].

§soc_min_mwh: f64

Minimum allowable SoC (MWh).

§soc_max_mwh: f64

Maximum allowable SoC (MWh). Typically equal to energy_capacity_mwh.

§variable_cost_per_mwh: f64

Variable cost per MWh discharged ($/MWh). Used in CostMinimization mode.

§degradation_cost_per_mwh: f64

Degradation cost per MWh throughput ($/MWh), applied to both charge and discharge.

§dispatch_mode: StorageDispatchMode

How the optimizer dispatches this unit.

§self_schedule_mw: f64

Pre-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.

Implementations§

Source§

impl StorageParams

Source

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.

Source

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.

Source

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.

Source

pub fn validate(&self) -> Result<(), StorageValidationError>

Validate storage parameters.

Source

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.

Source

pub fn market_curve_value(points: &[(f64, f64)], mw: f64) -> f64

Evaluate a storage market bid/offer curve at a given MW level.

Source

pub fn market_curve_marginal_value(points: &[(f64, f64)], mw: f64) -> f64

Evaluate the marginal value of a storage market bid/offer curve.

Trait Implementations§

Source§

impl Clone for StorageParams

Source§

fn clone(&self) -> StorageParams

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StorageParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for StorageParams

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for StorageParams

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,