pub struct LoadingDirection {
pub d_p: Vec<f64>,
pub d_q: Vec<f64>,
}Expand description
Per-bus (Δp, Δq) in per-unit: the injection change per unit of λ.
s_spec(λ) = s_base + λ · Δs, so λ = 0 is the base case and λ = 1 is the
base case plus one full direction.
Fields§
§d_p: Vec<f64>Indexed by Bus::idx.
d_q: Vec<f64>Implementations§
Source§impl LoadingDirection
impl LoadingDirection
Sourcepub fn scale_loads(buses: &[Bus]) -> Self
pub fn scale_loads(buses: &[Bus]) -> Self
The default: Δp_i = p_spec_i, Δq_i = q_spec_i at every bus that is a
net consumer (p_spec < 0), zero elsewhere. Constant power factor,
generation held at schedule.
The slack picks up both the load increase and the incremental losses.
Its own entry is irrelevant either way — a slack bus contributes no P
equation, so nothing in the augmented system ever reads it — but at high
λ its output can become physically absurd. That is a property of the
scenario, not a defect; scale_loads_with_pickup
is the realistic alternative.
Sourcepub fn scale_buses(buses: &[Bus], subset: &[usize]) -> Self
pub fn scale_buses(buses: &[Bus], subset: &[usize]) -> Self
scale_loads restricted to subset: a local or
zonal stress direction rather than a system-wide one.
Sourcepub fn scale_loads_with_pickup(buses: &[Bus], weights: &[f64]) -> Self
pub fn scale_loads_with_pickup(buses: &[Bus], weights: &[f64]) -> Self
scale_loads, with the active-power pickup shared
over weights instead of dumped on the slack:
Δp_gen,i = −ŵ_i · Σ_j Δp_load,j, with ŵ normalized over the supplied
weights.
This is the analytic equivalent of running
DistributedSlack inside the
corrector, and the analytic form is required rather than merely cheaper.
That loop moves p_spec as a function of the solved state; such a
dependence is invisible to ∂g/∂λ, so running it inside the corrector
would silently corrupt the tangent — the one vector continuation needs
exact. Its effect is exactly linear in λ, so folding it into Δp is
both faithful and free.
Weights at slack buses are dropped: a slack has no P equation, so a share allocated to it would vanish and the pickup would no longer sum to the load increase.
Sourcepub fn explicit(d_p: Vec<f64>, d_q: Vec<f64>) -> Self
pub fn explicit(d_p: Vec<f64>, d_q: Vec<f64>) -> Self
A study direction from a market or scenario tool, taken as given.
Sourcepub fn to_target(buses: &[Bus], p_target: &[f64], q_target: &[f64]) -> Self
pub fn to_target(buses: &[Bus], p_target: &[f64], q_target: &[f64]) -> Self
MATPOWER’s base-case-to-target-case form: Δ = target − base.
pub fn zero(n: usize) -> Self
Sourcepub fn total_active_load_increase(&self) -> f64
pub fn total_active_load_increase(&self) -> f64
Σ over net consumers of −Δp_i: the per-unit load increase per unit
of λ, and the multiplier behind the reported margin.
Counts only the consuming half, so a direction with generation pickup reports the same margin as the same load ramp without it — the margin is how much more load the system carries, not how much more the machines produce.
Trait Implementations§
Source§impl Clone for LoadingDirection
impl Clone for LoadingDirection
Source§impl Debug for LoadingDirection
impl Debug for LoadingDirection
Source§impl PartialEq for LoadingDirection
impl PartialEq for LoadingDirection
impl StructuralPartialEq for LoadingDirection
Auto Trait Implementations§
impl Freeze for LoadingDirection
impl RefUnwindSafe for LoadingDirection
impl Send for LoadingDirection
impl Sync for LoadingDirection
impl Unpin for LoadingDirection
impl UnsafeUnpin for LoadingDirection
impl UnwindSafe for LoadingDirection
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