Expand description
The weighted Laplacian L = A diag(w) Aᵀ, reference grounding, and the
index bookkeeping for mapping a grounded solve back to full size.
Built from the same A, w factors the incidence module produces, so
L and its reference-grounded form share an exact factorization.
Structs§
- Grounded
Index Map - Maps indices between the full
[0, n)space and the grounded[0, n−1)space (row/columnrremoved). Used by the DC OPF interior point operators (thekktfeature) to place a grounded solve back into full bus order.
Functions§
- build_
weighted_ laplacian L = A diag(w) Aᵀ(n×n). Withw = bthis is the DC Laplacian; withw = b²·θ_f⁻¹it is the reweighted LaplacianL₁from the KKT system.- ground_
at - Delete row
rand columnrfrom a square matrix, returning the(n−1)×(n−1)grounded matrix. Used to remove the slack bus so a singular Laplacian becomes SPD. The single-reference case ofground_at_each. - ground_
at_ each - Delete every row and column in
refsfrom a square matrix, returning the grounded matrix of siden − k, wherekis the count of distinct in-range references. Grounding one bus per connected component turns a singular Laplacian SPD. Grounding several buses within one component fixes several angles to zero; this is not a participation factor based slack model. - reference_
indicator - The reference indicator, length
n:1at every grounded (slack) bus,0elsewhere. The multi-reference form ofunit_vector; a downstream solver reads it to recover which buses were grounded. - unit_
vector - The unit vector
e_r, lengthn.