An Open-Source Toolbox for Embedding Neural Stability Surrogates in Stability-Constrained Optimization
Summary
This guest lecture introduces an open workflow for learning a neural surrogate of small-signal stability and embedding that surrogate as an exact constraint in unit commitment. It was delivered at the third International Summer School on IBR-Dominated Power Systems, held at the University of Strathclyde in Glasgow. The school follows earlier editions at Imperial College London in 2024 and Tsinghua University in 2025.
The accompanying tutorial uses a compact IEEE 14-bus example. It generates eigenvalue-labelled operating points, trains a small residual ReLU network, converts the trained model into mixed-integer linear constraints, and compares baseline and stability-constrained decisions.
Course materials
Python tutorial
Open the GitHub repository
NCET package
Documentation · Install
Tutorial workflow
The notebooks follow the modelling steps in order:
- Run AC power flow, dynamic initialisation, and small-signal eigenvalue analysis with ANDES.
- Train a residual ReLU regressor in PyTorch to predict the critical eigenvalue real part.
- Encode the trained network as mixed-integer linear constraints with NCET.
- Solve the baseline and stability-constrained one-period unit commitment problems in CVXPY.