I Introduction
Machine learning has recently been employed to solve optimal power flow (OPF) problems efficiently. By applying supervised learning techniques and using prepared (load, optimal solution) data, [1, 2] indicate deep neural network (DNN) could reduce the computation time of the conventional method by determining active constraints upon the given load. The studies in [3] and later in [4, 5, 6] train DNN for solving OPF problems by learning the highdimensional loadsolution mapping, which could directly generate feasible and closetooptimal solutions much faster than conventional solvers.
While existing works suggest the potential of DNN in solving ACOPF problems, the presence of multiple loadsolution mappings poses a fundamental challenge to the supervised learningbased schemes. As the nonconvex ACOPF problem may admit multiple optimal solutions for a load input [7], the training dataset may contain “mixed” data points, i.e., the solutions to different load inputs correspond to different mappings, making the learning task inherently difficult. Consequently, the trained DNN can fail to learn a legitimate mapping (one of the multiple target mappings) and generate inferior solutions [8]. See Fig. 1 for an illustrating example. Since the solutions to a load from different mappings can derive similar objective values or exhibit similar solution structures (e.g., both solutions have “highvoltage” solutions on the same buses and “lowvoltage” solutions on the remaining buses), it is nontrivial to differentiate them from each other. Consequently, intuitive methods such as selecting the leastcost and “highvoltage” solution for each load may fail to address the issue.
There exist two approaches to tackle the challenge. One is to prepare the training dataset so that it contains data points from only one mapping [8]
. The other is to apply unsupervised learning to train DNN without labeling data points
[9]. Yet, their limitations lie in (i) substantial computational complexity in preparing training data and in unsupervised learning and (ii) no guarantee to learn a legitimate mapping for ACOPF problems with multiple loadsolution correspondences.In this paper, we propose DeepOPFAL as an augmented learning approach to learn a unique mapping from an augmented load input to the corresponding solution, and then use it to solve ACOPF problems. Our contribution is twofold. First, after presenting a simple example showing ACOPF problems can indeed admit multiple loadsolution mappings, we develop DeepOPFAL following a particular augmentedlearning design. Specifically, we train a DNN to learn the mapping from (load, initial point) to the unique OPF solution generated by the NewtonRaphson method with the load and initial point as intake^{1}^{1}1We note that DeepOPFAL is different from the approach in [10] in that it directly outputs the solution in one pass while the latter is an iterative scheme that replaces the update function in the NewtonRaphson method by a DNN.. Second, simulation results on IEEE test cases show that DeepOPFAL achieves better ACOPF optimality and similar feasibility and speedup performance, as compared to a recent scheme [4], with the same DNN size yet elevated training complexity. Simulation results also show robust performance of DeepOPFAL.
Ii ACOPF and Multiple Loadsolution Mappings
The standard ACOPF problem is formulated as
(1)  
(2)  
(3)  
(4)  
(5)  
(6)  
(7)  
, , , and denote the real part, the imaginary part, the conjugate, and the magnitude of a complex variable , respectively. and denote the set of buses and the set of edges, respectively. (resp. ) and (resp. ) denote the active (resp. reactive) power generation and active (resp. reactive) load on bus , respectively. represents complex voltage, including the magnitude and the phase angle , on bus . and denote the admittance and the branch flow limit of the branch , respectively. (2) and (3) represent powerflow balance equations. (4) and (5) represent the active and reactive generation limits. (6) represents the voltage magnitude limit, and (7) represents the branch flows limits. The objective is to minimize the total cost of active power generation, where is the quadratic cost function of the generator at bus . We set and if bus has no generator. As shown in Fig. 1, existing learningbased schemes fail to learn either of two legitimate mappings.
distance as the loss function fails to learn any of the two mappings.
Iii DeepOPFAL: Solving ACOPF Problems by Learning Unique Augmented Mapping
The schematic of the proposed DeepOPFAL is shown in Fig. 2
. It follows a particular augmentedlearning design to train a DNN to learn the mapping from (load, initial point) to the unique ACOPF solution generated by the NewtonRaphson method with the load and initial point as intake. We build the DNN model on the multilayer feedforward neural network structure with ReLU as the activation function of hidden layers. We design the loss function as the total mean square error between the generated solution and the ground truth (the generated ACOPF solution). We apply the popular Adam algorithm to update the DNN’s parameters in training.
DeepOPFAL uses the trained DNN to predict the bus voltages and reconstructs the bus injections, i.e., RHS values of (2)(3), and finally the generations, all by simple scalar calculation. Such a predictandreconstruct framework [3, 11, 4] guarantees the powerflow equality constraints and reduces the number of variables to predict. Lastly, DeepOPFAL employs the postprocessing process in [4] to help keep the obtained solution within the box constraints in (4)(6).We now explain the unique augmented mapping learned by DeepOPFAL. Denote as the Lagrangian of the ACOPF problem in (1)(7), where is the concatenation of the primal variables, the dual variables, the slack variables, and the load input (denoted as ). Let and denote the initial values of , and the updated ones by the NewtonRaphson method after the th iteration, respectively. Similarly, let and denote the initial conditions for the primal variables and the updated ones after the th iteration, respectively. Recall that the NewtonRaphson method works as follows: for the th iteration, it first computes the gradient and Hessian of the Lagrangian with respect to , i.e., and . It then computes the update step for as . It extracts from and generates with a predetermined stepsize . Hence, given and , and all followup s are uniquely determined. Finally, the iterations terminate when prespecified termination criteria are satisfied. Both the total number of iterations and final solution are unique for given initial point and load . Overall, we observe a unique mapping from () to the corresponding final solution, described as . DeepOPFAL aims to learn this unique mapping .
Discussion
(i) DeepOPFAL can learn the augmented mapping of any deterministic iterative algorithm. We choose to learn that of the popular NewtonRaphson method. For a load input, one can run several DeepOPFAL in parallel with different initial points and output the leastcost solution. (ii) DeepOPFAL learns a unique augmented mapping, but requiring a larger DNN and more training data than learning a standard loadsolution one, as observed in Sec. IV. (iii) As we will also see in Sec. IV, for the set of (load, initial point) inputs for which the NewtonRaphson method fails to converge, DeepOPFAL can still generate solutions with decent optimality performance. This indicates better practicability of DNN schemes over iterative solvers, in addition to speedup.
Iv Numerical Experiments
We conduct simulations in CentOS 7.6 with quadcore (i73770@3.40G Hz) CPU and 16GB RAM. We compare performance of DeepOPFAL and a recent scheme DeepOPFV [4]
on IEEE 39/300bus systems. We generate realistic load on each bus by multiplying the default value by an interpolated demand curve based on 11hour California’s net load in Jul. – Sept. 2021, with a time granularity of 30 seconds thus 2,760 load instances per day. For each load, we randomly generate initial points and fed them together with the loads into the Matpower Interior Point Solver (MIPS) solver
[12], which implements the NewtonRaphson method, to obtain reference ACOPF solutions. Our DNN models consist of 3 hidden layers with 1024/768/512 neurons for the 39bus system and 4 hidden layers with 1024/768/512/256 neurons for the 300bus system. We set the batch size, maximum epoch, and learning rate to be 50, 4000, and 1e4, respectively.
Performance metrics
(i) the relative optimality difference, i.e., , between the objective values obtained by DeepOPFAL and MIPS; (ii) the average running times of the MIPS solver, i.e., , the DNN schemes, i.e., , and the corresponding average speedup ratios, i.e., ; (iii) the average constraint satisfaction percentages for active/reactive generation and branch flow limit, i.e., , and , respectively; (iv) the average loadserving mismatch percentage of active and reactive loads, i.e., and , respectively.
Metric 









(%)  0.48  8.56  0.66  5.98  
(%)  97.5  99.3  97.4  99.8  
(%)  94.6  91.7  98.4  96.7  
(%)  99.9  100  99.9  100  
(%)  0.19  0.61  0.09  0.32  
(%)  6.47  27.6  0.49  12.9  
(ms)  1621  1621  1987  1987  
(ms)  1.4  1.3  1.3  1.2  
1157  1247  1528  1655 
Metric 








(%)  0.01  0.01  0.13  20.4  
(%)  100  100  99.9  23.2  
(%)  100  100  100  78.3  
(%)  100  100  100  80.7  
(%)  0.0  0.01  0.1  73.4  
(%)  0.02  0.02  0.02  109.2  
(ms)  2978  2978      
(ms)  2.2  1.8  2.2    
1353  1654     
The case with multiple loadsolution mappings
We evaluate the performance of DeepOPFAL and DeepOPFV with the same DNN size and training/testing data (for fair comparisons) on an IEEE 39bus system having two loadsolution mappings with on average 30% difference in objective values [7]. We design two datasets: balanced dataset (with 89,972 data points; for each load, the ratio between the numbers of two solutions is 1:1) and unbalanced dataset (with 52,384 data points; for each load, the ratio between the numbers of the lowcost solutions and the highcost solutions are 9:1). We split each dataset with the “80/20” strategy to obtain the training set and test set, respectively. The results are shown in Table I. As seen, DeepOPFAL outperforms DeepOPFV in both datasets and achieves smaller optimality gap and similar constraint and load satisfaction percentages. DeepOPFAL performs more consistently than DeepOPFV over the two datasets, demonstrating its effectiveness in solving ACOPF problems with multiple loadsolution mappings.
The case with unique loadsolution mapping and robust performance
We evaluate the performance of DeepOPFAL and DeepOPFV on the IEEE 300bus test system, which we observe has a unique loadsolution mapping. We use the same size DNN but different size dataset, following the “80/20” training/testing splitting rule. The training set for DeepOPFV contains 2,760 (load, solution) data pairs. The training set for DeepOPFAL has 110,400 ((load, initial point), solution) data points, where we randomly sample 40 initial points for each load. The results in Table II show that DeepOPFAL achieves similar optimality gap, feasibility, and speedup performance, as compared to DeepOPFV. These results confirm that, for this setting with a unique loadsolution mapping, the (higherdimensional) augmented mapping to learn by DeepOPFAL is degenerated and can be represented using the samesize DNN as the (lowerdimensional) loadsolution one to learn by DeepOPFV. Meanwhile, the augmented mapping still requires more data to train, if one has no prior knowledge of its degenerated dimension, as in this simulation.
We also test DeepOPFAL using 276020 (load, initial point) data for which the MIPS solver fails to converge. We observe in Table II that it still attains decent performance, while the nonconvergent solutions by the MIPS solver suffer from significant performance degradation. This implies that DeepOPFAL, while trained with data generated by the MIPS solver, achieves more robust performance than the solver.
V Concluding Remark
We propose DeepOPFAL as the first learningbased approach that guarantees to learn a unique augmented mapping for solving ACOPF problems that potentially admit multiple loadsolution correspondences. Simulation results show that it achieves a smaller optimality gap and similar feasibility and speedup performances compared to a recent DNN scheme, with elevated training complexity. A future direction is to improve augmentedlearning designs for better training efficiency for solving ACOPF and other nonconvex problems.
References
 [1] Y. Ng, S. Misra, L. A. Roald, and S. Backhaus, “Statistical learning for DC optimal power flow,” in Proc. of IEEE PSCC, 2018.
 [2] L. Zhang, Y. Chen, and B. Zhang, “A convex neural network solver for dcopf with generalization guarantees,” IEEE Trans. Control. Netw. Syst., Early Access, 2021.
 [3] X. Pan, T. Zhao, and M. Chen, “DeepOPF: Deep Neural Network for DC Optimal Power Flow,” in Proc. IEEE SmartGridComm, Beijing, China, Oct. 2019, available on arXiv in May 2019 (arXiv:1905.04479v1).
 [4] W. Huang, X. Pan, M. Chen, and S. H. Low, “Deepopfv: Solving acopf problems efficiently,” IEEE Trans. Power Syst., vol. 37, no. 1, pp. 800–803, 2021.

[5]
F. Fioretto, T. W. Mak, and P. Van Hentenryck, “Predicting ac optimal power flows: Combining deep learning and lagrangian dual methods,” in
Proc. AAAI, vol. 34, no. 01, 2020, pp. 630–637.  [6] A. S. Zamzam and K. Baker, “Learning optimal solutions for extremely fast AC optimal power flow,” in Proc. IEEE SmartGridComm, 2020.
 [7] W. A. Bukhsh, A. Grothey, K. I. McKinnon, and P. A. Trodden, “Local solutions of the optimal power flow problem,” IEEE Trans. Power Syst., vol. 28, no. 4, pp. 4780–4788, 2013.
 [8] J. Kotary, F. Fioretto, and P. Van Hentenryck, “Learning hard optimization problems: A data generation perspective,” arXiv preprint arXiv:2106.02601, 2021.
 [9] W. Huang and M. Chen, “DeepOPFNGT: A Fast Unsupervised Learning Approach for Solving ACOPF Problems without Ground Truth,” in ICML Workshop on Tackling Climate Change with Learning, 2021.
 [10] K. Baker, “A Learningboosted QuasiNewton Method for AC Optimal Power Flow,” arXiv preprint arXiv:2007.06074, 2020.
 [11] X. Pan, T. Zhao, M. Chen, and S. Zhang, “DeepOPF: A Deep Neural Network Approach for SecurityConstrained DC Optimal Power Flow,” IEEE Trans. Power Syst., vol. 36, no. 3, pp. 1725–1735, May 2021.
 [12] R. D. Zimmerman, C. E. MurilloSánchez, R. J. Thomas et al., “MATPOWER: Steadystate operations, planning, and analysis tools for power systems research and education,” IEEE Trans. Power Syst., vol. 26, no. 1, pp. 12–19, Feb. 2011.