Expand description
DC sensitivity factors: PTDF and LODF.
Because the DC model is exactly linear, the derivative of a branch flow with respect to a bus injection is a constant — not a local slope that drifts as the operating point moves, but the true, global answer. That is what makes these factors worth precomputing, and it is why they exist for DC and not for AC.
PTDF (power transfer distribution factors) answers if I inject one more unit at bus j and let the reference absorb it, how much of it shows up on branch k? LODF (line outage distribution factors) answers if branch l trips, what fraction of the power it was carrying lands on branch k? — the workhorse of contingency screening, since it turns “re-solve the network once per outage” into one matrix column.
§The formulation
With N the non-reference buses of one island, B_NN its reduced
susceptance matrix, and Bf the branch-flow matrix
(Bf[k, from_k] = +b_k, Bf[k, to_k] = −b_k):
\[ \mathrm{PTDF}[:, j] = B_f,\theta^{(j)}, \qquad B_{NN}\theta^{(j)} = e_j \] \[ \mathrm{PTDF}[k, :] = x, \qquad B_{NN},x = B_f[k, N]^\mathsf{T} \]
The second line uses B_NN = B_NNᵀ — true even with phase shifters, since
the shift lives on the right-hand side — so a row costs one solve rather
than one per bus.
\[ \mathrm{LODF}[:, l] = \frac{\mathrm{PTDF}[:, from_l] - \mathrm{PTDF}[:, to_l]}{1 - d_l}, \qquad d_l = \mathrm{PTDF}[l, from_l] - \mathrm{PTDF}[l, to_l] \]
The numerator is one solve against e_from − e_to, not two, and it yields
d_l as a by-product — so a LODF column costs exactly what a PTDF column
does.
§Why columns and rows, not matrices
The dense factors are enormous. On case9241pegase (9,241 buses, 16,049
branches) a full PTDF is 1.19 GB and a full LODF 2.06 GB. Both are offered
(DcSensitivity::ptdf_dense, DcSensitivity::lodf_dense) because small
networks and test code genuinely want them, but the column and row accessors
are the API to reach for, and each costs a single triangular solve against a
factorization computed once in DcSensitivity::new.
§Scope
Distributed slack is not supported: each island has one reference, or
several whose pickup split is arbitrary. lightsim2grid carries the same
limitation, as a TODO PTDF: distributed slack in the equivalent place.
Structs§
- DcSensitivity
- Precomputed DC sensitivity factors for one network.
- Dense
Matrix - A minimal row-major dense matrix.