Expand description
DC sensitivity matrices.
PTDF maps nodal injections to branch flows (f = PTDF · p); LODF maps a
branch outage to the flow it redistributes onto the others. Both come from
the reference grounded DC Laplacian ABA = ground_with(L, refs): one
row/column removed per reference bus. Positive branch weights use a dense
Cholesky factorization; nonsingular indefinite cases fall back to dense
Gaussian elimination. Disconnected networks with one reference per island are
supported. Several references in one island are fixed angle buses; this is
not a participation factor based distributed slack model. PTDF is dense
m × n; a future sparse path would compute selected columns or use sparse
factors rather than make PTDF itself sparse.
Functions§
- build_
lodf - LODF (
m × m): pre-outage flow on branchkredistributes onto branchlwith factorLODF[l, k]. Diagonal is−1. A branch whose outage islands the network (denominator≈ 0) gets a zero column. - build_
ptdf - PTDF (
m × n): branch flows from nodal injections,f = PTDF · p. Every reference-bus column is zero. The Laplacian is grounded at the whole reference set (reference_bus_indices), one row/column per slack. One reference per island handles disconnected networks; several references within one island fixes all of those bus angles to zero. - build_
ptdf_ lodf - Both DC sensitivity matrices
(PTDF, LODF)from a single Laplacian factorization. When a caller needs both for the same case (thesensitivitiesbundle), this factors and inverts the grounded Laplacian once instead of paying the O(n³) twice across separatebuild_ptdf/build_lodfcalls.