Taking the Guesswork Out of Trading #7: Geometric Learning, Graph Neural Networks and Linear Analysis in Power Systems
- Ognjen Vukovic
- Feb 23
- 4 min read
Updated: Feb 24
Learning the Transformation Process

EnAnalytica is a specialized consultancy focused on developing advanced optimization and analysis solutions for electricity markets, particularly those employing nodal pricing mechanisms like ERCOT or flow-based market coupling like Europe. Additionally, there is also some work performed on NEMDE in Australia.
Goal: Accelerating Power Transfer Distribution Factor (PTDF) Estimation via Graph Neural Network Learning
Context:
The Power Transfer Distribution Factor (PTDF) matrix is a fundamental tool in power system analysis, enabling rapid assessment of line power flows resulting from changes in power injections. It is derived through linear algebraic operations involving network topology (incidence matrix) and line parameters (susceptance matrix). However, for expansive interconnected power grids, the computational burden associated with the repeated calculation and inversion of these matrices becomes a significant bottleneck, particularly in real-time or near-real-time applications such as contingency analysis, optimal power flow, and market simulations.
Problem:
This research aims to investigate the feasibility and efficacy of employing Graph Neural Networks (GNNs) to directly predict the PTDF matrix based on the network topology and line parameters, thereby circumventing the computationally intensive linear algebraic procedures. Specifically, we seek to determine if a GNN can learn the complex, non-linear mappings between:
Input:
Graph representation of the power system, including:
Network topology (incidence matrix or adjacency list).
Line parameters (reactance, impedance, admittance).
Output:
The corresponding PTDF matrix.
Hypothesis:
We hypothesize that a well-designed GNN, trained on a representative dataset of power system network configurations and their corresponding PTDF matrices, can accurately approximate the PTDF matrix. This would significantly reduce the computational latency associated with PTDF estimation, enabling faster and more responsive power system analysis.
Research Objectives:
Develop a GNN architecture that effectively captures the structural and parametric information of the power system network.
Train and validate the GNN using a comprehensive dataset of power system topologies and PTDF matrices.
Evaluate the accuracy and computational efficiency of the GNN-based PTDF prediction compared to traditional linear algebraic methods.
Analyze the generalization capabilities of the GNN across varying network sizes and operating conditions.
Investigate the potential for incorporating additional features (e.g., historical load data, voltage profiles) to enhance PTDF prediction accuracy.
Significance:
Successful development of a GNN-based PTDF prediction model would offer several key benefits:
Computational Efficiency: Reduced computational time for PTDF estimation, enabling faster power system analysis and control.
Scalability: Improved scalability for large-scale power grids, facilitating real-time applications.
Robustness: Potential for enhanced robustness to noise and uncertainties in network parameters.
Adaptability: Capability to adapt to dynamic changes in network topology and operating conditions.
Methodology:
Data Generation: Create a diverse dataset of power system network topologies and their corresponding PTDF matrices using power system simulation tools (e.g.,
PowerWorld, MATPOWER).
Graph Representation: Transform the power system network into a graph representation suitable for GNN processing.
GNN Architecture Selection: Choose and adapt an appropriate GNN architecture (e.g., GCN, GAT) for PTDF matrix prediction.
Training and Validation: Train the GNN using the generated dataset and evaluate its performance using appropriate metrics (e.g., mean squared error, mean absolute error).
Performance Evaluation: Compare the computational time and accuracy of the GNN-based PTDF prediction with traditional linear algebraic methods.
Sensitivity Analysis: Perform sensitivity analysis to assess the impact of network size, line parameters, and other factors on GNN performance.
Expected Outcomes:
A trained GNN model capable of accurately predicting the PTDF matrix based on network topology and line parameters.
A quantitative assessment of the computational efficiency and accuracy of the GNN-based approach.
Insights into the generalization capabilities of GNNs for PTDF prediction in large-scale power systems.
Algorithm:
Overall Approach: Data-Driven PTDF Approximation via Graph Neural Networks
Power System Data Acquisition:
Retrieve power system data (generators, loads, lines, etc.) from various sources and time snapshots.
Integrate SCED dispatch data to align with real-time operations.
Network Graph Construction:
Build a NetworkX graph representing the power system's topology (buses as nodes, lines/transformers as edges).
Extract edge features (dependent on the matrix you want to predict) from the network data.
Power Flow and PTDF Calculation:
Perform a load flow calculation to determine the system's operating state.
Compute the Power Transfer Distribution Factor (PTDF) matrix, which describes the sensitivity of line flows to power injections.
Data Preparation for GNN:
Convert the NetworkX graph into a PyTorch Geometric Data object, suitable for GNN input.
Create target flow tensors from the PTDF matrix, representing the desired output of the GNN.
GNN Model Initialization:
Why GAT (optional, you can change) => GATs are chosen because they are well-suited to handle the complex, irregular, and potentially noisy nature of power system networks. Their attention mechanism allows them to learn the varying importance of network components, capture long-range dependencies, and potentially provide insights into the underlying power flow dynamics. All of these points are very important when trying to predict the PTDF matrix.
Initialize a Graph Attention Network (GAT) model, designed to learn the relationship between the network topology and PTDF values.
Goal:
To train the GNN to accurately predict the PTDF matrix, given the network's topology and line parameters, thus avoiding the computationally intensive traditional PTDF calculations.
Result example - early stages ( 10000 x 10000 PTDF matrix):


Please remember, this only, and only, demonstrates that a GNN can, in principle, learn the complex mapping between a power system's graph representation (topology and line parameters) and its PTDF matrix. That is all for this early stage!
Comments