Skip to main content

linear_initial_guess

Function linear_initial_guess 

Source
pub fn linear_initial_guess(buses: &mut [Bus], ybus: &YBusSparse)
Expand description

Computes a smarter-than-flat-start initial voltage guess for Newton-Raphson by solving one linearized constant-admittance system, mirroring PGM’s NewtonRaphsonPFSolver::initialize_derived_solver. Each energized (PQ) bus’s injection is approximated as a constant admittance y = -conj(S) evaluated at the flat-start |V|=1 assumption and added to the Y-bus diagonal; Slack buses (both real sources and de-energized nodes, which gridoxide models as fixed Slack buses at V=0) keep their already-set voltage. The resulting linear system Y'_nn·U_n = -Y'_ns·U_s is solved for the unknown PQ bus voltages via LU decomposition, and voltage_mag/ voltage_ang are overwritten with the result. If the reduced system is singular, buses are left at their prior (flat-start) values. PGM applies no step damping or voltage clamping beyond this — a better initial guess is its only robustness mechanism, needed on networks combining weak sources with large transformer phase shifts where plain flat-start NR diverges.

linear::impedance offers the same linearization, built on the same solve_constant_admittance, as a standalone power-flow method (linear::linear_power_flow). This entry point stays deliberately island-unaware: it runs before the solver’s own classify/mark_unreferenced_islands pass, so it must not mutate bus types, and a singular result here is simply a warm start that did not happen rather than a failure to report.