Spaces:
Running
Close Enough? Turning GENCO Predictions into Feasible AC Solutions
1. Introduction
Can a GENCO AC-OPF prediction with small residuals be turned into an independently verified feasible operating point, with limited adjustments and a small change in generation cost?
This study investigates AC feasibility restoration for GENCO predictions on the IEEE14 and IEEE30 systems. The workflow combines separately trained GENCO models, constrained optimization, and an independent AC constraint checker. Restoration is formulated as minimizing the normalized deviation from a prediction subject to AC power-flow equations and operating limits. The resulting solutions are independently checked against these constraints.
The study compares four approaches, namely raw GENCO predictions, feasibility restoration, cold-start AC-OPF, and GENCO-initialized AC-OPF. The evaluation examines feasibility, prediction adjustments, generation cost, and end-to-end runtime to assess how much correction is needed and what computational cost it incurs.
2. Experimental setup
I trained separate GENCO AC-OPF models for IEEE14 and IEEE30 using OpenGridFM's gridfm-graphkit, with 200 epochs and seed 42 for each grid. Each model is evaluated on its corresponding grid using its best-validation checkpoint and saved normalization statistics. The model parameters remain fixed throughout the restoration experiment.
For each grid, I sampled 10 validation cases and 50 held-out test cases from the recorded partitions using seed 42. The workflow was checked on the validation cases before evaluating all four methods on the same test cases.
3. AC model and restoration methods
For a case with n buses and m active generators, the operating point and complex bus voltages are
Here p is generator active power in MW, and q is bus-aggregate reactive generation in MVar. Voltage magnitudes are in p.u. and angles are in radians. Let C_g map active generators to buses, and let C_f and C_t select the from-end and to-end bus voltages of each branch. The exported admittance matrices include the source branch parameters and bus shunts and are scaled so that the following expressions return complex powers in MW + jMVar:
For fixed case parameters a, the AC feasible set is
The loads are P^d and Q^d. The sets in the last three lines identify reference buses, branches with positive thermal ratings, and branches with active angle-difference limits. Bounds and limits are taken from each case after removing inactive equipment. The selected cases have one active generator per generator bus, so the bus-aggregate reactive-generation bounds match the individual generator bounds.
Let denote the denormalized GENCO prediction. Restoration locally solves
where the normalized distance is
The scales are
Each variable group is averaged first, and the four groups receive equal weight. Angles use the same fixed reference. The original prediction remains the distance target when the initial solver point is clipped to variable bounds.
The four methods are:
- Raw GENCO: return the prediction and independently check its feasibility.
- GENCO + restoration: locally minimize the distance defined above over the AC feasible set.
- Cold-start AC-OPF: minimize generation cost from zero angles, unit voltage, and midpoint generation bounds, clipped to variable bounds.
- GENCO-initialized AC-OPF: minimize the same generation cost starting from the GENCO prediction.
The two AC-OPF baselines locally solve
All three optimization methods use CasADi and IPOPT. Restoration targets minimum change, while the two AC-OPF baselines target generation cost.
4. Feasibility checks and tolerance sensitivity
A separate NumPy evaluator recomputes complex power injections and branch flows and checks all nine constraint groups. For equality constraints and inequalities written with a zero right-hand side, violations are
where the constraints are h_k(x) = 0 and g_k(x) <= 0, respectively. Thermal violations use the excess apparent-power magnitude above the branch rating.
Power-related violations are divided by the system base power of 100 MVA. Voltage and angle violations are expressed in p.u. and radians. Using d_k = 100 for power violations measured numerically in MW, MVar, or MVA, and d_k = 1 for voltage and angle violations, define
Here, k indexes individual scalar constraints across the nine constraint groups.
A scenario passes when all checked quantities are finite and
The heatmaps show the maximum violation within each constraint group for every test scenario. Blue indicates values below the tolerance, and red indicates exceedances. Raw predictions exhibit power-balance and reactive-generation-limit violations, with additional from-end thermal-limit violations on IEEE30. After restoration, every checked constraint group passes in all test cases.
The tolerance-sensitivity curves show how the fraction of feasible scenarios changes with the acceptance tolerance. The vertical line marks 1e-5. All curves recheck the same fixed predictions and solutions without rerunning optimization.
5. Restoration results
The overview compares joint feasibility and each scenario's maximum violation before and after restoration. At the selected tolerance, restoration and both AC-OPF baselines pass all checks in all 100 test scenarios.
| Method | IEEE14: cases passing / 50 | IEEE30: cases passing / 50 |
|---|---|---|
| Raw GENCO | 1/50 | 0/50 |
| GENCO + restoration | 50/50 | 50/50 |
| Cold-start AC-OPF | 50/50 | 50/50 |
| GENCO-initialized AC-OPF | 50/50 | 50/50 |
The largest normalized violations after restoration are 3.52e-9 on IEEE14 and 2.61e-9 on IEEE30.
The adjustment plots show cumulative distributions of per-scenario root-mean-square changes in active generation, reactive generation, voltage magnitude, and voltage angle. Reactive-generation RMS adjustments are evaluated at generator buses, while voltage adjustments are evaluated at all buses. Median active-generation adjustments are 0.00466 MW for IEEE14 and 0.07556 MW for IEEE30. The voltage-magnitude axis uses units of 0.001 p.u., and voltage-angle changes are shown in degrees.
For each scenario, the signed relative generation-cost difference is
The reference is the stored local AC-OPF solution for that scenario. Positive values indicate higher cost, and negative values indicate lower cost.
Generation costs are compared with each scenario's stored local AC-OPF reference solution. Mean relative cost differences after restoration are 0.0831% for IEEE14 and 0.0630% for IEEE30. The left panel shows their distributions. The right panel compares raw and restored cost differences for each scenario. Points above the diagonal indicate a cost increase during restoration.
6. Runtime and network examples
Runtime is measured on an Apple M4 Pro CPU with batch size one, two PyTorch inference threads, and BLAS thread limits set to one. Each test case is measured five times. Online timing includes preprocessing, inference where applicable, constraint checks, fresh optimization-model construction, numerical solution, extraction, and return overhead. Offline training, model loading, and startup warmup are outside the timed interval.
The table reports mean milliseconds per case. Parentheses give the standard deviation of the five repeat means.
| Method | IEEE14: ms/case | IEEE30: ms/case |
|---|---|---|
| Raw GENCO + check | 9.001 (0.055) | 9.882 (0.098) |
| GENCO + restoration | 19.924 (0.104) | 30.618 (0.215) |
| Cold-start AC-OPF | 10.467 (0.083) | 20.164 (0.120) |
| GENCO-initialized AC-OPF | 19.378 (0.108) | 29.602 (0.245) |
The upper panels show mean component times. The lower panels show distributions of per-case median runtimes across the five repeats. Both GENCO-assisted optimization pipelines take longer overall than cold-start AC-OPF in this CPU experiment. GENCO initialization slightly reduces solver iterations, but inference overhead outweighs the solver-time savings.
The network plots show the case with the largest raw normalized violation for each grid: IEEE14 scenario 247972 and IEEE30 scenario 29986. Node colors indicate the voltage-magnitude change from prediction to restoration, measured in units of 0.001 p.u. Red indicates an increase and blue a decrease. Gold rings identify generator buses. Each panel uses its own color scale.
7. Discussion
The experiments show that GENCO predictions can be converted into independently checked feasible AC operating points with small adjustments and modest reference-cost differences. Comparing restoration with GENCO-initialized AC-OPF also separates two objectives: preserving the predicted operating point and further optimizing its generation cost.
The current CPU implementation restores feasibility but takes longer overall than cold-start AC-OPF. Larger networks, batched inference, and reuse of optimization models are useful next experiments for identifying when this workflow can also reduce total runtime.
Code and resources
Acknowledgements
I thank the GridFM community for organizing the challenge and the GENCO and OpenGridFM teams for making their research and software openly available.
Team and contact
- Jing Qi, Georgia Institute of Technology
- Contact: jqi67@gatech.edu






