pub struct StateLayout {
pub n_buses: usize,
pub angle_ref: Option<usize>,
/* private fields */
}Expand description
Maps buses to positions in the state vector.
Fields§
§n_buses: usize§angle_ref: Option<usize>The bus whose angle is held at zero, if one is pinned.
A network measured only in magnitudes and powers is invariant under a
global phase shift, so without a reference G is singular by
construction no matter how many measurements there are. But that
invariance disappears the moment a phasor measurement supplies an
absolute angle — and pinning a reference on top of one would then be a
false constraint, rotating the whole estimate away from the angles that
were actually measured. So this is None exactly when the measurement
set determines the phase by itself.
Implementations§
Source§impl StateLayout
impl StateLayout
Sourcepub fn new(buses: &[Bus], measurements: &[Measurement], net: &SeNetwork) -> Self
pub fn new(buses: &[Bus], measurements: &[Measurement], net: &SeNetwork) -> Self
Builds the layout for a measurement set.
A reference is pinned only when the measurements contain no voltage
angle; see angle_ref.
When one is pinned it is the physical node a source feeds, not the virtual slack bus behind it. power-grid-model normalizes by setting its slack bus’s angle to zero, and its slack bus is that physical node, since it has no virtual bus at all. Pinning the virtual bus instead leaves every angle offset by the drop across the source impedance — a constant, invisible in magnitudes, and exactly the 6.5e-3 rad uniform shift the transmission-case fixture showed before this was fixed. Stiff sources hide it, which is why the smaller fixtures agreed either way.
Sourcepub fn n_unknowns(&self) -> usize
pub fn n_unknowns(&self) -> usize
Number of unknowns: 2N when the phase is measured, 2N − 1 when a
reference has to be pinned.
Auto Trait Implementations§
impl Freeze for StateLayout
impl RefUnwindSafe for StateLayout
impl Send for StateLayout
impl Sync for StateLayout
impl Unpin for StateLayout
impl UnsafeUnpin for StateLayout
impl UnwindSafe for StateLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more