pub struct AcOtsInstance { /* private fields */ }Expand description
The AC optimal transmission switching instance: an AC optimal power flow base, whose network supplies the candidate branches and their initial statuses, plus the switching options.
The base objective is kept exactly; switching costs enter the objective
only when it states ObjectiveTerm::BranchSwitchingCost
(with_switching_objective).
Implementations§
Source§impl AcOtsInstance
impl AcOtsInstance
Sourcepub fn new(base: AcOpfInstance, options: AcOtsOptions) -> Result<Self, Error>
pub fn new(base: AcOpfInstance, options: AcOtsOptions) -> Result<Self, Error>
Combine an AC optimal power flow base with explicit switching options. The base objective is kept exactly.
§Errors
An option names an unknown branch or names one twice, states a negative or non-finite cost, a nonpositive or non-finite current limit, a switching budget above the switchable branch count, or an open budget below the number of fixed open branches.
Sourcepub fn from_ac_opf(base: AcOpfInstance) -> Result<Self, Error>
pub fn from_ac_opf(base: AcOpfInstance) -> Result<Self, Error>
Sourcepub fn from_network(network: BalancedNetwork) -> Result<Self, Error>
pub fn from_network(network: BalancedNetwork) -> Result<Self, Error>
The default switching instance over a network: the AC optimal power
flow AcOpfInstance::from_network states, with the defaults of
from_ac_opf.
§Errors
As AcOpfInstance::from_network and new.
Sourcepub fn with_options(self, options: AcOtsOptions) -> Result<Self, Error>
pub fn with_options(self, options: AcOtsOptions) -> Result<Self, Error>
Sourcepub fn with_switching_objective(self) -> Self
pub fn with_switching_objective(self) -> Self
Add the switching cost objective term, once.
Sourcepub const fn base(&self) -> &AcOpfInstance
pub const fn base(&self) -> &AcOpfInstance
The AC optimal power flow base: the network with its initial topology, the objective, the constraint selections, and the initial point.
Sourcepub fn network(&self) -> &BalancedNetwork
pub fn network(&self) -> &BalancedNetwork
The network with every candidate branch at its initial status.
Sourcepub const fn constraints(&self) -> &ActiveConstraints
pub const fn constraints(&self) -> &ActiveConstraints
The active constraint selections.
Sourcepub const fn initial_point(&self) -> Option<&OperatingPoint<BalancedNetwork>>
pub const fn initial_point(&self) -> Option<&OperatingPoint<BalancedNetwork>>
The optional solver initial point.
Sourcepub const fn options(&self) -> &AcOtsOptions
pub const fn options(&self) -> &AcOtsOptions
The switching options as stated.
Sourcepub fn branches(&self) -> &[AcOtsBranch]
pub fn branches(&self) -> &[AcOtsBranch]
Every physical branch in table order, with its resolved switching settings.
Sourcepub fn branch_order(&self) -> impl ExactSizeIterator<Item = &str>
pub fn branch_order(&self) -> impl ExactSizeIterator<Item = &str>
The branch identities in table order.
Sourcepub fn initial_closed(&self) -> Vec<bool>
pub fn initial_closed(&self) -> Vec<bool>
The initial branch statuses in table order.
Sourcepub fn validate_topology(&self, branch_closed: &[bool]) -> Result<f64, Error>
pub fn validate_topology(&self, branch_closed: &[bool]) -> Result<f64, Error>
Check a complete final branch status vector, in branch table order, against the fixed branches, the budgets, and the islanding policy, and return its switching cost. This does not certify AC feasibility.
The initial topology’s own islands are not checked against the policy: a base network with several islands accepts its initial statuses.
§Errors
A vector of the wrong length, a changed fixed branch, a budget exceeded, when islands are forbidden a final topology that splits an island of the initial topology, or a final topology that leaves buses supplied initially in an island with no in-service generator.
Sourcepub fn fix_topology(
&self,
branch_closed: &[bool],
) -> Result<(AcOpfInstance, Vec<Diagnostic>), Error>
pub fn fix_topology( &self, branch_closed: &[bool], ) -> Result<(AcOpfInstance, Vec<Diagnostic>), Error>
The AC optimal power flow over a validated final topology. Every branch row stays in the network with its final status. When islands are allowed, each final island gets exactly one reference bus. The switching options, the current limits, and the switching cost term are not part of the derived problem, and each discard is reported. An initial point that states branch statuses describes the initial topology, so it is discarded too.