pub struct AcPfSolution { /* 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 solution: complex bus voltages, active and reactive bus
injections, and terminal branch flows over the shared instance.
Implementations§
Source§impl AcPfSolution
impl AcPfSolution
Sourcepub fn new(
instance: Arc<AcPfInstance>,
termination: Termination,
bus_voltage_magnitude: Vec<f64>,
bus_voltage_angle: Vec<f64>,
bus_active_injection: Vec<f64>,
bus_reactive_injection: Vec<f64>,
branch_from_active_flow: Vec<f64>,
branch_from_reactive_flow: Vec<f64>,
branch_to_active_flow: Vec<f64>,
branch_to_reactive_flow: Vec<f64>,
three_winding_transformer_terminal_power: Vec<ThreeWindingTransformerTerminalPower>,
) -> Result<AcPfSolution, Error>
pub fn new( instance: Arc<AcPfInstance>, termination: Termination, bus_voltage_magnitude: Vec<f64>, bus_voltage_angle: Vec<f64>, bus_active_injection: Vec<f64>, bus_reactive_injection: Vec<f64>, branch_from_active_flow: Vec<f64>, branch_from_reactive_flow: Vec<f64>, branch_to_active_flow: Vec<f64>, branch_to_reactive_flow: Vec<f64>, three_winding_transformer_terminal_power: Vec<ThreeWindingTransformerTerminalPower>, ) -> Result<AcPfSolution, Error>
Assemble the required results: per bus voltage magnitudes (per unit) and angles (degrees), net injections (MW, MVAr) in bus table order, and per branch terminal flows (MW, MVAr into the branch at each terminal) in branch table order.
§Errors
A column whose length disagrees with the instance’s tables.
Sourcepub fn instance(&self) -> &AcPfInstance
pub fn instance(&self) -> &AcPfInstance
The immutable instance this solution solves. Borrowed; never a copy.
The shared instance owner, for another solution of the same problem.
Sourcepub fn network(&self) -> &BalancedNetwork
pub fn network(&self) -> &BalancedNetwork
The network the solved instance calculates on.
Sourcepub fn branch_order(&self) -> Vec<String>
pub fn branch_order(&self) -> Vec<String>
Stable branch identities in bulk column order.
Sourcepub fn generator_order(&self) -> Vec<String>
pub fn generator_order(&self) -> Vec<String>
Stable generator identities in bulk column order.
Sourcepub fn termination(&self) -> &Termination
pub fn termination(&self) -> &Termination
How the producing calculation ended.
Sourcepub fn with_producer(self, producer: impl Into<String>) -> AcPfSolution
pub fn with_producer(self, producer: impl Into<String>) -> AcPfSolution
Record the producer identity.
Sourcepub fn with_residuals(self, residuals: Residuals) -> AcPfSolution
pub fn with_residuals(self, residuals: Residuals) -> AcPfSolution
Record the numerical residuals.
Sourcepub fn branch_identity_order(&self) -> impl Iterator<Item = String>
pub fn branch_identity_order(&self) -> impl Iterator<Item = String>
The branch identities the flow columns follow, in table order.
Sourcepub fn generator_dispatch(&self) -> Option<&GeneratorDispatch>
pub fn generator_dispatch(&self) -> Option<&GeneratorDispatch>
Per generator dispatch, when the instance determines it uniquely or the source records an explicit allocation.
Sourcepub fn with_generator_dispatch(
self,
dispatch: GeneratorDispatch,
) -> Result<AcPfSolution, Error>
pub fn with_generator_dispatch( self, dispatch: GeneratorDispatch, ) -> Result<AcPfSolution, Error>
Record an explicit per generator allocation.
§Errors
A dispatch whose length disagrees with the generator table.
Sourcepub fn bus_voltage_magnitude(&self, bus: BusId) -> Option<f64>
pub fn bus_voltage_magnitude(&self, bus: BusId) -> Option<f64>
Voltage magnitude at one bus, per unit.
Sourcepub fn bus_voltage_angle(&self, bus: BusId) -> Option<f64>
pub fn bus_voltage_angle(&self, bus: BusId) -> Option<f64>
Voltage angle at one bus, degrees.
Sourcepub fn bus_active_injection(&self, bus: BusId) -> Option<f64>
pub fn bus_active_injection(&self, bus: BusId) -> Option<f64>
Net active injection at one bus, MW.
Sourcepub fn bus_reactive_injection(&self, bus: BusId) -> Option<f64>
pub fn bus_reactive_injection(&self, bus: BusId) -> Option<f64>
Net reactive injection at one bus, MVAr.
Sourcepub fn branch_from_active_flow(&self, identity: &str) -> Option<f64>
pub fn branch_from_active_flow(&self, identity: &str) -> Option<f64>
Active flow into the branch at its from terminal, MW, by stable branch identity.
Sourcepub fn branch_from_reactive_flow(&self, identity: &str) -> Option<f64>
pub fn branch_from_reactive_flow(&self, identity: &str) -> Option<f64>
Reactive flow into the branch at its from terminal, MVAr.
Sourcepub fn branch_to_active_flow(&self, identity: &str) -> Option<f64>
pub fn branch_to_active_flow(&self, identity: &str) -> Option<f64>
Active flow into the branch at its to terminal, MW.
Sourcepub fn branch_to_reactive_flow(&self, identity: &str) -> Option<f64>
pub fn branch_to_reactive_flow(&self, identity: &str) -> Option<f64>
Reactive flow into the branch at its to terminal, MVAr.
Sourcepub fn three_winding_transformer_terminal_powers(
&self,
) -> &[ThreeWindingTransformerTerminalPower]
pub fn three_winding_transformer_terminal_powers( &self, ) -> &[ThreeWindingTransformerTerminalPower]
Three winding transformer terminal powers in transformer table order.
Trait Implementations§
Source§impl Clone for AcPfSolution
impl Clone for AcPfSolution
Source§fn clone(&self) -> AcPfSolution
fn clone(&self) -> AcPfSolution
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more