#[non_exhaustive]pub struct AcOpfPreparation {Show 18 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 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 buses: AcBusData,
pub generators: AcGeneratorData,
pub storage: AcStorageData,
pub branches: AcBranchData,
}Expand description
Matrix free AC OPF input data on the branch pi model.
Units follow Units. Under Units::PerUnit, powers are per unit on
base_mva and admittances are per unit on the system base. Under
Units::Native, powers stay in MW/MVAr and every admittance vector is
scaled by base_mva, so power computed from admittances and per unit
voltages lands in MW/MVAr. Voltage magnitudes are per unit and angles are
radians in both systems. Relaxations of AC OPF, the SOC forms included,
consume this same preparation; the relaxation is a formulation choice
made downstream.
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§objective: PreparedObjectiveThe objective represented by the generator cost columns.
skip_zero_impedance: bool§synthesize_unrated_limits: boolWhether absent source ratings were replaced with synthesized limits.
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§buses: AcBusData§generators: AcGeneratorData§storage: AcStorageData§branches: AcBranchDataImplementations§
Source§impl AcOpfPreparation
impl AcOpfPreparation
pub fn n_generators(&self) -> usize
pub fn n_branches(&self) -> usize
pub fn n_storage(&self) -> usize
Sourcepub fn calc_nodal_generator_data(&self) -> Result<NodalAcGeneratorData>
pub fn calc_nodal_generator_data(&self) -> Result<NodalAcGeneratorData>
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.
Sourcepub fn calc_vm_setpoints(&self) -> Vec<f64>
pub fn calc_vm_setpoints(&self) -> Vec<f64>
Conventional voltage magnitude start: the case voltage, overwritten by each generator’s positive setpoint in generator column order (last wins), with a non-positive case voltage falling back to 1.0.
The result is not clamped to [vm_min, vm_max]; feasibility repair is
solver preparation and stays downstream.
Trait Implementations§
Source§impl Clone for AcOpfPreparation
impl Clone for AcOpfPreparation
Source§fn clone(&self) -> AcOpfPreparation
fn clone(&self) -> AcOpfPreparation
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 AcOpfPreparation
impl Debug for AcOpfPreparation
Source§impl<'de> Deserialize<'de> for AcOpfPreparation
impl<'de> Deserialize<'de> for AcOpfPreparation
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 AcOpfPreparation
impl PartialEq for AcOpfPreparation
Source§fn eq(&self, other: &AcOpfPreparation) -> bool
fn eq(&self, other: &AcOpfPreparation) -> bool
self and other values to be equal, and is used by ==.