IEEE Conference on Decision and Control (CDC), 2026

Mixed-Integer Nonlinear Differentiable Predictive Control for Underground Pumped Hydro Energy Storage Systems

Honghui Zheng1 Ján Boldocký2 Yury Dvorkin1 Ján Drgoňa1

1Department of Civil and Systems Engineering, Johns Hopkins University
2Slovak University of Technology in Bratislava

Scheduling an underground pumped hydro plant for the day-ahead market is a mixed-integer nonlinear program: every hour the unit picks pump, idle, or turbine and a power setpoint, under polynomial performance curves and a nonconvex volume-head coupling. MI-DPC trains a Transformer policy to output the whole 24-hour schedule in one forward pass. Training is self-supervised: the gradient of the ex-post profit flows through a differentiable plant simulator and a Gumbel-Softmax straight-through estimator, so no pre-solved schedules are needed.

Paper Code BibTeX

Schematic of the UPHES system: an upper reservoir, a lower reservoir in an abandoned mine, and a reversible Francis pump-turbine with head h_t bounded by h_min and h_max
Johns Hopkins Whiting School of Engineering SOLARIS lab, Johns Hopkins University Johns Hopkins Ralph O'Connor Sustainable Energy Institute Slovak University of Technology in Bratislava

1.6%

gap to piecewise MIQP

Mean ex-post profit of 2,489 ± 71 EUR/day over 47 training seeds, against 2,530 EUR/day for the piecewise MIQP baseline.

4.9 ms

per 24-hour schedule

Five orders of magnitude faster than piecewise MIQP (919 s) and 390× faster than global-linear MIQP (1.91 s).

+24.6%

profit over global-linear MIQP

2,489 versus 1,997 EUR/day, scored under the exact nonlinear simulator on 19 held-out days.

161 s

of one-time training

Self-supervised on sampled price scenarios, with no pre-solved optimal schedules as labels.

The scheduling problem

An underground pumped hydro plant uses an abandoned mine as its lower reservoir. As a price taker in the day-ahead market it pumps when electricity is cheap and generates when it is expensive. Over a horizon of \(N = 24\) hours, the schedule solves

$$ \begin{aligned} \max_{p_t^{T},\, p_t^{P},\, m_t} \quad & \sum_{t=1}^{N} \Big( (p_t^{T} + p_t^{P})\, \lambda_t^{\mathrm{DA}} - C_{\mathrm{op}}\, (p_t^{T} + p_t^{P})^{2} \Big) && \text{day-ahead profit} \\ \text{s.t.} \quad & m_t \in \{-1, 0, 1\} && \text{one mode per hour: pump, idle, or turbine} \\ & p_{\min}^{T}(h_t)\,[m_t]_+ \le p_t^{T} \le p_{\max}^{T}(h_t)\,[m_t]_+ && \text{head-dependent turbine limits} \\ & p_{\min}^{P}(h_t)\,[-m_t]_+ \le p_t^{P} \le p_{\max}^{P}(h_t)\,[-m_t]_+ && \text{head-dependent pump limits} \\ & q_t = f_{T}^{\mathrm{UPC}}(p_t^{T}, h_t)\,[m_t]_+ + f_{P}^{\mathrm{UPC}}(p_t^{P}, h_t)\,[-m_t]_+ && \text{polynomial unit performance curves} \\ & v_t = v^{\mathrm{init}} + \Delta t \sum_{s=1}^{t} q_s, \quad v_t = f^{\mathrm{vol}}(h_t) && \text{reservoir dynamics and volume-head coupling} \\ & 0 \le v_t \le v_{\max}, \quad h_{\min} \le h_t \le h_{\max}, \quad v_N \le v^{\mathrm{target}} && \text{bounds and end-of-day target} \end{aligned} $$

with \(\lambda_t^{\mathrm{DA}}\) the day-ahead price, \(p_t^{T} \ge 0\) and \(p_t^{P} \le 0\) the turbine and pump power, \(q_t\) the flow, \(h_t\) the hydraulic head, and \(v_t\) the lower-reservoir volume. Integer modes, bivariate polynomial performance curves, and a nonconvex volume-head map make this a mixed-integer nonlinear program (MINLP).

Existing solvers trade fidelity for tractability. A global linearization (MIQP-GL) solves in seconds but misjudges the physics; a piecewise approximation (MIQP-PW) is accurate but takes about a quarter of an hour per schedule. Either way the approximate schedule is then executed on the real plant, where deviations are settled at imbalance prices and water left above the end-of-day target has a cost. All results on this page are therefore ex-post profits, evaluated under the exact nonlinear simulator with both of these costs included.

MI-DPC

MI-DPC treats scheduling as a parametric problem. A neural policy \(\pi_\theta\) reads the parameters \(\xi = [h^{\mathrm{init}}, v^{\mathrm{init}}, \lambda_1^{\mathrm{DA}}, \dots, \lambda_N^{\mathrm{DA}}]\) and outputs, for all 24 hours at once, continuous power ratios and mode logits. A Gumbel-Softmax layer turns the logits into hard modes, a differentiable simulator rolls out the nonlinear plant, and the loss is the negative ex-post profit plus soft feasibility penalties. Because every block is differentiable, the policy is trained directly on the control objective over sampled price scenarios, with no optimal schedules as labels.

MI-DPC pipeline: problem parameters feed a neural policy that outputs power ratios and mode logits; a Gumbel-Softmax straight-through estimator produces hard modes; a differentiable simulator rolls out the UPHES dynamics; the loss combines negative ex-post profit with constraint penalties. Forward pass in green, backward pass in red
The MI-DPC pipeline. Green arrows show the forward pass, red arrows the gradient flowing back through the simulator and the straight-through estimator.

Four ingredients make the mixed-integer nonlinear setting trainable:

  1. Transformer policy. Each hour is a token holding the normalized price and the initial head and volume. A Transformer encoder attends over the full horizon, which is what arbitrage needs: whether to pump at 3 a.m. depends on the evening peak. Two heads output the power ratios and the mode logits, and the mode-logit biases are initialized to the mode frequencies of optimal schedules so that training starts from sensible mode mixes.
  2. Gumbel-Softmax with two-stage annealing. Each hour's mode is sampled as a hard one-hot choice in the forward pass, while the backward pass differentiates a softmax relaxation at temperature \(\tau\). MI-DPC holds the temperature high through a warm-up and then decays it exponentially. The details are below.
  3. Parallel differentiable simulator. Rolling the plant out hour by hour takes 24 sequential simulator steps. The parallel rollout evaluates all hours at once from the initial head, recovers the head trajectory, and re-evaluates once with it. This two-pass fixed-point estimate gives up a little simulator fidelity during training and makes training about 12 times faster.
  4. Straight-through clamp and soft penalties. States are clamped to their physical bounds in the forward pass, so profit is never computed on an infeasible trajectory, while the backward pass uses a unit gradient so that a saturated state still produces a training signal. Penalties on the unclamped head and volume push the policy back inside the bounds.

Differentiable mode selection

Gumbel-Softmax is used here, rather than a sigmoid or rounding straight-through estimator, because the three modes are mutually exclusive and unordered, which a softmax over three logits encodes by construction, and because its noise makes the forward pass a sample from the policy's own distribution while the temperature controls the bias and variance of the gradient.

For each hour \(t\) the policy outputs three logits \(\boldsymbol{\ell}_t = (\ell_{t,P}, \ell_{t,I}, \ell_{t,T})\), one per mode. During training they are perturbed with independent Gumbel noise and passed through a softmax at temperature \(\tau\):

$$ g_{t,i} = -\log\!\big(-\log U_{t,i}\big), \quad U_{t,i} \sim \mathrm{Uniform}(0,1), \qquad \tilde{s}_{t,i} = \frac{\exp\!\big((\ell_{t,i} + g_{t,i})/\tau\big)}{\sum_{j \in \{P,I,T\}} \exp\!\big((\ell_{t,j} + g_{t,j})/\tau\big)} $$

The simulator needs a hard decision, so the forward pass takes the largest entry, and the mode is read off the resulting one-hot vector:

$$ \bar{\boldsymbol{s}}_t = \mathrm{one\_hot}\Big( \arg\max_i \, \tilde{s}_{t,i} \Big) = \mathrm{one\_hot}\Big( \arg\max_i \, (\ell_{t,i} + g_{t,i}) \Big), \qquad m_t = \bar{\boldsymbol{s}}_t^{\top} \, [-1,\, 0,\, 1]^{\top} $$

By the Gumbel-max trick, \(\bar{\boldsymbol{s}}_t\) is an exact sample from the categorical distribution \(\mathrm{softmax}(\boldsymbol{\ell}_t)\), whatever the temperature. The argmax has zero gradient almost everywhere, so the backward pass replaces its Jacobian with that of the relaxed sample:

$$ \frac{\partial \bar{\boldsymbol{s}}_t}{\partial \boldsymbol{\ell}_t} \;:=\; \frac{\partial \tilde{\boldsymbol{s}}_t}{\partial \boldsymbol{\ell}_t} $$

The temperature therefore acts on the gradient, not on the forward decision. At high \(\tau\) the relaxed sample \(\tilde{\boldsymbol{s}}_t\) is close to uniform and its gradient is smooth and reaches all three logits, which keeps every mode in play; but it is a poor stand-in for the hard decision, so the gradient is biased. At low \(\tau\) the relaxed sample approaches the one-hot vector, the bias shrinks, and the gradient becomes sharp and noisy. MI-DPC holds the temperature high through a warm-up and then lowers it:

$$ \tau(e) = \begin{cases} \tau_0, & e < e_w, \\[4pt] \tau_0 \left( \dfrac{\tau_{\mathrm{end}}}{\tau_0} \right)^{(e - e_w)/(E - e_w)}, & \text{otherwise,} \end{cases} $$

with \(E\) the number of epochs and \(e_w\) the warm-up length. In the paper \(\tau_0 = 10\), \(\tau_{\mathrm{end}} = 0.08\), and the warm-up covers 9 of 25 epochs. At inference the noise is dropped and each hour takes the mode with the largest logit.

Animation of Gumbel-Softmax samples on the probability simplex with vertices pump, idle, and turbine: as the temperature decreases from 5 to 0.05 the cloud of samples collapses onto the vertices
Relaxed samples \(\tilde{\boldsymbol{s}}_t\) on the mode simplex as the temperature anneals. Lower \(\tau\) concentrates the samples at the pump (P), idle (I), and turbine (T) vertices. The animation is illustrative: it sweeps \(\tau\) smoothly from 5 to 0.05 and is not the two-stage training schedule above.

Straight-through clamp and loss

The same forward-hard, backward-smooth idea is applied to the state bounds.

Two panels comparing a standard clamp and a straight-through clamp: identical forward outputs on the left; on the right the standard clamp has zero gradient outside the bounds while the straight-through clamp keeps a gradient of one everywhere
Standard clamp versus straight-through clamp. Both produce the same output; only the straight-through clamp keeps a gradient when a state saturates its bound.

The training loss is

$$ \mathcal{L} = -\Big( \underbrace{\textstyle\sum_t p_t^{\mathrm{sim}} \lambda_t^{\mathrm{DA}}}_{\text{revenue}} - \underbrace{C_{\mathrm{op}} \textstyle\sum_t (p_t^{\mathrm{sim}})^2}_{\text{operating cost}} - \underbrace{\omega_{\mathrm{SI}} \textstyle\sum_t (p_t^{\mathrm{sim}} - p_t^{\mathrm{opt}})\, \lambda_t^{\mathrm{SI}}}_{\text{imbalance penalty}} - \underbrace{\omega_{\mathrm{TV}}\, \alpha \bar{\lambda}\, [v_N - v^{\mathrm{target}}]_+}_{\text{target-volume penalty}} \Big) + \mathcal{L}^{\mathrm{feas}} $$

where \(p^{\mathrm{opt}}\) is the scheduled power, \(p^{\mathrm{sim}}\) the power realized in the simulator, and \(\mathcal{L}^{\mathrm{feas}}\) the penalty on head and volume bound violations.

Results

The case study is a representative Belgian plant with a head range of 50 to 99 m and a 588,000 m³ reservoir, with performance curves measured on a reduced-scale Francis pump-turbine. Prices are 2024 Belgian day-ahead prices from the transmission system operator Elia. The policy trains for 25 epochs on 10,000 sampled price scenarios and is evaluated on 19 held-out days chosen by K-medoids clustering. MI-DPC numbers are the mean and standard deviation over 47 training seeds.

Benchmark

All three methods are scored by the same ex-post profit. The MIQP baselines optimize under approximate dynamics, so their schedules deviate once executed and pay imbalance and target-volume penalties; MI-DPC trains on the ex-post profit directly. It earns 24.6% more than the global-linear MIQP and comes within 1.6% of the piecewise MIQP, and it is the only one of the three fast enough to re-dispatch in real time as market conditions change.

MethodEx-post profit (EUR/day)Training timeInference time
MIQP-GL1,997n/a1.91 s
MIQP-PW2,530n/a918.89 s
MI-DPC2,489 ± 71161 s4.9 ms
Mean ex-post profit across the 19 benchmark days. The MIQP baselines are deterministic, solved with Gurobi to a 1% optimality gap with a one-hour limit.
Two density plots of per-day ex-post profit over the 19 benchmark days. Left: MI-DPC against MIQP-GL. Right: MI-DPC against MIQP-PW. Each curve is filled underneath and has a dashed vertical line at its mean; the legends give the mean and standard deviation across days
Distribution of per-day ex-post profit over the 19 benchmark days: MI-DPC against (a) MIQP-GL and (b) MIQP-PW. Dashed lines mark the means; the legend gives the mean and the standard deviation across days, which reflects how much profit varies from one price day to another, not the spread across seeds. MI-DPC profits are averaged over 47 seeds for each day. This figure is supplementary; it is not in the conference paper.

A converged schedule

For a representative day, the trained policy pumps through the low-price hours and turbines at the price peaks. The dispatch stays inside the head-dependent feasible power bands at every hour, and head and volume remain within bounds and end the day near the target.

Animation of the MI-DPC schedule for a representative day unfolding hour by hour. Top panel: power dispatch in red against the day-ahead price in blue, with shaded bands for the feasible turbine and pump power. Bottom panel: hydraulic head in orange and reservoir volume in green with the end-of-day target as a dashed line
The converged MI-DPC schedule for a representative day, revealed hour by hour; the rest of the day is shown faintly. Top: power dispatch (red) and day-ahead price (blue), with shaded bands for the feasible turbine (positive) and pump (negative) power. Bottom: hydraulic head (orange) and reservoir volume (green); the dashed line is the end-of-day target.

Ablation

Three design choices are ablated, each over 47 seeds on the same 19 days.

Three violin plots of per-seed mean ex-post profit over 47 seeds: policy architecture (Transformer, Bi-LSTM, MLP, CNN), temperature schedule (annealed, fixed), and training simulator (parallel, sequential), with horizontal lines at the MIQP-PW and MIQP-GL means
Per-seed ex-post profit over 47 seeds, with the MIQP-PW and MIQP-GL means as horizontal lines. (a) Policy architecture. (b) Temperature schedule. (c) Training simulator.
  1. Architecture. The Transformer reaches 2,489 ± 71 EUR/day, ahead of the Bi-LSTM (2,421 ± 133), the MLP (2,353 ± 143), and the CNN (2,081 ± 187).
  2. Temperature schedule. Two-stage annealing beats a fixed temperature of 0.08 (2,285 ± 163 EUR/day) and more than halves the spread across seeds, from 163 to 71 EUR/day: the warm-up regularizes the combinatorial search.
  3. Training simulator. The parallel rollout beats the sequential rollout (2,142 ± 51 EUR/day) and trains 12× faster, 176 s against 2,133 s in the paired runs.

Training dynamics

The animation replays one training run on the same representative day: at each epoch it shows the schedule the policy would produce at that point in training. The broad arbitrage pattern, pumping through the cheap midday hours and generating in the evening peak, is found within the first four epochs, while the temperature is still high. What keeps changing afterwards is the low-margin early morning, where the mode flips between pump and turbine from one epoch to the next. Those hours settle only as the temperature decays, and idle hours appear only late in training, once the decisions are nearly hard.

Training with the sequential rollout instead reaches a lower profit (see the ablation above) and takes longer: over 47 paired runs the mean training time is 2,133 s, against 176 s with the parallel simulator, a 12-fold speed-up.

This animation is supplementary; it is not in the conference paper.

Animation of one training run over 25 epochs for a representative day. Top panel: the power schedule at the current epoch in red against the day-ahead price in blue, with shaded feasible power bands. Middle panel: the resulting hydraulic head in orange and reservoir volume in green. Bottom strip: training loss and Gumbel-Softmax temperature against epoch, with a cursor at the current epoch
How the schedule for one day evolves during training. Top: power dispatch at the current epoch (red) against the day-ahead price (blue); faint red lines are the schedules of the two previous epochs. Middle: the resulting head (orange) and volume (green). Bottom: training loss and temperature; epochs still to come are shown faintly.

Citation

@inproceedings{zheng2026midpc,
  title={Mixed-Integer Nonlinear Differentiable Predictive Control for Underground Pumped Hydro Energy Storage Systems},
  author={Zheng, Honghui and Boldock{\'y}, J{\'a}n and Dvorkin, Yury and Drgo{\v{n}}a, J{\'a}n},
  booktitle={2026 IEEE 65th Conference on Decision and Control (CDC)},
  year={2026},
  eprint={2609.17964},
  archivePrefix={arXiv}
}