#[non_exhaustive]pub struct DcOpfPreparation {Show 20 fields
pub name: String,
pub n_buses: usize,
pub n_source_generators: usize,
pub n_source_branches: usize,
pub base_mva: f64,
pub units: Units,
pub formula: BranchSusceptanceFormula,
pub objective: PreparedObjective,
pub skip_zero_impedance: bool,
pub synthesize_unrated_limits: bool,
pub correct_angle_difference_bounds: bool,
pub bus_ids: Vec<BusId>,
pub bus_analysis_rows: Vec<usize>,
pub bus_source_rows: Vec<Option<usize>>,
pub reference_buses: ReferenceBuses,
pub p_d: Vec<f64>,
pub g_s: Vec<f64>,
pub p_shift: Vec<f64>,
pub generators: DcGeneratorParameters,
pub branches: DcBranchParameters,
}Expand description
Matrix free DC OPF input data.
A problem instance is complete numerical input for one problem family. It is separate from the source network, a matrix projection, a solver formulation, and a solution.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: String§n_buses: usize§n_source_generators: usize§n_source_branches: usize§base_mva: f64§units: Units§formula: BranchSusceptanceFormulaFormula used to calculate each branch susceptance.
objective: PreparedObjectiveThe objective represented by the generator cost columns.
skip_zero_impedance: bool§synthesize_unrated_limits: boolWhether zero and negative source thermal ratings were replaced with synthesized limits while assembling this instance.
#[serde(default)] keeps documents written before this field readable;
their limits retain the old unsynthesized meaning.
correct_angle_difference_bounds: boolWhether PowerModels’ angle difference correction was applied.
bus_ids: Vec<BusId>Dense bus index to external bus ID.
bus_analysis_rows: Vec<usize>Dense bus index to row in the star-lowered analysis network.
bus_source_rows: Vec<Option<usize>>Dense bus index to source bus row. A synthetic star bus has no source row; an explicitly isolated source bus has no dense row here.
reference_buses: ReferenceBuses§p_d: Vec<f64>Nodal active demand in dense bus order.
g_s: Vec<f64>Nodal shunt conductance in dense bus order.
The DC power flow model holds voltage magnitude at one per unit, so a
shunt draws the constant real power g_s and does not depend on the
angle. It belongs in the injection: the bus susceptance matrix keeps
zero row sums and carries no shunt. A nodal balance subtracts it
beside Self::p_d, as MATPOWER runpf does.
p_shift: Vec<f64>Nodal phase shift injection in dense bus order. The complete fixed
withdrawal in L theta = Cg pg - fixed is p_d + g_s + p_shift.
generators: DcGeneratorParameters§branches: DcBranchParametersImplementations§
Source§impl DcOpfPreparation
impl DcOpfPreparation
pub fn n_generators(&self) -> usize
pub fn n_branches(&self) -> usize
Sourcepub fn calc_fixed_nodal_withdrawal(&self) -> Vec<f64>
pub fn calc_fixed_nodal_withdrawal(&self) -> Vec<f64>
Fixed nodal withdrawal in dense bus order.
With A oriented from bus to bus and
L = A diag(b) A^T, the DC balance is
L theta = Cg pg - (p_d + g_s + p_shift).
Sourcepub fn calc_branch_flow_offset(&self) -> Vec<f64>
pub fn calc_branch_flow_offset(&self) -> Vec<f64>
Fixed branch flow offset in active branch column order.
The complete branch flow over this preparation’s internal positive
weights is f = diag(b) A^T theta + branch_flow_offset, where the
offset is -b * shift elementwise. In the public PowerModels sign
spelling the same flow is p_branch = -Bf va + b .* shift with the
negated susceptances (crate::DcOperators emits that
form); the two agree term for term because this b is the negation
of the public one.
Sourcepub fn calc_nodal_generator_data(&self) -> Result<NodalGeneratorParameters>
pub fn calc_nodal_generator_data(&self) -> Result<NodalGeneratorParameters>
Project generator cost and bounds to bus space.
The bounds at a bus are the sum of the generator bounds, which is the
range the bus total can reach. The cost curves at a bus combine by the
parallel rule q = 1 / Σ(1/qᵢ), the curve that the least cost split of
the bus total follows. That combination is an approximation: it agrees
with generator space only while the split stays inside the bound of
each generator. A bus with one generator keeps that generator’s own
coefficients.
Trait Implementations§
Source§impl Clone for DcOpfPreparation
impl Clone for DcOpfPreparation
Source§fn clone(&self) -> DcOpfPreparation
fn clone(&self) -> DcOpfPreparation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DcOpfPreparation
impl Debug for DcOpfPreparation
Source§impl<'de> Deserialize<'de> for DcOpfPreparation
impl<'de> Deserialize<'de> for DcOpfPreparation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for DcOpfPreparation
impl PartialEq for DcOpfPreparation
Source§fn eq(&self, other: &DcOpfPreparation) -> bool
fn eq(&self, other: &DcOpfPreparation) -> bool
self and other values to be equal, and is used by ==.