Expand description
Sparse matrix builders for power system cases.
DC OPF and sensitivity builders use the DC bus susceptance matrix
L = A diag(b) Aᵀ, where A is the signed bus by branch incidence matrix
(n×m) and b is the positive branch susceptance vector. Stored nonzero off
diagonal entries are negative, diagonals are nonnegative, and
diag = sum of |off-diagonal|; this is the M-matrix form SDDM solvers expect
once the grounded matrix is positive definite.
Re-exports§
pub use incidence::IncidenceParts;pub use incidence::build_flow_map;pub use incidence::build_incidence;pub use incidence::susceptance_diag;pub use laplacian::GroundedIndexMap;pub use laplacian::build_weighted_laplacian;pub use laplacian::ground_at;pub use laplacian::ground_at_each;pub use laplacian::reference_indicator;pub use laplacian::unit_vector;pub use sensitivity::SensitivityMatrices;pub use sensitivity::SensitivityMatrixMetadata;pub use sensitivity::SensitivityMetadata;pub use sensitivity::SensitivityOptions;pub use sensitivity::SensitivitySolver;pub use sensitivity::SensitivitySolverPath;pub use sensitivity::build_lodf;pub use sensitivity::build_ptdf;pub use sensitivity::build_ptdf_lodf;pub use sensitivity::build_ptdf_lodf_with_options;
Modules§
- incidence
- DC network primitives: the signed incidence matrix
A, branch susceptancesb, the flow mapB Aᵀ, and the phase shift injection. - laplacian
- Weighted bus Laplacians
L = A diag(w) Aᵀ, reference grounding, and the index bookkeeping for mapping a grounded solve back to full size. For DC power flow,wis the branch susceptance vectorb, andLis the DC bus susceptance matrix. - sensitivity
- DC sensitivity matrices.
- triplet
CooBuilder— a small HashMap backed coordinate format accumulator. Deduplicates(i, j)entries on insert (eachaddis O(1) amortized, independent ofnnz). Replaces the previous Vec linear scan accumulator, which was O(nnz²) per case.
Structs§
- Build
Options - Matrix
Stats - Common stats over a sparse matrix used by the TUI and
meta.json. - Ybus
Parts Re(Y_bus)andIm(Y_bus)as separate CSR matrices.- Zero
Impedance Skips - Branch rows skipped because the selected builder cannot represent a zero branch denominator.
Enums§
- DcConvention
- Rule for the DC branch susceptance
b. - Scheme
- Which MATPOWER fast decoupled scheme to use.
- Zero
Impedance Rule - Which branch denominator a matrix builder uses when deciding whether a branch can contribute a finite admittance or susceptance.
Functions§
- build_
adjacency - Build the
n × n0/1 adjacency matrix. - build_
bdoubleprime - build_
bprime - build_
lacpf - build_
ybus - sddm_
check - Whether a matrix is SDDM (symmetric diagonally dominant M-matrix). Useful as a quick sanity check before feeding it to an SDDM solver.
- skipped_
zero_ impedance - Count in-service branch rows the given builder rule will skip. This is the shared accounting used by matrix metadata and solver property regressions.