Expand description
Sparse matrix calculations 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 laplacian::GroundedIndexMap;pub use laplacian::calc_reference_indicator;pub use laplacian::calc_unit_vector;pub use laplacian::calc_weighted_laplacian;pub use laplacian::ground_at;pub use laplacian::ground_at_each;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::calc_lodf;pub use sensitivity::calc_ptdf;pub use sensitivity::calc_ptdf_lodf;pub use sensitivity::calc_ptdf_lodf_with_options;
Modules§
- 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. - multiconductor
- Native multiconductor nodal admittance over
MulticonductorNetwork(#232): terminal and conductor indexed, in the network’s actual units (volts, amperes, siemens), with no implicit positive sequence transformation anywhere. - 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§
- Branch
Susceptance Formula - 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§
- calc_
adjacency_ matrix - Calculate the
n × n0/1 adjacency matrix. - calc_
admittance_ matrix - Calculate the bus admittance matrix, returned as separate real and imaginary sparse matrices.
- calc_
bdoubleprime_ matrix - Calculate the MATPOWER fast decoupled power flow
Bppmatrix. - calc_
bprime_ matrix - Calculate the MATPOWER fast decoupled power flow
Bpmatrix. - calc_
diagonal - Sparse diagonal matrix from
values(square,len × len). - calc_
lacpf_ matrix - Calculate the flat start linear AC power flow block matrix.
- calc_
susceptance_ diagonal B = diag(b), shapem × m.- calc_
zero_ impedance_ skips - Count in-service branch rows the given builder rule will skip. This is the shared accounting used by matrix metadata and solver property regressions.
- check_
sddm - Whether a matrix is SDDM (symmetric diagonally dominant M-matrix). Useful as a quick sanity check before feeding it to an SDDM solver.