pub struct AcSensitivity { /* private fields */ }Expand description
A converged operating point, factorized once and ready to be differentiated.
Holds one factorization of the power-flow Jacobian at that point. Every
accessor is a triangular solve against it, never a refactorization — the
same contract DcSensitivity
offers, and the reason both own a
RealFactorization rather than
borrowing the Newton path’s solver.
Implementations§
Source§impl AcSensitivity
impl AcSensitivity
Sourcepub fn new(
buses: &[Bus],
ybus: &YBusSparse,
lines: &[Line],
transformers: &[Transformer],
) -> Option<Self>
pub fn new( buses: &[Bus], ybus: &YBusSparse, lines: &[Line], transformers: &[Transformer], ) -> Option<Self>
Factorizes the Jacobian at the operating point buses describes.
buses must be a converged solution — this linearizes about
whatever state it is handed and cannot tell a solved network from an
unsolved one, so the derivatives of a non-converged state are
meaningless rather than wrong-looking. ybus, lines and
transformers must be the same network that solution came from.
Takes the branch lists rather than a finished Vec<BranchParams> for
the same reason crate::run_power_flow does: the tap sensitivities
need each transformer’s own tap, which BranchParams has already
folded into its four admittance entries. Deriving both here also means
a caller cannot pass a branch list that disagrees with the Y-bus.
Returns None if the Jacobian is singular there.
Unlike the DC side there is no per-island bookkeeping, and none is
needed: every island carries its own slack, so the assembled Jacobian
is block-diagonal across islands and non-singular as a whole. A
sourceless island contributes no rows at all, because
network::mark_unreferenced_islands has already pinned its buses to
Slack — so it is excluded rather than making the system singular.
pub fn n_buses(&self) -> usize
pub fn n_branches(&self) -> usize
Sourcepub fn state_response(&self, variable: Variable) -> Option<StateResponse>
pub fn state_response(&self, variable: Variable) -> Option<StateResponse>
How the whole state responds to one variable — the forward direction, one solve.
Returns an all-zero response for a variable that is not a free input (active injection at a slack bus, reactive injection where the voltage is held). That is the correct derivative, not a failure: perturbing a quantity the solve itself determines moves nothing.
None only for an out-of-range bus, or a singular solve.
Sourcepub fn branch_response(
&self,
variable: Variable,
terminal: Terminal,
) -> Option<Vec<(f64, f64)>>
pub fn branch_response( &self, variable: Variable, terminal: Terminal, ) -> Option<Vec<(f64, f64)>>
(dP, dQ) at every branch’s terminal, for one variable.
The AC counterpart of a PTDF column, and the reason the forward direction exists: one solve, then a dot product per branch.
Sourcepub fn function_row(&self, function: Function) -> Option<FunctionRow>
pub fn function_row(&self, function: Function) -> Option<FunctionRow>
How one function responds to injection at every bus — the adjoint direction, one solve.
The AC counterpart of a PTDF row. Where
branch_response answers “one variable moves,
what happens everywhere”, this answers “one thing is watched, what
moves it” — which is the question an overload actually poses.
Auto Trait Implementations§
impl Freeze for AcSensitivity
impl RefUnwindSafe for AcSensitivity
impl Send for AcSensitivity
impl Sync for AcSensitivity
impl Unpin for AcSensitivity
impl UnsafeUnpin for AcSensitivity
impl UnwindSafe for AcSensitivity
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