#[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
The result of BalancedNetwork::merge_buses.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.network: BalancedNetworkThe merged network.
source: BalancedNetworkThe network the merge read; a shared handle, not a copy.
rule: BusMergeRuleThe 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
impl BusMerge
Sourcepub fn calc_removed_flows(
&self,
flows: &MergedFlows<'_>,
) -> Result<RemovedFlows>
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.