Skip to main content

Module electrical

Module electrical 

Expand description

The scalar electrical formulas both network families share, which live in powerio-core (electrical::calc_impedance_base, the power factor relations and the voltage power law term). The scalar electrical formulas both network families share: the per unit impedance base, the power factor relations and the voltage power law term. Each is the one implementation the transmission, distribution, composition and matrix crates call.

Enums§

ApparentPowerOrder
The order calc_line_apparent_power multiplies in. The orders are the same product and can differ in the last place.
ImpedanceRatioForm
Which ratio calc_impedance_from_ratio reads and how it forms the split. The forms can differ in the last place.
ReactiveRatioForm
How calc_reactive_ratio forms tan(acos |pf|). The forms are the same ratio and can differ in the last place.
RebaseOrder
The order in which calc_impedance_rebase forms value · Z_base(from) / Z_base(to). Each reader keeps the order it has always used, so its results stay bit for bit the same; the quantity is the same in every order.

Constants§

LOAD_VOLTAGE_RATIO_FLOOR
Below this voltage ratio a power law term with exponent below one is continued by its tangent at the floor (calc_voltage_power_term): x^γ has an unbounded slope at zero for γ < 1 (and is itself unbounded for γ < 0), and an iterate can pass near zero on its way to a solution.
SQRT_3
√3, the line to line over line to neutral voltage ratio of a balanced three phase system.

Functions§

calc_admittance_base
The admittance base S / V² of a voltage base and a power base in consistent units (volts and volt amperes give siemens, kilovolts and megavolt amperes give siemens as well), formed as power / (voltage · voltage). None unless both bases are positive and finite and the quotient is positive and finite. The one admittance base: dividing by it takes a susceptance or conductance to per unit as dividing by calc_impedance_base takes an impedance.
calc_branch_impedance_base
The impedance base V₁ V₂ / S of a branch between two voltage bases at a power base, formed as from_voltage · to_voltage / power, in consistent units: the base on which a line joining two nominal voltages (an IIDM line between voltage levels) states its per unit series impedance. With from_voltage == to_voltage it is calc_impedance_base. None unless all three bases are positive and finite and the quotient is positive and finite.
calc_impedance_base
The impedance base V² / S of a voltage base and a power base in consistent units (volts and volt amperes give ohms, kilovolts and megavolt amperes give ohms as well). None unless both bases are positive and finite and the quotient is finite; the caller states what an unusable base means for its own quantity. The same quantity as calc_branch_impedance_base with one voltage at both ends.
calc_impedance_from_ratio
The resistance and reactance (R, X) of an impedance of magnitude magnitude with the given R / X or X / R ratio, split as form states over calc_impedance_ratio_divisor. The one impedance from a magnitude and a ratio: the SINCAL multiconductor transformer, source and rated shunt readers and the OpenDSS source’s short circuit impedance read it.
calc_impedance_ratio_divisor
The divisor |Z| / X of an impedance with the given ratio, formed as form states: hypot(R/X, 1) or √(1 + 1 / (X/R)²).
calc_impedance_rebase
value taken from the per unit base (from_voltage, from_power) to the base (to_voltage, to_power) when it is a per unit impedance, the factor Z_base(from) / Z_base(to); with the bases swapped it takes a per unit admittance from from to to. order picks the operation order (RebaseOrder). The one per unit rebase: the SINCAL balanced transformer’s series impedance, the PSS/E CM=2 magnetizing admittance and the integrated transmission and distribution transformer lowering read it.
calc_line_apparent_power
The apparent power of a balanced current current at the voltage voltage: factor · V · I, with factor SQRT_3 for a three phase rating at its line to line voltage and 1 for a single phase one, in consistent units (kilovolts and kiloamperes give megavolt amperes), the product taken in order. The one rating conversion from current: the CGMES, UCTE, PowSybl PSS/E and SINCAL readers, the multiconductor to balanced lowering and the OpenDSS source read it.
calc_line_current
The balanced current of an apparent power power at voltage, S / (factor · V): the inverse of calc_line_apparent_power. The CGMES, UCTE and SINCAL writers and the OpenDSS source and Thevenin writer read it.
calc_log_voltage_power_term
One voltage power law term c x^γ over the log voltage ratio ℓ = ln x, formed as c e^{γ ℓ}, with its derivative γ c e^{γ ℓ} with respect to ℓ: calc_voltage_power_term on the positive voltage domain a log voltage lift defines, where no floor is needed. The one log voltage term evaluation: the multiconductor OPF load parameter sensitivity over its log voltage coordinate reads it.
calc_power_factor_coefficients
The coefficients [a, b] of a fixed power factor written as the row a P + b Q = 0: a = √((1 − |pf|)(1 + |pf|)) and b = −pf, so that Q / P = a / pf (calc_reactive_ratio’s ReactiveRatioForm::Sine) and a tiny nonzero power factor keeps a finite row.
calc_power_factor_coefficients_derivative
The derivatives of calc_power_factor_coefficients with respect to pf: [−pf / √(1 − pf²), −1] on |pf| < 1.
calc_power_factor_sine
The sine of a power factor’s angle, sin(acos |pf|) = √((1 − |pf|)(1 + |pf|)), formed without the cancellation of 1 − pf² near unity: the calc_quadrature of a unit magnitude. Reactive power is S times this for an apparent power S. NaN when |pf| > 1.
calc_quadrature
The quadrature leg √(m² − r²) of a magnitude m and its in phase part r, formed as √((m − |r|)(m + |r|)), free of the cancellation of m² − r² near |r| = m, and as m √((1 − q)(1 + q)) with q = |r| / m where that product overflows: the reactance of a short circuit test from its impedance and resistance, the magnetizing current of a no load test from its exciting current and loss, the reactive power of an apparent power and its active part, and with m = 1 the sine of a power factor (calc_power_factor_sine). Zero when both are zero; NaN when |r| > m or either is NaN. The caller states what an excess means for its quantity.
calc_rated_admittance
The admittance that draws power at voltage, power / V², formed as power / (voltage · voltage) in consistent units: a susceptance from a rated reactive power (a capacitor bank or a shunt section in Mvar at kilovolts), a conductance from an active power. The one power over voltage squared at a real power (calc_squared_voltage_admittance): calc_admittance_base, the capacitor stamp, the BMOPF capacitor lowering, the OpenDSS common return bank and the CGMES and PSS/E shunt and SVC conversions read it.
calc_rated_power
The power an admittance draws at voltage, admittance · V², formed as admittance · (voltage · voltage): the inverse of calc_rated_admittance.
calc_reactive_ratio
The reactive over active power ratio a power factor fixes, OpenDSS and BMOPF by sign: Q / P = tan(acos |pf|) with pf > 0, Q on the same side as P, and the opposite sign for pf < 0, formed as form states. Infinite at pf = ±0 and NaN when |pf| > 1.
calc_reactive_ratio_derivative
The derivative of calc_reactive_ratio with respect to pf (either form), −1 / (pf² √(1 − pf²)) on 0 < |pf| < 1.
calc_squared_voltage_admittance
The admittance S / V² that draws the power power at a voltage whose squared magnitude is voltage_squared, formed as power / voltage_squared, for a real or a complex power (conj(S) / |V|² takes conj(S)). Unchecked, as calc_squared_voltage_impedance. The one power over voltage squared: calc_rated_admittance is it at voltage · voltage, and the distribution load’s nominal admittance and the transformer magnetizing base read it.
calc_squared_voltage_impedance
The impedance V² / S that draws the power power at a voltage whose squared magnitude is voltage_squared, formed as voltage_squared / power, for a real or a complex power (|V|² / conj(S) takes conj(S)). With an impedance in place of the power it is the power that impedance draws, the same quotient. Unchecked: the caller states what an unusable voltage or power means. The one voltage squared over a power: calc_branch_impedance_base (over V₁ V₂), the distribution ZIP coefficient and nominal power conversions and the OpenDSS rated reactor read it.
calc_voltage_power_term
One voltage power law term c x^γ at the voltage ratio x = |V| / V_nom and its derivative γ c x^(γ−1) with respect to x. Exponents 0, 1 and 2 (constant power, current and impedance) are evaluated without powf. For any other γ < 1 and x below LOAD_VOLTAGE_RATIO_FLOOR the term follows its tangent at the floor, c (f₀ + f₀' (x − x₀)), so value and slope stay finite and consistent as a voltage approaches zero.
calc_voltage_power_terms
The sum of voltage power law terms [coefficient, exponent] at the voltage ratio x, with its derivative with respect to x, each term by calc_voltage_power_term.
calc_wye_line_voltage
The line to line voltage of a balanced three phase system from its line to neutral voltage, √3 V_LN: the inverse of calc_wye_phase_voltage.
calc_wye_phase_voltage
The line to neutral voltage of a balanced three phase system from its line to line voltage, V_LL / √3. The one line to neutral conversion (OpenDSS, MG-RAVENS, pandapower, the transmission and distribution coupling).