Skip to main content

DcOperators

Struct DcOperators 

Source
pub struct DcOperators { /* private fields */ }
Expand description

DC matrix operations built once from an instance.

Implementations§

Source§

impl DcOperators

Source

pub fn build(instance: &DcPfInstance) -> Result<Self, Error>

Build the operators. Zero impedance branches are preserved by the instance and have no finite DC row, so they refuse the build until resolved explicitly with merge_zero_impedance_buses; no branch is ever skipped silently. Out of service branches and self loops carry no operator column.

§Errors

A zero impedance branch, a non-finite branch value, or a branch naming an undeclared bus.

Source

pub fn build_with( instance: &DcPfInstance, options: &DcOperatorOptions, ) -> Result<Self, Error>

Build the operators under explicit DcOperatorOptions. With skip_zero_impedance set, a zero impedance branch is dropped from the operator axis and listed by skipped_branch_rows instead of refusing the build; every other rule of build holds.

§Errors

A zero impedance branch when it is not skipped, a non-finite branch value, or a branch naming an undeclared bus.

Source

pub fn update(&mut self, instance: &DcPfInstance) -> Result<(), Error>

Refresh the injection vectors and reference rows from the instance’s current specifications. The network dependent matrices are untouched: an operating point update goes through here and reconstructs nothing.

§Errors

A specification list whose length disagrees with the built bus axis.

Source

pub const fn branch_susceptance_formula(&self) -> BranchSusceptanceFormula

The selected branch susceptance formula.

Source

pub fn bus_ids(&self) -> &[BusId]

Dense bus row to bus id, the row mapping of every bus axis.

Source

pub fn branch_identities(&self) -> &[String]

Operator column to stable analysis branch identity.

Source

pub fn branch_rows(&self) -> &[usize]

Operator column to the analysis branch row it represents: the position in the network’s branch table (three winding transformer windings follow the branches). Out of service branches, self loops, and skipped zero impedance branches have no column, so this is the row selection every branch axis shares.

Source

pub fn skipped_branch_rows(&self) -> &[usize]

Analysis branch rows dropped under DcOperatorOptions::skip_zero_impedance, in table order. Empty unless the option was set and a zero impedance branch existed.

Source

pub const fn options(&self) -> DcOperatorOptions

The options the operators were built with.

Source

pub fn analysis_sources(&self) -> &[AnalysisBranchSource]

Operator column to the source branch or three winding transformer winding represented by that column.

Source

pub fn calc_incidence_matrix(&self) -> SparseMatrix

The PowerModels incidence matrix A, m × n: each branch row has +1 at its from bus and -1 at its to bus.

Source

pub fn calc_branch_susceptances(&self) -> &[f64]

Calculate the per branch susceptances b, with PowerModels signs.

Source

pub fn calc_branch_flow_matrix(&self) -> SparseMatrix

Calculate the branch flow matrix Bf = Diagonal(b) * A, m × n.

Source

pub fn calc_bus_susceptance_matrix(&self) -> SparseMatrix

Calculate the bus susceptance matrix B = Aᵀ * Diagonal(b) * A, n × n.

Source

pub fn bus_power_injection(&self) -> &[f64]

The per bus net power injection the instance states, per unit on the network MVA base, in bus row order.

Source

pub fn calc_branch_phase_shift_injection(&self) -> Vec<f64>

Calculate the branch phase shift injection b .* shift in branch order.

Source

pub fn calc_bus_phase_shift_injection(&self) -> Vec<f64>

Calculate the bus phase shift injection p_shift = Aᵀ * (b .* shift) in bus order.

Source

pub fn calc_branch_flow_dc( &self, voltage_angles: &[f64], ) -> Result<Vec<f64>, Error>

Calculate DC active power flow in branch order from bus voltage angles in radians: p_branch = -Bf va + b .* shift.

§Errors

The voltage angle length differs from the bus axis length.

Source

pub fn calc_bus_injection_dc( &self, voltage_angles: &[f64], ) -> Result<Vec<f64>, Error>

Calculate DC active power injection in bus order from bus voltage angles in radians: p_bus = -B va + p_shift.

§Errors

The voltage angle length differs from the bus axis length.

Source

pub fn calc_reference_constrained_system( &self, ) -> Result<ReferenceConstrainedSystem, Error>

Calculate the reference constrained linear system over the internal positive factor weights: the reference grounded positive semidefinite matrix L = -B with reference rows and columns removed, and the right hand side at the retained buses is p - p_shift (from p = -B va + p_shift) plus the coupling carried in from every eliminated reference bus’s stated angle, radians, so L_grounded va = rhs solves the stated problem with each reference bus fixed at the angle it states rather than at zero. Sign conversion from the public susceptances is confined to this fill.

§Errors

An instance with no reference row.

Trait Implementations§

Source§

impl Clone for DcOperators

Source§

fn clone(&self) -> DcOperators

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DcOperators

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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