Skip to main content

AcPfInstance

Struct AcPfInstance 

Source
pub struct AcPfInstance { /* 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 power flow instance: the shared network plus one AcBusSpecification per bus.

Implementations§

Source§

impl AcPfInstance

Source

pub fn new( network: BalancedNetwork, specifications: Vec<AcBusSpecification>, ) -> Result<AcPfInstance, Error>

Build an AC power flow instance from explicit bus specifications. The specification vector follows bus table order and is retained exactly; it is not inferred again from bus types, loads, generator schedules, or HVDC lines. with_network derives a replacement under HvdcTreatment::FixedInjection.

§Errors

The specification count differs from the bus count, or no specification declares a reference bus.

Source

pub fn new_with_hvdc( network: BalancedNetwork, specifications: Vec<AcBusSpecification>, hvdc_treatment: HvdcTreatment, ) -> Result<AcPfInstance, Error>

new stating the HVDC treatment the instance applies when with_network derives a replacement, when hvdc_diagnostics reports, and when to_dc_pf converts. The specifications are retained exactly, whatever the treatment.

§Errors

As new.

Source

pub fn from_network(network: BalancedNetwork) -> Result<AcPfInstance, Error>

Build the instance from the network’s stated data. A PQ bus states its net injections; a PV bus its net active injection and the regulating generator’s voltage setpoint; a reference bus its setpoint magnitude and stated angle. Net injections count 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, or conflicting active voltage controllers: two in service generators at one bus stating different voltage setpoints are refused until an explicit edit resolves them.

Source

pub fn from_network_with_hvdc( network: BalancedNetwork, hvdc_treatment: HvdcTreatment, ) -> Result<AcPfInstance, 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

As from_network.

Source

pub fn with_initial_point( self, point: OperatingPoint<BalancedNetwork>, ) -> AcPfInstance

Supply an optional solver initial point.

Source

pub fn with_network( self, network: BalancedNetwork, ) -> Result<AcPfInstance, Error>

Replace the network and recalculate the fixed bus specifications while preserving the HVDC treatment and a compatible initial point.

§Errors

The replacement has no reference bus, has conflicting voltage controllers, or changes an identity layout used by the initial point.

Source

pub fn network(&self) -> &BalancedNetwork

The network this instance calculates on. Borrowed; never a copy.

Source

pub fn specifications(&self) -> &[AcBusSpecification]

The per bus specifications, in bus table order.

Source

pub const fn hvdc_treatment(&self) -> HvdcTreatment

How from_network_with_hvdc and with_network treat the network’s HVDC lines.

Source

pub fn hvdc_diagnostics(&self) -> Vec<Diagnostic>

What the stated injections did with the network’s HVDC lines, as DcPfInstance::hvdc_diagnostics states it.

Source

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

The optional solver initial point.

Source

pub fn to_dc_pf(&self) -> (DcPfInstance, Vec<Diagnostic>)

The DC power flow instance this AC problem implies: reactive data and voltage magnitudes are discarded, and the DC model’s flat voltage assumption is recorded as a diagnostic.

Trait Implementations§

Source§

impl BalancedCalculationInstance for AcPfInstance

Source§

fn network(&self) -> &BalancedNetwork

The instance’s balanced electrical network.
Source§

impl Clone for AcPfInstance

Source§

fn clone(&self) -> AcPfInstance

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 AcPfInstance

Source§

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

Formats the value using the given formatter. Read more
Source§

impl From<AcPfInstance> for PioValue

Source§

fn from(value: AcPfInstance) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Imply<T> for U
where T: ?Sized, U: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V