pub struct Branch {
pub from_bus: usize,
pub to_bus: usize,
pub resistance: f64,
pub reactance: f64,
pub susceptance: f64,
pub tap_ratio: f64,
pub phase_shift: f64,
pub in_service: bool,
}Expand description
A branch (line or transformer) connecting two buses
Fields§
§from_bus: usizeFrom bus index
to_bus: usizeTo bus index
resistance: f64Resistance (per-unit)
reactance: f64Reactance (per-unit)
susceptance: f64Total line charging susceptance (per-unit)
tap_ratio: f64Transformer tap ratio (1.0 for lines)
phase_shift: f64Transformer phase shift (radians)
in_service: boolBranch status (true = in service)
Implementations§
Source§impl Branch
impl Branch
Sourcepub fn line(
from_bus: usize,
to_bus: usize,
resistance: f64,
reactance: f64,
) -> Self
pub fn line( from_bus: usize, to_bus: usize, resistance: f64, reactance: f64, ) -> Self
Create a transmission line
Sourcepub fn line_with_charging(
from_bus: usize,
to_bus: usize,
resistance: f64,
reactance: f64,
susceptance: f64,
) -> Self
pub fn line_with_charging( from_bus: usize, to_bus: usize, resistance: f64, reactance: f64, susceptance: f64, ) -> Self
Create a transmission line with charging
Sourcepub fn transformer(
from_bus: usize,
to_bus: usize,
resistance: f64,
reactance: f64,
tap_ratio: f64,
) -> Self
pub fn transformer( from_bus: usize, to_bus: usize, resistance: f64, reactance: f64, tap_ratio: f64, ) -> Self
Create a transformer
Sourcepub fn admittance(&self) -> (f64, f64)
pub fn admittance(&self) -> (f64, f64)
Calculate series admittance (1/Z)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Branch
impl<'de> Deserialize<'de> for Branch
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl GridElement for Branch
impl GridElement for Branch
Source§fn element_type(&self) -> &'static str
fn element_type(&self) -> &'static str
Element type name for debugging
Source§fn apply(&self, _state: &mut StateStore)
fn apply(&self, _state: &mut StateStore)
Apply element’s contribution to the state
Auto Trait Implementations§
impl Freeze for Branch
impl RefUnwindSafe for Branch
impl Send for Branch
impl Sync for Branch
impl Unpin for Branch
impl UnwindSafe for Branch
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)