#[non_exhaustive]pub struct McOpfLoadLaw {
pub nominal: f64,
pub terms: [Vec<[f64; 2]>; 2],
}Expand description
A sum of voltage power laws: coefficient times (|U|/nominal)^exponent. Coefficients are per-unit power; exponents are dimensionless.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.nominal: f64Coil nominal voltage divided by V_base.
terms: [Vec<[f64; 2]>; 2]Active then reactive terms; each [coefficient, exponent] contributes coefficient * (|U| / nominal)^exponent in per-unit power.
Implementations§
Source§impl McOpfLoadLaw
impl McOpfLoadLaw
Sourcepub fn new(nominal: f64, terms: [Vec<[f64; 2]>; 2]) -> Self
pub fn new(nominal: f64, terms: [Vec<[f64; 2]>; 2]) -> Self
A law of active then reactive [coefficient, exponent] terms at the
per unit coil nominal voltage nominal.
Sourcepub fn calc_power(&self, voltage: f64) -> [(f64, f64); 2]
pub fn calc_power(&self, voltage: f64) -> [(f64, f64); 2]
The law’s per unit active and reactive power at the per unit voltage
magnitude voltage (on V_base), each with its derivative with
respect to voltage: the terms summed by the one power law term
evaluation ([powerio_core::electrical::calc_voltage_power_term]) at
the ratio voltage / nominal.
Sourcepub fn calc_impedance_admittance(&self) -> Option<Complex64>
pub fn calc_impedance_admittance(&self) -> Option<Complex64>
The constant admittance of a law whose every term has exponent two
(pure constant impedance), per unit: conj(Σ P + j Σ Q) / nominal²
(powerio_dist::calc_load_nominal_admittance), so
the coil current is Y U at every voltage, zero included. None
when any term has another exponent.