State-of-the-art constraint-exact scenario generation
for power grids
Code and benchmark: github.com/Nishant27-2006/constraint-placement
Generative models are increasingly used to produce operational scenarios for power systems, and such scenarios must satisfy the physical laws they describe. An injection pattern that violates Kirchhoff's laws cannot occur on any real network. Several methods achieve exact satisfaction of affine physical invariants. The question the field has not answered is where the constraint belongs: in the hypothesis class, at inference, in the loss, or in the coordinates.
We answer it by building the constraint into the hypothesis class, as an orthogonal projection of the velocity field onto the constraint nullspace. That is exact under any Runge–Kutta scheme, excludes no minimiser of the flow-matching objective, and costs zero additional function evaluations. On the transmission-network suite it sets the state of the art: best variogram score of 16 methods, leading the strongest baseline by 3.8% (t = -6.1) and inference-time correction by 10.5% (t = -12.4); best CRPS of 16; and constraint violation 727,790× lower than unconstrained flow matching.
Across 16 methods, 10 seeds and three suites built from real grid measurements, we isolate the variable that governs the answer: the codimension of the constraint set. On a controlled contrast where the only change is how much of the state the physics determines, train-time projection moves from neutral to decisive. Soft penalties, the field's default, are dominated on both axes simultaneously.
grid suite (the metric that measures spatio-temporal dependence structure). Leads the runner-up by 3.8% (t = -6.1) and inference-time correction by 10.5% (t = -12.4).Sixteen methods, ten seeds, identical backbone, budget and data.
grid suite)kNN-Historical) places second of sixteen.measured, significantly better on grid. Hover any marker for its interval and t-statistic.Codimension is the control variable, and it decides the answer. The two grid suites are the same 118-bus system and the same measured injections; the only change is whether the model must also emit the 186 line flows the constraint matrix determines exactly. Codimension goes 0.093 → 0.648 and train-time projection goes from neutral to a decisive win. This is a controlled contrast, not a correlation.
The practical rule follows directly: the more of the state your physics pins down, the more you gain by building it into the hypothesis class rather than bolting it on afterwards. At high codimension, the regime real transmission networks live in, where line flows are determined functions of injections, train-time projection is the method of choice.
grid.| λ | ES | rel. to FM | ‖Ax−b‖∞ (MW) |
|---|---|---|---|
| 1 | 545.5 | +0.3% | 219 |
| 10 | 595.5 | +9.5% | 236 |
| 100 | 843.9 | +55.1% | 277 |
| 1000 | 1043 | +91.8% | 187 |
| train-time | 533.3 | -2.0% | 6.48×10-4 |
Three orders of magnitude of λ move the violation from 219 MW to 187 MW, the same order and still unacceptable, while the score degrades to +92%. There is no λ to tune.
Scenario feasibility does not reach the scheduling decision; calibration carries it. The exactly-feasible routes take the worst regret among neural methods (ours 53%, FM+reduced 66%); the best belong to the most over-dispersed baselines (16%). Exact ensembles are sharper, the scheduler trusts them, under-commits reserve and pays in load shed.
A study that stopped at the energy score would have reported the opposite. Limit: 3 seeds on this stage, not 10.
grid.Every hypothesis was registered with its acceptance criteria before the sweep ran, so the conclusions below are the ones the data selected rather than the ones we went looking for. Three questions the field had left open are now answered.
Open question: is there a universal ranking of constraint routes?
Answer: no, and we can say exactly what governs it. Train-time projection beats inference-time correction by 3.39% on grid (t = -9.09) and the ordering inverts on measured (+3.38%, t = +5.05). Codimension predicts which regime you are in. This is the result the field was missing.
Open question: does working in physical rather than chart coordinates protect the learned distribution under a topology change?
Answer: every exact route transfers. Rebuilding the projector from the contingency PTDF restores exact feasibility zero-shot across all eight outages, for physical and chart coordinates alike (896.4 vs 881.8). Operators can swap topology without retraining, a stronger and more useful result than a differentiator would have been.
Open question: how much retraction does a nonlinear AC manifold actually need?
Measured: one retraction after the solve reaches |g|∞ = 0.0077 from 5.1, free in score. Per-step retraction at 3 Gauss-Newton iterations reaches only 129, worse than doing nothing.
A non-neural baseline places second of sixteen on both grid suites. kNN-Historical resamples analogue days: zero parameters, zero NFE, exactly feasible by construction. It beats every GAN, VAE and normalising flow on all three suites.
@inproceedings{anonymous2026constraintplacement,
title = {Where Does a Physical Constraint Belong in a Generative Model?},
author = {Anonymous},
booktitle = {Submitted to the International Conference on Learning Representations},
year = {2026}
}