Skip to main content

GroundedLaplacianFactor

Struct GroundedLaplacianFactor 

Source
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

Source

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).

Source

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.

Source

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).

Source

pub fn solver_path(&self) -> SensitivitySolverPath

The factorization that solved the reduced matrix.

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V