pub struct GroundedLaplacianFactor { /* private fields */ }Expand description
The grounded weighted Laplacian L = A diag(w) Aᵀ of an edge list,
factored once for repeated DC solves: the grounds’ rows and columns are
removed (Grounding), and so is every bus no edge touches, and the
reduced matrix is factored by the one sparse factorization of the PTDF
builder (Cholesky, then LDLᵀ, then LU, each accepted only when it
solves a probe right hand side accurately). Grounded and untouched buses
keep angle zero. With w the branch susceptances and one ground per
connected component, solve is a lossless DC power flow
and calc_edge_flows its branch flows.
Implementations§
Source§impl GroundedLaplacianFactor
impl GroundedLaplacianFactor
Sourcepub fn from_edges(
n: usize,
edges: &[(usize, usize, f64)],
grounds: &[usize],
) -> Result<Self>
pub fn from_edges( n: usize, edges: &[(usize, usize, f64)], grounds: &[usize], ) -> Result<Self>
Factor the grounded Laplacian of edges ((a, b, w), buses below n)
with grounds fixed at zero angle.
§Errors
Error::ShapeMismatch for an edge or ground outside 0..n, and
Error::SingularNetwork for a nonfinite weight or a reduced matrix
no factorization solves (a component without a ground).
Sourcepub fn solve(&self, injection: &[f64]) -> Vec<f64>
pub fn solve(&self, injection: &[f64]) -> Vec<f64>
The angles that balance injection (one per bus), grounded and
untouched buses at zero.
§Panics
When injection is shorter than the bus count.
Sourcepub fn calc_edge_flows(&self, theta: &[f64]) -> Vec<f64>
pub fn calc_edge_flows(&self, theta: &[f64]) -> Vec<f64>
The flow w (θ_a − θ_b) of each edge at angles theta
(calc_edge_flows over this factor’s edges).
Sourcepub fn solver_path(&self) -> SensitivitySolverPath
pub fn solver_path(&self) -> SensitivitySolverPath
The factorization that solved the reduced matrix.