Skip to main content

calc_ptdf_rows

Function calc_ptdf_rows 

Source
pub fn calc_ptdf_rows(
    case: &IndexedNetwork<'_>,
    options: &SensitivityOptions,
    branches: &[usize],
) -> Result<CsMat<f64>>
Expand description

The PTDF rows of branches (dense branch indices), a branches.len() × n matrix whose row i is the full PTDF’s row branches[i].

Each row is one solve, x = ABA⁻¹ (e_from − e_to) through the symmetric grounded matrix, scaled by the branch susceptance, so neither the m × n PTDF nor an inverse is formed. The solver follows SensitivityOptions::solver on the reduced dimension alone, and entries at or below SensitivityOptions::drop_tolerance are omitted.

§Errors

An index outside the branch table, the conditions of the full builders, and Error::SingularNetwork when no factorization is trusted.