arXiv:2610.26351eess.SYOct 2026

Manuscript Offprint

arXiv:2610.26351

PhyPro-FM: A Physics and Prompt-Guided Graph Foundation Model for Contingency Analysis

Xu Yang, Zhanyuan Sheng, Chenhui Lin, Haotian Liu, Qi Wang, Yue Yang, Wenchuan Wu

Xu Yang, Graduate Student Member, IEEE, Zhanyuan Sheng, Chenhui Lin, Senior Member, IEEE

Haotian Liu, Member, IEEE, Qi Wang, Member, IEEE, Yue Yang, Member, IEEE, and Wenchuan Wu, Fellow, IEEE

Abstract—The continuous evolution of next-generation power systems, characterized by the high penetration of renewable energy resources and dynamic topology variations, poses formidable challenges to traditional N-1/N-2 contingency analysis in terms of computational efficiency and scalability. While deep learning-based methods offer accelerated inference, existing studies predominantly treat contingency analysis as a pure regression problem, often overlooking the physical essence of grid operation and engineering requirements of real-world scenarios. To bridge this gap, this paper proposes a physics and prompt-guided graph foundation model (PhyPro-FM) for generalizable and engineering-viable contingency analysis. The proposed architecture integrates graph neural networks with a learnable global query mechanism and, notably, introduces a prompt-guided learning paradigm. By leveraging historical snapshots as few-shot prompts, the model dynamically captures correlations between target and historical operating conditions, significantly enhancing generalization capabilities under unseen topologies. Furthermore, we design a physics-informed training mechanism that prioritizes branch power flow errors over nodal voltage errors, aligning the optimization objective with critical grid security constraints. To ensure engineering applicability, a physics-informed inference mechanism is also developed, incorporating a residual-based correction module and a specialized post-processing strategy for singular branches to circumvent numerical instability. Comprehensive experiments demonstrate that PhyPro-FM outperforms state-of-the-art methods in accuracy and generalization, validating its superior physical consistency and robustness for practical engineering applications.

Index Terms—Contingency analysis, graph foundation model, physics-informed learning, prompt-guided learning.

I. INTRODUCTION

WITH the ongoing evolution of next-generation power systems, an increasing number of distributed energy resources are being integrated into the grid. On the generation side, renewable energy sources represented by wind and solar power are widely connected, gradually replacing traditional large-scale generators [1]-[3]. On the demand side, flexible loads are constantly emerging, such as electric vehicle aggregators, AI servers, and data centers [4]-[6]. Meanwhile, on the grid side, newly built transmission lines, line maintenance, and N-1/N-2 contingencies cause continuous changes in grid topology [7], [8]. The randomness and volatility across these three dimensions are leading to increasingly drastic variations in power flow, simultaneously making situation awareness both more critical and more challenging.

As one of the most fundamental and important tools for power system situation awareness, contingency analysis empowers critical tasks including grid planning, operational mode verification, and economic dispatch [9], [10]. Traditional contingency analysis approaches rely on mathematical methods such as the Newton-Raphson method for iterative solution [11], [12]. Although it can ultimately yield accurate results, it suffers from the drawbacks of long computation time and the inability to perform multi-scenario batch calculations. Under the current power system landscape, real-time, high-precision, and large-scale batch contingency analysis has become imperative, such as interval evaluation of renewable energy output, N-1/N-2 contingency screening, and massive user energy consumption scenarios, posing a formidable challenge to traditional methods.

References (38)