pypsa.SubNetwork.incidence_matrix#
- SubNetwork.incidence_matrix(branch_components: Collection[str] | None = None, busorder: pd.Index | None = None) sp.sparse.csr_matrix #
Construct a sparse incidence matrix (directed)
- Parameters:
branch_components (iterable sublist of branch_components) – Buses connected by any of the selected branches are adjacent (default: branch_components (network) or passive_branch_components (sub_network))
busorder (pd.Index subset of n.buses.index) – Basis to use for the matrix representation of the adjacency matrix (default: buses.index (network) or buses_i() (sub_network))
- Returns:
incidence_matrix – Directed incidence matrix
- Return type:
sp.sparse.csr_matrix