pub struct DcPfSolution { /* private fields */ }Expand description
The DC power flow solution: bus angles and injections and branch terminal active flows over the shared instance.
Implementations§
Source§impl DcPfSolution
impl DcPfSolution
Sourcepub fn new(
instance: Arc<DcPfInstance>,
termination: Termination,
bus_voltage_angle: Vec<f64>,
bus_active_injection: Vec<f64>,
branch_from_active_flow: Vec<f64>,
branch_to_active_flow: Vec<f64>,
three_winding_transformer_terminal_active_power: Vec<ThreeWindingTransformerTerminalActivePower>,
) -> Result<Self, Error>
pub fn new( instance: Arc<DcPfInstance>, termination: Termination, bus_voltage_angle: Vec<f64>, bus_active_injection: Vec<f64>, branch_from_active_flow: Vec<f64>, branch_to_active_flow: Vec<f64>, three_winding_transformer_terminal_active_power: Vec<ThreeWindingTransformerTerminalActivePower>, ) -> Result<Self, Error>
Assemble the required results: per bus voltage angles (degrees) and net active injections (MW) in bus table order, and per branch terminal active flows (MW, 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) -> &DcPfInstance
pub fn instance(&self) -> &DcPfInstance
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>) -> Self
pub fn with_producer(self, producer: impl Into<String>) -> Self
Record the producer identity.
Sourcepub fn with_residuals(self, residuals: Residuals) -> Self
pub fn with_residuals(self, residuals: Residuals) -> Self
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<Self, Error>
pub fn with_generator_dispatch( self, dispatch: GeneratorDispatch, ) -> Result<Self, Error>
Record an explicit per generator allocation.
§Errors
A dispatch whose length disagrees with the generator table.
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 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_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 three_winding_transformer_terminal_active_powers(
&self,
) -> &[ThreeWindingTransformerTerminalActivePower]
pub fn three_winding_transformer_terminal_active_powers( &self, ) -> &[ThreeWindingTransformerTerminalActivePower]
Three winding transformer terminal active powers in transformer table order.
Sourcepub fn bus_voltage_angles(&self) -> &[f64]
pub fn bus_voltage_angles(&self) -> &[f64]
The complete bus_voltage_angle column, in bus_order.
Sourcepub fn bus_active_injections(&self) -> &[f64]
pub fn bus_active_injections(&self) -> &[f64]
The complete bus_active_injection column, in bus_order.
Sourcepub fn branch_from_active_flows(&self) -> &[f64]
pub fn branch_from_active_flows(&self) -> &[f64]
The complete branch_from_active_flow column, in branch_order.
Sourcepub fn branch_to_active_flows(&self) -> &[f64]
pub fn branch_to_active_flows(&self) -> &[f64]
The complete branch_to_active_flow column, in branch_order.
Trait Implementations§
Source§impl Clone for DcPfSolution
impl Clone for DcPfSolution
Source§fn clone(&self) -> DcPfSolution
fn clone(&self) -> DcPfSolution
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more