Table of Contents
Fetching ...

Differentiable Power-Flow Optimization

Muhammed Öz, Jasmin Hörter, Kaleb Phipps, Charlotte Debus, Achim Streit, Markus Götz

Abstract

With the rise of renewable energy sources and their high variability in generation, the management of power grids becomes increasingly complex and computationally demanding. Conventional AC-power-flow simulations, which use the Newton-Raphson (NR) method, suffer from poor scalability, making them impractical for emerging use cases such as joint transmission-distribution modeling and global grid analysis. At the same time, purely data-driven surrogate models lack physical guarantees and may violate fundamental constraints. In this work, we propose Differentiable Power-Flow (DPF), a reformulation of the AC power-flow problem as a differentiable simulation. DPF enables end-to-end gradient propagation from the physical power mismatches to the underlying simulation parameters, thereby allowing these parameters to be identified efficiently using gradient-based optimization. We demonstrate that DPF provides a scalable alternative to NR by leveraging GPU acceleration, sparse tensor representations, and batching capabilities available in modern machine-learning frameworks such as PyTorch. DPF is especially suited as a tool for time-series analyses due to its efficient reuse of previous solutions, for N-1 contingency-analyses due to its ability to process cases in batches, and as a screening tool by leveraging its speed and early stopping capability. The code is available in the authors' code repository.

Differentiable Power-Flow Optimization

Abstract

With the rise of renewable energy sources and their high variability in generation, the management of power grids becomes increasingly complex and computationally demanding. Conventional AC-power-flow simulations, which use the Newton-Raphson (NR) method, suffer from poor scalability, making them impractical for emerging use cases such as joint transmission-distribution modeling and global grid analysis. At the same time, purely data-driven surrogate models lack physical guarantees and may violate fundamental constraints. In this work, we propose Differentiable Power-Flow (DPF), a reformulation of the AC power-flow problem as a differentiable simulation. DPF enables end-to-end gradient propagation from the physical power mismatches to the underlying simulation parameters, thereby allowing these parameters to be identified efficiently using gradient-based optimization. We demonstrate that DPF provides a scalable alternative to NR by leveraging GPU acceleration, sparse tensor representations, and batching capabilities available in modern machine-learning frameworks such as PyTorch. DPF is especially suited as a tool for time-series analyses due to its efficient reuse of previous solutions, for N-1 contingency-analyses due to its ability to process cases in batches, and as a screening tool by leveraging its speed and early stopping capability. The code is available in the authors' code repository.

Paper Structure

This paper contains 31 sections, 13 equations, 8 figures, 4 tables, 2 algorithms.

Figures (8)

  • Figure 1: Schematic view of the components of the energy grid and the current applications of power flow calculations.
  • Figure 2: The figure depicts the operational graph of the power balance equation. The calculated power $S_{calc}$ (depending on the current voltage vector) and the actual power $S_{bus}$ are formed and their active/reactive components are used in $y_{calc}$ and $y$ to create the loss function. The green colored variables, namely the voltage magnitude of PV-buses and the voltage angle of PV and PQ buses, are trainable and are used as the voltage solution after training.
  • Figure 3: Comparison of our Differentiable Simulation (blue), NR (red) and the DC-approximation (green) on CPU without data loading time. Left: the IEEE-118 grid, right: case9241pegase grid. In both cases our differentiable simulation is slower than NR but the solution quality lies between NR and DC.
  • Figure 4: Scaling behavior of DPF (braces show the number of iterations), NR and DC. While on CPU (left) the scaling seems similar between the different approaches, on GPU (right) the better scaling behavior becomes apparent. Yet for a grid size of 9,241 NR is still faster, as our gradient-based approach needs about 1,000 iterations in its base form for convergence.
  • Figure 5: Solution distance of previous solutions (or initialization) to the solution of the next time step for the IEEE-118 grid. Subsequent time-steps have very similar grids, and as a result, very similar solutions.
  • ...and 3 more figures