Skip to main content

DispatchableLoad

Struct DispatchableLoad 

Source
pub struct DispatchableLoad {
Show 29 fields pub bus: u32, pub p_sched_pu: f64, pub q_sched_pu: f64, pub p_min_pu: f64, pub p_max_pu: f64, pub q_min_pu: f64, pub q_max_pu: f64, pub archetype: LoadArchetype, pub cost_model: LoadCostModel, pub fixed_power_factor: bool, pub in_service: bool, pub resource_id: String, pub product_type: Option<String>, pub dispatch_notification_minutes: f64, pub min_duration_hours: f64, pub baseline_mw: Option<f64>, pub rebound_fraction: f64, pub rebound_periods: usize, pub ramp_up_pu_per_hr: Option<f64>, pub ramp_down_pu_per_hr: Option<f64>, pub initial_p_pu: Option<f64>, pub pq_linear_equality: Option<PqLinearLink>, pub pq_linear_upper: Option<PqLinearLink>, pub pq_linear_lower: Option<PqLinearLink>, pub ramp_group: Option<String>, pub energy_offer: Option<EnergyOffer>, pub reserve_offers: Vec<ReserveOffer>, pub reserve_group: Option<String>, pub qualifications: QualificationMap,
}
Expand description

A dispatchable load resource at a specific bus.

Represents any demand-side resource that can vary its consumption in response to price signals or ISO dispatch instructions. Compatible archetypes include interruptible loads, demand response resources, EV charging aggregators, and virtual power plants.

Fields§

§bus: u32

External bus number this resource is attached to.

§p_sched_pu: f64

Scheduled / baseline real power consumption (per-unit, positive = consuming).

§q_sched_pu: f64

Scheduled / baseline reactive power consumption (per-unit, positive = consuming).

§p_min_pu: f64

Minimum real power served (per-unit).

  • Curtailable: p_min < p_sched (partial curtailment allowed).
  • Interruptible: 0.0 (full curtailment allowed).
  • Elastic: may be 0.0 or greater.
§p_max_pu: f64

Maximum real power served (per-unit).

  • Curtailable / Interruptible: typically equals p_sched_pu.
  • Elastic: may exceed p_sched_pu (load can increase above baseline).
§q_min_pu: f64

Minimum reactive power served (per-unit).

For fixed-power-factor loads: q_sched * p_min / p_sched. For IndependentPQ: independently bounded.

§q_max_pu: f64

Maximum reactive power served (per-unit).

For fixed-power-factor loads: q_sched_pu. For IndependentPQ: independently bounded.

§archetype: LoadArchetype

Demand-response archetype — governs variable structure and constraints.

§cost_model: LoadCostModel

Cost / benefit model for objective function.

§fixed_power_factor: bool

Fixed power factor flag.

When true, reactive power tracks real power proportionally: Q_served = q_sched_pu / p_sched_pu * P_served

Implemented as an equality constraint in AC-OPF, or by substituting Q_served as a function of P_served (eliminating one variable).

Automatically false for IndependentPQ archetype.

§in_service: bool

Whether this resource is active in the OPF.

When false, the resource is treated as a fixed load at p_sched_pu.

§resource_id: String

Stable user-facing identifier for this demand-response resource.

When empty, callers may canonicalize it from network context.

§product_type: Option<String>

ISO/RTO market product type, e.g., “ECRSS”, “NSRS”, “RRS”, “ERCOT_DR”.

§dispatch_notification_minutes: f64

Dispatch notification lead time in minutes.

Distinguishes real-time (< 10 min) from day-ahead (> 60 min) resources. Informational — affects market product eligibility, not OPF math.

§min_duration_hours: f64

Minimum dispatch duration in hours (e.g., 1.0 for ERS in ERCOT).

Informational — affects market product eligibility, not OPF math.

§baseline_mw: Option<f64>

Customer baseline load (MW). When present, curtailment is measured as baseline_mw - p_served_mw instead of p_sched - p_served. Used for settlement. Dispatch optimization still uses p_sched.

§rebound_fraction: f64

Fraction of curtailed energy that rebounds as additional load after curtailment ends (0.0–1.0). Zero means no rebound.

§rebound_periods: usize

Number of periods over which rebound energy is spread.

§ramp_up_pu_per_hr: Option<f64>

Maximum upward ramp rate of served real power (per-unit per hour).

None means the load has no ramp constraint (legacy behaviour). When set, the SCUC/SCED LP enforces p_served[t] - p_served[t-1] <= ramp_up_pu_per_hr * dt and the initial-period constraint p_served[0] <= initial_p_pu + ramp_up_pu_per_hr * dt[0] (via the optional initial_p_pu below).

§ramp_down_pu_per_hr: Option<f64>

Maximum downward ramp rate of served real power (per-unit per hour).

§initial_p_pu: Option<f64>

Prior-horizon served real power (per-unit). Used as the anchor for the first-period ramp constraint when ramp_up_pu_per_hr / ramp_down_pu_per_hr is set. None disables the first-period anchor.

§pq_linear_equality: Option<PqLinearLink>

Linear EQUALITY linking q = q_at_p_zero_pu + beta * p for consumers whose reactive output is rigidly tied to their real power schedule. Q-reserves on these devices are forced to zero.

§pq_linear_upper: Option<PqLinearLink>

Linear UPPER bound q + q^qrd ≤ q_at_p_zero_pu + beta * p for consumers that cap their reactive output relative to real power. For consumers q^qrd is on the LHS of the upper bound — the formulation is symmetric to producers but with qrd and qru swapped on the role of “tightening the box”.

§pq_linear_lower: Option<PqLinearLink>

Linear LOWER bound q − q^qru ≥ q_at_p_zero_pu + beta * p for consumers that floor their reactive output relative to real power.

§ramp_group: Option<String>

Identifier for a multi-block ramp aggregate.

When multiple DispatchableLoad entries share the same ramp_group, the SCUC/SCED LP constrains Σ p_served across the group (rather than each block individually) against the shared ramp_up_pu_per_hr, ramp_down_pu_per_hr, and initial_p_pu. Use this when a single physical consumer is split into price-block DL entries that must still respect the consumer-level ramp rate as an aggregate.

§energy_offer: Option<EnergyOffer>

Energy offer for market clearing.

§reserve_offers: Vec<ReserveOffer>

Reserve offers keyed by product ID (generic reserve model).

§reserve_group: Option<String>

Identifier for a physical reserve-capability aggregate.

When multiple dispatchable-load blocks share this value, the reserve LP constrains the sum of their awards by the group’s capability instead of treating each block as an independent provider. This is useful when one physical consumer is split into multiple price blocks.

§qualifications: QualificationMap

Custom qualification flags for reserve products.

Implementations§

Source§

impl DispatchableLoad

Source

pub fn curtailable( bus: u32, p_sched_mw: f64, q_sched_mvar: f64, p_min_mw: f64, cost_per_mwh: f64, base_mva: f64, ) -> Self

Create a curtailable load with linear curtailment cost.

§Arguments
  • bus: external bus number
  • p_sched_mw, q_sched_mvar: scheduled consumption (MW / MVAr)
  • p_min_mw: minimum served real power (MW)
  • cost_per_mwh: Value of Lost Load or interruptible contract price ($/MWh)
  • base_mva: system MVA base for per-unit conversion
Source

pub fn elastic( bus: u32, p_min_mw: f64, p_max_mw: f64, a_choke_price: f64, b_slope: f64, base_mva: f64, ) -> Self

Create an elastic load with quadratic utility function.

Demand curve: MU(P) = a - b*P where P is in MW. At equilibrium: MU(P_served) = LMP.

Source

pub fn interruptible( bus: u32, p_sched_mw: f64, q_sched_mvar: f64, cost_per_mwh: f64, base_mva: f64, ) -> Self

Create an interruptible load with interrupt penalty.

Source

pub fn reserve_offer(&self, product_id: &str) -> Option<&ReserveOffer>

Get the reserve offer for a specific product, if any.

Source

pub fn p_injection_sched(&self) -> f64

Net injection contribution at the bus at scheduled level (negative = load consuming).

Source

pub fn q_injection_sched(&self) -> f64

Net reactive injection at the bus at scheduled level.

Source

pub fn pf_ratio(&self) -> f64

Fixed-power-factor ratio Q/P (0 if p_sched = 0).

Trait Implementations§

Source§

impl Clone for DispatchableLoad

Source§

fn clone(&self) -> DispatchableLoad

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 DispatchableLoad

Source§

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

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

impl<'de> Deserialize<'de> for DispatchableLoad

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 DispatchableLoad

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>,