arXiv:2609.02646cs.LGSep 2026

Manuscript Offprint

arXiv:2609.02646

Differentiable Electricity-Market Clearing for Gradient-Based Planning

Luca Mungo, Maarten P. Scholl, Arnau Quera-Bofarull

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Planning a large data center is difficult because a facility big enough to matter changes the electricity prices it will pay. Those prices are set by market clearing, a constrained optimization problem solved anew in every operating condition. However, simulating the market tells a planner how a candidate plan performs but not how to improve it. Here we treat market clearing as a differentiable optimization layer: each forward pass solves the market, and reverse-mode automatic differentiation propagates the planning cost back through the cleared prices to the plan. After validating these gradients against finite differences, we apply them to a concrete problem: allocating 50 MW of data-center load across six candidate buses in two synthetic networks, under a fixed cost per active site, evaluated over 36 operating states. Judged against exhaustive enumeration of all site combinations, gradient optimization recovers the continuous allocations almost exactly, with worst-case objective gaps of 2.3% and 8.5% of the cost difference between the best and worst single site. Its one systematic error is instructive: near the costs at which a site should close, the smooth relaxation of the discrete site count shrinks the site rather than closing it, so discrete transitions arrive late. Differentiable market clearing thus turns market-aware planning into a problem gradients can search.

1 Introduction

Planning investments in electricity markets is challenging because investment decisions can substantially alter dispatch, congestion, and electricity prices. These outcomes are determined by market clearing, an optimization problem that minimizes generation costs subject to system constraints and, in doing so, determines generator dispatch and electricity prices [Kirschen and Strbac, 2004]. Evaluating a candidate investment therefore requires clearing the market under that investment, often across many operating conditions. This process tells the planner how a proposed investment will perform, but not how the investment should be adjusted, so finding the best plan may require searching a large space of alternatives. We study this problem in a simple setting: how should a planner distribute 50 MW of new data-center load across six candidate buses when each allocation changes the prices the data centers will pay?

We ask whether the gradient of the planning objective with respect to the investment decision can guide the search over candidate plans. Obtaining these sensitivities requires differentiating through the market-clearing problem itself. The planning objective depends on nodal prices, which are dual outputs of a constrained optimization problem, so its gradient must account for how those prices respond to changes in the plan. Optimization layers and automatic implicit differentiation provide the computational tools for obtaining these gradients [Amos and Kolter, 2017, Agrawal et al., 2019,

Preprint.

Blondel et al., 2022, Besançon et al., 2024]. This yields a differentiable market-clearing model that can be embedded directly within a gradient-based planning procedure.

Each candidate plan is evaluated by clearing the market across its operating states, and reverse-mode automatic differentiation propagates the resulting cost through nodal prices to the planning variables; electricity-market clearing becomes a differentiable optimization layer. We use this approach to allocate a load across candidate buses in two families of synthetic networks. Because site selection is discrete, we optimize a smooth relaxation of the site-count penalty, then commit and refine the resulting plans.

Across both fixed-cost sweeps, the gradient-based procedure produces plans whose objective values closely track the numerical optimum defined in Appendix B. This pattern persists across five near-uniform initializations, with the largest departures from the numerical optimum and the greatest variation occurring near portfolio switches. Although we evaluate only one instance of each network family, these case studies show that differentiable market clearing can guide an end-to-end planning procedure toward near-optimal solutions, while also exposing the difficulty of smooth relaxations near discrete portfolio switches.

Our approach builds on two established lines of work. Sensitivity analysis of optimal power flow has long been used to characterize how locational marginal prices respond to changes in demand and other market parameters [Conejo et al., 2005, Yang and Deng, 2014], while differentiable optimization layers provide general tools for propagating derivatives through constrained optimization problems [Amos and Kolter, 2017, Agrawal et al., 2019, Blondel et al., 2022, Besançon et al., 2024]. Data-center siting has likewise been formulated as a bilevel formulation (a nested optimization problem in which location decisions affect subsequent electricity-market outcomes) [Zeng et al., 2024] but has typically been addressed using reformulation and decomposition techniques. While small bilevel problems can be addressed through single-level reformulations, evidence from large-scale electricity-grid planning suggests that implicit-gradient methods can outperform reformulation-based approaches as the problem size and number of operating scenarios grow [Degleris et al., 2026]. This motivates studying gradient-based methods for market-aware data-center planning. Our setting combines these threads by propagating derivatives through cleared nodal prices to optimize the spatial allocation of a large new load. Unlike continuous capacity-expansion settings, the resulting outer problem also contains a discrete site-selection decision; we address it through a smooth relaxation and evaluate the resulting plans against an enumerated numerical reference.

References (19)