# Efficient Sampling for Data-Driven Frequency Stability Constraint via Forward-Mode Automatic Differentiation

arXiv: https://arxiv.org/abs/2407.15045 · HTML: https://mlsanity.com/paper/2407.15045/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 7 of its 15 references that are in the map.
- First posted on arXiv 21 Jul 2024.

## Builds on (most cited first, 7 of 7)

- [Gradient Surgery for Multi-Task Learning](https://mlsanity.com/paper/2001.06782/) (2020)
- [Automatic differentiation in machine learning: a survey](https://mlsanity.com/paper/1502.05767/) (2015)
- [An SQP Method Combined with Gradient Sampling for Small-Signal Stability Constrained OPF](https://mlsanity.com/paper/1608.03843/) (2016)
- [Simultaneous Scheduling of Multiple Frequency Services in Stochastic Unit Commitment](https://mlsanity.com/paper/1809.10391/) (2018)
- [Mitigating Load-Altering Attacks Against Power Grids Using Cyber-Resilient Economic Dispatch](https://mlsanity.com/paper/2206.13129/) (2022)
- [Control-mode as a Grid Service in Software-defined Power Grids: GFL vs GFM](https://mlsanity.com/paper/2307.15623/) (2023)
- [Optimal Design of Neural Network Structure for Power System Frequency Security Constraints](https://mlsanity.com/paper/2304.11963/) (2023)

## Abstract (arXiv)

Encoding frequency stability constraints in the operation problem is challenging due to its complex dynamics. Recently, data-driven approaches have been proposed to learn the stability criteria offline with the trained model embedded as a constraint of online optimization. However, random sampling of stationary operation points is less efficient in generating balanced stable and unstable samples. Meanwhile, the performance of such a model is strongly dependent on the quality of the training dataset. Observing this research gap, we propose a gradient-based data generation method via forward-mode automatic differentiation. In this method, the original dynamic system is augmented with new states that represent the dynamic of sensitivities of the original states, which can be solved by invoking any ODE solver for a single time. To compensate for the contradiction between the gradient of various frequency stability criteria, gradient surgery is proposed by projecting the gradient on the normal plane of the other. In the end, we demonstrate the superior performance of the proposed sampling algorithm, compared with the unrolling differentiation and finite difference. All codes are available at https://github.com/xuwkk/frequency_sample_ad.
