Physics-Guided Transformer Framework for Real-Time Voltage Stability Margin Prediction under Renewable Uncertainty
Abstract
This paper proposes a Physics-Guided Transformer (PG-Transformer) framework that integrates physical knowledge of power systems with advanced deep learning architectures for accurate and uncertainty-aware VSM prediction. Simulated Phasor Measurement Unit (PMU) measurements generated from dynamic time-domain simulations of the benchmark IEEE 39-bus and IEEE 118-bus systems are preprocessed using denoising, normalization and time windowing techniques to form a multivariate time series dataset. Classical stability indices L-index, Thevenin Equivalent Ratio and PV Margin are embedded into the learning pipeline to guide the model toward physically consistent feature representations. To address severe class imbalance, a Conditional Wasserstein GAN with Gradient Penalty (CWGAN-GP) is employed to generate synthetic unstable samples while maintaining physical validity. The proposed PG-Transformer employs multi-head self-attention for spatiotemporal correlation learning and Monte Carlo Dropout for uncertainty quantification. Experimental results show that the model achieves an RMSE of 0.0378, R² of 0.973, accuracy of 96.67%, F1-score of 0.886, and AUC of 0.987, outperforming state-of-the-art baselines such as Random Forest, CNN-LSTM and Physics-Guided LSTM models. Ablation studies confirm the complementary benefits of physics-guided features, GAN-based resampling, and uncertainty modeling, collectively improving accuracy by 6.47%. The framework operates with an average inference latency of 1.75 ms/sample, validating its suitability for real-time voltage stability monitoring in renewable-rich smart grids.