pub struct DcOperators { /* private fields */ }Expand description
DC matrix operations built once from an instance.
Implementations§
Source§impl DcOperators
impl DcOperators
Sourcepub fn build(instance: &DcPfInstance) -> Result<Self, Error>
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.
Sourcepub fn build_with(
instance: &DcPfInstance,
options: &DcOperatorOptions,
) -> Result<Self, Error>
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.
Sourcepub fn update(&mut self, instance: &DcPfInstance) -> Result<(), Error>
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.
Sourcepub const fn branch_susceptance_formula(&self) -> BranchSusceptanceFormula
pub const fn branch_susceptance_formula(&self) -> BranchSusceptanceFormula
The selected branch susceptance formula.
Sourcepub fn branch_identities(&self) -> &[String]
pub fn branch_identities(&self) -> &[String]
Operator column to stable analysis branch identity.
Sourcepub fn branch_rows(&self) -> &[usize]
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.
Sourcepub fn skipped_branch_rows(&self) -> &[usize]
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.
Sourcepub const fn options(&self) -> DcOperatorOptions
pub const fn options(&self) -> DcOperatorOptions
The options the operators were built with.
Sourcepub fn analysis_sources(&self) -> &[AnalysisBranchSource]
pub fn analysis_sources(&self) -> &[AnalysisBranchSource]
Operator column to the source branch or three winding transformer winding represented by that column.
Sourcepub fn calc_incidence_matrix(&self) -> SparseMatrix
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.
Sourcepub fn calc_branch_susceptances(&self) -> &[f64]
pub fn calc_branch_susceptances(&self) -> &[f64]
Calculate the per branch susceptances b, with PowerModels signs.
Sourcepub fn calc_branch_flow_matrix(&self) -> SparseMatrix
pub fn calc_branch_flow_matrix(&self) -> SparseMatrix
Calculate the branch flow matrix Bf = Diagonal(b) * A, m × n.
Sourcepub fn calc_bus_susceptance_matrix(&self) -> SparseMatrix
pub fn calc_bus_susceptance_matrix(&self) -> SparseMatrix
Calculate the bus susceptance matrix B = Aᵀ * Diagonal(b) * A, n × n.
Sourcepub fn bus_power_injection(&self) -> &[f64]
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.
Sourcepub fn calc_branch_phase_shift_injection(&self) -> Vec<f64>
pub fn calc_branch_phase_shift_injection(&self) -> Vec<f64>
Calculate the branch phase shift injection b .* shift in branch
order.
Sourcepub fn calc_bus_phase_shift_injection(&self) -> Vec<f64>
pub fn calc_bus_phase_shift_injection(&self) -> Vec<f64>
Calculate the bus phase shift injection
p_shift = Aᵀ * (b .* shift) in bus order.
Sourcepub fn calc_branch_flow_dc(
&self,
voltage_angles: &[f64],
) -> Result<Vec<f64>, Error>
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.
Sourcepub fn calc_bus_injection_dc(
&self,
voltage_angles: &[f64],
) -> Result<Vec<f64>, Error>
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.
Sourcepub fn calc_reference_constrained_system(
&self,
) -> Result<ReferenceConstrainedSystem, Error>
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
impl Clone for DcOperators
Source§fn clone(&self) -> DcOperators
fn clone(&self) -> DcOperators
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more