pub struct SlackDistribution {
pub factors: Vec<f64>,
pub tolerance: f64,
pub max_outer_iter: usize,
}Expand description
Who participates in picking up the imbalance, and by how much.
Weights are normalized per island, which is the only reading that works on a disconnected network: each island has its own slack and its own imbalance, and a global normalization would size one island’s correction by another island’s generators.
Fields§
§factors: Vec<f64>Participation weight per bus, indexed by Bus::idx.
tolerance: f64Convergence tolerance on the slack’s remaining deviation from its schedule, per-unit.
max_outer_iter: usizeCap on outer passes. Around seven is typical at the default tolerance.
Implementations§
Source§impl SlackDistribution
impl SlackDistribution
Sourcepub fn uniform(buses: &[Bus]) -> Self
pub fn uniform(buses: &[Bus]) -> Self
Every generator bus — Slack and PV — takes an equal share.
PQ buses are excluded even when they carry positive p_spec. A
positive injection at a PQ bus is a fixed schedule, not a machine
under governor control, and the distinction is exactly what
participation means.
Sourcepub fn from_weights(factors: Vec<f64>) -> Self
pub fn from_weights(factors: Vec<f64>) -> Self
Explicit per-bus weights.
Trait Implementations§
Source§impl Clone for SlackDistribution
impl Clone for SlackDistribution
Auto Trait Implementations§
impl Freeze for SlackDistribution
impl RefUnwindSafe for SlackDistribution
impl Send for SlackDistribution
impl Sync for SlackDistribution
impl Unpin for SlackDistribution
impl UnsafeUnpin for SlackDistribution
impl UnwindSafe for SlackDistribution
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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