pub struct Layout {
pub non_slack_idx: Vec<usize>,
pub pq_idx: Vec<usize>,
pub n_angle: usize,
pub n_unknowns: usize,
pub n_buses: usize,
}Expand description
The Newton unknown layout, derived once per segment.
Reproduces solver::newton_raphson_cached’s ordering exactly — every
non-slack bus contributes an angle unknown in bus order, then every PQ bus a
magnitude unknown — because the corrector’s mismatch vector and the
augmented Jacobian’s rows must agree with it term for term.
Fields§
§non_slack_idx: Vec<usize>§pq_idx: Vec<usize>§n_angle: usize§n_unknowns: usize§n_buses: usizeImplementations§
Source§impl Layout
impl Layout
pub fn analyze(buses: &[Bus]) -> Self
Sourcepub fn embed(&self, from: &Layout, t: &[f64]) -> Vec<f64>
pub fn embed(&self, from: &Layout, t: &[f64]) -> Vec<f64>
Re-expresses a tangent written in from’s layout in this one.
A PV → PQ switch grows the unknown count by one, so the tangent that
was steering the walk no longer even has the right length — but it still
carries the direction of travel, which is the part that matters. Mapping
it bus by bus (the newly-freed magnitude gets a zero component) gives the
next tangent solve a bordering row that points the right way, so the walk
continues forward across the event instead of doubling back.
Sourcepub fn get(&self, buses: &[Bus], lambda: f64, k: usize) -> f64
pub fn get(&self, buses: &[Bus], lambda: f64, k: usize) -> f64
The value of unknown k, with k == n_unknowns meaning λ itself.
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnsafeUnpin for Layout
impl UnwindSafe for Layout
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