Skip to main content

DistLoadVoltageModel

Enum DistLoadVoltageModel 

Source
#[non_exhaustive]
pub enum DistLoadVoltageModel { ConstantPower { v_nom: Vec<f64>, }, ConstantCurrent { v_nom: Vec<f64>, }, ConstantImpedance { v_nom: Vec<f64>, }, Zip { v_nom: Vec<f64>, alpha_z: Vec<f64>, alpha_i: Vec<f64>, alpha_p: Vec<f64>, beta_z: Vec<f64>, beta_i: Vec<f64>, beta_p: Vec<f64>, }, Exponential { v_nom: Vec<f64>, gamma_p: Vec<f64>, gamma_q: Vec<f64>, }, BoundedZip { v_nom: Vec<f64>, alpha_z: Vec<f64>, alpha_i: Vec<f64>, alpha_p: Vec<f64>, beta_z: Vec<f64>, beta_i: Vec<f64>, beta_p: Vec<f64>, v_low_pu: f64, v_min_pu: f64, v_max_pu: f64, cutoff_pu: f64, }, BoundedExponential { v_nom: Vec<f64>, gamma_p: Vec<f64>, gamma_q: Vec<f64>, v_low_pu: f64, v_min_pu: f64, v_max_pu: f64, }, BoundedConstantPower { v_nom: Vec<f64>, v_min_pu: f64, v_max_pu: f64, current_limit_pu: Option<f64>, }, }

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

ConstantPower

Constant power load. v_nom is volts per active phase when the source states it.

Fields

§v_nom: Vec<f64>
§

ConstantCurrent

Constant current load. v_nom is volts per active phase.

Fields

§v_nom: Vec<f64>
§

ConstantImpedance

Constant impedance load. v_nom is volts per active phase.

Fields

§v_nom: Vec<f64>
§

Zip

ZIP load coefficients by active phase. v_nom is volts per active phase; alpha terms apply to active power and beta terms to reactive power.

Fields

§v_nom: Vec<f64>
§alpha_z: Vec<f64>
§alpha_i: Vec<f64>
§alpha_p: Vec<f64>
§beta_z: Vec<f64>
§beta_i: Vec<f64>
§beta_p: Vec<f64>
§

Exponential

Exponential voltage model by active phase. v_nom is volts per active phase.

Fields

§v_nom: Vec<f64>
§gamma_p: Vec<f64>
§gamma_q: Vec<f64>
§

BoundedZip

ZIP law with low-voltage current interpolation and high-voltage impedance continuation. See Self::power_scale for the equations. Below v_low_pu the entire nominal load is constant impedance; the dropout curve applies only above that threshold.

Fields

§v_nom: Vec<f64>
§alpha_z: Vec<f64>
§alpha_i: Vec<f64>
§alpha_p: Vec<f64>
§beta_z: Vec<f64>
§beta_i: Vec<f64>
§beta_p: Vec<f64>
§v_low_pu: f64
§v_min_pu: f64
§v_max_pu: f64
§cutoff_pu: f64
§

BoundedExponential

Exponential law inside a voltage band, with nominal-impedance continuation below v_low_pu, current interpolation up to v_min_pu, and impedance continuation above v_max_pu. The continuations apply equally to P and Q, independently of their middle-band exponents. See Self::power_scale for the equations. Arrays follow active branches.

Fields

§v_nom: Vec<f64>
§gamma_p: Vec<f64>
§gamma_q: Vec<f64>
§v_low_pu: f64
§v_min_pu: f64
§v_max_pu: f64
§

BoundedConstantPower

Constant power between positive voltage bounds, with impedance continuation outside them and an optional current-magnitude limit. v_nom is volts per active branch. current_limit_pu is a multiple of that branch’s nominal apparent power divided by nominal voltage. P and Q share one scale, preserving power factor. See Self::power_scale.

Fields

§v_nom: Vec<f64>
§v_min_pu: f64
§v_max_pu: f64
§current_limit_pu: Option<f64>

Implementations§

Source§

impl DistLoadVoltageModel

Source

pub fn v_nom(&self) -> &[f64]

Source§

impl DistLoadVoltageModel

Source

pub fn power_scale( &self, phase: usize, voltage: f64, ) -> Result<[f64; 2], String>

Evaluate active/reactive power multipliers at a nonnegative voltage magnitude in volts. Coefficient and nominal-voltage arrays follow active load branches, rather than bus conductor order.

For a bounded ZIP law, let u = voltage / v_nom. Below v_low_pu, both factors are u². Between that threshold and v_min_pu, the constant-power/current contributions interpolate current magnitude from v_low_pu to respectively 1/v_min_pu and 1; the impedance term stays u². Above v_max_pu, their power factors are respectively (u/v_max_pu)² and u²/v_max_pu. Inside the band they are 1 and u. Above the low threshold, a positive cutoff multiplies the result by (1 + tanh(500 * (u - cutoff_pu))) / 2.

For a bounded exponential law the middle-band factors are u^gamma_p and u^gamma_q. Both factors become u² below the low threshold, u * (low + (1/min - low) * (u-low)/(min-low)) between low and min, and (u/max)² above max (using u² when max is zero). These continuations need not join the exponential law continuously.

For bounded constant power, the scale is (u/min)² at or below min, 1 inside the band, and (u/max)² above max. An optional current limit caps this scale at u * current_limit_pu.

Returns an error for missing coefficients, invalid parameters or nonfinite evaluation instead of manufacturing a nominal load law.

Source

pub fn without_voltage_bounds(&self) -> Self

Nominal law without voltage bounds: the middle-band law, with the low-voltage transitions, high-voltage continuation and dropout removed. Any other law is returned unchanged. A caller uses this only with an explicit diagnostic when the destination cannot carry the full law.

Trait Implementations§

Source§

impl Clone for DistLoadVoltageModel

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for DistLoadVoltageModel

Source§

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

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

impl Default for DistLoadVoltageModel

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for DistLoadVoltageModel

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 JsonSchema for DistLoadVoltageModel

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for DistLoadVoltageModel

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for DistLoadVoltageModel

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
Source§

impl StructuralPartialEq for DistLoadVoltageModel

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.