pub struct McAcPfSolution { /* 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 multiconductor AC power flow solution: terminal complex voltages,
optional terminal currents and powers, and source injections over the
shared instance.
Implementations§
Source§impl McAcPfSolution
impl McAcPfSolution
Sourcepub fn new(
instance: Arc<McAcPfInstance>,
termination: Termination,
terminal_voltage_magnitude: Vec<f64>,
terminal_voltage_angle: Vec<f64>,
source_active_injection: Vec<f64>,
) -> Result<McAcPfSolution, Error>
pub fn new( instance: Arc<McAcPfInstance>, termination: Termination, terminal_voltage_magnitude: Vec<f64>, terminal_voltage_angle: Vec<f64>, source_active_injection: Vec<f64>, ) -> Result<McAcPfSolution, Error>
Assemble the required results: per terminal voltage magnitudes (volts) and angles (radians) in bus table and stated terminal order, and per source terminal active injections (watts) in source table order.
§Errors
A column whose length disagrees with the instance’s resolved terminals.
Sourcepub fn instance(&self) -> &McAcPfInstance
pub fn instance(&self) -> &McAcPfInstance
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) -> &MulticonductorNetwork
pub fn network(&self) -> &MulticonductorNetwork
The network the solved instance calculates on.
Sourcepub fn termination(&self) -> &Termination
pub fn termination(&self) -> &Termination
How the producing calculation ended.
Sourcepub fn with_producer(self, producer: impl Into<String>) -> McAcPfSolution
pub fn with_producer(self, producer: impl Into<String>) -> McAcPfSolution
Record the producer identity.
Sourcepub fn with_residuals(self, residuals: Residuals) -> McAcPfSolution
pub fn with_residuals(self, residuals: Residuals) -> McAcPfSolution
Record the numerical residuals.
Sourcepub fn terminal_voltage_magnitude(
&self,
bus: &str,
terminal: &str,
) -> Option<f64>
pub fn terminal_voltage_magnitude( &self, bus: &str, terminal: &str, ) -> Option<f64>
Voltage magnitude at one bus terminal, volts.
Sourcepub fn terminal_voltage_angle(&self, bus: &str, terminal: &str) -> Option<f64>
pub fn terminal_voltage_angle(&self, bus: &str, terminal: &str) -> Option<f64>
Voltage angle at one bus terminal, radians.
Sourcepub fn terminal_current_magnitude(
&self,
bus: &str,
terminal: &str,
) -> Option<f64>
pub fn terminal_current_magnitude( &self, bus: &str, terminal: &str, ) -> Option<f64>
Current into the network at one bus terminal, amperes, when the producer reported currents.
Sourcepub fn terminal_active_power(&self, bus: &str, terminal: &str) -> Option<f64>
pub fn terminal_active_power(&self, bus: &str, terminal: &str) -> Option<f64>
Active power into the network at one bus terminal, watts, when the producer reported terminal powers.
Sourcepub fn with_terminal_currents(
self,
values: Vec<f64>,
) -> Result<McAcPfSolution, Error>
pub fn with_terminal_currents( self, values: Vec<f64>, ) -> Result<McAcPfSolution, Error>
Record per terminal current magnitudes, amperes.
§Errors
A column whose length disagrees with the resolved terminals.
Sourcepub fn with_terminal_powers(
self,
values: Vec<f64>,
) -> Result<McAcPfSolution, Error>
pub fn with_terminal_powers( self, values: Vec<f64>, ) -> Result<McAcPfSolution, Error>
Record per terminal active powers, watts.
§Errors
A column whose length disagrees with the resolved terminals.
Sourcepub fn source_active_injections(&self) -> &[f64]
pub fn source_active_injections(&self) -> &[f64]
Per source terminal active injections, watts, in source table order with each source’s terminal map order.
Trait Implementations§
Source§impl Clone for McAcPfSolution
impl Clone for McAcPfSolution
Source§fn clone(&self) -> McAcPfSolution
fn clone(&self) -> McAcPfSolution
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more