#[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
ConstantPower
Constant power load. v_nom is volts per active phase when the source
states it.
ConstantCurrent
Constant current load. v_nom is volts per active phase.
ConstantImpedance
Constant impedance load. v_nom is volts per active phase.
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
Exponential
Exponential voltage model by active phase. v_nom is volts per active
phase.
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
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
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.
Implementations§
Source§impl DistLoadVoltageModel
impl DistLoadVoltageModel
Sourcepub fn power_scale(
&self,
phase: usize,
voltage: f64,
) -> Result<[f64; 2], String>
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.
Sourcepub fn without_voltage_bounds(&self) -> Self
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
impl Clone for DistLoadVoltageModel
Source§impl Debug for DistLoadVoltageModel
impl Debug for DistLoadVoltageModel
Source§impl Default for DistLoadVoltageModel
impl Default for DistLoadVoltageModel
Source§impl<'de> Deserialize<'de> for DistLoadVoltageModel
impl<'de> Deserialize<'de> for DistLoadVoltageModel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for DistLoadVoltageModel
impl JsonSchema for DistLoadVoltageModel
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more