pub struct AcOpfSolution { /* 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 optimal power flow solution: the AC power flow results plus the
optimized generator active and reactive dispatch and the objective value.
Implementations§
Source§impl AcOpfSolution
impl AcOpfSolution
Sourcepub fn new(
instance: Arc<AcOpfInstance>,
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>,
generator_active_power: Vec<f64>,
generator_reactive_power: Vec<f64>,
objective: f64,
three_winding_transformer_terminal_power: Vec<ThreeWindingTransformerTerminalPower>,
) -> Result<AcOpfSolution, Error>
pub fn new( instance: Arc<AcOpfInstance>, 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>, generator_active_power: Vec<f64>, generator_reactive_power: Vec<f64>, objective: f64, three_winding_transformer_terminal_power: Vec<ThreeWindingTransformerTerminalPower>, ) -> Result<AcOpfSolution, Error>
Assemble the results: the AC power flow columns, the optimized per generator dispatch (MW and MVAr, generator table order), and the objective value.
§Errors
A column whose length disagrees with the instance’s tables.
Sourcepub fn instance(&self) -> &AcOpfInstance
pub fn instance(&self) -> &AcOpfInstance
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>) -> AcOpfSolution
pub fn with_producer(self, producer: impl Into<String>) -> AcOpfSolution
Record the producer identity.
Sourcepub fn with_residuals(self, residuals: Residuals) -> AcOpfSolution
pub fn with_residuals(self, residuals: Residuals) -> AcOpfSolution
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 with_bus_active_power_marginals(
self,
marginals: Vec<f64>,
) -> Result<AcOpfSolution, Error>
pub fn with_bus_active_power_marginals( self, marginals: Vec<f64>, ) -> Result<AcOpfSolution, Error>
Attach the derivative of the optimal objective with respect to added active demand, in objective units per MW and bus table order.
§Errors
A column whose length disagrees with the instance’s bus table.
Sourcepub fn with_bus_reactive_power_marginals(
self,
marginals: Vec<f64>,
) -> Result<AcOpfSolution, Error>
pub fn with_bus_reactive_power_marginals( self, marginals: Vec<f64>, ) -> Result<AcOpfSolution, Error>
Attach the derivative of the optimal objective with respect to added reactive demand, in objective units per MVAr and bus table order.
§Errors
A column whose length disagrees with the instance’s bus table.
Sourcepub fn with_branch_thermal_limit_multipliers(
self,
from: Vec<f64>,
to: Vec<f64>,
) -> Result<AcOpfSolution, Error>
pub fn with_branch_thermal_limit_multipliers( self, from: Vec<f64>, to: Vec<f64>, ) -> Result<AcOpfSolution, Error>
Attach the two nonnegative apparent power limit multipliers, in objective units per MVA and branch table order. Increasing the shared rating by one MVA changes the local optimal objective by the negative sum of the from and to terminal multipliers.
Sourcepub fn bus_active_power_marginal(&self, bus: BusId) -> Option<f64>
pub fn bus_active_power_marginal(&self, bus: BusId) -> Option<f64>
Optimal objective derivative per added MW of active demand at one bus.
Sourcepub fn bus_reactive_power_marginal(&self, bus: BusId) -> Option<f64>
pub fn bus_reactive_power_marginal(&self, bus: BusId) -> Option<f64>
Optimal objective derivative per added MVAr of reactive demand.
Sourcepub fn branch_from_limit_multiplier(&self, identity: &str) -> Option<f64>
pub fn branch_from_limit_multiplier(&self, identity: &str) -> Option<f64>
From-terminal apparent power bound multiplier by branch identity.
Sourcepub fn branch_to_limit_multiplier(&self, identity: &str) -> Option<f64>
pub fn branch_to_limit_multiplier(&self, identity: &str) -> Option<f64>
To-terminal apparent power bound multiplier by branch identity.
Sourcepub fn bus_active_power_marginals(&self) -> Option<&[f64]>
pub fn bus_active_power_marginals(&self) -> Option<&[f64]>
All active demand marginals in bus table order, when attached.
Sourcepub fn bus_reactive_power_marginals(&self) -> Option<&[f64]>
pub fn bus_reactive_power_marginals(&self) -> Option<&[f64]>
All reactive demand marginals in bus table order, when attached.
Sourcepub fn branch_from_limit_multipliers(&self) -> Option<&[f64]>
pub fn branch_from_limit_multipliers(&self) -> Option<&[f64]>
All from-terminal thermal bound multipliers in branch table order.
Sourcepub fn branch_to_limit_multipliers(&self) -> Option<&[f64]>
pub fn branch_to_limit_multipliers(&self) -> Option<&[f64]>
All to-terminal thermal bound multipliers in branch table order.
Sourcepub fn generator_active_power(&self, identity: &str) -> Option<f64>
pub fn generator_active_power(&self, identity: &str) -> Option<f64>
Optimized active power of one generator, MW, by stable identity.
Sourcepub fn generator_reactive_power(&self, identity: &str) -> Option<f64>
pub fn generator_reactive_power(&self, identity: &str) -> Option<f64>
Optimized reactive power of one generator, MVAr.
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.
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.
Sourcepub fn bus_voltage_magnitudes(&self) -> &[f64]
pub fn bus_voltage_magnitudes(&self) -> &[f64]
The complete bus_voltage_magnitude column, in bus_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 bus_reactive_injections(&self) -> &[f64]
pub fn bus_reactive_injections(&self) -> &[f64]
The complete bus_reactive_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_from_reactive_flows(&self) -> &[f64]
pub fn branch_from_reactive_flows(&self) -> &[f64]
The complete branch_from_reactive_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.
Sourcepub fn branch_to_reactive_flows(&self) -> &[f64]
pub fn branch_to_reactive_flows(&self) -> &[f64]
The complete branch_to_reactive_flow column, in branch_order.
Sourcepub fn generator_active_powers(&self) -> &[f64]
pub fn generator_active_powers(&self) -> &[f64]
The complete generator_active_power column, in generator_order.
Sourcepub fn generator_reactive_powers(&self) -> &[f64]
pub fn generator_reactive_powers(&self) -> &[f64]
The complete generator_reactive_power column, in generator_order.
Trait Implementations§
Source§impl Clone for AcOpfSolution
impl Clone for AcOpfSolution
Source§fn clone(&self) -> AcOpfSolution
fn clone(&self) -> AcOpfSolution
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more