Skip to main content

BusMerge

Struct BusMerge 

Source
#[non_exhaustive]
pub struct BusMerge { pub network: BalancedNetwork, pub source: BalancedNetwork, pub rule: BusMergeRule, pub merged_buses: BTreeMap<BusId, BusId>, pub groups: Vec<BusGroup>, pub removed_branches: Vec<RemovedBranch>, pub removed_switches: Vec<RemovedSwitch>, pub branch_rows: Vec<Option<usize>>, pub switch_rows: Vec<Option<usize>>, pub charging_shunts: Vec<usize>, pub diagnostics: Vec<Diagnostic>, }
Expand description

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§network: BalancedNetwork

The merged network.

§source: BalancedNetwork

The network the merge read; a shared handle, not a copy.

§rule: BusMergeRule

The rule that produced this merge.

§merged_buses: BTreeMap<BusId, BusId>

Every merged bus to the bus that now carries it. Buses that survived, whether or not they absorbed others, are absent.

§groups: Vec<BusGroup>

Every group of two or more buses, in ascending survivor order.

§removed_branches: Vec<RemovedBranch>

Removed branches in source row order.

§removed_switches: Vec<RemovedSwitch>

Removed switches in source row order.

§branch_rows: Vec<Option<usize>>

For each source branch row, its row in the merged network, or None when the merge removed it.

§switch_rows: Vec<Option<usize>>

For each source switch row, its row in the merged network, or None when the merge removed it.

§charging_shunts: Vec<usize>

Rows of the merged network’s shunt table holding removed branches’ equivalent admittances, one per in-service removed branch with a nonzero equivalent, after the source’s own shunts. This includes series equivalents even under MergedCharging::Drop. Each carries the uid merged-charging:<branch>.

§diagnostics: Vec<Diagnostic>

What the merge changed or could not do.

Implementations§

Source§

impl BusMerge

Source

pub fn survivor(&self, bus: BusId) -> BusId

The bus that carries bus in the merged network: its survivor when it merged, else bus itself.

Source

pub fn is_identity(&self) -> bool

Whether the merge changed nothing.

Source§

impl BusMerge

Source

pub fn calc_removed_flows( &self, flows: &MergedFlows<'_>, ) -> Result<RemovedFlows>

Recover the active power on every removed element from a solution of the merged network.

Each merged group is one bus of the merged solution. The power its members exchange through the removed elements follows from what sits at each member: the stated in-service loads (p), shunts (g, at 1 per unit voltage), storage (ps), and HVDC terminals (-pf at the from end, pt at the to end), the generator outputs, and the flows flows states for the kept branches and three winding transformer windings at that member. Whatever the merged solution injects at a group beyond those stated values, such as a slack generator’s adjustment, enters at the survivor.

Where the removed elements of a group form a tree, Kirchhoff’s current law fixes every flow. A loop is split by the elements’ reactances, which is the DC power flow of the unmerged elements. A zero reactance element (a switch, or an exact zero impedance branch) holds its two buses at one angle, so an element in parallel with it carries nothing. A loop made only of zero reactance elements has no physical split, so the minimum norm split is reported with a diagnostic. Out-of-service branches and open switches carry none.

A group whose injections do not balance gets a diagnostic: a group with no reference bus, or any group when flows states the generator outputs, should balance, and an imbalance means the solution modeled a device differently.

§Errors

Error::MergedFlowShape when a slice in flows does not match the merged network’s table, or when a group holds a three winding transformer winding and flows states no winding flows.

Trait Implementations§

Source§

impl Clone for BusMerge

Source§

fn clone(&self) -> BusMerge

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 BusMerge

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.