Skip to main content

series_admittance_of

Function series_admittance_of 

Source
pub fn series_admittance_of(
    r: f64,
    x: f64,
    row: usize,
) -> Result<Option<(f64, f64)>>
Expand description

The series admittance (g, b) of an impedance, guarded.

None is an impedance too small to divide by, under MIN_DIVISIBLE_MAGNITUDE; the caller decides whether that is a skip or an error. The bound is on the impedance magnitude, not on r² + x², which is its square: bounding the square would refuse impedances the DC builders divide by.

Y_bus takes r already zeroed under the XB scheme, so it passes its own pair rather than a branch’s.

§Errors

Error::NonFiniteSusceptance when r/x are NaN/Inf, so a bad value cannot write NaN or a silent zero downstream. NaN leaves hypot NaN, which is not below the bound, so it arrives at that check rather than reading as zero impedance. row only labels the error.