Skip to main content

calc_bus_power_injection

Function calc_bus_power_injection 

Source
pub fn calc_bus_power_injection(
    admittance: &YbusParts,
    vm: &[f64],
    va: &[f64],
) -> Result<(Vec<f64>, Vec<f64>), Error>
Expand description

The complex power injection S = diag(V) conj(Y V) at every bus, split into active and reactive parts (p, q), at the voltages vm (per unit) and va (radians) in the admittance matrix’s bus order. The injections are the ones the Jacobian of PowerFlowJacobian::from_admittance differentiates, formed by the same calculation as PowerFlowJacobian::calc_bus_power_injection; a solver that holds a Jacobian calls that method instead, which reuses its merged admittance.

§Errors

An admittance matrix that is not square, or voltages whose length is not its side.