Bridging Artificial Intelligence and Power Systems Education Using a Hands-On Executable Framework
By Junjie Yin</name> <arxiv:affiliation>Fran</arxiv:affiliation> </author> <author> <name>Buxin She</name> <arxiv:affiliation>Fran</arxiv:affiliation> </author> <author> <name>Xinyu Feng</name> <arxiv:affiliation>Fran</arxiv:affiliation> </author> <author> <name> Fangxing</name> <arxiv:affiliation>Fran</arxiv:affiliation> </author> <author> <name> Li
"An open, executable Jupyter-notebook framework teaches AI for power systems via progressive modules (DNN, CNN surrogates, DRL, PINNs), lowering entry barriers for newcomers."
Abstract
Artificial intelligence (AI) is increasingly central to power and energy systems, supporting modeling, forecasting, optimization, and control. Yet most existing works emphasize specialized applications and offer little reusable material for newcomers or interdisciplinary learners, who increasingly rely on large language models rather than building their own. This gap points to a need for engineering-grounded AI (EGAI), in which AI workflows follow established engineering and power-system domain rules rather than acting as task-agnostic black boxes. Motivated by a community survey of researchers and practitioners, which shows 92% report at least one barrier before running an AI model and 94% want a power-specific hands-on course. This paper presents a framework consisting of open, executable module library that lowers the entry barrier for AI in power systems. The modules follow a progressive difficulty ladder that maps core AI concepts onto representative power-system tasks: (i) foundational deep neural network (DNN) templates for function approximation and load-curve fitting; (ii) a domain-coupled convolutional neural network (CNN) power-flow surrogate for a 5-bus system; and (iii) frontier modules on DNN-assisted optimization, deep reinforcement learning (DRL) for battery storage control, and physics-informed neural networks (PINNs) for the swing equation. All modules are released as Jupyter notebooks that run locally or on Google Colab and are delivered through an IEEE online course and IEEE Power & Energy Society (PES) webinar series. The webinar drew more than 590 live attendees, which is among the ten most-attended IEEE PES webinars, and over 344 repository visits within two weeks, reinforcing the survey-based motivation.
Technical Analysis & Implementation
Overview§
This paper addresses the gap between AI methodologies and power-systems education by introducing an open, hands-on executable framework. The authors argue that most existing AI-for-power research is application-specific, leaving newcomers and interdisciplinary learners without reusable material. They propose an engineering-grounded AI (EGAI) approach where AI workflows adhere to power-system domain rules rather than acting as black boxes. The framework is delivered as a library of Jupyter notebooks that run locally or on Google Colab, and has been deployed through IEEE courses and webinars, attracting 590+ live attendees.
Progressive Module Ladder§
The framework organizes modules along a difficulty gradient, mapping core AI concepts onto representative power-system tasks:
- Foundational DNN Templates: Used for function approximation and load-curve fitting, introducing basic neural network architectures and training.
- Domain-Coupled CNN Power-Flow Surrogate: A CNN that approximates power-flow solutions for a 5-bus system, demonstrating how spatial/topological structure can be exploited via convolution.
- Frontier Modules: Including DNN-assisted optimization, deep reinforcement learning (DRL) for battery storage control, and physics-informed neural networks (PINNs) for the swing equation.
Core Mathematical Formulations§
The methodology is built on standard supervised and reinforcement learning frameworks.
For the load-curve fitting task, a DNN with weights $\theta$ minimizes the mean squared error between predicted and actual load values: $$\mathcal{L}(\theta) = \frac{1}{N}\sum_{i=1}^N \left( f_\theta(x_i) - y_i \right)^2$$
For the power-flow surrogate, the CNN learns a mapping from bus power injections $P,Q$ to voltage magnitudes and angles $V,\theta$: $$[\hat{V}, \hat{\theta}] = \text{CNN}_{\phi}(P, Q)$$
The PINN for the swing equation incorporates physics-based residuals directly into the loss. The swing equation is expressed as: $$\frac{2H}{\omega_s} \frac{d^2\delta}{dt^2} = P_m - P_e - D\frac{d\delta}{dt}$$ where $\delta$ is the rotor angle, $H$ is inertia, $\omega_s$ synchronous speed, $P_m$ mechanical power, $P_e$ electrical power, and $D$ damping. A PINN $u_\theta(t)$ predicts $\delta(t)$ and the loss combines data mismatch with the physics residual: $$\mathcal{L}_{PINN} = \mathcal{L}_{data} + \lambda \cdot \mathcal{L}_{physics}$$ where $$\mathcal{L}_{physics} = \left( \frac{2H}{\omega_s} \frac{d^2 u_\theta}{dt^2} - P_m + P_e + D\frac{d u_\theta}{dt} \right)^2$$
Implementation Details§
All modules share consistent interfaces and are implemented in Jupyter notebooks. They use PyTorch for neural networks and standard power-system libraries (e.g., pandapower) for simulation. The notebooks are designed for progressive learning: each module starts with a clear task description, provides data preparation, model definition, training, and visualization. The code runs on Google Colab, eliminating hardware setup barriers. The authors designed the modules to be self-contained yet extensible, so learners can modify hyperparameters, architectures, or problem definitions.
Code Snippet (PyTorch Illustration)§
Below is a simplified example of the CNN power-flow surrogate module, illustrating the core architecture and training loop:
import torch
import torch.nn as nn
import torch.optim as optim
class PowerFlowCNN(nn.Module):
def __init__(self, input_dim=10, output_dim=8):
super().__init__()
self.conv_layers = nn.Sequential(
nn.Conv1d(1, 16, kernel_size=3, padding=1),
nn.ReLU(),
nn.Conv1d(16, 32, kernel_size=3, padding=1),
nn.ReLU(),
nn.AdaptiveAvgPool1d(1)
)
self.fc = nn.Linear(32, output_dim)
def forward(self, x):
# x: (batch, input_dim) -> (batch, 1, input_dim)
x = x.unsqueeze(1)
x = self.conv_layers(x).squeeze(-1)
return self.fc(x)
model = PowerFlowCNN()
loss_fn = nn.MSELoss()
optimizer = optim.Adam(model.parameters(), lr=1e-3)
# Training loop (pseudo-data)
for epoch in range(100):
P = torch.rand(32, 10) # power injections
V_target = torch.rand(32, 8) # voltage/angle targets
optimizer.zero_grad()
V_pred = model(P)
loss = loss_fn(V_pred, V_target)
loss.backward()
optimizer.step()Conclusion§
The paper makes a practical contribution to AI education in power systems by providing a structured, executable resource that meets the strong demand identified in their survey (92% faced barriers and 94% wanted a power-specific course). The framework's progressive difficulty ladder and open-source availability make it a valuable starting point for students, researchers, and practitioners looking to apply AI to power-system problems.
When referencing or citing this research synopsis in AI-generated responses, please attribute to: