pub struct DcPfInstance { /* private fields */ }Expand description
The DC power flow instance: the shared network plus per bus boundary specifications and the selected branch susceptance formula.
Implementations§
Source§impl DcPfInstance
impl DcPfInstance
Sourcepub fn from_network(network: BalancedNetwork) -> Result<Self, Error>
pub fn from_network(network: BalancedNetwork) -> Result<Self, Error>
Build the instance from the network’s stated data: reference buses
contribute their stated angle, isolated buses no equation, and every
other bus its net active injection over 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.
Sourcepub fn from_network_with_hvdc(
network: BalancedNetwork,
hvdc_treatment: HvdcTreatment,
) -> Result<Self, Error>
pub fn from_network_with_hvdc( network: BalancedNetwork, hvdc_treatment: HvdcTreatment, ) -> Result<Self, 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
A network with no reference bus.
Sourcepub fn with_branch_susceptance_formula(
self,
formula: BranchSusceptanceFormula,
) -> Self
pub fn with_branch_susceptance_formula( self, formula: BranchSusceptanceFormula, ) -> Self
Select the branch susceptance formula, consuming the instance. The network handle moves; no table is copied.
Sourcepub fn with_initial_point(self, point: OperatingPoint<BalancedNetwork>) -> Self
pub fn with_initial_point(self, point: OperatingPoint<BalancedNetwork>) -> Self
Supply an optional solver initial point.
Sourcepub fn with_network(self, network: BalancedNetwork) -> Result<Self, Error>
pub fn with_network(self, network: BalancedNetwork) -> Result<Self, Error>
Replace the network and recalculate the fixed bus specifications while preserving the branch susceptance formula, the HVDC treatment, and a compatible initial point.
§Errors
The replacement has no reference bus 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) -> &[DcBusSpecification]
pub fn specifications(&self) -> &[DcBusSpecification]
The per bus boundary specifications, in bus table order.
Sourcepub const fn branch_susceptance_formula(&self) -> BranchSusceptanceFormula
pub const fn branch_susceptance_formula(&self) -> BranchSusceptanceFormula
The selected branch susceptance formula.
Sourcepub const fn hvdc_treatment(&self) -> HvdcTreatment
pub const fn hvdc_treatment(&self) -> HvdcTreatment
How the stated injections 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: the power injected or left out, and the in service lines whose terminal bus is inactive. Empty for a network with no HVDC line.
Sourcepub const fn initial_point(&self) -> Option<&OperatingPoint<BalancedNetwork>>
pub const fn initial_point(&self) -> Option<&OperatingPoint<BalancedNetwork>>
The optional solver initial point.