Learning to Optimize meets Neural-ODE: Real-Time, Stability-Constrained AC OPF

Vincenzo Di Vito, Mostafa Mohammadian, Kyri Baker, Ferdinando FiorettoarXiv 2024 · DOI

Abstract

Modern power grids face increasing volatility due to renewable energy integration, requiring faster-than-real-time optimal power flow (OPF) solutions. While "Learning to Optimize" (LtO) methods offer millisecond-level inference, they often produce solutions that violate generator dynamic stability. We present DynOPF-Net, a framework that integrates LtO with Neural Ordinary Differential Equations (Neural-ODEs) to solve the AC-OPF problem while guaranteeing stability. By embedding differentiable physics proxies into a Lagrangian dual learning framework, DynOPF-Net achieves zero stability violations and significant speedups over traditional numerical solvers.

Introduction

The Alternating Current Optimal Power Flow (AC-OPF) problem is fundamental to power system operations, determining cost-effective generator set-points to meet demand. Traditionally treated as a steady-state optimization solved every 5 to 60 minutes, the modern grid's rapid fluctuations from intermittent renewables demand much faster control.

While recent machine learning (ML) approaches can predict grid solutions nearly instantly, they typically ignore generator dynamics. A solution that appears optimal in a steady state might trigger rotor angle instability, leading to system-wide blackouts. DynOPF-Net bridges this gap by making ML-driven grid operations both lightning-fast and physically safe.

Problem Formulation

The research addresses the Stability Constrained AC-OPF problem. Unlike standard AC-OPF, which focuses on static constraints like voltage limits and line thermal capacities, this formulation includes the differential equations governing generator rotor angles and frequencies.

Model 2: The Stability Constrained AC-OPF Problem formulation including generator dynamics.

Methodology: The DynOPF-Net Architecture

DynOPF-Net employs a dual-network architecture designed for end-to-end differentiability:

  1. The LtO Model ($D_\psi$): A deep neural network that maps load demands to predicted optimal generator set-points (voltage and power).
  2. Neural-ODE Predictors ($N_\phi^g$): High-speed physics proxies that replace slow numerical simulators. Each generator has a dedicated Neural-ODE to predict how its internal state (rotor angle and frequency) evolves over time based on the LtO model's output.
The DynOPF-Net architecture showing the integration of the LtO model and Neural-ODE predictors within a Lagrangian learning framework.

Lagrangian Dual Learning

To enforce physical constraints, the framework utilizes a Lagrangian approach during training. Physical violations, such as rotor angle limits, are converted into penalties in the loss function. Because the Neural-ODE components are differentiable, the entire system can be trained via backpropagation. The model learns to adjust its "optimal" predictions to avoid states identified as unstable by the Neural-ODE proxies.

Experimental Results

The model was evaluated on the WSCC 9-bus and IEEE 57-bus benchmarks using 10,000 load profiles. Ground truth solutions were generated using the IPOPT numerical solver.

Key Findings

  • Guaranteed Stability: While baseline ML methods (e.g., DC3 or standard Lagrangian-Dual) resulted in unstable dynamics in 4-7% of cases, DynOPF-Net achieved zero stability violations across all tests.
  • Computational Efficiency: The Neural-ODE components were approximately 20 times faster than traditional numerical solvers like Dopri5.
  • Real-Time Performance: Inference times were recorded at 1ms for the 9-bus system and 9ms for the 57-bus system, meeting the requirements for real-time grid control.
  • Optimality: The "optimality gap"—the cost difference between DynOPF-Net and the theoretical perfect solution—remained negligible at approximately 0.1% to 0.2%.

Discussion and Future Work

The study demonstrates that optimizing for cost without considering generator "swing" is insufficient for fast-timescale operations. Neural-ODEs proved superior to Physics-Informed Neural Networks (PINNs) in capturing dynamics across varying operational conditions, as PINNs often struggled with generalization bias.

Future research will focus on scaling the architecture to grids with thousands of buses by leveraging the parallelizable nature of the per-generator predictors. Additionally, incorporating more complex generator models and inverter-based resources like battery storage will be critical for modernizing the framework for future grid architectures.

Summary updated

BibTeX
@misc{vito2024learning,
  author = {Vincenzo Di Vito and Mostafa Mohammadian and Kyri Baker and Ferdinando Fioretto},
  title = {{Learning to Optimize meets Neural-ODE: Real-Time, Stability-Constrained AC OPF}},
  year = {2024},
  eprint = {2410.19157},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.19157},
}
Figure