Contingency-constrained economic dispatch with safe reinforcement learning

Michael Eichelbeck, Hannah Markgraf, Matthias Althoff

Abstract

This paper introduces a robust framework for microgrid management that integrates Reinforcement Learning (RL) with formal safety guarantees. By employing a safety layer based on constrained zonotopes, the proposed method ensures system resilience against grid outages (islanding) while optimizing economic dispatch. Experimental results demonstrate that the safe RL agent achieves zero safety violations and superior cost-efficiency compared to standard RL baselines.

Introduction

Modern microgrids face the dual challenge of optimizing economic dispatch—balancing power from the grid, batteries, and renewables—while maintaining operational safety under uncertainty. A critical safety concern is the islanding contingency: the sudden disconnection from the main utility grid. Standard RL approaches, while effective at handling complexity, lack the rigorous guarantees needed to ensure a microgrid has sufficient battery reserves to survive such events.

Methodology

The authors propose a hybrid control architecture that combines the flexibility of RL with the rigor of formal methods. The core of this approach is a Safety Layer that intercepts actions from a Proximal Policy Optimization (PPO) agent.

To define the boundaries of safe operation, the framework utilizes Backwards Reachability Analysis to calculate a Safe State Set. This set represents all battery charge levels from which the system can guaranteed-survive an islanding event of duration $H$, regardless of load or solar fluctuations. To overcome the exponential computational complexity typically associated with such calculations, the authors employ constrained zonotopes. This geometric representation allows for polynomial-time safe set computation, enabling real-time action projection via Quadratic Programming (QP).

Evolution of safe sets using constrained zonotopes for backwards reachability analysis.

Evaluation and Results

The framework was validated using 220 days of real-world residential load and solar PV data. The RL agent was trained for 100 days and evaluated over a 20-day period with synthetic forecasts to simulate realistic prediction uncertainty.

Key Performance Metrics

  • Safety Guarantees: The "Safe Agent" achieved zero violations of the islanding constraint throughout the test period. In contrast, the baseline RL agent frequently breached safety limits.
  • Operational Efficiency: Training the agent with the safety layer active allowed it to learn the boundaries of the safe space. This resulted in higher total rewards and lower safety penalties (120.96 vs. 156.10 for the baseline).
  • Real-Time Performance: The safety layer's maximum execution time was recorded at 0.23 seconds, well within the 1-minute sampling interval required for microgrid dispatch.
Comparative performance metrics over training steps: (a) Total reward, (b) Maximum safety violation, (c) Mean cost, and (d) Mean penalty.

Discussion and Future Work

A significant insight from this work is that the safety layer acts as a constructive constraint during training, guiding the agent toward more robust policies. However, the current model relies on linearized microgrid dynamics and does not yet account for AC power flow or line losses. Future research will focus on generalizing this approach to more complex grid topologies and integrating advanced forecasting models to further enhance resilience.

Summary updated

BibTeX
@inproceedings{eichelbeck2022contingency,
  author = {Michael Eichelbeck and Hannah Markgraf and Matthias Althoff},
  title = {{Contingency-constrained economic dispatch with safe reinforcement learning}},
  booktitle = {ICMLA},
  year = {2022},
  doi = {10.1109/icmla55696.2022.00103},
}
Figure