Real-time monitoring of inverter-based microgrids is essential for stability, fault response, and operational decision-making. However, electromagnetic transient (EMT) simulations, required to capture fast inverter dynamics, are computationally intensive and unsuitable for real-time applications. This paper presents a data-driven surrogate modeling framework for fast prediction of microgrid behavior using convolutional neural networks (CNN) and Light Gradient Boosting Machine (LightGBM). The models are trained on a high-fidelity EMT digital twin dataset of a microgrid with ten distributed generators under eleven operating and disturbance scenarios, including faults, noise, and communication delays. A sliding-window method is applied to predict important system variables, including voltage magnitude, frequency, total active power, and voltage dip. The results show that model performance changes depending on the type of variable being predicted. The CNN demonstrates high accuracy for time-dependent signals such as voltage, with an R2 value of 0.84, whereas LightGBM shows better performance for structured and disturbance-related variables, achieving an R2 of 0.999 for frequency and 0.75 for voltage dip. A combined CNN+LightGBM model delivers stable performance across all variables. Beyond accuracy, the surrogate models also provide major improvements in computational efficiency. LightGBM achieves more than 1000× speedup and runs faster than real time, while the hybrid model achieves over 500× speedup with near real-time performance. These findings show that data-driven surrogate models can effectively represent microgrid dynamics. They also support real-time and faster-than-real-time predictions. As a result, they are well-suited for applications such as monitoring, fault analysis, and control in inverter-based power systems.
Figures & tables
Reference
System / Focus
Model Type
EMT High- Frequency Data
Multiple Disturbances
OOD / Robustness Test
Main Limitation / Scope
[ 14 ]
Transient stability
CNN
No
Limited
No
Focused on stability classification, not multi-target surrogate regression
[ 27 ]
Transient security assessment
Deep learning
No
Limited
Partial
Emphasis on security assessment under partial observability
[ 22 ]
Transient stability
CNN + saliency map
No
Limited
No
Primarily classification and interpretability oriented
[ 29 ]
Small-signal stability
Deep CNN
No
Limited
No
Focused on small-signal stability, not EMT waveform prediction
[ 30 ]
Voltage vulnerability assessment
CNN
No
Limited
No
Application-specific vulnerability assessment
[ 19 ]
Small-signal stability correction
LightGBM
No
Limited
No
Structured stability features, not EMT multi-channel dynamics
TABLE I: Comparison of Representative Recent Studies on Data-Driven and Surrogate Modeling Approaches for Power-System Dynamics
Fig. 1: Internal structure of a representative distributed generation (DG) unit in the inverter-based microgrid. Each DG unit consists of a distributed energy source, a DC-link capacitor, and a voltage source inverter (VSI) that operates using PWM switching. The inverter output is filtered by an LCL filter and connected to the AC bus via a coupling transformer. A local controller regulates voltage, frequency, and power using control signals (V∗,f∗,P∗,Q∗) , based on measurement feedback (VDG,IDG,PDG,QDG,fDG) . The same structure is assumed for all DG units.
Parameter
Value
Filter resistance, Rf
0.1Ω
Filter inductance, Lf
4mH
Filter capacitance, Cf
200μF
Line resistance, Rc
0.1Ω
Line parameters (2, 4, 6, 8)
1.5mH+0.1Ω
Line parameters (1, 3, 5, 7, 9)
0.5mH+0.07Ω
TABLE II: Key Parameters of the Inverter-Based Microgrid
Fig. 2: EMT digital twin microgrid and dataset generation framework. A grid-connected inverter-based microgrid is simulated under multiple disturbance scenarios. Synchronized measurements are collected and processed to extract key electrical variables (V1,V2,V3,I1,I2,I3,PDGk,QDGk,fDGk) . Derived features (Vmag,Ptotal,Qtotal) are computed and segmented using a sliding-window approach with window length W and stride S . The resulting dataset is organized into training, validation, and OOD test sets for surrogate modeling.
Fig. 3: Real-time surrogate modeling workflow using CNN and LightGBM. Multivariate time-series windows Xt∈RW×d are processed in parallel: CNN captures temporal waveform patterns, while LightGBM learns structured nonlinear relationships from statistical features. The models predict key variables (Vmag,fDG1,Ptotal,Vdip) , followed by OOD evaluation under noise and communication delay, and runtime benchmarking against EMT simulation to assess real-time capability.
CNN Architecture
LightGBM Hyperparameters
Conv1D (32): (100, 32)
Boosting: gbdt
Conv1D (64): (100, 64)
Learning rate: 0.05
MaxPool: (50, 64)
Estimators: 300
Conv1D (64): (50, 64)
Max depth: 6
GlobalAvgPool: (64)
Num leaves: 31
Dense (64)
Min child samples: 20
TABLE III: Model Architecture and Hyperparameters Used in This Study
Fig. 4: Training and evaluation of CNN and LightGBM models under OOD conditions, such as noise and communication delay scenarios. The digital twin simulation is used to generate the training and validation data for both models. CNN converges steadily across all targets, while LightGBM converges faster and stabilizes early. Both models are tested on noise and communication delay scenarios.
Fig. 5: Comparison of model predictions and ground truth under unseen conditions for key microgrid variables: voltage magnitude ( Vmag ), frequency ( fDG1 ), total active power ( Ptotal ), and voltage dip ( Vdip ). Results from CNN, LightGBM, and the hybrid model are shown. Insets show small local differences between the models. Smooth variables ( Vmag , Ptotal ) and frequency are predicted accurately, while Vdip shows highly variable behavior with more visible deviations. The hybrid model provides consistent performance across both smooth and dynamic signals.
Fig. 6: Residual distributions and prediction accuracy for key microgrid variables: voltage magnitude ( Vmag ), frequency ( fDG1 ), total active power ( Ptotal ), and voltage dip ( Vdip ). Histograms display the residual distributions along with kernel density estimates, while the insets show predicted versus true values. Most variables have residuals that are tightly centered around zero with low bias, and they show strong linear agreement, especially for fDG1 and Ptotal . In contrast, Vdip shows higher variance and increased prediction spread due to its highly dynamic behavior.
Method
Sim (s)
Time (s)
Speedup
RT Ratio
Simulink
1.00
941.16
1.00
0.001
LightGBM
1.00
0.89
1053.58
1.12
CNN
1.00
5.09
185.04
0.20
Hybrid
1.00
1.80
522.65
0.56
TABLE IV: Runtime and Real-Time Performance Comparison
Fig. 7: Combined evaluation of prediction accuracy and computational efficiency. The top panel shows R2 scores for LightGBM, CNN, and the hybrid model across key variables: Vmag , fDG1 , Ptotal , and Vdip . The bottom panel presents runtime on a logarithmic scale relative to the EMT simulation.
This paper proposes a Mamba surrogate model with mixture-of-experts (MoE) routing to represent the transient dynamics of inverter-based resources. A Mamba surrogate model is a predictive machine learning model built on the Mamba architecture. MoE routing uses a router network to assign data-dependent weights to specialized subnetworks (experts). The resulting Mamba--MoE surrogate can perform two tasks: (i) closed-loop simulation and (ii) measurement-window forecasting of inverter transients. A single Mamba backbone with task conditioning and expert routing serves both tasks, replacing two separate specialists. Task-matched objectives fit each prediction form, and an adaptive conformal layer provides prediction intervals for both tasks. For the considered grid-following inverter, the unified surrogate model remains in the same low-error regime as a Mamba specialist pair while using 13% fewer parameters. The prediction intervals achieve 94--96% empirical mean marginal coverage across the two tasks. For transient dynamics---that is, beyond the vicinity of an equilibrium point---our surrogate model with MoE routing yields lower errors across all outputs in both tasks compared to a shared Mamba backbone without expert routing. A controller hardware-in-the-loop simulation validates our results and shows that adapting only the shared output head with limited measured data reduces held-out forecasting error.
Haoguang Wang, Huy Hoang Le, Akhila Kandivalasa +3
School of Mechanical Engineering, Purdue University, West Lafayette, IN 47907 USA · R&D Department, Powermore Ltd., Da Nang, 550000 VN · Department of Electrical and Computer Engineering, New Jersey Institute of Technology, Newark, NJ 07102 USA +1
This work introduces a latency-aware benchmarking framework for evaluating deep learning models in power system anomaly detection using high-fidelity, time-domain signals generated from an industry-grade electromagnetic transient simulator. Eight neural network architectures, ranging from MLPs to Transformers, were systematically evaluated on streaming datasets representing both physical faults and cyber-attacks in inverter-dominated networks. All models successfully classified two representative multi-event sequences in real time with sub-cycle response times below 15 ms. However, although classification decisions occurred within one cycle, the end-to-end inference latency consistently exceeded three cycles, ranging from 50 to 90 ms. These results highlight a critical gap between algorithmic capability and protection-grade deployment, pointing to the need for further optimization and hardware acceleration. The findings establish a reproducible benchmark for sub-cycle anomaly detection and provide guidance for transitioning machine learning methods from research prototypes to real-world protection applications.
Emad Abukhousa, Saman Zonouz, A. P. Sakis Meliopoulos
School of Electrical and Computer Engineering, Georgia Institute of Technology, Atlanta, GA, USA
The rapid evolution of energy structures has positioned microgrids as pivotal components of next-generation power systems, offering enhanced resilience and renewable energy integration. However, the inherent low inertia, complex dynamics, and poor model conditions of microgrids necessitate advanced data-driven frequency control strategies. Although reinforcement learning (RL) has demonstrated certain potential and advantages, existing RL methods often struggle with generalization across diverse microgrid configurations and lack adaptability to unseen environments, particularly when explicit system parameters are unavailable. To address these challenges, in this paper, we introduce a novel prompt decision transformer (Prompt-DT) architecture for microgrid frequency control. Unlike traditional approaches that rely on hard-to-obtain environmental characteristic parameters, the proposed method leverages few-shot expert historical trajectories as prompts to guide autonomous perception and adaptive decision-making. In addition, we propose a context-aware training and execution mechanism utilizing self-supervised contrastive learning to enhance environment recognition and prompt utilization efficiency. In addition, a physics-informed prompt design technique that filters prompts based on cumulative reward and frequency volatility is proposed, ensuring high-quality physical guidance during online execution. Finally, to ensure generalization in unseen environments with limited data, we develop a lightweight finetuning approach that achieves performance comparable to full-parameter finetuning with minimal adjustments.
Xu Yang, Chenhui Lin, Haotian Liu +3
State Key Laboratory of Power Systems, Department of Electrical Engineering, Tsinghua University, Beijing 100084, China