Skip to main content

Module sensitivity

Module sensitivity 

Source
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 branch k redistributes onto branch l with factor LODF[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 (the sensitivities bundle), this factors and inverts the grounded Laplacian once instead of paying the O(n³) twice across separate build_ptdf/build_lodf calls.