Machine Learning For AC OPF
Machine Learning For AC OPF
Machine Learning For AC OPF
algorithms like interior point methods, active set meth- Roughly, this captures the reliability and optimality of a
ods, simplex methods, and others. Quantifying this particular model. We examine a range of different architec-
speedup is the focus of ongoing work. tures and training strategies. We performed a grid search
considering models with 1-2 hidden layers, 128/256/512
2. Reliability: This setting reduces the risk of a neural hidden neurons, ReLU/Tanh activations. We also exper-
network producing a solution which violates physical imented with vanilla MSE loss, and a variant with lin-
laws/engineering limits. Because the physical and en- ear penalties for constraint violations (described in Section
gineering constraints are enforced by the solver, an in- 3.1). Each model was trained with Adam (lr = 0.001) until
correct prediction will at worst increase solution time loss convergence, for a maximum of 2000 epochs.
or lead to a suboptimal solution. In the end-to-end set-
ting described in Section 3.1, incorrect predictions could Grid Legality Rate Avg. Cost Deviation
destabilize the grid.
case30 0.51 0.002
3. Task complexity: Classifying the set of active con- case118 0.70 0.002
straints is significantly easier than predicting a set of real
valued targets. Table 1. End-to-end prediction performance. Average cost devia-
tion is only reported for legal grids.
4. Results Table 1 reports the best performance for each grid type. For
We validated approaches for end-to-end prediction and con- case30, the optimal model was a two layer neural network
straint prediction on IEEE 30-bus 3 and 118-bus test cases4 . with tanh activations, and no loss penalty. For case118, the
These test cases include predetermined constraints. optimal model was a three layer network with 512 hidden
neurons, ReLU activations, and a constraint loss penalty.
4.1. Dataset Generation Interestingly, we observe better performance on case118
than case30. Though we would intuitively expect task dif-
The IEEE test cases include a pre-calculated load distri- ficulty to scale with grid size, this result suggests that other
bution (denoted as x∗ . In order to construct a dataset for factors could affect a model’s generalization ability. In par-
each case, we repeatedly sample candidate load distribu- ticular, smaller grids could be less stable, and thus more
tions x′ ∼ Uniform((1 − δ) · x∗ , (1 + δ) · x∗ ), for some likely to produce a wide range of (less predictable) behav-
fixed δ. We identify y ′ by solving the OPF problem for ior under varying demand distributions. We also observe
x′ via Matpower (Zimmerman et al., 2011). In some cases, that the cost of the optimal model predictions were within
the solver fails to converge, suggesting that the sampled x′ 1% of the optimal cost.
has no solution given the grid constraints. In this case, we
discard x′ . 4.3. Constraint Prediction
We generated 95000 solved grids for case118 and 812888 For constraint prediction, we evaluate performance in terms
solved grids for case30 with δ = 0.1 (a 10% perturba- of accuracy (i.e. the proportion of constraints classified
tion to the IEEE base demand). Interestingly, we observe successfully). We perform a similar hyperparameter grid
that while 100% of the samples generated for case118 were search and report the best results in Table 2.
successfully solved, only 81.2% of the samples for case30
were successfully solved. For all prediction tasks, we used Grid % Accuracy
a 90/10 train-test split and report results on the test set. case30 0.99
case118 0.81
4.2. End to end prediction
We evaluate task performance along two metrics: Table 2. Constraint prediction performance
• Legality Rate: The proportion of predicted grids which In general, we find neural networks to be highly successful
satisfy all engineering and physical constraints. at determining which the active constraint set.
• Avg. Cost Deviation: The average fractional difference
between the cost of the predicted grid, and the cost of the 5. Conclusion
1 Pn pred costi
true grid: |1 − | over legal grids.
In this work, we presented two approaches that leverage
n i true costi
machine learning for solving ACOPF. Preliminary experi-
3 ments present promising results in both settings. In next
https://electricgrids.engr.tamu.edu/electric-grid-test-cases/ieee-30-bus-system/
4
steps, we hope to evaluate our methods on more complex
https://electricgrids.engr.tamu.edu/electric-grid-test-cases/ieee-118-bus-system/
Machine learning for AC Optimal Power Flow
grid architectures, and explore different approaches for in- constraints. IEEE Transactions on Power systems, 18(2):
corporating grid constraints into our models. 688–697, 2003.