Adaptive Electromagnetic Transient-level Digital Twins for Data Centers via In-Context Learning with LLMs
Authors: Amit Jena, Bin Wang, Aoxia Chen, Brad Chadwell, Billy Yancey, Le Xie
Organizations: Department of Electrical and Computer Engineering, Texas A&M University, College Station, TX 77843 USA · Advanced Technology Solutions, ISO New England, Holyoke, MA 01040 USA · Electric Power Engineers (EPE), Austin, TX USA · School of Engineering and Applied Sciences, Harvard University, Boston, MA 02134 USA
The rapid growth of artificial intelligence (AI) workloads has significantly increased data center (DC) power demand. Frequent operational and configurational changes, such as load surges caused by dynamic workload allocation, can induce electromagnetic transients (EMTs) whose accurate prediction is critical for reliable DC operation and maintenance. Although high-fidelity EMT solvers are widely adopted for transient analysis, their computational cost limits large-scale and multi-scenario studies. Digital twins address this computational bottleneck by emulating the behavior of a physical system and enabling fast prediction in place of expensive high-fidelity simulation. However,data-driven digital twins are non-adaptive and fail to generalize once the DC configuration changes. To address this limitation, this paper proposes an adaptive EMT-level digital twin for DCs based on in-context learning (ICL) with large language models (LLMs). We formulate the EMT prediction task as a system identification problem under parametric uncertainty and develop a GPT-2-based framework that adapts to unseen DC configurations at inference time from a small set of EMT trajectory samples, without model retraining. The proposed framework is validated on three representative EMT scenarios and benchmarked against three baseline non-adaptive twins. Results demonstrate superior prediction accuracy, improved adaptability to unseen operating conditions, and substantial computational speedups compared to high-fidelity EMT simulation.
Figures & tables
Fig. 1 : Overview of the Proposed ICL-based Adaptive Digital Twin Framework . The twin is meta-trained on multi-configuration EMT data, adapted to unseen configurations using a few test-time samples, and evaluated by predicting EMT waveforms with high fidelity.
Fig. 2 : Schematic Diagram of the DC Power System Model. The DC is supplied power through two different paths, thus leading to two distinct operating modes. (1) Grid-connected mode : an upstream transmission grid and an interface transformer power the IT load, gated by a circuit breaker. (2) Off-grid mode : A battery-backed grid-forming inverter provides power to the IT load, gated by a separate circuit breaker. The two paths join at the point of common coupling (PCC), which employs a droop-controlled actuator (inset) that regulates the PCC voltage by tracking active and reactive power ( PPCC , QPCC ) through low pass filtering, sample-and-hold, and P−f and Q−V droop control loops to set an internal three-phase voltage behind an output impedance.
Parameter
Symbol
Value
EMT simulation timestep
Δtsim
5 μ s
Nominal grid voltage
Vgrid
345 kV
Transformer rating
ST
100 MVA
Nominal PCC frequency
fPCCref
60 Hz
Nominal PCC voltage
VPCCref
1.0 p.u.
P – f droop gain
Kp
0.0005
TABLE I : Nominal PSCAD Model Parameters (Common to All Cases)
Case
Dist. Type
Stoch. Param.
Nominal Value
Variation Range
Step- change
Step load
PL
25 MW
[0, 320] MW
QL
8.44 MVAR
[0, 105.2] MVAR
Gradual- change
Ramp load
PL
25 MW
[0, 320] MW
QL
8.44 MVAR
[0, 105.2] MVAR
Mode- switch
Breaker toggle
SGFM
150 MVA
[ − 80, 80] MVA
TABLE II : Configuration Parameters for the Three EMT Case Studies
Parameter
Symbol
Value
Model Architecture (GPT-2 backbone)
Number of transformer layers
L
6
Number of attention heads
H
4
Embedding dimension
d
128
Context length
n
36
Training and Test Configuration
TABLE III : ICL Model Architecture and Training Hyperparameters
Method
Adapts?
Step-change
Gradual-change
Mode-switching
Avg. over all cases
MAE
RMSE
MAE
RMSE
MAE
RMSE
ET (s)
Gain ( × )
PSCAD (ground truth)
–
–
–
–
–
–
–
128.06
1×
ICL (ours)
✓
0.00078
0.00316
0.00152
0.00438
0.00119
0.00524
9.911
12.92 ×
ARMAX
×
0.06613
0.09493
0.05090
0.07071
0.08273
0.10764
0.026
4925 ×
LSTM
×
0.00842
0.01343
0.00067
0.00092
0.00248
0.01201
1.156
110.78 ×
PINN
×
0.04139
0.04818
0.03338
0.04204
0.01977
0.03332
0.791
161.90 ×
TABLE IV : Comparison of Three-Phase PCC Voltage Prediction Accuracy, Execution Speed, and Adaptivity Across Methods and Test Cases
Fig. 3 : EMT prediction results . The top row presents the detailed Case 1 (step-change): (a) the applied load disturbance, (b) the ground-truth three-phase PCC voltage, and (c) the corresponding adaptive digital twin prediction. The bottom row presents single-phase cross-method comparisons: (d) PCC voltage and (e) PCC current for Case 1, and (f) PCC voltage for Case 3 (mode-switching). The proposed ICL-based adaptive digital twin accurately reproduces both the voltage and current EMT responses. The quantitative results for all cases, including Case 2 (gradual-change), are reported in Table IV .