pub struct AcPfInstance { /* private fields */ }Expand description
The calculation types used by solver consumers. The full problem
vocabulary lives in powerio_prob; these types sit at the facade root so
a consumer does not need a second PowerIO dependency to name its boundary.
The AC power flow instance: the shared network plus one
AcBusSpecification per bus.
Implementations§
Source§impl AcPfInstance
impl AcPfInstance
Sourcepub fn new(
network: BalancedNetwork,
specifications: Vec<AcBusSpecification>,
) -> Result<AcPfInstance, Error>
pub fn new( network: BalancedNetwork, specifications: Vec<AcBusSpecification>, ) -> Result<AcPfInstance, Error>
Build an AC power flow instance from explicit bus specifications.
The specification vector follows bus table order and is retained
exactly; it is not inferred again from bus types, loads, generator
schedules, or HVDC lines. with_network derives
a replacement under HvdcTreatment::FixedInjection.
§Errors
The specification count differs from the bus count, or no specification declares a reference bus.
Sourcepub fn new_with_hvdc(
network: BalancedNetwork,
specifications: Vec<AcBusSpecification>,
hvdc_treatment: HvdcTreatment,
) -> Result<AcPfInstance, Error>
pub fn new_with_hvdc( network: BalancedNetwork, specifications: Vec<AcBusSpecification>, hvdc_treatment: HvdcTreatment, ) -> Result<AcPfInstance, Error>
new stating the HVDC treatment the instance applies
when with_network derives a replacement, when
hvdc_diagnostics reports, and when
to_dc_pf converts. The specifications are retained
exactly, whatever the treatment.
§Errors
As new.
Sourcepub fn from_network(network: BalancedNetwork) -> Result<AcPfInstance, Error>
pub fn from_network(network: BalancedNetwork) -> Result<AcPfInstance, Error>
Build the instance from the network’s stated data. A PQ bus states
its net injections; a PV bus its net active injection and the
regulating generator’s voltage setpoint; a reference bus its setpoint
magnitude and stated angle. Net injections count in service
generators, loads, and HVDC lines; each in service HVDC line is a
fixed injection at its stated terminal powers
(HvdcTreatment::FixedInjection).
§Errors
A network with no reference bus, or conflicting active voltage controllers: two in service generators at one bus stating different voltage setpoints are refused until an explicit edit resolves them.
Sourcepub fn from_network_with_hvdc(
network: BalancedNetwork,
hvdc_treatment: HvdcTreatment,
) -> Result<AcPfInstance, Error>
pub fn from_network_with_hvdc( network: BalancedNetwork, hvdc_treatment: HvdcTreatment, ) -> Result<AcPfInstance, Error>
from_network under an explicit HVDC
treatment. HvdcTreatment::Ignore leaves every HVDC line out of the
stated injections; hvdc_diagnostics states
what that drops.
§Errors
As from_network.
Sourcepub fn with_initial_point(
self,
point: OperatingPoint<BalancedNetwork>,
) -> AcPfInstance
pub fn with_initial_point( self, point: OperatingPoint<BalancedNetwork>, ) -> AcPfInstance
Supply an optional solver initial point.
Sourcepub fn with_network(
self,
network: BalancedNetwork,
) -> Result<AcPfInstance, Error>
pub fn with_network( self, network: BalancedNetwork, ) -> Result<AcPfInstance, Error>
Replace the network and recalculate the fixed bus specifications while preserving the HVDC treatment and a compatible initial point.
§Errors
The replacement has no reference bus, has conflicting voltage controllers, or changes an identity layout used by the initial point.
Sourcepub fn network(&self) -> &BalancedNetwork
pub fn network(&self) -> &BalancedNetwork
The network this instance calculates on. Borrowed; never a copy.
Sourcepub fn specifications(&self) -> &[AcBusSpecification]
pub fn specifications(&self) -> &[AcBusSpecification]
The per bus specifications, in bus table order.
Sourcepub const fn hvdc_treatment(&self) -> HvdcTreatment
pub const fn hvdc_treatment(&self) -> HvdcTreatment
How from_network_with_hvdc and
with_network treat the network’s HVDC lines.
Sourcepub fn hvdc_diagnostics(&self) -> Vec<Diagnostic>
pub fn hvdc_diagnostics(&self) -> Vec<Diagnostic>
What the stated injections did with the network’s HVDC lines, as
DcPfInstance::hvdc_diagnostics states it.
Sourcepub const fn initial_point(&self) -> Option<&OperatingPoint<BalancedNetwork>>
pub const fn initial_point(&self) -> Option<&OperatingPoint<BalancedNetwork>>
The optional solver initial point.
Sourcepub fn to_dc_pf(&self) -> (DcPfInstance, Vec<Diagnostic>)
pub fn to_dc_pf(&self) -> (DcPfInstance, Vec<Diagnostic>)
The DC power flow instance this AC problem implies: reactive data and voltage magnitudes are discarded, and the DC model’s flat voltage assumption is recorded as a diagnostic.
Trait Implementations§
Source§impl BalancedCalculationInstance for AcPfInstance
impl BalancedCalculationInstance for AcPfInstance
Source§fn network(&self) -> &BalancedNetwork
fn network(&self) -> &BalancedNetwork
Source§impl Clone for AcPfInstance
impl Clone for AcPfInstance
Source§fn clone(&self) -> AcPfInstance
fn clone(&self) -> AcPfInstance
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more