Optimal Power Flow Solution Method for Alternating Current Based on Neural Network and Augmented Lagrangian
By combining the augmented Lagrangian method with neural network, the inequality constraints of the AC optimal current model are transformed into equation constraints, and the neural network is used for parameterized modeling, the high-dimensional nonlinear problem of AC optimal current solution is solved, and the fast and accurate solution effect is achieved.
Patent Information
- Application Number
- CN202411169068.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2044-08-23
AI Technical Summary
When solving the problem of optimal AC current, the existing technology has difficulties in solving the problem of high dimensionality, nonlinearity and nonconvexity. Traditional methods have problems in accuracy and efficiency, and deep neural network models have limitations in constraint adaptability and robustness.
The inequality constraints of the communicative optimal current model are transformed into equation constraints, and parameterized modeling is performed through neural networks. The augmented Lagrangian function is used as a loss function to drive neural network training to achieve rapid solution.
It realizes fast and accurate solution of the best AC trend, improves the adaptability and robustness of the model under topological changes and load changes, and avoids the shortcomings of traditional methods.
Smart Images

Figure CN119093377B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power grid optimal power flow, and in particular to an AC optimal power flow solving method based on a neural network and augmented Lagrangian. Background Art
[0002] Due to various emerging events (e.g., high penetration of new energy, changing topologies, deregulated power markets, etc.), the power system is operating in a more volatile and stochastic manner, and thus is more prone to large-scale failures and even blackouts than ever before. This forces system operators to adjust generator setpoints at an increasingly high frequency to meet power demand while ensuring the stable operation of the network. However, due to the sinusoidal nature of electrical characteristics, the AC Optimal Power Flow (ACOPF) is typically a high-dimensional, non-linear, and non-convex problem. Therefore, solving the ACOPF is both challenging and time-consuming. Typically, to achieve fast and reliable scheduling, the non-convex model can be relaxed to a convex model by using the DC Optimal Power Flow (DCOPF) or second-order cone techniques. Unfortunately, when the grid load is heavy, the DCOPF may be inaccurate, and the second-order cone may result in an uncompact decision feasible region and inaccurate solutions, leading to unreliable scheduling. In summary, traditional methods have problems in terms of accuracy and efficiency.
[0003] To address these issues, recent research has proposed the idea of using Deep Neural Networks (DNN) to predict ACOPF solutions. A common approach is to perform Supervised Learning (SL), also known as Imitation Learning (IL), to directly learn the mapping between operations and ACOPF solutions. In the SL / IL framework, the sampled operating conditions must be packaged with the ACOPF solutions to provide labeled data for training. Once the DNN model is well-trained on the labeled sample data, the ACOPF solution can be simply calculated through a real-time feedforward process. However, the learning algorithm of SL / IL can only mine the empirical patterns in the data, and the decision-making quality depends on the data distribution and the SL model itself, thus failing to find the true physical patterns. Therefore, the robustness and generality may be limited. Moreover, the algorithms of the pure SL / IL framework are prone to violating the constraints of power grid operation. Therefore, two alternative solutions have been proposed for this problem. One still belongs to the SL / IL method but involves several mandatory physical constraints. For example, by introducing penalties for constraint violations in the DNN loss to constrain the learning process, and then using Lagrangian duality to adjust the penalty weights during the training process. Numerical studies have shown that as the physical constraints in the learning domain are strengthened, the DNN for ACOPF solution becomes more accurate. Some research has introduced power transfer penalties in the DNN learning loss for DCOPF. The other is a method based on Reinforcement Learning (RL), which attempts to adapt to the ACOPF pattern through a reward mechanism. However, to achieve high-performance RL, the reward function must be carefully designed. Even so, RL is still prone to falling into local optima.
[0004] Generally speaking, the existing research has provided some physically and data co-driven solutions for ACOPF, but there are still some key problems. For example, the topology adaptability problem is still under consideration and has not been solved. In addition, learning multiple physical constraints in a simple penalty manner requires careful design of the penalty weights, and it is difficult to find the perfect values of the penalty weights. Therefore, when the DNN trained in this way is deployed online, physical failures are likely to occur. Summary of the Invention
[0005] The purpose of the present invention is to overcome the shortcomings of the prior art and provide an AC optimal power flow solution method based on neural networks and augmented Lagrangian.
[0006] The purpose of the present invention is achieved through the following technical solutions: An AC optimal power flow solution method based on neural networks and augmented Lagrangian, comprising the following steps:
[0007] Step S1: Establish an AC optimal power flow model;
[0008] Step S2: Based on the augmented Lagrangian method (ALM), transform the inequality constraints of the AC optimal power flow model into equality constraints through slack variables and dual variables, and construct an augmented Lagrangian function;
[0009] Step S3: Use a neural network to parametrically model the ACOPF problem and realize the mapping from input conditions to the ACOPF solution; Step S4: Embed the augmented Lagrangian function as the loss function into the training process of the neural network, and train the neural network by minimizing the loss function;
[0010] Step S5: Use the trained neural network to achieve fast solution of the ACOPF problem.
[0011] Specifically, the AC optimal power flow model in Step S1 is as follows:
[0012]
[0013] s.t. g(v, x) = 0 (1b)
[0014] h min ≤ h(v, x) ≤ h max (1c)
[0015] where g(v, x) and h(v, x) are the equality constraint and inequality constraint of the model respectively, v = [V i , δ i , is the decision variable vector, represents the bus set, is the given initial operating condition vector, and represent the synchronous generator set and the new energy generator set respectively, represents the load set, P i g,max 、 and P i g,min 、 represent the maximum and minimum active / reactive powers of the i-th generator respectively, and are the active and reactive powers of the load on the i-th bus respectively. The new energy prediction value is represented by P i g,max , denotes, and f is the objective function that synthesizes the blocked costs of power generation and new energy accommodation.
[0016] Specifically, the objective function f is:
[0017]
[0018]
[0019] Among them, i represents the generator, and P i g is the active power output of the generator, and P i g,max is the predicted output value of the new energy unit, and f i C represents the power generation cost, and f i R represents the reserve cost, and a i and b i and c i represent the cost coefficient of generator i, and respectively represent the sets of synchronous generators and renewable generators.
[0020] Specifically, the constraint conditions of the AC optimal power flow model are as follows:
[0021]
[0022] Among them, V i represents the voltage amplitude of the i-th bus, j ∈ i represents that bus j is connected to bus i through branch ij, and G ij and B ij respectively represent the conductance and susceptance of branch ij, and δ ij is the voltage phase angle difference between both ends of branch ij, and are respectively the lower limit and upper limit of the voltage, S ij is the line power flow, is the line power flow transfer limit.
[0023] Specifically, in step S2, the inequality constraints are transformed into equality constraints through slack variables u and l, and an augmented Lagrangian function is constructed:
[0024]
[0025] Among them, f(·) is the solution objective of the optimal power flow model, corresponding to Equation (2); g(·) is the equality constraint of the optimal power flow model, including the system AC power flow equality constraint described by Equation (3); h(·) is the inequality constraint of the optimal power flow model, including the system operation upper and lower limit constraints of Equations (4) to (6); λ, γ, and τ are dual variables, u and l are slack variables, and μ∑log(u) and μ∑log(l) are barrier function terms. Specifically, the model constructed by using a neural network in step S3 is:
[0026]
[0027] s.t. g(φ θ (x), x) = 0 (8c)
[0028] ReLU(h(φ θ (x), x) - h max ) = 0 (8d)
[0029] ReLU(h min -h(φ θ (x), x)) = 0 (8e)
[0030] where φ θ (·) represents a neural network model that realizes the mapping from x to v, and θ is the parameter of the neural network.
[0031] Specifically, the training process of the neural network in step S4 is as follows:
[0032]
[0033] where ρ > 0, and equation (9b) is the loss function;
[0034] The neural network parameter learning strategy based on ALM is as follows:
[0035]
[0036] In the formula.
[0037] The present invention has the following advantages:
[0038] The present invention proposes a method for relaxing the modeling of an AC optimal power flow model based on the Augmented Lagrangian methods (ALM), models the optimal power flow model as a relaxed unconstrained model, and proposes a neural network parameterized modeling method for AC optimal power flow and a construction method for the augmented Lagrangian learning strategy. The AC optimal power flow Lagrangian function is used as the loss function to drive the training of the neural network, and finally, the fast calculation of AC optimal power flow is realized. Brief Description of the Drawings
[0039] Figure 1 It is a schematic flow chart of the optimal power flow model solving method of the present invention. Detailed Embodiments
[0040] To make the objectives, technical solutions, and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention, that is, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Usually, the components of the embodiments of the present invention described and illustrated herein can be arranged and designed in various different configurations.
[0041] Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present invention.
[0042] It should be noted that relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.
[0043] The present invention will be further described below in conjunction with the accompanying drawings, but the scope of protection of the present invention is not limited to the following. As Figure 1 shown, the AC optimal power flow solution method based on neural network and augmented Lagrangian is characterized by including the following steps:
[0044] Step S1: Establish an AC optimal power flow model; model the AC optimal power flow (ACOPF) problem as an optimization problem including equality constraints and inequality constraints. The purpose of the ACOPF problem is to obtain the most economical dispatch with the minimum amount of new energy being blocked while considering transmission constraints. The AC optimal power flow model is:
[0045]
[0046] s.t. g(v, x) = 0 (1b)
[0047] h min ≤ h(v, x) ≤ h max (1c)
[0048] Among them, \(g(v, x)\) and \(h(v, x)\) are the equality constraint and inequality constraint of the model respectively, where \(v = [V i , \delta i \), is the decision variable vector, represents the set of buses, is the given initial operating condition vector, and represent the sets of synchronous generators and new energy generators respectively, represents the load set, \(P i g,max \), and \(P i g,min \), represent the maximum and minimum active / reactive power of the \(i\)-th generator respectively, and are the active and reactive power of the load on the \(i\)-th bus respectively. The new energy prediction value is represented by \(P i g,max , and \(f\) is the objective function that combines the costs of power generation and the obstruction of new energy consumption:
[0049]
[0050] Among them, \(i\) represents the generator, \(P i g is the active power output of the generator, \(P i g,max is the predicted output value of the new energy generator, \(f i C represents the power generation cost, \(f i R represents the reserve cost, \(a i , \(b i , \(c i represent the cost coefficients of generator \(i\), and represent the sets of synchronous generators and renewable generators respectively. Equation (1) includes (1a), (1b) and (1c), and Equation (2) includes Equation (2a), (2b) and (2c);
[0051] The constraints \(g\) and \(h\) reflect Kirchhoff's theorem, generator operating limits and grid constraints:
[0052]
[0053] Among them, \(V i represents the voltage magnitude of the \(i\)-th bus, \(j\in i\) represents that bus \(j\) is connected to bus \(i\) through branch \(ij\), \(G ij and \(B ijrepresent the conductance and susceptance of branch ij, respectively, and δ ij is the phase angle difference of the voltages at both ends of branch ij, and V i min and V i max are the lower and upper limits of the voltage, respectively, and S ij is the line power flow, which can be calculated from the power flow transfer factors of each node; is the line power flow transfer limit; Equation (3) includes Equations (3a) and (3b), and Equation (4) includes Equations (4a) and (4b);
[0054] Step S2: Based on the augmented Lagrangian method ALM, transform the inequality constraints of the AC optimal power flow model into equality constraints through slack variables and dual variables, and construct an augmented Lagrangian function; to solve the ACOPF model, transform the inequality constraints into equality constraints through slack variables u and l, and the augmented Lagrangian function is as follows:
[0055]
[0056] where f(·) is the solution objective of the optimal power flow model, corresponding to Equation (2); g(·) is the equality constraint of the optimal power flow model, including the system AC power flow equality constraint described by Equation (3); h(·) is the inequality constraint of the optimal power flow model, including the system operation upper and lower limit constraints of Equations (4) to (6); to construct the Lagrangian function of Equations (1) to (6), introduce dual variables λ, γ, and τ, introduce slack variables u and l to transform the inequality constraints into equality constraints, and introduce barrier function terms μ∑log(u) and μ∑log(l);
[0057] Step S3: Use a neural network to perform parametric modeling on the ACOPF problem to achieve the mapping from input conditions to the ACOPF solution; for Equation (7), methods such as the Newton method or KKT conditions can be used to solve it. However, due to the continuous expansion of the power system scale and the multiple uncertainties of renewable energy, the convergence of the model-based solution method is poor and the solution efficiency faces huge challenges. The non-real-time solver needs to perform stochastic programming or robust programming on the ACOPF, which further reduces the solution speed. To solve the above problems, the present invention uses an ACOPF real-time solver based on the augmented Lagrangian and neural network, and parameterizes Equation (1) with a neural network into the following model:
[0058]
[0059] s.t.g(φ θ (x),x) = 0 (8c)
[0060] ReLU(h(φ θ (x),x) - h max) = 0 (8d)
[0061] ReLU(h min -h(φ θ (x), x)) = 0 (8e)
[0062] wherein, is the predicted solution obtained by the neural network model, φ θ (·) represents the neural network model, which realizes the mapping from x to v, and θ is the parameter of the neural network. It should be noted that the inequality constraint can be modeled by using the ReLu function, as shown in equations (8d) and (8e).
[0063] Step S4: Take the augmented Lagrangian function as the loss function and embed it into the training process of the neural network. Train the neural network by minimizing the loss function; Equation (8) includes equations (8a), (8b), (8c), (8d) and (8e). The model (8) is non-convex and non-linear and is difficult to solve. The present invention approximates the solution of the model by the ALM method to alleviate the problem of difficult solution. ALM usually relaxes the strong convexity condition and is easy to construct the form of the loss function to be embedded into the neural network training.
[0064] Specifically, the present invention proposes the following augmented Lagrangian learning strategy. For concise mathematical expression, the neural network parameterizes the augmented Lagrangian function as follows:[[]]
[0065] G(φ θ (x), x) = [g(φ θ (x), x)[[]] T , ReLU(h(φ θ (x), x) - h max )[[]] T , ReLU(h min -h(φ θ (x), x))[[]] T [[]] T (9a)
[0066]
[0067] where ρ > 0, G(φ θ (x), x) is the constructed constraint matrix type; Equation (9b) is the loss function; is the L2 regularization term of the loss function.
[0068] During the training process of the neural network, adjust the penalty coefficient in the augmented Lagrangian function and the parameters of the barrier function term to improve the training effect and generalization ability of the neural network.
[0069] The neural network parameter learning strategy based on ALM is as follows:[[]]
[0070]
[0071] Step S5: Use the trained neural network to achieve fast solution of the ACOPF problem. Based on the above neural network calculation model and the ALM learning strategy, fast calculation of ACOPF can be achieved.
[0072] As described above, it is only the preferred embodiment of the present invention and does not impose any form of limitation on the present invention. Any person skilled in the art can make many possible changes and modifications to the technical solution of the present invention, or modify it into an equivalent embodiment with equivalent changes, without departing from the scope of the technical solution of the present invention. Therefore, any changes, modifications, equivalent changes and modifications made to the above embodiments based on the technology of the present invention without departing from the content of the technical solution of the present invention all fall within the protection scope of this technical solution.
Claims
1. An AC optimal power flow solution method based on neural network and augmented Lagrangian, characterized in that: Including the following steps: Step S1: Establish an AC optimal power flow model; The AC optimal power flow model is: s.t.g(υ,x)=0 (1b) h min ≤h(υ,x)≤h max (1c) where \(g(v, x)\) and \(h(v, x)\) are the equality constraint and inequality constraint of the model respectively, is the decision variable vector, represents the set of buses, is the given initial operating condition vector, and represent the set of synchronous generator units and new energy generator units respectively, represents the set of loads, and represent the maximum and minimum active / reactive power of the \(i\)-th generator respectively, and are the active and reactive power of the load on the \(i\)-th bus respectively. The new energy prediction value is represented by and \(f\) is the objective function that combines the costs of power generation and the obstruction of new energy consumption. The objective function f is: Among them, i represents the generator, is the active power output of the generator, is the predicted output value of the new energy unit, represents the power generation cost, represents the reserve cost, a i and b i and c i represent the cost coefficients of generator i; The constraint conditions of the AC optimal power flow model are: Wherein, and respectively represent the reactive power that can be generated, the lower limit and the upper limit of reactive power of the i-th synchronous generator and the new energy unit; and are respectively the active and reactive power loads of the i-th bus. V i and V j represent the voltage amplitudes of the i-th and j-th buses. j ∈ i means that bus j is connected to bus i through branch ij. G ij and B ij respectively represent the conductance and susceptance of branch ij. δ ij is the phase angle difference between the voltages at both ends of branch ij. and are respectively the lower limit and the upper limit of the voltage. S ij is the line power flow. is the line power flow transfer limit. |S ij | represents the apparent power of the branch between buses i and j. Step S2: Based on the augmented Lagrangian method (ALM), transform the inequality constraints of the AC optimal power flow model into equality constraints through slack variables and dual variables, and construct an augmented Lagrangian function; In step S2, the inequality constraints are transformed into equality constraints through slack variables u and l, and an augmented Lagrangian function is constructed: Among them, f(·) is the solution objective of the optimal power flow model, corresponding to Equation (2); g(·) is the equality constraint of the optimal power flow model, including the system AC power flow equality constraint described by Equation (3); h(·) is the inequality constraint of the optimal power flow model, including the system operation upper and lower limit constraints of Equations (4) to (6); λ, γ, and τ are dual variables, u and l are slack variables, μ∑log(u) and μ∑log(l) are barrier function terms; h min and h max are the upper and lower constraint boundaries of the inequality constraint; Step S3: Use a neural network to perform parametric modeling on the ACOPF problem to achieve the mapping from input conditions to the ACOPF solution; Step S4: Embed the augmented Lagrangian function as the loss function into the training process of the neural network, and train the neural network by minimizing the loss function; Step S5: Use the trained neural network to achieve the fast solution of the ACOPF problem.
2. The AC optimal power flow solution method based on neural network and augmented Lagrangian according to claim 1, characterized in that: The neural network model constructed in step S3 is: s.t. g(φ θ (x), x) = 0 (8c) ReLU(h(φ θ (x),x)-h max ) = 0 (8d) ReLU(h min -h(φ θ (x),x)) = 0 (8e) Among them, is the predicted solution obtained by the neural network model; φ θ (·) represents the neural network model, which realizes the mapping from x to v, and θ is the parameter of the neural network.
3. The AC optimal power flow solution method based on neural network and augmented Lagrangian according to claim 2, characterized in that: The training process of the neural network in step S4 is: where ρ > 0, G(φ θ (x), x) is for constructing a constraint matrix type; Equation (9b) is a loss function; is the L2 regularization term of the loss function; The learning strategy based on ALM is as follows:
Citation Information
Patent Citations
Alternating current optimal power flow calculation method, system and equipment of power system and storage medium
CN114421481A