Skip to main content

calc_ptdf_by_island

Function calc_ptdf_by_island 

Source
pub fn calc_ptdf_by_island(
    case: &IndexedNetwork<'_>,
    options: &SensitivityOptions,
) -> Result<Vec<IslandPtdf>>
Expand description

Calculate one PTDF matrix per connected component using one shared solve.

Component detection is linear in the network size. The existing global PTDF builder performs the factorization and solves once; this function then partitions its sparse output, avoiding a separate factorization for every island. Each result carries explicit mappings back to the source network.

Closed switches must be merged during normalization first, because the DC incidence matrix models branches, not switch connections. Every component must contain a reference bus, as required by the global sensitivity builder.