Skip to main content

Branch

Struct Branch 

Source
#[non_exhaustive]
pub struct Branch {
Show 20 fields pub from: BusId, pub to: BusId, pub r: f64, pub x: f64, pub b: f64, pub charging: Option<BranchCharging>, pub rate_a: f64, pub rate_b: f64, pub rate_c: f64, pub rating_sets: Vec<BranchRatingSet>, pub current_ratings: Option<BranchCurrentRatings>, pub tap: f64, pub shift: f64, pub in_service: bool, pub angmin: f64, pub angmax: f64, pub control: Option<TransformerControl>, pub solution: Option<BranchSolution>, pub uid: Option<String>, pub extras: BTreeMap<String, Value>,
}

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.
§from: BusId§to: BusId§r: f64

Series resistance (p.u.).

§x: f64

Series reactance (p.u.).

§b: f64

MATPOWER compatible total line charging susceptance (p.u.). This is the legacy total projection; when charging is present, per terminal admittance is canonical and this field is compatibility data.

§charging: Option<BranchCharging>

Per terminal shunt admittance (p.u.). If absent, derive symmetric susceptance from b.

§rate_a: f64§rate_b: f64§rate_c: f64§rating_sets: Vec<BranchRatingSet>

Additional MVA rating sets beyond A/B/C. Matrix builders continue to use rate_a unless they opt into one of these named sets.

§current_ratings: Option<BranchCurrentRatings>

Current ratings, when the source distinguishes them from MVA ratings.

§tap: f64

Tap ratio, MATPOWER convention: 0 means “no tap” (a line), treated as 1.

§shift: f64

Phase shift (degrees).

§in_service: bool§angmin: f64§angmax: f64§control: Option<TransformerControl>

Regulating-transformer control data, when this branch is a transformer under automatic tap or phase control. None for lines and for fixed-ratio transformers. #[serde(default)] so JSON written before the field existed still deserializes.

§solution: Option<BranchSolution>

Solved branch flow values, when present in a case snapshot.

§uid: Option<String>

Stable row identity; see Bus::uid.

§extras: BTreeMap<String, Value>

Implementations§

Source§

impl Branch

Source

pub fn new(from: BusId, to: BusId, r: f64, x: f64) -> Branch

Source

pub fn effective_tap(&self) -> f64

Effective tap ratio (0 ⇒ 1).

Source

pub fn terminal_charging(&self) -> BranchCharging

Per terminal shunt admittance, deriving the legacy symmetric MATPOWER charging model when the richer field is absent.

Source

pub fn legacy_total_charging_b(&self) -> f64

Total susceptance projection for MATPOWER shaped formats that only carry one line charging value.

Source

pub fn has_non_matpower_charging(&self) -> bool

Whether this branch has charging that a MATPOWER branch row cannot carry.

Source

pub fn is_transformer(&self) -> bool

A transformer iff the raw tap field is nonzero (an explicit 1 counts) or there is a phase shift.

Source

pub fn has_angle_limits(&self) -> bool

True when the branch constrains its angle difference, i.e. the limits deviate from the ±360° “unconstrained” default. Formats without angle limit fields (PSS/E, PowerWorld) use this to warn on what they drop.

Trait Implementations§

Source§

impl Clone for Branch

Source§

fn clone(&self) -> Branch

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Branch

Source§

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

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

impl<'de> Deserialize<'de> for Branch

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Branch, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Branch

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> 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> 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 = 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.
§

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

§

fn vzip(self) -> V

§

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

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,