Lydion Energy Research Neural dynamics

Learning grid dynamics while they happen.

Neural ordinary differential equations for online dynamic security assessment. Research by Mert Karaçelebi and Jochen Cremer in the Intelligent Electrical Power Grids group at TU Delft.

01 The problem

After a severe disturbance, a grid has seconds. Lower inertia means it falls further, faster.

Losing a large generator or a major line opens a gap between generation and demand, and frequency drops. Protection arrests it at the nadir. If the nadir crosses critical limits, more generation disconnects and the system can black out. Inverter-based generation makes the dynamics both faster and harder to model.

Operators need to know, within seconds, where the system is heading. The usual tools struggle with:

  • the computational cost of detailed simulation;
  • poor generalisation of offline-trained models to unseen conditions and topologies;
  • data limits: dimensionality, changing topology and the variety of dynamic events;
  • uncertainty about the size and location of the disturbance.
Frequency after an event. Left of a dotted line, measurements are used for event analysis and model training. Right of it, the online model predicts the trajectory, including the nadir and recovery period, for security assessment.
Measurements from the first seconds train the model; the trained model then predicts the nadir and recovery. The online model tracks the measured frequency, the offline simulation does not.

02 Try it

Inertia sets how fast frequency falls. Fast reserves set how far. The earlier a battery acts, the shallower the nadir, which is why a forecast that arrives a second early is worth having.

2.5 s
10 %
0.6 s
System frequency after losing generationFrequency in hertz over 20 seconds, with and without a battery, against the 49.0 hertz load shedding limit. The numbers below the chart give the nadir for each case.05101520 sHzUFLS stage 1, 49.0 Hzbattery on
Nadir, no battery
48.88 Hz
Nadir, with battery
49.17 Hz
Initial RoCoF
-1.00 Hz/s
Frequency stays above 49.0 Hz. No load is shed.
Aggregated single-machine model: swing equation with load damping, a governor driving a reheat steam turbine, and a battery that ramps to 3 % of demand once activated. Illustrative parameters, not a specific grid. Solid line with battery, dashed line without.

03 The method

A neural ODE learns the right-hand side of dx/dt = fθ(x, t) from measurements. A standard ODE solver then produces the trajectory.

That gives continuous-time predictions, adaptive computation and memory-efficient training, and it does not need to know when, where or what the disturbance was.

Online and decentralised

The Online Neural Dynamics Forecaster does not model the whole grid. Pretrained NODEs sit at measurement points such as large generators. After an event each one retrains on its own local post-fault measurements over a moving window, so it follows cascading effects and control actions as they happen. Only model parameters travel to the operator, which keeps data transfer small, and the validation error doubles as a confidence index.

Transmission grid diagram. Three generators, outlined in red, each run their own neural ODE. Their parameters and initial states go to the system operator, which runs dynamics monitoring, dynamic security assessment and corrective control.
Decentralised NODEs at three generators report to the system operator.

Training fast enough to matter

Adjoint sensitivity is the standard way to train a NODE. The collocation method instead estimates derivatives straight from the data and fits the network to them: much faster, but it fails on complex dynamics. The work combines the two. The collocation error decides where training points are sampled, so the slower adjoint training spends its effort where the trajectory is hard.

Three panels. (a) A simulated trajectory with training points concentrated where the error is large. (b) Collocation-based derivatives against the neural network output, with their difference shaded. (c) The absolute error used as sampling weights.
Training points are drawn at random, weighted by the gap between collocation derivatives and the network output.
Training method against sampling strategy. DFD is the discrete Fréchet distance, the largest time-independent error. Lower is better for MSE, DFD and time.
TrainingSamplingMSEDFDR²s per epoch
Adjoint sensitivityNone4.170.5230.940.23
CollocationNone39.217.60.050.12
Adjoint sensitivityRandom3.440.320.960.15
Adjoint sensitivityCollocation-weighted4.870.550.940.14

Sampling cuts training time per epoch from 0.23 s to about 0.15 s at similar accuracy. Collocation on its own is fastest but cannot follow these dynamics (R² of 0.05).

04 Case studies

Test systems were simulated in DIgSILENT PowerFactory 2024 and PowerSimulationsDynamics.jl, some modified with inverter-based generation and its controllers. Initial conditions vary generation and demand. Disturbances are three-phase short circuits of varying impedance, duration and location, and the models are told none of it.

Frequency against time. With threshold activation the battery engages late and under-frequency load shedding still activates. With NODE-based activation the battery engages earlier and frequency stays above the limit.
A battery that acts early. Both runs activate the same battery. Triggered by the forecast, it acts early enough to avoid under-frequency load shedding.
Frequency against time in a severe event. Without action, generation disconnects and the system collapses near 16 seconds. With a system integrity protection scheme triggered by the NODE, frequency recovers towards nominal.
Islanding before collapse. A severe event drives frequency below the machines’ limits. The forecast triggers a protection scheme that disconnects a predefined region, and the rest of the system recovers.

The trigger has to be trustworthy. It fires only after the validation error has stayed below a confidence threshold over repeated training epochs.

Two panels of mean absolute frequency error against training epochs, for the two examples. Validation error in red falls below a dashed confidence threshold after a few epochs.
Validation error (red) and training error (black) against the confidence threshold.

Learning oscillations, epoch by epoch

Modified IEEE 9-bus system, one synchronous generator replaced by an inverter-based unit. One NODE tracks angle, voltage and speed of both non-slack generators. Solid lines are predictions, dotted lines the simulated truth, scaled for display.

Warm start. Pretraining gets the model close quickly. The rest of training is spent on the oscillatory periods.
Undamped oscillations. The model learns the simple dynamics first, then finds and adapts to the critical oscillation.
Damped oscillations. The damping is already in the measurements, and the forecast picks it up within a few epochs.

05 Papers

  1. 2025

    Online Neural Dynamics Forecasting for power system security

    Mert Karaçelebi, Jochen L. Cremer

    International Journal of Electrical Power & Energy Systems, vol. 167, 110566

    DOI 10.1016/j.ijepes.2025.110566Free PDFPreprint
    Abstract

    The increase in variable renewable energy sources has brought about significant changes in power system dynamics, mainly due to the widespread adoption of power electronics and nonlinear controllers. The resulting complex system dynamics and the unpredictable nature of disturbances pose substantial challenges for real-time dynamic security assessment (DSA). Machine learning (ML) methods offer advantages in terms of computational speed compared to numerical methods and simulators. Offline-trained ML models, however, are limited by their training domain; e.g., they cannot easily consider various grid topologies and data changes. Neural Ordinary Differential Equations (NODEs) leverage the integration of neural networks and ODE solvers to enable continuous-time dynamic trajectory predictions from time series data, resolving the limitation on topological and data changes. This paper introduces the Online Neural Dynamics Forecaster (ONDF) workflow, designed to monitor and assess system security in real-time using multiple NODEs trained solely with local post-fault measurements. Through several case studies, we compare the regression and DSA classification capabilities of ONDF with various ML models. Our findings demonstrate that ONDF provides a novel and scalable approach for system operators to make informed decisions and apply corrective control actions based on predicted dynamics.

  2. 2025

    Power system frequency monitoring and emergency control with neural ordinary differential equations

    Mert Karaçelebi, Jochen L. Cremer

    Sustainable Energy, Grids and Networks, vol. 43, 101815

    Abstract

    Increasing renewable energy supply and distributed generating sources in the power grid lead to lower inertia levels. Lower inertia combined with higher uncertainty in operation can cause drastic frequency fluctuations when a disturbance occurs. System operators must know whether the transmission system is secure against a disturbance. Real-time models attempt to predict the frequency in near-real time however require pretraining on a large variety of possible disturbances. Training models in real-time would not require pre-training as they are directly trained on the occurring disturbance. However, training in real-time is not feasible until now as fast-occurring system dynamics require shorter prediction (and training) times for security and operation which standard machine learning models are not capable of. For the first time, this work proposes a fast training strategy that learns Neural Ordinary Differential Equations (NODE) in near real-time directly on the occurring disturbance, simultaneously addressing the inaccuracy issue of model-based dynamic studies. NODE learns the dynamics or derivatives of an ODE system that standard ODE solvers can solve. NODE provides a continuous function for predicting future dynamics in a decentralized way, hence faster frequency stability assessment for longer time spans. We propose a collocation-based sampling using the collocation gradients. Case studies on the IEEE 39-bus system show the approach is feasible for near real-time operation, accurately predicts future system states, and enables operators to apply predesigned corrective control actions, potentially making the system secure for future disturbances.