Skip to main content

AcOtsInstance

Struct AcOtsInstance 

Source
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

Source

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.

Source

pub fn from_ac_opf(base: AcOpfInstance) -> Result<Self, Error>

The default switching instance over an AC optimal power flow base: every initially in-service branch may switch, at zero cost, with no budget, no islands, and no current limits, and the objective gains the switching cost term.

§Errors

As new.

Source

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.

Source

pub fn with_options(self, options: AcOtsOptions) -> Result<Self, Error>

Replace the switching options, keeping the base problem and its objective.

§Errors

As new.

Source

pub fn with_switching_objective(self) -> Self

Add the switching cost objective term, once.

Source

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.

Source

pub fn network(&self) -> &BalancedNetwork

The network with every candidate branch at its initial status.

Source

pub const fn objective(&self) -> &Objective

The typed objective.

Source

pub const fn constraints(&self) -> &ActiveConstraints

The active constraint selections.

Source

pub const fn initial_point(&self) -> Option<&OperatingPoint<BalancedNetwork>>

The optional solver initial point.

Source

pub const fn options(&self) -> &AcOtsOptions

The switching options as stated.

Source

pub fn branches(&self) -> &[AcOtsBranch]

Every physical branch in table order, with its resolved switching settings.

Source

pub fn branch_order(&self) -> impl ExactSizeIterator<Item = &str>

The branch identities in table order.

Source

pub fn initial_closed(&self) -> Vec<bool>

The initial branch statuses in table order.

Source

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.

Source

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.

§Errors

As validate_topology.

Trait Implementations§

Source§

impl Clone for AcOtsInstance

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AcOtsInstance

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.