#[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: Extras,
}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.from: BusId§to: BusId§r: f64Series resistance (p.u.).
x: f64Series reactance (p.u.).
b: f64MATPOWER 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: f64Tap ratio, MATPOWER convention: 0 means “no tap” (a line), treated as 1.
shift: f64Phase 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: ExtrasImplementations§
Source§impl Branch
impl Branch
pub fn new(from: BusId, to: BusId, r: f64, x: f64) -> Self
Sourcepub fn effective_tap(&self) -> f64
pub fn effective_tap(&self) -> f64
Effective tap ratio (0 ⇒ 1).
Sourcepub fn terminal_charging(&self) -> BranchCharging
pub fn terminal_charging(&self) -> BranchCharging
Per terminal shunt admittance, deriving the legacy symmetric MATPOWER charging model when the richer field is absent.
Sourcepub fn legacy_total_charging_b(&self) -> f64
pub fn legacy_total_charging_b(&self) -> f64
Total susceptance projection for MATPOWER shaped formats that only carry one line charging value.
Sourcepub fn has_non_matpower_charging(&self) -> bool
pub fn has_non_matpower_charging(&self) -> bool
Whether this branch has charging that a MATPOWER branch row cannot carry.
Sourcepub fn is_transformer(&self) -> bool
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.
Sourcepub fn has_angle_limits(&self) -> bool
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.