#[non_exhaustive]pub struct DcOpfInstance {Show 15 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 convention: DcConvention,
pub skip_zero_impedance: bool,
pub bus_ids: Vec<BusId>,
pub reference_buses: ReferenceBuses,
pub p_d: Vec<f64>,
pub g_s: Vec<f64>,
pub p_shift: Vec<f64>,
pub generators: DcGeneratorData,
pub branches: DcBranchData,
}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§convention: DcConvention§skip_zero_impedance: bool§bus_ids: Vec<BusId>Dense bus index to external bus ID.
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 approximation holds the 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.
generators: DcGeneratorData§branches: DcBranchDataImplementations§
Source§impl DcOpfInstance
impl DcOpfInstance
pub fn n_generators(&self) -> usize
pub fn n_branches(&self) -> usize
Sourcepub fn nodal_generator_data(&self) -> NodalGeneratorData
pub fn nodal_generator_data(&self) -> NodalGeneratorData
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 DcOpfInstance
impl Clone for DcOpfInstance
Source§fn clone(&self) -> DcOpfInstance
fn clone(&self) -> DcOpfInstance
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 DcOpfInstance
impl Debug for DcOpfInstance
Source§impl<'de> Deserialize<'de> for DcOpfInstance
impl<'de> Deserialize<'de> for DcOpfInstance
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 DcOpfInstance
impl PartialEq for DcOpfInstance
Source§fn eq(&self, other: &DcOpfInstance) -> bool
fn eq(&self, other: &DcOpfInstance) -> bool
self and other values to be equal, and is used by ==.