Fast AC power flow for the many-scenarios problem

<strong>Fast AC power flow for the many-scenarios problem</strong>
Topics
Network Security
TSO
Page published on
November 17, 2026

Security analysis, remedial-action studies, and uncertainty analysis all require running many AC load flows on networks that differ only locally. Our approach stores the base network in a sparse form and updates it cheaply for each local change. This makes these repeated studies substantially faster while keeping the full AC nonlinear model.

Introduction

The bottleneck of security analysis is not resolving one AC load flow. It is the hundredth, or thousandth, load flow on almost the same network.

Consider an N-1 study. Starting from a solved operating point, an engineer may need to assess the loss of every credible line, one at a time. Other workflows ask similar questions: what changes can we expect when a transformer tap moves, when a shunt is switched, or when a local substation configuration changes? In each case, the physical action is local, but its impact propagates across the whole network.

This blog post discusses how to speed up AC power-flow analysis when studying many nearby scenarios. The central idea is simple: prepare a reusable representation of the base grid, then make only a small correction for each nearby scenario.

One solved base grid, many nearby scenarios
One solved base grid, many nearby scenarios

    Why are repeated AC load flows demanding?

    Two features make AC power flow computationally challenging.

    • First, the grid is coupled. A change in injection or topology at one bus travels through the branches that connect it to the rest of the system. Even an outage that affects only two terminals can change voltages, reactive-power production, and transmission flows far away.
    • Second, the problem is nonlinear. At a bus, the specified active and reactive power must be consistent with the local voltage and current. This creates a nonlinear constraint, so we cannot obtain the final state with one fixed linear calculation.  

    The Newton–Raphson method is the established workhorse for this task, and for good reason. At each iteration, it linearizes the nonlinear power mismatch around its current estimate and solves the resulting linear system. Mature implementations, including those in open-source tools such as pandapower and PowSyBl/OpenLoadFlow, already make this process efficient, even on large grids. So, what’s the point here?

    The opportunity lies in the setting where the same work is repeated many times. In a conventional Newton–Raphson solve, the Jacobian, i.e. the matrix that describes the local response of the nonlinear equations, must be constructed and factorized as the iteration progresses. Doing that for every nearby contingency means repeatedly preparing very similar large systems.

    The alternative discussed here retains the fully coupled, nonlinear AC formulation and speeds up the solution process by reusing more of the linear-algebra work shared with the base case. While it uses approximations during the calculation, it solves the original AC power-flow equations at convergence. 

    The PFPD approach: a reusable circuit and some corrective currents

    Our method builds on the PFPD family of approaches by R. Benato (1)—short for Power Flow of the University of Padova. The intuition at the base of these methods follows: 

    At a particular voltage, a constant-power load or generator can be represented by an equivalent shunt admittance. An admittance describes how easily current flows in response to voltage. In a network model, all such relationships form the bus-admittance matrix. In PFPD, adding the equivalent shunt admittances that mimic the impact of external powers to the physical grid yields a generalized admittance matrix: a fixed circuit representation tailored to an operating point. 

    An exact generalized admittance matrix with shunt admittances that precisely match the constant power injections would require knowledge of each bus voltage. Of course, finding that voltage is the point of the power-flow calculation. We therefore keep the shunt approximation fixed and introduce corrective currents: extra nodal currents that account for the difference between the fixed circuit representation and the original constant-power condition.

    The relationship can be read as:

    voltage = fixed_circuit_voltage + network_response  *  corrective_current

     

    In the PFPD algorithm, the network response is fixed to the generalized admittance matrix, while the corrective currents and voltages are iteratively adapted. At convergence, the algorithm satisfies the original active-power, reactive-power, and voltage-magnitude constraints to the chosen numerical tolerance.  This approach avoids the construction of a new Newton-Raphson Jacobian at every iteration.  

    Two ways to repeat AC power-flow studies
    Two ways to repeat AC power-flow studies

    How N-SIDE made it faster 

    Keeping the reusable part sparse 

    Power grids are naturally sparse: a bus connects directly to only a small number of other buses, so most entries of the corresponding matrices are zero. Sparse numerical methods exploit that structure to save memory and computation.

    Our formulation retains this advantage in the key operations. We treat the slack bus as a fixed-voltage boundary rather than modeling it through a very large shunt in the core system. We then factorize two sparse matrices once using LU factorization. An LU factorization prepares a matrix so we can efficiently solve subsequent linear systems by means of two triangular systems. 

    N-SIDE’s formulation also avoids explicitly constructing a troublesome dense object that can arise around PV buses—buses where active power and voltage magnitude are controlled. Instead, a block-matrix identity lets us produce the same result from sparse submatrices and reusable solves. That distinction is relevant on large grids: a dense intermediate object can erase much of the benefit of starting with a sparse network.

    For repeated studies, a solved base case gives an especially good starting point. We choose the generalized shunt admittances so that the base-case voltage profile is reproduced with zero corrective current. A contingency or remedial action can then begin from this known state rather than from scratch.

    One way to picture the approach is as a prepared map of the grid’s response. The base-case factorization prepares the map. The nonlinear iteration still decides how much to correct at each bus, but it follows the prepared map rather than redrawing it for every scenario.

    Local changes need local corrections 

    The payoff becomes clearer when the network itself changes. Disconnecting one line, moving a transformer tap, changing a phase shift, or switching a shunt alters only a small part of the admittance matrix. Mathematically, this is often a low-rank update: a correction much smaller than the full network matrix. 

    We use the Woodbury identity to apply these local network changes. In plain language, Woodbury is a matrix rule that combines a precomputed solution operator for the base network with a small matrix describing the local action. Rather than factorizing the complete post-action network for every outage or tap change, we reuse the base sparse factors and calculate a small scenario-specific correction.

    The nonlinear corrective-current loop still runs after an action. Woodbury accelerates the repeated calculation of the updated network response inside that loop; it is not a claim that an outage can be assessed by a single linear step. But when a study contains hundreds of local actions, avoiding a full refactorization for each one adds up quickly.

    A local action becomes a small matrix correction
    A local action becomes a small matrix correction

    What the benchmarks show

    We evaluated the prototype on batches of non-islanding N-1 line outages in three open test systems: PEGASE 1354, synthetic Texas (6717 buses), and PEGASE 9241. For each system, we first solved a base case; the timed measurements then covered non-islanding line contingencies. The compared load-flow calculations used the same 0.01 MVA mismatch target, and the reference tools used their security-analysis facilities where applicable.

    Across these N-1 batches, the measured average time per contingency was 14.4–18.0 times faster than pandapower’s Newton–Raphson implementation and 3.9–9.4 times faster than PowSyBl/OpenLoadFlow’s Newton–Raphson implementation. The proposed solver remained below 7 ms per outage in the three tested batches, with approximately three to five nonlinear iterations on average.

    Average CPU time per N-1 line contingency
    Average CPU time per N-1 line contingency

    Speed would not be useful if it came from solving a materially different electrical problem. We therefore compared the resulting voltages with pandapower’s. Across the retained N-1 cases, the largest observed voltage-magnitude difference was 1.18 x 10⁻⁴ per unit, and the largest angle difference was 1.65 x 10⁻³ degrees.

    What remains to be solved

    The current method has clear limits. Reactive-power limits at PV buses are not yet supported. Islanding actions are excluded because they change the effective structure of the network. The advantage of a low-rank update also weakens when a change is not local, has high rank, or produces an ill-conditioned small correction matrix; a robust production implementation should recognise those cases and fall back to sparse factorization. 

    As with the original PFPD approach, convergence can depend on the quality of the fixed-shunt admittance initialization. Extending the method to handle reactive-power limits efficiently is the most important next step toward broader operational use.

     

    From one solve to a fast study

    The key insight is not that AC power flow becomes easy. It is that a large batch of related AC load flows should not be treated as a large batch of unrelated problems.

    By combining a fixed generalized-admittance representation, reusable sparse factors, corrective currents that restore the exact nonlinear constraints, and low-rank updates for local actions, the method creates a promising computational kernel for high-throughput AC security analysis. It keeps the physics that motivate AC power flow while making repeated operational scenarios much cheaper to explore.

    This work illustrates N-SIDE’s approach to power-system challenges: combining power-system modelling and numerical methods to make demanding studies more efficient. Our results show the potential of the proposed method for repeated AC calculations, while also identifying the developments needed for broader operational use.

    Explore the full methodology, benchmark protocol, and results in our publicly available paper.

    References

    1. R. Benato, “A basic AC power flow based on the bus admittance matrix incorporating loads and generators including slack bus,” IEEE Transactions on Power Systems, vol. 37, pp. 1363–1374, Mar. 2022. https://ieeexplore.ieee.org/document/9511788