Power distribution / micro-grid modeling, reconstruction and stability control method and system and power distribution / micro-grid
By performing undirected graph modeling and multi-agent reinforcement learning on the distribution network, combined with a distributed backstepping control strategy, the problem of poor adaptability of traditional methods in dynamic environments is solved, and the rapid response and stability improvement of the power grid in complex environments are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-29
- Publication Date
- 2026-04-28
AI Technical Summary
Traditional distribution network reconfiguration methods are poorly adaptable to dynamic environments, making it difficult to achieve rapid response and ensure system stability. In particular, they cannot meet the real-time, adaptability, and robustness requirements of the power grid in complex environments when large-scale renewable energy and distributed power sources are connected.
We employ a method based on physical information neural networks and multi-agent reinforcement learning to model the distribution network as an undirected graph. We extract state features through dynamic graph convolutional neural networks, construct a Markov decision model with embedded security policies, and combine it with a distributed backstepping control strategy to achieve adaptive reconfiguration and stable control of the power grid.
It enhances the adaptive capability and robustness of the power grid in dynamic environments, enabling rapid response to topology changes and ensuring synchronous stability of voltage and current in islanded operation mode, thereby improving system stability and reliability.
Smart Images

Figure CN121939335A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power grid control technology, and relates to distribution / microgrid modeling, reconfiguration and stability control methods, systems and distribution microgrids. Background Technology
[0002] With the increasing severity of the global energy crisis and environmental problems, renewable energy has become a core direction for energy transition in various countries. Among them, photovoltaic power generation has been widely used in distribution networks due to its green and low-carbon advantages. However, the volatility and uncertainty of photovoltaic power generation disrupt the unidirectional power flow characteristics of traditional distribution networks, leading to voltage limit exceedance issues. Traditional voltage control methods typically rely on accurate modeling of the distribution network, optimizing it through detailed network topology, parameters, and operating conditions.
[0003] The operation of distribution networks is becoming increasingly complex. Especially with the large-scale integration of renewable energy and distributed power sources, distribution networks face more diverse load demands and sudden faults, gradually revealing the limitations of traditional grid control and optimization methods. Distribution network reconfiguration, as an important means to improve grid operating efficiency and ensure power supply, aims to optimize power flow, reduce losses, and improve system stability by adjusting the grid topology. However, in actual operation, distribution networks frequently face various dynamic changes such as equipment failures, load fluctuations, and voltage instability, which places higher demands on the real-time scheduling and optimization of the distribution network.
[0004] Currently, distribution network reconfiguration methods mainly rely on traditional optimization algorithms, such as genetic algorithms, particle swarm optimization, and simulated annealing. While these methods can improve the operating efficiency of distribution networks to some extent, they have poor adaptability in dynamic environments. For example, existing optimization methods typically assume that the grid topology and load demand are static. However, in reality, the grid topology and load status change significantly over time, and traditional algorithms cannot respond to these changes in real time. Furthermore, traditional algorithms are computationally intensive and slow, making it difficult to achieve rapid reconfiguration in large-scale distribution networks, thus limiting their effectiveness in practical applications.
[0005] Furthermore, most existing distribution network reconfiguration methods neglect system security and robustness. During grid operation, the system may encounter sudden faults or external disturbances. Traditional reconfiguration methods often fail to guarantee that the system can quickly return to a stable state under these circumstances, thus affecting the reliability of the grid and the quality of power supply. Therefore, there is an urgent need for a new method to address the issues of real-time performance, adaptability, and robustness in distribution network reconfiguration, in order to improve the stability and security of the distribution network in complex environments.
[0006] For example, the existing invention patent application document CN118630824A, entitled "A Secondary Voltage Control Method for Islanded Microgrids Based on Disturbance Observer," includes the following steps: establishing a large-signal model of the state space of the secondary voltage control of an islanded microgrid based on an inverter, and linearizing its feedback to obtain the voltage control input under the condition of no nonlinear disturbance; designing a nonlinear disturbance observer and providing an estimated value of the voltage control input of the nonlinear disturbance observer; calculating the deviation between the estimated value of the i-th distributed generation unit in the islanded microgrid at time t and the actual nonlinear disturbance, thereby obtaining the disturbance estimation error; substituting the disturbance estimation error into the large-signal model to construct the i-th distributed generation unit in the islanded microgrid at time t under the condition of nonlinear disturbance. The voltage control input of the distributed generation unit is calculated; the deviation of the i-th distributed generation unit from the output voltage value received from the neighboring distributed generation units is calculated, and the voltage deviation and its derivative of the i-th distributed generation unit at time t are obtained; using the voltage deviation and its derivative of the i-th distributed generation unit at time t described in step S5, the sliding surface of the i-th distributed generation unit in the islanded microgrid at time t is constructed; using the sliding surface based on the exponential reaching law, the auxiliary control input is calculated to control the output voltage of the i-th distributed generation unit in the islanded microgrid to follow the voltage reference value so as to stabilize the microgrid; the Lyapunov function of the closed-loop system model of the i-th distributed generation unit in the islanded microgrid at time t is constructed and the system convergence is proved. However, convergence and stability are two important and distinct indicators. Therefore, convergence is also an important performance indicator of IMG, and good convergence performance ensures that IMG can achieve voltage following quickly and accurately. Recently, some finite-time control methods for IMG have been proposed to achieve fast system convergence. For example, the existing invention patent application document CN113972687A, entitled "A Secondary Control Method for Islanded Microgrids Based on Switching Topology," includes the following steps: Step S1, using mobile emergency generators as distributed generators for islanded microgrid scheduling; Step S2, designing a fixed-time distributed secondary control method to compensate for frequency and voltage errors caused by primary control, thereby accurately distributing active power; Step S3, designing a distributed finite-time controller to adjust the voltage and frequency of all distributed generators to a fixed reference level. However, these control strategies need to satisfy the conditions of finite-time stability analysis, i.e., the constructed Lyapunov function must satisfy... This requirement makes control design more challenging. On the other hand, it is well known that in an IMG, most loads (such as motors) need to operate at rated frequency and voltage, while a DG has low inertia and is susceptible to environmental changes. Therefore, the system often needs to ensure good transient performance indicators.
[0007] In summary, traditional power system control methods can no longer meet the needs of modern power systems. Summary of the Invention
[0008] The technical solution of this invention is used to solve the problem of how to achieve system adaptive finite-time control for distribution / microgrid variable structure systems.
[0009] The present invention solves the above-mentioned technical problems through the following technical solutions:
[0010] This invention provides a method for modeling, reconfiguration, and stability control of distribution / microgrids, including:
[0011] S1. Based on power parameter acquisition, the distribution / microgrid is modeled as an undirected graph model, and the impedance distance matrix is estimated using a physical information neural network. The network topology and line impedance parameters are jointly identified.
[0012] S2. When the distribution / microgrid meets the preset conditions, a reconfiguration operation is triggered:
[0013] The preset conditions include: a microgrid failure, or the microgrid being in islanded operation and having unbalanced power; or voltage or current exceeding limits; or the failure duration exceeding a preset time threshold.
[0014] Among them, a multi-agent reinforcement learning method is used for distribution / microgrid reconfiguration. The reconfiguration operation includes: constructing a Markov decision model with embedded safety policies; using a dynamic graph convolutional neural network to extract state features; and having the multi-agent output a reconfiguration topology scheme that satisfies electrical safety constraints.
[0015] S3. Solve the Zubov equation based on the neural network or construct the Lyapunov function to perform stability analysis on the topology switching process. If the stability condition is not met, return to S2 and repeat the reconstruction operation until the new topology is in a stable state.
[0016] S4. When the new topology is stable and in islanded operation mode, a distributed backstepping control strategy is used to perform secondary control on the distributed generation unit, so that the system converges within a predefined finite time and achieves synchronous stability of voltage and current.
[0017] Distribution / microgrid modeling, reconfiguration, and stability control systems, including:
[0018] The real-time network topology and parameter identification module for power distribution systems is used to model the distribution / microgrid as an undirected graph model based on power parameter acquisition, use physical information neural networks to estimate the impedance distance matrix, and jointly identify the network topology and line impedance parameters.
[0019] The distribution / microgrid reconfiguration module is used to trigger a reconfiguration operation when the distribution / microgrid meets preset conditions.
[0020] The preset conditions include: a microgrid failure, or the microgrid being in islanded operation and having unbalanced power; or voltage or current exceeding limits; or the failure duration exceeding a preset time threshold.
[0021] Among them, a multi-agent reinforcement learning method is used for distribution / microgrid reconfiguration. The reconfiguration operation includes: constructing a Markov decision model with embedded safety policies; using a dynamic graph convolutional neural network to extract state features; and having the multi-agent output a reconfiguration topology scheme that meets electrical safety constraints. The distribution / microgrid reconfiguration module is connected to the real-time network topology and parameter identification module of the power distribution system.
[0022] The topology stabilization module is used to solve the Zubov equation based on neural networks or construct the Lyapunov function to perform stability analysis on the topology switching process. If the stability condition is not met, it returns to S2 and performs the reconfiguration operation in a loop until the new topology is in a stable state. The topology stabilization module is connected to the distribution / microgrid reconfiguration module.
[0023] The secondary control module is used to perform secondary control of the distributed generation unit using a distributed backstepping control strategy when the new topology is stable and in islanded operation mode, so that the system converges within a predefined finite time and achieves synchronous stability of voltage and current. The secondary control module is connected to the topology stabilization module.
[0024] For distribution microgrids, the aforementioned distribution / microgrid modeling, reconfiguration, and stability control methods are adopted.
[0025] The beneficial effects of this invention are as follows:
[0026] This invention provides an integrated management and control method for distribution / microgrids that combines topology identification, operational stability assessment, power grid structure reconfiguration, and islanded operation control. Compared with existing decentralized, passive, and fragmented solutions, it has the following significant technical advantages:
[0027] 1. Connecting the entire chain of perception, decision-making, and control: Starting from the joint estimation of the underlying topology and impedance, this invention connects the entire process from stability modeling and analysis, intelligent reconfiguration strategy generation to autonomous control of isolated areas, and constructs a closed-loop operation mechanism that integrates data-driven and physical model integration. It can realize global coordinated response to system structure, state, and control, and significantly improve the adaptive capability and robustness of the power grid in dynamic environments.
[0028] 2. Achieving unified optimization and distributed collaborative control across levels and modes: This method combines centralized learning (such as PINN and topology evaluation) with multi-agent distributed optimization (such as GCN reinforcement learning and islanding control) to uniformly handle the switching and control objectives of multiple scenarios of the power grid from the main grid interconnection state to the local islanding operation mode. It solves the key problem in the existing technology that it is difficult to take into account both global optimization and local stability, and has higher engineering applicability and scalability. Attached Figure Description
[0029] Figure 1 This is a schematic diagram of the basic steps of the distribution / microgrid modeling, reconfiguration and stability control method according to Embodiment 1 of the present invention;
[0030] Figure 2 This is a flowchart illustrating a method for real-time network topology and parameter identification of a power distribution system according to Embodiment 2 of the present invention.
[0031] Figure 3 This is a schematic flowchart of a method for joint estimation of power grid topology and impedance according to Embodiment 3 of the present invention;
[0032] Figure 4 This is a schematic diagram comparing simulation experimental data of the impedance estimated and the actual impedance according to the method of joint estimation of power grid topology and impedance in Embodiment 3 of the present invention.
[0033] Figure 5 This is a schematic diagram of the basic steps of a microgrid stability analysis method according to Embodiment 4 of the present invention;
[0034] Figure 6 This is a symbolic regression framework diagram of Embodiment 4 of the present invention;
[0035] Figure 7 This is a schematic diagram of the basic steps of the microgrid group topology switching stability analysis method in Embodiment 5 of the present invention;
[0036] Figure 8 This is a schematic diagram of the basic steps of the power system neural network controller design method according to Embodiment Six of the present invention;
[0037] Figure 9 This is a schematic diagram comparing the ability of the neural network to process more complex nonlinear systems in Embodiment 6 of the present invention with the ability of traditional control methods to process simple nonlinear systems.
[0038] Figure 10 This is a schematic diagram comparing the attraction domain of Embodiment 6 of the present invention with the attraction domain of the conventional method;
[0039] Figure 11 This is a flowchart illustrating the distribution network voltage control method based on timing and topology characteristics according to Embodiment 7 of the present invention.
[0040] Figure 12 This is a schematic diagram of the distribution network modeling environment in Embodiment 7 of the present invention;
[0041] Figure 13 This is a schematic diagram of the intelligent agent connection topology in Embodiment 7 of the present invention;
[0042] Figure 14 This is a schematic diagram of the spatiotemporal three-dimensional dynamic representation of distribution network node voltage under a typical summer day scenario, according to Embodiment 7 of the present invention.
[0043] Figure 15 This is a flowchart illustrating the power distribution network reconfiguration method based on multi-agent security reinforcement learning according to Embodiment 8 of the present invention.
[0044] Figure 16 This is a flowchart illustrating the optimal first-order frequency control method based on reinforcement learning according to Embodiment 9 of the present invention.
[0045] Figure 17 This is a schematic diagram of the basic steps of the secondary voltage control method for an islanded microgrid according to Embodiment 10 of the present invention; Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0047] The technical solution of the present invention will be further described below with reference to the accompanying drawings and specific embodiments:
[0048] Example 1
[0049] like Figure 1 As shown, the distribution / microgrid modeling, reconfiguration, and stability control method provided by this invention includes the following basic steps:
[0050] S1. Based on power parameter acquisition, the distribution / microgrid is modeled as an undirected graph model, and the impedance distance matrix is estimated using a physical information neural network. The network topology and line impedance parameters are jointly identified.
[0051] S2. When the distribution / microgrid meets the preset conditions, a reconfiguration operation is triggered:
[0052] The preset conditions include: a microgrid failure, or the microgrid being in islanded operation and having unbalanced power; or voltage or current exceeding limits; or the failure duration exceeding a preset time threshold.
[0053] Among them, a multi-agent reinforcement learning method is used for distribution / microgrid reconfiguration. The reconfiguration operation includes: constructing a Markov decision model with embedded safety policies; using a dynamic graph convolutional neural network to extract state features; and having the multi-agent output a reconfiguration topology scheme that satisfies electrical safety constraints.
[0054] S3. Solve the Zubov equation based on the neural network or construct the Lyapunov function to perform stability analysis on the topology switching process. If the stability condition is not met, return to S2 and repeat the reconstruction operation until the new topology is in a stable state.
[0055] S4. When the new topology is stable and in islanded operation mode, a distributed backstepping control strategy is used to perform secondary control on the distributed generation unit, so that the system converges within a predefined finite time and achieves synchronous stability of voltage and current.
[0056] Example 2
[0057] This invention provides a method for real-time network topology and parameter identification of a power distribution system based on Embodiment 1, such as... Figure 2 As shown, it includes:
[0058] S1. Collect data from smart meter nodes installed in the historical distribution network and construct a dataset. Specific implementation steps are as follows:
[0059] Data from nodes where smart meters are installed is collected, including voltage amplitude, active power, and reactive power. Historical data from nodes in the distribution network with installed smart meters are used as input features. A node voltage amplitude matrix V = [|V1|, |V2|, ..., |V...] is constructed. N |] T ,|V i | represents the voltage magnitude at node i, and N represents the total number of nodes; the active power injection matrix P = [P1, P2, ..., P...]. N ] T The reactive power injection matrix Q = [Q1, Q2, ..., Q...] N ] T .
[0060] S2. Using the historical measurement data of smart meters, calculate the admittance matrix, deduce the network topology, and preliminarily estimate the line parameters. The specific implementation steps are as follows:
[0061] Power flow models typically include two types of equations: active power equations and reactive power equations. The power flow at each node is influenced by voltage, phase angle, and the network admittance matrix. For a three-phase distribution network, the basic power flow equations are as follows:
[0062] S21. Construct the power flow model equations as follows:
[0063]
[0064] Among them, P i and Q i These are the active and reactive power injections at node i, V. i and V j These are the voltage magnitudes at nodes i and j, respectively, G ij and B ij These are the conductance and susceptance in the admittance matrix, respectively, and θ i and θ j These are the voltage phase angles at nodes i and j, respectively. Based on the power flow equations, the admittance values between nodes can be calculated using active and reactive power injections, which are then used for subsequent topology and parameter identification.
[0065] The power flow equations are nonlinear. To simplify calculations, and given the small difference in node voltage phase angles (typically less than 5°), a first-order Taylor expansion approximation can be used, transforming the nonlinear power flow equations into linear ones. Voltage phase angle difference θ i -θ j It is very small and can be simplified using the first-order approximation formula (3):
[0066] cos(θ i -θ j )≈1,sin(θ) i -θ j )≈θ i -θ j (3)
[0067] Based on the approximation of equation (3), the power flow equations can be linearized into equations (4) and (5):
[0068]
[0069] S22. For a three-phase power distribution system, the linearization of the power equation and voltage phase angle equation at the nodes can be further simplified to linearized equations, as follows:
[0070]
[0071] S23. Based on equations (6) and (7), the conductance G and susceptance B between each node are approximately calculated, and the admittance matrix Y is obtained. The elements of the admittance matrix Y ij As shown in the following formula:
[0072]
[0073] Y ij =-(G ij +jB ij (i≠j)(9)
[0074] Among them, Yii For self-admittance (diagonal element), Y ij For mutual admittance (off-diagonal elements);
[0075] The admittance matrix Y is a matrix describing the electrical connections of a power distribution network, and its elements Y ij The admittance matrix represents the electrical connection between node i and node j, and its construction depends on the conductance G. ij and susceptance B ij .
[0076] S24. Since power distribution networks are typically sparse networks, meaning most nodes are not directly connected, many elements of the admittance matrix are zero; only other nodes connected to the current node have admittance values. To avoid incorrect connections due to noise or measurement errors, the admittance matrix elements Y... ij Sparsity processing is employed, and a threshold Y is set. thresh To exclude unimportant connections, the specific exclusion method is as follows:
[0077]
[0078] Among them, Y ij Y is the admittance between node i and node j. thresh The threshold is expressed as follows:
[0079]
[0080] in, φ is the self-admittance of node i in the admittance matrix at phase φ, i.e., the admittance value of the node. N is the number of nodes in the network, and K is an empirical constant used to control the degree of sparsity.
[0081] Threshold Y thresh It is used to determine which elements in the admittance matrix are considered valid connections. If the element Y in the admittance matrix... ij The absolute value is greater than or equal to the threshold Y thresh If so, then an electrical connection is considered to exist between node i and node j. ij ≥Y thresh Assume there is a connection between nodes i and j; if element Y in the admittance matrix ij The absolute value is less than the threshold Y thresh If no direct connection is found between node i and node j, then it is assumed that there is no direct connection between them. This sparsity reduction method effectively removes unimportant connections, allowing for the deduction of the actual topology of the power distribution network and subsequent analysis and optimization.
[0082] S25. Based on the topology deduced in S24, the line parameters conductance G and susceptance B of the distribution network are initially estimated using a linear regression method. The linear regression method is solved using the least squares (OLS) method, with the objective function set as follows:
[0083]
[0084] Where, p i Y is the active power of node i. ij It is an element of the admittance matrix, V j It is the voltage amplitude at node j.
[0085] S3. Power grid topology modeling is performed based on a Graph Convolutional Network (GCN). Each power grid node is treated as a node in the graph, and power grid lines are treated as edges. The importance of each node is calculated through a message passing mechanism. Then, the parameters of the GCN are iteratively optimized using the total loss function. Finally, the placement strategy for the Measurement Device (SMD) is obtained using the GCN. The specific implementation steps are as follows:
[0086] S31. Based on the topological structure derived in S2, construct an adjacency matrix A, where A is an n-order square matrix, in the following form:
[0087]
[0088] a ij For elements in A, in the power distribution network, they represent the electrical connection relationship between i and j, with specific values as follows:
[0089]
[0090] Define the initial state feature vector of node i as: D i ={V i P i Q i}, X i Data from smart meters includes voltage and power; the initial state feature vector of the node is D = {D1, D2, ..., D...} N In the graph convolutional network (GCN) with the adjacent matrix A as input, the graph convolutional network consists of multiple stacked layers, and its node feature iterative calculation formula is as follows:
[0091]
[0092] H (0) =D (16)
[0093] in, It is a degree matrix; H (l-1) It is a feature of layer l-1, W (l-1)These are the training weight parameters of the (l-1)th layer, σ(·) is the activation function ReLU, and H (l) This represents the aggregation of information about nodes and their neighbors;
[0094] S32, Node features H after transformation using formula (15) i and H j The LeakyReLU function is introduced to calculate the attention score e of neighboring nodes. ij As shown in the following formula:
[0095] e ij =LeakyReLU(a T [WH i ||WH j ])(17)
[0096] Wherein, the weight matrix W represents the parameters to be trained, e ij Let a represent the attention coefficient of node i to its neighbor j. T These are the attention weight parameters to be trained; || represents feature vector concatenation; WH i and WH j These are the linearly transformed features of node i and its neighbor j, respectively; H i The features of node i are used; the normalized attention weight α is calculated using the Softmax function. ij As shown in the following formula:
[0097]
[0098] in, It is the set of neighbors of node i; α ij This represents the importance of candidate point j of the measurement device at node i;
[0099] S33. Filter candidate points of the measuring device using the Measurement Device Candidate Point Score (MIS). Specific steps include:
[0100] S331. An attention mechanism is used to aggregate neighborhood information to obtain new features of candidate points of the measurement device. As shown in the following formula:
[0101]
[0102] in, The feature of node i in layer l+1; WH i It is the feature after the transformation of neighbor i, α ij Let j be the contribution weight of neighbor j to node i;
[0103] S332, the result from formula (19) Calculate the Measurement Importance Score (MIS) for all nodes as follows:
[0104]
[0105] S333. Select the K measurement points with the highest MIS scores as candidate points for the optimal measurement device. In the graph attention network (GAT), the MIS scores are passed to a softmax layer for classification. The softmax function converts the output of each node into a probability distribution of whether or not an SMD is installed, as shown in the following formula:
[0106]
[0107] in, It is the probability predicted by the model of whether node i needs SMD.
[0108] S34. To minimize SMD resource consumption, it is necessary not only to focus on the accuracy of node classification but also to introduce an optimization objective for resource consumption during training and design a loss function. Specific steps include:
[0109] S341. The node classification loss function uses the binary cross-entropy loss function to calculate the difference between the predicted probability of whether each node needs SMD and the actual label, as shown in the following formula:
[0110]
[0111] Among them, y i This is the actual label of node i, with a value of 0 or 1, indicating whether SMD is needed. It is the probability predicted by the model of whether node i needs SMD;
[0112] S342. To minimize SMD resource consumption, i.e., to encourage as few nodes as possible to be classified as "requiring SMD", a resource consumption regularization term is introduced to limit the number of SMDs allocated, as follows:
[0113]
[0114] Here, λ is the regularization coefficient; this term encourages the network to predict as few nodes as possible that require SMD, thereby reducing resource consumption.
[0115] S343. Combining equations (22) and (23), we obtain the total loss function, as shown below:
[0116]
[0117] The Adam optimization algorithm is used to minimize the total loss function, iteratively adjusting the parameters of the graph convolutional network (GCN) to be trained. This allows the GCN network to not only optimize node classification accuracy but also minimize SMD resource consumption. During training, in addition to minimizing the classification loss, the regularization term λ for SMD resource consumption needs to be adjusted appropriately to ensure that the model can classify efficiently while controlling the number of SMDs.
[0118] S4. Based on optimizing the placement of nodes in the real-time measurement device (SMD), the SMD data is used as the input to the GNN network to identify the real-time network topology and parameters of the system. The specific implementation steps are as follows:
[0119] S41. Based on the SMD installation nodes optimized and confirmed in S3, collect data on the SMD installation nodes in the three-phase distribution network, including voltage phasors, current phasors, active power, and reactive power, and construct a dataset X = (X1, X2, ..., X...). N ) T Where N represents the number of nodes with SMD installed, X i This represents the data of the i-th node, including U. i J i P i Q i Let represent the data of the i-th node, including voltage, current, active power, and reactive power, respectively, and the parameters are represented as follows: Normalizing the dataset X yields the normalized dataset X′=(X′1,X′2,…,X′ N ) T
[0120] Where A, B, and C represent the three phases in the distribution network, and s represents the number of sampling points. Let represent the voltage variable of the i-th node at the s-th sampling point under three-phase conditions; Let represent the variable of the current at the i-th node at the s-th sampling point under three-phase conditions; Let represent the variable of the active power of the i-th node at the s-th sampling point under three-phase conditions; Let X' and X' represent the reactive power variables of the i-th node at the s-th sampling point under three-phase conditions. i It is X i The row normalization result represents the normalized value of the node across all sampled data points;
[0121] S42, X ′ Using the admittance matrix Y estimated in step S2 as input to the graph neural network (GNN) model, a transition function is established based on the power flow equation, thereby constructing the GNN model. In a three-phase distribution network, the state of node n is determined by its own voltage u.n and adjacent node voltage u k The update is performed using the power flow equation, specifically calculated as follows:
[0122]
[0123] Among them, s n Three-phase complex power injection for node n; u n Y represents the three-phase complex voltage of node n and its adjacent node k; nn The self-admittance and mutual admittance matrices of the nodes are calculated from the line impedance; ⊙ represents the element-wise multiplication of the Hadamard product;
[0124] The power flow equation is converted into a real matrix representation as follows:
[0125]
[0126] in, <Z nn > is the real number representation of the nodal impedance matrix; <Y nk > is the real-valued representation of the admittance matrix of adjacent nodes; in GNNs, this physical constraint is used as the transition function F. w This is used to update the voltage state at each level; the global representation of the transition function is:
[0127] [x] = F w ([x],[l])(27)
[0128] Where [x] represents the node state (voltage value) of the entire network. [l] represents the characteristic information of the line (resistance, reactance); F w Define the physical transition function for state updates;
[0129] A Generative Neural Network (GNN) is used as the backbone network to learn the global topology of the power grid and predict parameters; node voltages are predicted using a transition function F. w The calculation is performed iteratively, as shown in the following formula:
[0130] [x] τ+1 =F w ([x] τ ,[k])(28)
[0131] Where τ represents the number of iterations; F w It is a transition function based on the power flow equation;
[0132] Iterative calculations continue until the following convergence condition is met:
[0133] ||[x] τ+1 -[x] τ ||2<∈ forward ×||[x]τ ||2 (29)
[0134] Where, ∈ forward A small threshold is used to determine convergence. When using the GNN model for line parameter identification, this task is treated as a regression problem because it involves predicting the voltage parameters of each node. The GNN model aggregates the local features of nodes and information from neighboring nodes, while the fully connected network regresses the voltage parameters of each node. The fully connected layers are branch networks, with two fully connected neural network layers connected after each branch. The first layer contains 256 nodes, and the second layer contains 128 nodes.
[0135] S43. In network training, the mean squared error (MSE) is used as the loss function, as shown in the following formula:
[0136]
[0137] Among them, v m It is the actual voltage measured by SMD, o m It is the predicted voltage of the GNN; by calculating the gradient of the loss function with respect to the line parameters, the line parameters of the graph neural network (GNN) are iteratively optimized.
[0138] Define the current line parameter as w, and calculate the gradient of the loss function with respect to w using the backpropagation method; for each line parameter w i The gradient is calculated as follows:
[0139]
[0140] Then, stochastic gradient descent (SGD) is used to update the line parameters, as follows:
[0141]
[0142] Where η is the learning rate and τ is the current iteration step. These are the line parameters at step τ. The Stochastic Gradient Descent (SGD) method is used to minimize the loss function and update the line parameters. After each update, the model adapts better to the data provided by SGD, resulting in more accurate line parameters.
[0143] S5. Use real-time current data acquired by SMD to identify whether the distribution network topology has changed; if it has changed, fine-tune the parameters of the pre-trained graph neural network (GNN) using transfer learning to adapt to the new topology and re-identify the parameters. The specific implementation steps are as follows:
[0144] S51. Using real-time current data measured by SMD, determine whether the distribution network topology has changed; set the input data as I = {I1, I2, ..., I...} N}, where Ii This represents the current phasor data for the i-th node;
[0145] When the topology occurs, current flows between the new branches, and the new branch input i in With output current i out Satisfying continuity:
[0146] ∑i in ≈∑i out (33)
[0147] If the topology has not changed, no current flows in the new branch:
[0148] ∑i in ≈0,∑i out ≈0(34)
[0149] The total change in current Δi of the newly connected branch n n As shown in the following formula:
[0150]
[0151] Among them, i in,c This represents the current flowing into the new branch from phase c (c∈{A,B,C}); i out,c This represents the current flowing out of the new branch from phase c (c∈{A,B,C}); max(|i in,c |,|i out,c |) represents the larger value of the current flowing into and out of the new branch in phase c; Δi n This indicates that for max(|i in,c |,|i out,c |) Numerical summation, that is, summing the maximum currents over phases A, B, and C;
[0152] To avoid the influence of noise on a single measurement, a time window method is used to perform multi-time statistics as follows:
[0153]
[0154] As shown in formula (36), if Δi is at consecutive T times... n If the sum of the currents is greater than the threshold ∈, then a topological change is determined to exist; if the current is 0 for a long period of time, then the topology is determined to have not changed.
[0155] To identify the topological connections of newly connected devices, the current correlation ρ between nodes k and l is calculated. k,l As shown in the following formula:
[0156]
[0157] Wherein, cov(i k i l) represents point i at k. k Current value and i l The covariance of the current value is shown in formula (38); Indicates point i at k k Current variance; Indicates point i l Current variance; This represents the average current at k points over a continuous period of time. This represents the average current at point l at consecutive time points;
[0158]
[0159] Set a threshold τ and adjust the adjacency matrix A as follows: As shown in the following formula:
[0160]
[0161] If ρ k,l If >τ, it means that nodes k and l are directly connected;
[0162] S52. After identifying the topology switch through changes in current data, the trained GNN model is fine-tuned using transfer learning to enable the model to adapt to the new topology. The transfer learning process is as follows (42):
[0163] Z new =Z old + Z (42)
[0164] Among them, Z new Z represents the weight parameters of the fully connected layers in the updated GNN network. old Z represents the weight parameters of the fully connected layers in the original trained model, and Z represents the parameter update amount obtained through fine-tuning.
[0165] S53. After identifying the topological changes, the system parameters are identified using a fine-tuned neural network (GNN). The parameter identification process is as follows:
[0166]
[0167] in, For the estimated voltage phasor, Z new For the updated GNN network fully connected layer weight parameters, For the adjusted topology state, f is a GNN neural network model. The GNN model outputs voltage phasor estimates for each node in the system, ensuring high accuracy during real-time estimation after topology changes.
[0168] Finally, parameter identification is performed using real-time SMD data, and the prediction accuracy of the model is evaluated using metrics such as mean square error (MSE) and absolute error of voltage phase angle (MAE), as shown in the following formula:
[0169]
[0170] in, For the actual voltage phasor, V i pred The predicted voltage phasor is denoted as . The effectiveness of transfer learning is verified by comparing the performance of the fine-tuned model with that of a baseline model (such as LSE) under different topologies.
[0171] Example 3
[0172] This invention provides a method for joint estimation of power grid topology and impedance based on Embodiment 1, such as... Figure 3 As shown, it includes:
[0173] S21. Abstract the power grid into an undirected graph and collect the power parameters of each observable node to construct a dataset. This includes the following implementation steps:
[0174] S211. Consider the power grid as an undirected graph G = (K, E); where K represents the set of nodes in the power grid, and E represents the set of lines in the power grid; let... Let S = {s0, s1, s2, ..., s} be the set of observable nodes in the power grid. N}, s0 represents the power source node in the power grid, s1 to s N This represents the observable nodes in the power grid, where N is the total number of observable nodes;
[0175] S212. Collect the electrical energy parameters of each observable node in the power grid, including voltage amplitude data V=(V0,V1,…,V i ,…V N Active power data P = (P0, P1, ..., P i ,…P N Reactive power data Q = (Q0, Q1, ..., Q i ,…Q N ), where V i P i Q i Let these represent the voltage magnitude, active power, and reactive power of the i-th observable node, respectively.
[0176] S213. Construct a dataset, let D = (V', P', Q') T Where, V'=(V1',V2',…,V i ',…V N ') TP' = (P1', P2', ..., P i ',…,P N ') T Q' = (Q1', Q2', ..., Q i ',…,Q N ') T ,() T V represents the transpose of a matrix, and V i '=(V i,1 V i,2 ,…,V i,s ), s represents the number of sampling points, V i,s P represents the voltage amplitude of the i-th observable node at the s-th sampling point; i '=(P i,1 ,P i,2 ,…,P i,s ), where P i,s Q represents the active power of the i-th observable node at the s-th sampling point; i '=(Q i,1 Q i,2 ,…,Q i,s ), Q i,s This represents the reactive power of the i-th observable node at the s-th sampling point.
[0177] S22. Construct a power flow calculation model with the impedance distance intersection matrix as a parameter, and introduce a physical information neural network (PINN) containing physical constraints to estimate the impedance distance intersection matrix, thereby obtaining the impedance distance matrix d. The specific implementation steps include the following:
[0178] S221. The power flow calculation model of the power grid is described using equations (2-1) to (2-3):
[0179] P i,i-1 =P i,i+1 +P i (2-1)
[0180] Q i,i-1 =Q i,i+1 +Q i (2-2)
[0181]
[0182] Where, r i+1 ,x i+1 Representing node s respectively i and node s i+1 Resistance and reactance of the lines between them; node s i-1 Representative node s i The upstream node, node s i+1 Representative node s iDownstream node; P i,i+1 Q i,i+1 They represent slave nodes s respectively i Outflowing active power and reactive power; ds(s i+1 ) represents node s i+1 The set of all downstream nodes; substituting equations (2-1) and (2-2) into equation (2-3) yields equation (2-4):
[0183]
[0184] Using equation (2-4) to list the square of the voltage at the power node and the difference between the squares of the voltages at each node, we can obtain equation (2-5):
[0185] V0 2 1 N×1 -V 2 =2RP+2XQ (2-5)
[0186] Among them, 1 N×1 This represents an N x 1 vector, where all elements are 1. P = {P1, P2, ..., P} N};Q={Q1,Q2,…,Q N};R and X are the intersection matrices of resistance distance and reactance distance, respectively. E i E j These represent the points from node s0 to s i The set of lines between and nodes s0 to s j A collection of routes between them;
[0187] S222. Introduce a physical information loss term into the framework of a deep neural network, and use the Physical Information Neural Network (PINN) to estimate the R and X matrices, obtaining... The physical information neural network PINN consists of one input layer, L hidden layers, one output layer, and one clustering layer; specifically, it includes the following implementation steps:
[0188] S2221. In the input layer, hidden layer, and output layer of PINN, the signal processing procedure is as shown in equation (2-6):
[0189] a (l) =σ(W (l) a (l-1) +b (l) (2-6)
[0190] Among them, W (l) Let b be the weight matrix of the l-th layer, where 1 ≤ l ≤ L+2; (l)Let a be the bias vector of the l-th layer; when l≥2, a (l -1) This is the output of the (l-1)th layer. When l = 1, a (0) =D, where σ is the activation function;
[0191] S2222. The clustering layer of PINN uses a density-based spatial clustering algorithm to cluster similar values in the results of the PINN output layer together, and replaces these similar values with cluster centers. After the clustering process is completed, the weighted average method of Equation (2-7) is used to calculate the cluster center μ of each class. C as follows:
[0192]
[0193] Where C represents a cluster; x i Let ω be the i-th data point in cluster C; i For data point x i The weights, and the data points x i Distance d to the mean of data points in cluster C i Inversely proportional, w i =1 / dis i +ò, where ò is a very small positive number, used to avoid division by zero errors;
[0194] S2223. Calculate the loss function Loss of the physical information neural network using equation (2-8); the loss function Loss includes the prediction error Loss1 of the neural network and the error Loss2 caused by the prediction result not conforming to physical laws:
[0195]
[0196] Loss=α1Loss1+α2Loss2 (2-8.c)
[0197] Where α1 and α2 are the weights of Loss1 and Loss2 in the total loss; The impedance intersection distance matrix is estimated by the physical information neural network; the loss function is calculated relative to W using the backpropagation algorithm and the chain rule. (l) b (l) The gradient is calculated, and finally the weights and biases of each layer are adjusted based on the calculated gradient.
[0198] S2224. Repeat steps S2221 to S2223 until the loss function Loss is less than the set threshold.
[0199] S223, based on the results The resistance distance matrix d is obtained through equation (2-9). r and reactance distance matrix dx :
[0200]
[0201] Where, d r (i,j) represents v i and v j The sum of the resistances of all lines between them, d x (i,j) represents v i and v j The sum of the reactances of all lines between them; the resistance distance matrix d r and reactance distance matrix d x It is uniformly represented by the impedance distance matrix d.
[0202] S23. Based on the impedance distance matrix d, the concept of node level is introduced, and a hierarchical iterative grouping algorithm is used to jointly estimate the topology and line impedance of the power grid. The specific implementation steps include the following:
[0203] S231. Input the set of observable nodes O, O = S, and the impedance distance matrix d formed by the impedance distances between these nodes;
[0204] S232. When determining the exact relationship between nodes, to avoid listing all node pairs and causing high computational complexity, a preliminary screening of node pairs is needed to obtain a set of candidate node pairs. Subsequent determination of the connection relationship between nodes is only made from these candidate pairs, which improves the algorithm's computational efficiency. Therefore, the concept of node level is introduced, where node s... i Node level l i equal The number of unique elements in the i-th row of the matrix; for distribution / microgrids, the parent node has a node level 1 higher than the child node, and the two nodes of a sibling node pair have the same node level; if the node levels of the two nodes are l a and l b If the difference is 1, then node s a For node s b Form a candidate parent-child node pair; if the node levels of the two nodes are l a and l b If they are equal, then node s a For node s b Form candidate sibling node pairs;
[0205] S233. For any node pair s in the candidate node pair set... a and s b Calculate the distance difference Φ abc :
[0206] Φ abc = d(a,c)-d(b,c); where s c∈O\{s a ,s b}
[0207] S234, if Φ abc =Φ abc' =d(a,b), s c ,s c' ∈O\{s a ,s b}, then node s a For node s b The parent node;
[0208] S235. If -d(a,b) < Φ abc =Φ abc' <d(a,b), s c ,s c' ∈O\{s a ,s b}, then node s a With node s b For sibling nodes;
[0209] S236. Based on the judgment results of steps S233 and S234, construct a preliminary topological relationship; if node s a With node s b If they are a parent-child node pair, then in node s a With node s b Add an edge between nodes s and update the set of lines E; if node s a With node s b If they are sibling nodes, then it is node s. a With node s b Create a new parent node s h and respectively at node s h and node s a Node s h and node s b Add an edge between them and update the line set E;
[0210] S237. If no new parent node s exists... h Then proceed to step S238; if a new parent node s exists. h Then update the impedance distance matrix d; for s h child nodes s a ,s b :
[0211]
[0212] For s h Non-child nodes s c ∈O\{s a ,sb}:
[0213] d(c,h)=d(a,c)-d(a,h);
[0214] S238. Remove nodes from node set O that have established parent-child or sibling relationships, and add the newly added nodes to node set O; when the number of nodes in set O is greater than 2, repeat steps S233 to S238; when the number of nodes in set O is equal to 2, connect the two remaining nodes, the iteration process terminates, and the topology is restored; when the number of nodes in set O is equal to 1, the iteration process terminates, and the topology is restored.
[0215] S239. Calculate the resistance r of the i-th line based on the impedance distance matrix d. i =d r (E(i,1),E(i,2)), reactance x i =d x (E(i,1),E(i,2)).
[0216] This embodiment also demonstrates a simulation experiment of the above method on IEEE 33-node. To simulate power system operation measurement data, the dataset D used by the physical information neural network in the experiment was generated using MATPOWER. The PINN prediction results were input into iterative grouping for joint topology and impedance estimation, obtaining estimated resistance and reactance data for each edge. To quantify the performance of this patented method, such as... Figure 4 As shown, the mean percentage error (MAPE) is selected as the performance index for impedance calculation; the mean percentage error of impedance estimation in this embodiment is 0.6640%.
[0217] Example 4
[0218] like Figure 5 As shown, the present invention provides a microgrid stability analysis method based on Embodiment 1, comprising the following basic steps:
[0219] Step S31: Data acquisition and preprocessing;
[0220] In this embodiment, since the data may be affected by noise during the acquisition process, filtering techniques are needed to remove this noise. A common approach is to use a low-pass filter to remove high-frequency random noise. The expression for a low-pass filter is:
[0221]
[0222] In equation (1), x(τ) is the original signal, y(t) is the filtered signal, and τ cutoff It is the cutoff time constant of the filter.
[0223] In this embodiment, to ensure the training effect of the neural network, the data is normalized to a uniform range (e.g., [0,1]) to reduce the dimensional differences between different parameters. The Min-Max Normalization method is used:
[0224]
[0225] This method ensures that all input data are within the same numerical range, making the training process more stable.
[0226] In this embodiment, to make the training process more stable, standardization is performed so that the mean of the data is 0 and the variance is 1, eliminating scale differences and improving training efficiency. The standardization formula is:
[0227]
[0228] In equation (3), μ is the mean of the data and σ is the standard deviation.
[0229] In this embodiment, the processed dataset is divided, typically into three portions: 70% for training, 15% for validation, and 15% for testing. This ensures the stability of model training and prevents overfitting. The training set is used to train the neural network, and the network adjusts its parameters based on the training data. The validation set is used to adjust the network's hyperparameters (such as learning rate and number of layers) and prevent overfitting. The test set is used to finally evaluate the model's performance and ensure its generalization ability.
[0230] S32. Construct a neural network model;
[0231] In this embodiment, a neural network architecture is designed to model the dynamics of the microgrid system. The state variables of the microgrid system are set to x∈R, and its dynamic system is described by the following ordinary differential equations:
[0232]
[0233] In equation (4), f(x) is a nonlinear vector field describing the dynamics of the microgrid.
[0234] In this embodiment, the output of the neural network is the Lyapunov function V. φ (x), where φ is the parameter of the neural network. The network is trained using the following formula:
[0235]
[0236] In equation (5), σ is the smooth ReLU activation function, g(x) is the input convex neural network (ICNN), F(x) is an invertible and continuously differentiable function, and ò is a small constant to ensure the positive definiteness of the Lyapunov function.
[0237] S33, Lyapunov risk function optimization and analyticalization;
[0238] In this embodiment, the neural network is trained by minimizing the Lyapunov risk function. The Lyapunov risk function... Used to measure the degree to which a Lyapunov function violates the stability condition. Defined as:
[0239]
[0240] In equation (6), where L f V φ (x i ) is the Lie derivative of the Lyapunov function, i.e., the rate of change along the system's trajectory:
[0241]
[0242] The loss function is minimized using the backpropagation algorithm to ensure that L f V φ (x i If )≤0, it satisfies the Lyapunov stability condition.
[0243] like Figure 6 As shown, in this embodiment, after training the neural network, symbolic regression (such as PySR) is used to transform the Lyapunov function V output by the neural network. φ (x) is transformed into an analytic mathematical expression. The goal of symbolic regression is to find an analytic expression that satisfies the conditions for a Lyapunov function:
[0244] V(0)=0, V(x)>0forx≠0 (3-8)
[0245] After symbolic regression, the analytical Lyapunov function V is obtained. analytical (x), for example:
[0246]
[0247] Where, α i It is a constant obtained from symbolic regression.
[0248] S34. Stability verification and counterexample generation;
[0249] In this embodiment, the analytical Lyapunov function V is... analytical(x) Perform stability verification. Use a numerical root-finding algorithm (such as SciPy's fsolve) to detect the roots of the Lyapunov function, ensuring that it is zero only at equilibrium points:
[0250] V analytical (x)=0 at equilibrium pointx=0 (3-10)
[0251] Simultaneously, calculate the Lie derivative:
[0252]
[0253] And ensure that it satisfies L in the state space. f V analytical (x)≤0 to ensure stability.
[0254] In this embodiment, if it is found that the Lyapunov function does not satisfy the stability condition at certain state points (i.e., counterexamples), these counterexamples are added to the training set, and the neural network is retrained until an effective Lyapunov function that satisfies the stability condition is found.
[0255] S35, an extension of high-dimensional networked microgrids;
[0256] In this embodiment, for a high-dimensional networked micronetwork system composed of multiple subsystems, the present invention employs a design method of combined neural network Lyapunov functions. The state of each subsystem is represented by an independent neural network Lyapunov function, and the interaction relationships between subsystems are learned through a shared neural network model. The combined design of Lyapunov functions...
[0257] The Yapnov function is expressed as:
[0258]
[0259] In equation (12), V i (x i ) and V ij (x i ,x j Let c represent the Lyapunov functions for a single subsystem and the interactions between subsystems, respectively. i and c ij It is a learnable constant, N i This represents the neighboring subsystem connected to subsystem i.
[0260] Example 5
[0261] like Figure 7 As shown, this invention provides a microgrid group topology switching stability analysis method based on Embodiment 1. It includes the following basic steps:
[0262] S41. Model the microgrid system and introduce the Zuboff equation;
[0263] In this embodiment, the dynamic equation of the k-th sub-micronet in the micronet group can be written as:
[0264]
[0265] Where, δ k For angular deviation, E k Voltage amplitude, The derivative of the angular deviation, M is the derivative of the voltage amplitude. ak and M vk It is the tracking time constant. and These are the steady-state injections of active power and reactive power, respectively, P k and Q k D represents active power injection and reactive power injection, respectively. ak and D vk It is a decrease in gain.
[0266] In this embodiment, the general form of the Zuboff equation is:
[0267]
[0268] Here, x is the system's state vector, which can contain the state variables of multiple microgrid subsystems. W(x) is the Lyapunov function, used to describe the system's stability. Ψ(x) is a given positive definite function related to the system state, used to represent stability. In this equation, when W(x) approaches 1, the system is close to an unstable state; when W(x) approaches 0, the system is in a stable state.
[0269] S42. Solve the Zubov equation in the microgrid system using a neural network to obtain the Lyapunov function;
[0270] In this embodiment, a multilayer feedforward neural network is constructed. The specific structure of the neural network is as follows: the input of the neural network is the system's state vector x, and the state of the microgrid system includes angle deviation and voltage amplitude:
[0271] x=[δ1,δ2,…,δ n E1, E2, ..., E n ]
[0272] The intermediate layers of a neural network consist of multiple hidden layers, each containing multiple neurons. The output of each layer is given by the following formula:
[0273] a (l) =σ(w (l) a (l-1)+b (l) (l=1,2,…,L)
[0274] Among them, a (l) It is the output of the l-th layer, a (0) =x,w (l) It is the weight matrix, b (l) σ is the bias vector, and σ is the activation function tanh. This usually represents the total number of layers in a neural network.
[0275] The Lyapunov function W output by the neural network N It is expressed as follows:
[0276] W N (x; θ) = a (L)
[0277] Here, θ represents the network parameters, including all weights and biases.
[0278] In this embodiment, a loss function is designed. The training objective of a neural network is to minimize the residual between the network output and the Zuboff equation using a loss function.
[0279] First, calculate the derivative of the neural network with respect to time:
[0280]
[0281] Where, x i (t) represents the state at the i-th sampling point at time t, W N (x i (t); θ) is the neural network in x i (t) Output under input.
[0282] Then, the physical information loss function is calculated by sampling the state of the system. Specifically, in the specific design operation of the loss function, the Zuboff equation residuals... For each sampling point x i (t), calculate the physical information loss:
[0283]
[0284] Where, N colloc It is the number of sampling points selected, Ψ(x) i (t) and θ) are stability functions learned through a neural network.
[0285] Determine boundary condition loss For boundary points, assuming W(x) takes the value of 1 at the boundary of the attraction domain, the boundary condition loss function of the system is:
[0286]
[0287] Where, N boundary This is the number of boundary points selected.
[0288] Total loss function It is the weighted sum of the losses from the above components:
[0289]
[0290] Where, λ p and λ b These are weighting coefficients used to adjust the relative importance of each loss term in the total loss function.
[0291] In this embodiment, the training and optimization of the neural network are discussed. The training process of the neural network involves minimizing the total loss function. First, the parameters θ of the neural network are updated using the gradient descent optimization algorithm. Then, the loss function is... By taking the derivative, we can obtain the gradient of the parameters.
[0292]
[0293] Then, the parameter θ is updated using gradient descent:
[0294]
[0295] Here, α is the learning rate, which determines the step size for each parameter update.
[0296] Finally, through multiple iterations, the network parameters θ gradually converge, thereby making W... N (x) satisfies the Zuboff equation and boundary conditions.
[0297] S43. Analyze the stability using Lyapunov functions and calculate the attractive region of the system;
[0298] In this embodiment, after the neural network is trained, the Lyapunov function W output by the network is used. N (x) is used to verify stability.
[0299] First, W is obtained through the output of the neural network. N (x).
[0300] Then calculate That is, W N (x) derivative with respect to time:
[0301]
[0302] in, It is the Lyapunov function WN The gradient of (x(t)) with respect to time t, It is the rate of change of the system state x(t).
[0303] Then, through judgment Symbolic analysis stability: if Then the system is stable; if The system is therefore unstable.
[0304] Finally, through analysis of W N The value of (x) determines the region of attraction D, where the region of attraction is W. N The region where (x) is less than 1:
[0305] D={x∣W N (x)<1}
[0306] By calculating the W of the microgrid under different topology switching conditions N We can use the value of (x) to determine whether the system can remain stable at x and to calculate the boundary of the attraction domain.
[0307] S44. Further analyze the stability of the microgrid system under different topology configurations to ensure stability during system topology switching.
[0308] In this embodiment, the topology switching of the microgrid group will change the connection method between subsystems, therefore the dynamic equations of the system will change with the topology change. The dynamic model of the system can be expressed as:
[0309]
[0310] Among them, x(t)=[δ1(t),δ2(t),…,δ n (t),E1(t),E2(t),…,E n [x(t)] is the state vector of the system, representing the voltage and angle of all subsystems of the system. f(x(t),τ(t)) is the nonlinear dynamic function of the system, which depends on the state and topology configuration τ(t) of the system. τ(t) is the topology configuration of the system at time t, representing the connection mode of the subsystems of the microgrid system.
[0311] In this embodiment, the Lyapunov function W is calculated using the Zubov equation via a neural network. N We can analyze the stability of the system under different topological configurations by using the derivative of (x). If the topological configuration τ(t) is chosen at time t, then according to the Zubov equation, the Lyapunov function W... N (x) satisfies the following relationship:
[0312]
[0313] Among them, WNτ (x(t)) is the Lyapunov function of the system under the topological configuration τ(t), which is obtained through neural network training in the above steps. It is its derivative with respect to time t.
[0314] Then, to ensure the stability of the system after topology switching in all states, the rate of change of the Lyapunov function satisfies the following condition:
[0315] D τ ={x∣W N (x)<1}
[0316]
[0317] Where D τ Let be the region of attraction of the system under the topological configuration τ(t), representing the region where the system can be stable. Furthermore, all states within the region of attraction satisfy ... This indicates that the state will tend towards an equilibrium point.
[0318] In this embodiment, the attraction domain under different topology configurations τ(t) is calculated based on the above analysis. When a topology switch occurs in the system, it is necessary to ensure that the operating state after the switch falls within the stable domain to guarantee the stability of the microgrid system's topology switch and achieve safe topology reconfiguration.
[0319] Specifically, ensure the following conditions are met before and after topology switching:
[0320] First condition, state x before switching before (t) falls within the topology configuration τ before the handover before attraction domain Within, that is:
[0321]
[0322] Second condition, the state after the switch x after (t) falls within the topology configuration τ after the handover after attraction domain Within, that is:
[0323]
[0324] The second condition, the stability condition: ensure that the state after the switch satisfies the stability condition, that is:
[0325]
[0326] This ensures the stability of the system after topology switching, guaranteeing a smooth transition and stability of the system state under the new topology configuration.
[0327] Example 6
[0328] like Figure 8 As shown, the power system neural network controller design method provided by the present invention includes the following basic steps:
[0329] S51. Perform dynamic modeling of the power system, and introduce and adopt Lyapunov stability theory;
[0330] In this embodiment, the dynamic behavior of a power system can typically be described using state-space equations. Here, the state equations of the power system are:
[0331]
[0332] Here, x(t) represents the system's state vector, which typically includes various system parameters, such as the generator's rotor angle and speed; u(t) represents the control input, such as the excitation current or speed regulation signal, which is the external control quantity applied to the system; A and B are matrices describing the system's dynamics, respectively. A mainly determines the system's natural behavior, such as the effects of inertia, damping, and load; while B describes the influence of the control input on the system state, such as how the excitation current affects the generator speed, or how current control changes the voltage output.
[0333] The aforementioned state-space model is a standard method for describing linear dynamic systems. It links the system's state variables (such as rotor angle) and control inputs (such as excitation current) through matrix equations to calculate the future state of the system.
[0334] In power systems, due to the nonlinear dynamics and complexity of the system, this model can be extended to a nonlinear state-space model:
[0335]
[0336] In this embodiment, Lyapunov stability theory is introduced. To ensure the stability of the power system, a neural network can be used to represent the Lyapunov function V(x), which is theoretically used to verify the stability of the system. The Lyapunov function has the following form:
[0337] V(x) = NN θ (x)
[0338] Here, V(x) is the Lyapunov function of the system, which can be considered as the system's "energy"; NN θ (x) is a neural network whose input is the system state x; the parameters θ are the weights and biases of the neural network. As the training process progresses, the neural network learns and adjusts these parameters to ensure that the Lyapunov function satisfies the stability conditions. Specifically, the stability conditions include:
[0339] (1) Positive definiteness: V(x) > 0 for x ≠ 0;
[0340] (2) Negative qualitative: Ensure that system energy decreases over time;
[0341] (3) The equilibrium point is 0, i.e., V(0) = 0.
[0342] Neural networks are used to approximate complex nonlinear functions, thus they can represent stability measures of highly complex dynamic systems. Neural networks provide a very powerful function approximation tool, especially when the behavior of a system is difficult to describe by a simple function.
[0343] In this embodiment, the stability condition of the Lyapunov function is described. To ensure the stability of the power system and guarantee the positive definiteness of the Lyapunov function in the system state space and its decreasing nature along the system trajectory, it is formulated as follows: And this condition is ensured through a neural network.
[0344] S52, Neural Network Control Input and Stability Verification;
[0345] In this embodiment, the control input is generated. To control the state of the power system, this invention uses a neural network to generate the control input u(t), i.e., the control signal. The form of the control input is:
[0346] u(t) = π(x(t)) = NN u (x(t))
[0347] Where u(t) is the control input, which determines how the system behavior is adjusted, such as adjusting the generator speed or excitation current; NN u (x(t)) is a neural network that calculates the control input u(t) based on the current state x(t) and uses it to adjust the operation of the system. x(t) is the state vector of the system. The neural network determines the optimal control signal based on the state value to ensure the system is stable and meets the operating requirements.
[0348] like Figure 9 As shown, in this embodiment, by using a neural network, the control strategy can automatically learn and generate control inputs from complex, nonlinear system dynamics, without relying on manually designed complex control rules.
[0349] In this embodiment, stability verification is performed. According to Lyapunov stability theory, the stability of the system requires that the Lyapunov function decreases along the trajectory of the system. That is, as shown in the following formula:
[0350]
[0351] Here, f(x,u) = Ax(t) + Bu(t) is the dynamic model of the system. To ensure system stability, the derivative of the Lyapunov function... Must meet ΔV(x) is the gradient of the Lyapunov function V(x), representing the rate of change of the Lyapunov function with respect to the state x; f(x,u) is the dynamics of the system, describing how the state x and the control input u affect the changes in the system; by ensuring The system's stability is achieved by ensuring that its "energy" decreases continuously over time.
[0352] The verification process of the Lyapunov condition is the core of proving the stability of the system, ensuring that under specific control inputs, the system will eventually stabilize at an equilibrium point.
[0353] In this embodiment, a Lyapunov risk function is constructed. To optimize the controller and Lyapunov function of the neural network, this invention defines a Lyapunov risk function. The Lyapunov risk function measures whether the system violates the Lyapunov conditions. The formula for this risk function is:
[0354]
[0355] E x~ρ(D) ρ(D) represents the expected value, which is calculated by sampling all states in the state space D; here, ρ(D) represents the probability distribution on the state space D, meaning that the risk function is calculated based on random sampling of the state space; max(0, -V) θ (x)) Ensure the positive definiteness of the Lyapunov function, that is, in state x, V θ (x) must be positive; max(0,L) fu V θ (x) is used to ensure that the derivative of the Lyapunov function is negative along the system trajectory, that is, to ensure stability; Ensure that the Lyapunov function is zero at the equilibrium point.
[0356] This risk function approximates the degree of violation of Lyapunov conditions through random sampling, thereby guiding the neural network to adjust its parameters during training so that the control system meets the stability requirements.
[0357] S53, Controller Optimization and Controller Design Process;
[0358] In this embodiment, controller optimization is performed. Specifically, to obtain the optimal control strategy and Lyapunov function, the controller design is optimized by minimizing the Lyapunov risk function. The ultimate optimization objective is:
[0359]
[0360] Meanwhile, in order to expand the system's attraction domain (i.e., stable region), this invention introduces an additional adjustment term:
[0361]
[0362] like Figure 10 As shown, in this embodiment, by minimizing this objective function, the neural network parameters can be optimized to design a controller that is both stable and has a large attraction field. α is a hyperparameter used to control the size of the attraction field.
[0363] The goal of optimization is to maximize the stability of the system while maximizing the attraction domain, thereby ensuring that the system operates stably in a wider state space.
[0364] In this embodiment, the controller design process includes initializing the controller and the neural network of the Lyapunov function, and optimizing them using gradient descent. Specifically, this includes: initializing the neural network parameters u(t) and θ, using the results of LQR (Linear Quadratic Regulator) as initial guesses; updating parameters θ and u through stochastic gradient descent (SGD), and iteratively optimizing the Lyapunov risk function; the optimization process continues until convergence, ensuring system stability and a large region of attraction. This process ensures that through neural network learning, the controller can automatically obtain a stable control strategy from the data and ensures stable operation of the system under given initial conditions.
[0365] Example 7
[0366] This embodiment provides a distribution network voltage control method based on timing and topology characteristics according to Embodiment 1, for use in scenarios where photovoltaic power is connected to the grid, such as... Figure 11 As shown, it includes the following steps:
[0367] S61. Model the distribution network as a radial diagram and establish a voltage control mathematical model for the distribution network containing photovoltaic penetration. The specific implementation steps are as follows:
[0368] S611. Model the distribution network as a radial graph G = (V, L), where V = {0, 1, ..., N} and L = {1, 2, ..., N} represent sets with N+1 buses and N edges, respectively, and the transformer is connected to bus 0.
[0369] S612. Establish a mathematical model for photovoltaics using equation (6-1):
[0370]
[0371] In the formula, This represents the rated capacity of the photovoltaic system at bus i; This represents the active power generated by the photovoltaic system at bus i. This represents the reactive power generated by the photovoltaic system at bus i. This represents the maximum reactive power generated by the photovoltaic system at bus i. Let i represent the real-valued control variable for the photovoltaic system at bus i.
[0372] S613. Using equation (6-2), establish the branch power flow balance equations of the distribution network:
[0373]
[0374] In the formula, This represents the active power consumed by the load at bus i; This represents the reactive power consumed by the load at bus i; v i and v i' θ represents the node voltage at bus i and bus i', respectively; ii' Indicates v i With v i' The phase angle between them; g ii' and b ii' Let i and i' represent the conductance and susceptance of the branch from bus i to bus i', respectively.
[0375] S614. The voltage control problem is expressed as equation (6-3):
[0376]
[0377] In the formula, v i,t vi represents the node voltage at bus i at time t; v0 represents the node voltage at bus 0, which is the reference voltage; β represents the weighting factor, used to measure the importance of line loss relative to voltage deviation. This represents the line loss on the l-th edge at time t; min indicates taking the minimum value.
[0378] S62. Formulate the voltage control problem as a Markov decision problem. The specific implementation steps are as follows:
[0379] S621. Model the entire distribution network as an environment and divide it into K regions, denoted as D = {D1, D2, ... D}. j ...,D K}, D j Let j represent the j-th distribution network region, and let agent j be in D based on time t. j Information observed in the region j,t Control all photovoltaic systems within the region; in this embodiment, such as... Figure 12 As shown, the entire power distribution network is divided into 5 zones.
[0380] S622, All local observations from agent 1 to agent I at time t {o 1,t ,o 2,t ,...,o I,t}Composition of environmental state s t , where the local observation value o of agent j at time t j,t It can be defined as equation (6-4):
[0381]
[0382] In the formula, and D at time t j The active and reactive power consumed by all loads within the area; and D at time t j The active and reactive power of all photovoltaic systems within the region; |v t | and θ t D at time t j The magnitude and phase angle of the voltage at all nodes within the region; D represents time t+1. j Trends in the active power output of all photovoltaic systems within the region;
[0383] S623, Action a of agent j at time t j,t It can be defined as equation (6-5):
[0384]
[0385] In the formula, U represents the location of agent j in D. j The total number of photovoltaic cells in the region; D represents the control of agent j. j The action of the k-th photovoltaic unit within the region, when At one time, photovoltaic power injects reactive power into the power distribution network; when
[0386] At that time, photovoltaic power absorbs reactive power from the distribution network;
[0387] S624. The state transition process of the entire system from time t to t+1 is determined by the state transition function s. t+1 =T(s) t ,o 1:I,t ,a 1:I,t ,χ t The decision is determined by the environmental state s at time t. t Local observations of all agents at time t 1:I,t and action a 1:I,tand environmental uncertainty at time t χ t The impact;
[0388] S625. At time t, after agent j executes the action and completes the state transition, it will receive the corresponding reward r. j,t The reward function is designed as shown in equation (6-6):
[0389]
[0390] In the formula, ψ v (v i,t ) represents the voltage barrier function, where a, b, c, d, and f are all hyperparameters; |v i,t When -v0|>0.05, the deviation between the node voltage and the reference voltage in the distribution network is large, resulting in a significant penalty; |v i,t When -v0|≤0.05, the deviation between the node voltage and the reference voltage in the distribution network is small, and the penalty is calculated using a Gaussian function with mean v0 and standard deviation d.
[0391] S63. Use a Long Short-Term Memory (LSTM) network and a Weighted Graph Convolutional Network (WGCN) to process the temporal and topological features of the system. The specific implementation steps are as follows:
[0392] S631. Using equation (6-7), establish the forget gate f of the LSTM network at time t. t Input gate i t Memory gate c t and output gate o t :
[0393]
[0394] In the formula, x t Represents the input at time t; h t-1 This represents the hidden state at time t-1; W represents the candidate memory state at time t; f U f Both represent the forgetting gate f at time t. t weights; b f The forget gate f represents time t. t The bias; W i U i Both represent the input gate i at time t. t weights; b i Indicates the input gate i at time t t The bias; W c U c Both represent time t. weights; b c Represents time t The bias; Wo U o Both represent the output gate o at time t. t weights; b c Indicates the output gate o at time t t The bias; σ represents the sigmoid activation function; tanh represents the hyperbolic tangent activation function; Represents the Hadamard product;
[0395] S632, D j Historical photovoltaic data for the first 96 time steps in the region The input is fed into the LSTM network, and the h obtained from equation (6-7) is processed using equation (6-8). t After passing through a fully connected layer, the photovoltaic active power output trend characteristics related to time t+1 are generated. And Integrate into the local observations of agent j;
[0396]
[0397] In the formula, W p Indicates the weights of the fully connected layer; b P Indicates the bias of the fully connected layer;
[0398] S633, such as Figure 13 As shown, the connection topology graph G of the agents in the distribution network is obtained, and the shortest hop count dis of agents j and j' in the topology graph G is determined. jj' ;
[0399] S634. Construct the input {X,A} of the WGCN network, where the feature matrix... Adjacency Matrix Based on the shortest hop count dis between agent j and agent j' jj' Let the j-th row and j' column of the adjacency matrix A be defined as
[0400] S635. Set the total number of layers in the WGCN network to L, and the propagation rule is as follows: Where F (0) =X;F (L) W represents the output of the L-th layer WGCN network. (L) σ represents the weight matrix of the Lth layer WGCN network; σ represents the sigmoid function. Represents the identity matrix; express The degree matrix.
[0401] S64. The agent in the Markov decision problem above is trained using the Deep Deterministic Policy Gradient (DDPG) algorithm based on reinforcement learning to obtain the optimal voltage control policy. The specific implementation steps are as follows:
[0402] S641. Construct an Actor network for agent j. A Critic network Among them o j Represents the local observations of agent j; a j ψ represents the output action of agent j; j and θ j These represent the parameters of the Actor network and the Critic network, respectively.
[0403] S642, Actor Network Based on Agent j and Critic Network Create each with ψ j 'Target Actor Network with parameters' With θ j 'Target Critic Network with parameters' And initialize its parameters to be the same as the original network, where o j ' represents the local observation of agent j at the next time step; a j 'Indicates the output action of agent j at the next moment;
[0404] S643. Using equation (6-9), Gaussian noise is added to the output of the Actor network.
[0405]
[0406] In the formula, ξ t The standard deviation of the Gaussian distribution;
[0407] S644. During the training process, each agent j acquires an experience {o} through interaction with the power distribution network environment. j,t ,a j,t ,r j,t ,o j,t+1} and store it in the shared experience buffer M;
[0408] S645. During the network update phase, a batch of samples containing M experiences is randomly sampled from the experience buffer M. Learning is performed, and the observations of each agent j are combined into a feature matrix. Input into WGCN, and use the aggregated observations of each agent j for updates to their respective Actor and Critic networks;
[0409] S646. Update the Actor network and Critic network using equations (6-10) and (6-11) respectively:
[0410]
[0411] In the formula, ζ ψ The learning rate of the Actor network. Indicates the relationship between ψ j Find the gradient;
[0412]
[0413] In the formula, ζ θ γ is the learning rate of the Critic network, and γ is the discount rate.
[0414] S647. The target Actor and Critic network are tracked step by step using equation (6-12):
[0415]
[0416] In the formula, For soft update parameters,
[0417] S648. Following the process in S43-S47, adjust the Actor network parameters ψ of agent j. j and Critic network parameters θ j Perform iterative training to obtain the optimal parameters of agent j. The corresponding optimal Actor network and optimal parameters The corresponding optimal Critic network is used to form the optimal agent j, thereby obtaining all the optimal agents and outputting the optimal voltage control strategy.
[0418] This embodiment also includes simulation experiments to demonstrate the above method. The power distribution network environment was built using Python, and all multi-agent reinforcement learning algorithms were implemented using the Python deep learning framework PyTorch. For the LSTM network used, the time step was 96, the number of stacked layers was three, and the number of neurons in each layer was 256, 128, and 64 respectively. The Adam optimizer was used, and the learning rate was 5×10⁻⁶. -3 The weighted graph convolutional network used has one stacked layer, 128 neurons, and employs the Adam optimizer with a learning rate of 4×10⁻⁶. -3 The reinforcement learning algorithm used was trained for 3000 epochs, with 480 time steps per epoch. The Actor and Critic networks in the algorithm were trained using the Adam optimizer with learning rates of 8×10⁻⁶. -4 and 8×10-4 Soft update rate The discount rate γ = 0.95.
[0419] The provided algorithm was applied to an IEEE-33 node distribution network, and the simulation results are as follows: Figure 14 As shown, in a typical summer day scenario, it can be seen that the voltage of all nodes is within the range of 0.95pu to 1.05pu throughout the day.
[0420] Example 8
[0421] This embodiment provides a distribution network reconfiguration method based on multi-agent security reinforcement learning, as described in Embodiment 1. The method flow is as follows: Figure 15 As shown, it includes:
[0422] S71. Construct a Markov decision process under the demand state of distribution network reconfiguration. The specific implementation steps are as follows:
[0423] S711, Construct the state space of the distribution network nodes. t The state of a distribution network consists of multiple elements, mainly including topology state, load state, and equipment state. The state space describes all states of the distribution network at a given moment. The distribution network node state space s t Represented as: s t ={P t Q t V t ,θ t ,φ t},include:
[0424] (1) Nodal active power injection vector P t Positive values indicate injection into the grid, and negative values indicate absorption from the grid; represented as:
[0425] P t =[P 1,t ,P 2,t ,…,P N,t (7-1)
[0426] In the formula, P i,t The active power injection at node i at time t, where N is the total number of nodes in the distribution network;
[0427] (2) Nodal reactive power injection vector Q t Positive values indicate injection into the grid, and negative values indicate absorption from the grid; represented as:
[0428] Q t =[Q 1,t Q 2,t ,…,Q N,t (7-2)
[0429] In the formula, Q i,t Let N be the reactive power injection at node i at time t, and N be the total number of nodes in the distribution network.
[0430] (3) Node voltage magnitude vector V t , is represented as:
[0431] V t =[V 1,t V 2,t ,…,V N,t (7-3)
[0432] In the formula, V i,t Let N be the voltage magnitude of node i at time t, and N be the total number of nodes in the distribution network.
[0433] (4) Node voltage phase angle vector θ t , is represented as:
[0434] θ t =[θ 1,t ,θ 2,t ,…,θ N,t (7-4)
[0435] In the formula, θ i,t Let be the voltage phase angle of node i at time t, and N be the total number of nodes in the distribution network;
[0436] (5) Switch state vector φ t , is represented as:
[0437] φ t =[φ 1,t ,φ 2,t ,…,φ K,t (7-5)
[0438] In the formula, φ k,t Let φ be the state of switch k at time t. k,t ∈{0,1}, where 0 represents the switch being open and 1 represents the switch being closed; K represents the total number of switches in the distribution network.
[0439] S712, Constructing the Distribution Network Action Space a t As shown in the following formula; the action space directly controls the changes in the switch state, affecting the topology of the distribution network. Each action must meet the electrical safety constraints of the distribution network, such as voltage amplitude constraints and power flow balance constraints.
[0440] a t =Δφ t (7-6)
[0441] In the formula, Δφ t =[Δφ 1,t ,Δφ 2,t,…,Δφ K,t ], where Δφ is the vector representing the change in switch state. k,t ∈{-1,0,1}, -1 represents open, 1 represents closed, and 0 represents unchanged; the distribution network reconfiguration task uses a policy network, based on state s t Generate work;
[0442] S713. Construct the following formula for the probability of system state transition after taking an action in the current state:
[0443] T(s t+1 |s t ,a t )=P(s t+1 |s t ,a t (7-7)
[0444] s in equation (7) t+1 The power flow calculation can be expressed as follows:
[0445] s t+1 =f(s) t ,a t )+∈ t (7-8)
[0446] In the formula, f(·) is the power flow equation of the distribution network, describing the relationship between power, voltage, and switching states; ∈ t It is random noise, representing external uncertainty;
[0447] S714. Construct the reward function for the distribution network from the dimensions of reliability, efficiency, and safety. The reward function is used to evaluate the agent's performance in state s. t Take action a t The immediate reward is as follows:
[0448] R(s t ,a t ,s t+1 )=w1·R1+w2·R2+w3·R3(7-9)
[0449] Where R1 is the voltage over-limit penalty term, as shown in equation (10); R2 is the line loss penalty term, as shown in equation (11); R3 is the comprehensive safety penalty term, as shown in equation (12); w1, w2, and w3 are weighting coefficients;
[0450]
[0451] In the formula, V i,t+1 Let V be the voltage magnitude of node i at time t+1. min and V max These are the lower and upper limits of the allowable voltage amplitude; This is an indicator function that takes the value 1 when the condition is true and 0 otherwise; N is the total number of nodes in the power grid.
[0452]
[0453] In the formula, P loss,j,t+1 Let be the power loss of line j at time t+1;
[0454]
[0455] In the formula, It is an indicator function; it returns 1 if the condition is true, and 0 otherwise. (C) voltage and C load These are penalty coefficients, representing the severity of voltage exceedance and line overload, respectively; ρ j,t+1 The load factor of line j at time t+1 is defined as follows: Among them, S j,t+1 Let j be the actual apparent power of line j at time t+1. For its maximum permissible apparent power; when ρ j,t+1 If ρ > 1, the line is overloaded; if ρ j,t+1 If ≤1, the line is within the safe operating range; ρ max This represents the maximum allowable load rate of the line.
[0456] S72. Constructing a security constraint condition that satisfies the distribution network through security policy embedding. To ensure that the agent always meets the security constraint condition of the distribution network during the learning process, a security layer for power stability is constructed, which is implemented through security policy embedding. The specific construction method of the security layer includes:
[0457] (1) Define the loss function of the policy network as:
[0458]
[0459] (2) Introduce the constraint loss function as follows:
[0460]
[0461] (3) Introduce a constraint penalty term into the loss function of the policy network as follows:
[0462]
[0463] In the formula, For strategic losses, The constraint penalty term is λ, which is the penalty coefficient. The safety layer enables the agent to automatically satisfy the constraints during the learning process.
[0464] S73. A Dynamic Graph Convolutional Network (GCN) is used to encode the state characteristics of the distribution network. The specific implementation steps are as follows:
[0465] (1) Model the distribution network as a graph G = (V, E), where V is the set of nodes, representing the bus or load in the distribution network; and E is the set of edges, representing the lines in the distribution network.
[0466] (2) The Graph Convolutional Neural Network (GCN) aggregates information from neighboring nodes through a message passing mechanism, and gradually updates the representations of nodes and edges, as shown in the following equation:
[0467]
[0468] In the formula, It is an adjacency matrix with self-loops added. yes The degree matrix, H (l) W is the feature matrix of the nodes in the l-th layer. (l) Let be the learnable weight matrix of the l-th layer, and σ(·) be the ReLU activation function. The loss function is used as the policy objective function when training the GCN model. After encoding the features, they are input into the action function to generate the policy.
[0469] S74. Construct a parameterized policy function using a deep neural network. The specific implementation steps are as follows:
[0470] The policy function is used to output the state s. t The selected action distribution is parameterized using a deep neural network as follows:
[0471] π(a t |s t ;θ π (7-17)
[0472] In the formula, θ π These are the learnable parameters of the policy network, including:
[0473] (1) In the input layer, state s t Input into the policy network;
[0474] (2) Use a multilayer perceptron in the hidden layer to extract high-order features of the power distribution network; use a graph convolutional neural network layer to aggregate neighborhood information and improve the expressive power of topological features;
[0475] (3) Output the motion distribution π(a) at the output layer. t |s t The results are mapped to the action space using the Softmax or Sigmoid function;
[0476] (4) The training objective of the policy network is to maximize the cumulative reward, as shown in the following formula:
[0477]
[0478] In the formula, J(θ) π (This refers to cumulative discount rewards.)
[0479] S75. Construct a multi-objective value function to evaluate the current state s. t Take action a t Long-term returns. The specific implementation steps are as follows:
[0480] State value V(s) estimated using a dual-network structure t ) and state-action value Q(s) t ,a t ),include:
[0481] (1) Input the current state s in the input layer. t ;
[0482] (2) Use a deep neural network in the hidden layer to extract state features;
[0483] (3) A state-valued function network V(s) is used in the output layer. t The state-action value function network Q(s) represents the long-term value of a state. t ,a t ) indicates that in state s t Take action a t The long-term value after;
[0484] (4) Using neural networks to model the state-value function network V(s) t ) and state-action value function network Q(s t ,a t The state-value function network loss is as follows:
[0485]
[0486] In the formula, V(s) t,i R represents the output of the value network. t,i For the true reward; the state-action value function network loss is as follows:
[0487]
[0488] In the formula, y t,i =r t +γ·Q(s t+1 ,a t+1 ), r t Q(s) represents the immediate reward the agent receives at the current time t, where γ is the discount factor, with a value ranging from 0 ≤ γ ≤ 1; t+1 ,a t+1Let t+1 be the state-action value calculated by the target network at the next time step, representing the future reward; simultaneously train the state-value function and the state-action value function, and combine the two parts of the loss as follows:
[0489]
[0490] in, This represents the total loss of the state-value function and the state-action-value function.
[0491] S76. Multi-agent collaborative training and optimization, after the objective function converges, the agents output a safe distribution network reconfiguration topology. This includes the following steps:
[0492] S761. In the distribution network topology reconfiguration problem, the sparsity of actions means that each reconfiguration only requires changing a small number of switch states. The sparse constraint is constructed as follows:
[0493] ||Δφ t ||0≤κ (7-22)
[0494] In the formula, ||·||0 represents the zero norm, and κ is a constraint parameter that controls the sparsity of the actions;
[0495] S762. During policy gradient optimization, sparse constraints are embedded into the loss function of the policy network as regularization terms, and the optimization objective is updated as follows:
[0496]
[0497] In the formula, λ is the sparsity regularization parameter, which controls the impact of sparsity constraints on the loss;
[0498] S763. To efficiently solve the above optimization problem, a sparse gradient sampling optimization strategy is used, including:
[0499] (1) Based on the output probability π(a) of the policy network t |s t ), select the top κ action components with the highest probabilities, and construct a sparse action candidate set. As shown in the following formula:
[0500]
[0501] In the formula, Top-κ(·) represents taking the first κ maximum values;
[0502] (2) In the action candidate set Sparse action sampling is performed, and the sampling probability is normalized as follows:
[0503]
[0504] In the formula, It is an indicator function used to filter sparse actions;
[0505] (3) The policy gradient is updated using the sparse action distribution as follows:
[0506]
[0507] S764. During training, dynamically adjust the sparsity parameter κ to adapt it to the system's operating state. The adjustment rule is as follows:
[0508] κ=min(κ max ,max(κ min ,κ0+η·t))(7-27)
[0509] In the formula, κ0 is the initial sparsity, η is the sparsity adjustment coefficient, and t is the current training round number;
[0510] S765, First from the experience replay buffer Sampling a batch of data (s) t ,a t ,r t ,s t+1 The process involves using a sparse action sampling strategy to filter the sampled data to obtain a sparse action distribution; then, based on the sparse action distribution, calculating the policy gradient and updating the parameters of the policy network; simultaneously, updating the parameters of the value network through iteration of the value function; finally, dynamically adjusting the policy according to the sparsity, and after multiple iterations, bringing the objective function to convergence.
[0511] Example 9
[0512] This embodiment provides an optimal first-order frequency control method based on reinforcement learning, as described in Embodiment 1. Figure 16 As shown, the specific implementation steps include:
[0513] S81. Establish a dynamic model of the power system, including the inertia and damping characteristic model of traditional generators, the dynamic behavior model of inverter foundation resources, and the model of the impact of load changes on system frequency. The specific implementation process is as follows:
[0514] S811. Construct the inertia and damping characteristic model of a traditional generator as follows:
[0515]
[0516] Where Δf is the frequency deviation, M is the system's inertial constant, and ΔP m It is the increase in the mechanical power of the generator, ΔP e It is the electrical power increment of the system, and D is the damping coefficient;
[0517] S812, The dynamic behavior model of the inverter's basic resources is constructed as follows:
[0518]
[0519] Where τ is the time constant of the inverter, and u is the control input signal generated by the frequency controller;
[0520] S813. Construct the model of the impact of load changes on system frequency as follows:
[0521]
[0522] In power systems, load changes directly affect system frequency. When the load increases, the system's electrical power demand rises. If generation power is not balanced in time, the system frequency will decrease; conversely, if the load decreases, the system frequency will increase. The impact of load changes on system frequency can be described by the following formula:
[0523]
[0524] Where, ΔP L It is the change in load power.
[0525] In practical systems, load variations are usually correlated with the system frequency. This can be expressed using the load frequency characteristic coefficient D. L To describe the load's response to frequency changes:
[0526] ΔP L =D L Δf (8-2) Among them, D L Δf is the load frequency characteristic coefficient, representing the load's sensitivity to frequency changes; Δf is the frequency deviation. Substituting equation (2) into equation (8-1) and rearranging, we can obtain...
[0527]
[0528] This indicates that the system's equivalent damping coefficient is determined by D and D0. L Together, they determine the load frequency characteristic D L The larger the value, the stronger the system's ability to adapt to load changes and the smaller the frequency deviation.
[0529] S82. Based on deep reinforcement learning algorithms, a frequency control strategy is designed; and the system frequency deviation is used as a reward signal to train the control strategy through interaction with the power system. The specific implementation process is as follows:
[0530] S821. Model the reinforcement learning problem as a Markov decision process, whose elements are: states s constructed from system frequency deviation and inverter power increment. t =[Δf t,ΔP e Action a constructed from control input signals t =u; the reward function constructed from frequency deviation and control cost. Where α is a weighting factor used to balance frequency deviation and control power cost; by optimizing the strategy π(a t |s t Maximize cumulative discount rewards:
[0531]
[0532] Where γ∈[0,1] is the discount factor;
[0533] S822. A recurrent neural network (RNN) is used to model the time coupling characteristics and capture the dynamic time series characteristics of frequency changes; the RNN hidden state update equation is:
[0534] h t =f(h) t-1 ,s t ;θ)
[0535] Among them, h t Let f be the current hidden state, f be the activation function of the RNN, and θ be the RNN parameters;
[0536] S823, The output layer of a recurrent neural network (RNN) generates a control signal u as follows:
[0537] u = W0h t +b0
[0538] Where W0 and b0 are the weights and biases of the output layer, respectively, and u is the control input signal of the frequency controller.
[0539] S83. Introduce Lyapunov function stability constraints into the reinforcement learning algorithm. This ensures that the learned frequency control strategy not only optimizes performance metrics but also satisfies system stability requirements. The specific implementation process is as follows:
[0540] Introducing the Lyapunov function V(s) t ), defined as follows:
[0541]
[0542] The stability condition for Lyapunov functions is as follows:
[0543]
[0544] Combining the inertia and damping characteristic model of a traditional generator, stability constraints are obtained:
[0545]
[0546] The above conditions are introduced into reinforcement learning training as constraints to ensure the stability of the frequency control strategy.
[0547] S84. A neural network is used for parameterized design of the controller, leveraging its nonlinear fitting capability to improve the response accuracy to complex frequency dynamics. The specific implementation process is as follows:
[0548] The controller uses a neural network parameterization form, as shown in the following equation:
[0549] u = π θ (s t )
[0550] Where, π θ It is a policy network that optimizes parameters θ through deep learning; the input to the neural network is the current state s. t The output is a control signal u;
[0551] Define the loss function L(θ) that minimizes the training objective of the neural network as:
[0552]
[0553] Here, λ is a penalty factor used to balance performance optimization and stability constraints.
[0554] S85. Discretize the frequency dynamic equations and propose a multi-node collaborative optimization objective; deploy the trained control strategy to the actual power system, and adjust the control parameters in real time through online optimization technology to adapt to the dynamic changes in the system's operating state. The specific implementation process is as follows:
[0555] S851. The continuous-time form of the frequency dynamic equation is as follows:
[0556]
[0557] Where, ω i Let f(ω) be the frequency deviation of the i-th generator. i ,u i This describes the dynamic change of frequency, u i It is the control input of the i-th generator;
[0558] Discretizing the frequency dynamic equation yields:
[0559] ω i (k)=ω i (k-1)+Δt·f(ω i (k-1),u i (k-1))
[0560] Where, ω i(k) represents the frequency deviation of the i-th generator, and Δt is the discrete time step;
[0561] S852. In discrete time, the objective of multi-node collaborative optimization is as follows:
[0562]
[0563] Where, ||ω i || ∞ The maximum value of the frequency deviation is used to measure the frequency control performance, ∑ k u i (k) 2 The sum of squares of the control signals is used to measure the overall control energy consumption of the system.
[0564] S853. Deploy the trained controller to the power system and further enhance its performance using real-time optimization techniques:
[0565] u t =π θ (s t )+Δu
[0566] Where Δu is the fine-tuning amount for real-time optimization, calculated using the fast gradient descent method, as shown in the following equation:
[0567]
[0568] Where η is the learning rate.
[0569] Example 10
[0570] like Figure 17 As shown, the secondary voltage control method for islanded microgrids provided by this invention includes the following basic steps:
[0571] S1. Establish a large-signal state-space model for secondary voltage control of an islanded microgrid based on an inverter;
[0572] In this embodiment, in the method for establishing a large-signal model of the state space for secondary voltage control of an islanded microgrid based on an inverter, the large-signal model of the i-th distributed generation unit in the islanded microgrid at time t is established as follows:
[0573]
[0574] Where i represents the sequence number of the distributed generation unit in the islanded microgrid, t represents time, and x i (t) represents the state of the i-th distributed generation unit in the islanded microgrid at time t. x represents i The derivative of (t), f i (x i(t)), g i (x i (t) represents the two state matrices of the large-signal model of the i-th distributed generation unit in the islanded microgrid at time t, u i (t) represents the voltage control input of the i-th distributed generation unit in the islanded microgrid at time t, y i (t) represents the output of the i-th distributed generation unit in the islanded microgrid at time t, v odi (t) represents the output voltage of the i-th distributed generation unit in the islanded microgrid at time t, h i (x i (t) is the state matrix of the output voltage of the large-signal model of the i-th distributed generation unit in the islanded microgrid at time t.
[0575] S2. The voltage control input is obtained by linearizing the input-output feedback of the large-signal model of the secondary voltage control state space of the islanded microgrid.
[0576] In this embodiment, the voltage control input is obtained by linearizing the input-output feedback of the large-signal model of the secondary voltage control state space of the islanded microgrid.
[0577]
[0578] In equation (9-2), For v odi The second derivative of (t), h i (x i (t)) along f i (x i The Lie derivative in the direction of (t)) and express Along f i (x i The Lie derivative in the direction of (t)) and express Along f i (x i The Lie derivative in the direction of (t)) and
[0579] S3. Calculate the deviation of the i-th distributed generation unit from the output voltage value received from the neighboring distributed generation unit at time t, and obtain the voltage deviation of the i-th distributed generation unit at time t and its derivative.
[0580] In this embodiment, the deviation of the i-th distributed generation unit from the output voltage value received from its neighboring distributed generation units is calculated, and the voltage deviation of the i-th distributed generation unit at time t and its derivative are obtained as follows:
[0581]
[0582] Where j represents the sequence number of another distributed generation unit in the islanded microgrid, i ≠ j, b i (t) represents the voltage pin gain of the i-th distributed generation unit in the islanded microgrid at time t, when b i When (t) = 1, it means that the i-th distributed generation unit of the islanded microgrid can obtain the voltage reference value at time t. When b i (t) = 0, indicating that the i-th distributed generation unit of the islanded microgrid cannot obtain a voltage reference value at time t, N i Let v represent the set of neighboring distributed generation units of the i-th distributed generation unit. ref (t) represents the voltage reference value of the i-th distributed generation unit in the islanded microgrid at time t.
[0583] S4. Design inequality boundary constraints according to specific transient performance requirements;
[0584] In this embodiment, the inequality boundary constraints are designed according to specific transient performance requirements as follows;
[0585]
[0586] In the formula, ρ i (t) is a positive and strictly decreasing function, ρ0, ρ ∞ All are positive integers, and satisfy ρ0>ρ ∞ κ is a constant that determines the convergence rate of the transient response, and t0 is the time during which the secondary voltage control action of the system is applied.
[0587] S5. Apply inequality boundary constraints to the consistency error of the i-th distributed generation unit in the islanded microgrid at time t.
[0588] In this embodiment, the specific process of applying inequality boundary constraints to the consistency error of the i-th distributed generation unit in the islanded microgrid at time t is as follows:
[0589]
[0590] S6. Use an error transformation function to transform the constrained consistency error of the i-th distributed generation unit into an unconstrained consistency error.
[0591] In this embodiment, the specific process of converting the constrained consistency error of the i-th distributed generation unit into an unconstrained consistency error using an error transformation function is as follows:
[0592] Introduce the following error transformation function:
[0593]
[0594] In the formula, S i (ε i )satisfy make
[0595] For S i (ε i Perform an inverse transformation to obtain the transformed unconstrained consistency error:
[0596]
[0597] S7. Construct the sliding mode surface based on the exponential reaching law for the i-th distributed generation unit of the islanded microgrid at time t.
[0598] In this embodiment, the specific process of converting the constrained consistency error of the i-th distributed generation unit into an unconstrained consistency error using an error transformation function is as follows:
[0599] Introduce the following error transformation function:
[0600]
[0601] In the formula, S i (ε i )satisfy make
[0602] For S i (ε i Perform an inverse transformation to obtain the transformed unconstrained consistency error:
[0603]
[0604] S8. Substitute the unconstrained consistency error of the i-th distributed generation unit into the sliding mode surface, calculate the auxiliary control input, and control the output voltage of the i-th distributed generation unit in the islanded microgrid to follow the voltage reference value so as to stabilize the microgrid.
[0605] In this embodiment, the unconstrained consistency error of the i-th distributed generation unit is substituted into the sliding mode surface to calculate the auxiliary control input. To stabilize the microgrid, the output voltage of the i-th distributed generation unit in the islanded microgrid is controlled to follow the voltage reference value, specifically as follows:
[0606] Differentiating equation (9-7) yields:
[0607]
[0608] In the formula,
[0609] To make the sliding surface approach 0, the following formula applies:
[0610]
[0611] Further obtain the auxiliary control input
[0612]
[0613] In the formula, a ij =1 indicates that there is communication between the i-th distributed generation unit and the j-th distributed generation unit; otherwise, a ij =0 indicates that there is no communication between the i-th distributed generation unit and the j-th distributed generation unit, and the voltage control input u is 0. i Under the action of (t), the sliding surface s of the i-th distributed generation unit of the islanded microgrid at time t is constructed. i (t) approaches 0, i.e., the voltage deviation e i (t) and its derivative The voltage v of the i-th distributed generation unit approaches 0, thus achieving the desired output voltage v. odi (t) Follows the voltage reference value v ref (t).
[0614] In this embodiment, inequality constraints are applied to the consistency error, so that the original system state error is limited to the specified inequality constraint boundary range, that is, the specified performance constraints are met. At the same time, in order to avoid the inequality constraints being substituted into the computational complexity of the controller design, an error transformation function is used to convert the constrained error into an "unconstrained error".
[0615] By incorporating the transformed "unconstrained" error into the design of the sliding mode controller, transient performance is considered on the basis of the original sliding mode control, that is, the control response is faster and the overshoot is smaller.
[0616] (1) This invention effectively reduces the reliance on high-cost synchronous phasor measurement units (PMUs) by using only smart meters and a small number of synchronous measurement devices (SMDs). This not only reduces equipment installation and maintenance costs but also allows the method to be widely applied in power distribution systems, achieving real-time, high-precision topology estimation and parameter identification even with limited measurement resources. This invention utilizes graph convolutional neural networks (GCNs) and stochastic gradient descent (SGD) to optimize the placement of the SMDs. By introducing regularization terms and a loss function, the positions of the SMDs can be dynamically adjusted with a minimum number of measurement devices, ensuring the accuracy and stability of topology estimation and parameter identification. This invention employs a deep neural network model based on graph neural networks (GNNs) and fully connected networks, significantly improving the accuracy of power distribution network topology identification.
[0617] (2) This invention can utilize existing smart meter devices to infer the topology and line parameters of low-voltage distribution networks. This avoids the high cost of deploying additional sensors for each node, while improving the system's versatility and operability. Traditional deep learning methods cannot effectively capture the relationship between the energy parameters of observable nodes and the impedance distance intersection matrix R,X, making it difficult to accurately estimate the values of the R and X matrices, and may produce solutions inconsistent with physical laws. This invention uses PINN to estimate the impedance distance intersection matrix, fully combining the nonlinear relationship of energy data between observable nodes and considering the physical characteristics of the underlying distribution network, providing an accurate impedance distance matrix for subsequent iterative grouping algorithms.
[0618] (3) This invention performs microgrid stability analysis based on the Lyapunov energy function of a neural network. It aims to construct a verifiable analytical Lyapunov function by combining deep learning and symbolic regression techniques, thereby efficiently and accurately analyzing and ensuring the stability of the microgrid system. This method models the dynamics of the microgrid system using a neural network, outputs the Lyapunov function, and uses symbolic regression to transform the neural network output into an analytical mathematical expression. This invention verifies the stability conditions and generates counterexamples for training, ensuring that the Lyapunov function meets global stability requirements, thus providing a stability guarantee for the microgrid control system. The method of this invention can be extended to high-dimensional networked microgrid systems, exhibiting good scalability and adaptability.
[0619] (4) This invention designs a loss function that satisfies the Zuboff condition and boundary conditions. Through neural network training, the Zuboff equation of the system can be effectively solved, and the Lyapunov function can be derived from it. Compared with the prior art, which can only provide an approximate boundary of the attraction domain, this invention can accurately calculate the exact boundary of the system's attraction domain, enabling accurate and stable evaluation in complex systems. By combining the powerful representational capabilities of neural networks, this invention enables the Zuboff equation to handle high-dimensional microgrid systems involving a large number of subsystems. When the system faces a topology switch, this invention further verifies the solution of the Zuboff equation to ensure that the system can still maintain a stable operating state under the new topology configuration after the switch. The construction of the Lyapunov function in this invention can ensure the stability analysis of the system, thereby providing a theoretical basis for the dynamic behavior of the system.
[0620] (5) This invention designs a neural network controller for power systems based on Lyapunov control theory. This addresses the challenges of nonlinear characteristics and high dimensionality in power systems while maintaining high power transmission efficiency, ensuring real-time transmission performance and stability, and meeting the needs of power systems. This invention constructs a dynamic model of the power system to which the controller is applicable; uses a Lyapunov function represented by a neural network to represent the system's energy or stability metrics; employs a neural network control input strategy; sets verification conditions for the Lyapunov conditions; and obtains the optimal control strategy and Lyapunov function through optimization operations, thereby achieving stable control of the power system. This invention enables efficient, low-cost, and easy-to-use stable control of power systems. Compared to traditional control methods, such as linear quadratic regulators (LQRs), this invention has stronger nonlinear processing capabilities.
[0621] (6) This invention utilizes a Long Short-Term Memory (LSTM) network to capture trend features in photovoltaic time series and generate key future feature information. These features are integrated into the agent's observation space, enhancing its ability to perceive future changes in the system, thereby improving the accuracy and adaptability of the agent's control strategy in response to photovoltaic fluctuations. This invention introduces a Weighted Graph Convolutional Network (WGCN) to efficiently extract the topological structure and correlation characteristics between agents. By constructing a weighted adjacency matrix based on the number of hops in the topological connections, WGCN can more accurately capture the direct relationships and potential correlations between agents. This design allows each agent to indirectly acquire the perception of the global environment even when relying solely on local observations, significantly improving the training efficiency of the decentralized framework.
[0622] (7) This invention presents a distribution network reconfiguration method based on multi-agent security reinforcement learning. By introducing security constraints and optimization algorithms, it improves the stability and operational efficiency of the distribution network while ensuring the safety of the power system. Furthermore, it can adjust the distribution network topology in real time, avoiding voltage exceedances and overload problems, and enhancing the system's adaptability to sudden situations. This invention employs a multi-agent reinforcement learning model, which can adaptively adjust the distribution network topology based on factors such as load fluctuations and changes in renewable energy output in dynamic environments, thereby improving the robustness and reliability of the system. In addition, the algorithm encodes the distribution network state through a graph convolutional network, making topology modeling more efficient and the optimization process response faster.
[0623] (8) This invention utilizes a reinforcement learning framework, combined with the dynamic characteristics of a recurrent neural network (RNN) modeling system, to achieve adaptive optimization of the control strategy without relying on the precise modeling of system parameters using traditional control methods. The reinforcement learning strategy can continuously improve during training, adapting to complex scenarios with different load conditions and high-proportion renewable energy penetration. Combined with the RNN design, this invention can effectively capture the time-series characteristics of dynamic frequency changes in the power system, improving the ability to model complex dynamic behaviors. Compared to traditional methods, RNNs can handle long-term dependencies, significantly improving the control effect on nonlinear systems. The introduction of Lyapunov function stability constraints in the control strategy design ensures that the system maintains frequency stability under any control strategy, avoiding the instability that may occur in traditional optimization methods.
[0624] (9) This invention addresses the problem of voltage fluctuations inevitably caused by changes in external environmental conditions, load disturbances, and plug-and-play requirements during microgrid islanding operation. It proposes a secondary voltage control method for islanded microgrids based on specified performance constraints. By applying inequality constraints to the existing voltage tracking consistency error, the voltage tracking error is limited to a specified range, satisfying the performance constraints and preventing voltage fluctuations from exceeding expected values and affecting the system's power supply quality under external disturbances. Furthermore, to reduce computational complexity, an error transformation function is used to convert constrained errors into unconstrained errors, which are then substituted into the subsequent sliding mode controller design. This enhances the robustness of sliding mode control while improving the system's transient performance, effectively improving the secondary voltage control effect of the microgrid. This allows the microgrid system to meet steady-state performance requirements while enhancing its transient performance, achieving secondary voltage control of islanded microgrids with specified performance constraints. This invention solves the technical problem of voltage fluctuations during microgrid operation caused by changes in external environmental conditions, load disturbances, and plug-and-play requirements in the prior art.
[0625] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for modeling, reconfiguration, and stability control of distribution / microgrids, characterized in that, include: S1. Based on power parameter acquisition, the distribution / microgrid is modeled as an undirected graph model, and the impedance distance matrix is estimated using a physical information neural network. The network topology and line impedance parameters are jointly identified. S2. When the distribution / microgrid meets the preset conditions, a reconfiguration operation is triggered: The preset conditions include: a microgrid failure, or the microgrid being in an islanded operation state with unbalanced power; or voltage or current exceeding limits; or the fault duration exceeding a preset time threshold. Among them, a multi-agent reinforcement learning method is used for distribution / microgrid reconfiguration. The reconfiguration operation includes: constructing a Markov decision model with embedded safety policies; using a dynamic graph convolutional neural network to extract state features; and having the multi-agent output a reconfiguration topology scheme that satisfies electrical safety constraints. S3. Solve the Zubov equation based on a neural network or construct a Lyapunov function to perform stability analysis on the topology switching process. If the stability condition is not met, return to S2 and repeat the reconstruction operation until the new topology is in a stable state. S4. When the new topology is stable and in islanded operation mode, a distributed backstepping control strategy is used to perform secondary control on the distributed generation unit, so that the system converges within a predefined finite time and achieves synchronous stability of voltage and current.
2. A method for modeling, reconfiguring, and stabilizing distribution / microgrids based on claim 1, characterized in that, Identify the network topology and parameters of the distribution / microgrid power distribution system, including: Collect data from smart meter nodes installed in historical power distribution networks and construct a dataset; Using historical measurement data from smart meters, the admittance matrix is calculated, the network topology is derived, and the line parameters are initially estimated. Power grid topology modeling is based on graph convolutional network (GCN). Each power grid node is treated as a node in the graph, and power grid lines are treated as edges. The importance of each node is calculated through a message passing mechanism. Then, the parameters of the graph convolutional network (GCN) are iteratively optimized through the total loss function. The placement strategy of the measurement device (PMU) is obtained using the graph convolutional network (GCN). Based on optimizing the placement of the measurement device PMU nodes, the data from the measurement device PMU is used as the input to the GNN network to identify the network topology and parameters of the system in real time. The real-time current data collected by the PMU is used to identify whether the distribution network topology has changed; if it has changed, the parameters of the pre-trained graph neural network (GNN) are fine-tuned using transfer learning to adapt to the new topology and the parameters are re-identified.
3. The distribution / microgrid modeling, reconfiguration, and stability control method based on claim 1, characterized in that, Identify the network topology and parameters of the distribution / microgrid power distribution system, including: The power grid is abstracted into an undirected graph, and the power parameters of each observable node are collected to construct a dataset; A power flow calculation model with impedance distance intersection matrix as parameter is constructed, and a physical information neural network PINN with physical constraints is introduced to estimate the impedance distance intersection matrix, thereby obtaining the impedance distance matrix d; Based on the impedance distance matrix d, the concept of node level is introduced, and a hierarchical iterative grouping algorithm is used to jointly estimate the topology and line impedance of the power grid.
4. A method for modeling, reconfiguring, and stabilizing distribution / microgrids based on claim 1, characterized in that, Stability analysis of distribution / microgrids is performed based on the Lyapunov energy function of a neural network, including: Data from a microgrid system operating in an isolated state is collected, and noise is removed through filtering to obtain a clean status signal. Based on the denoised data, the dynamics of the micronetwork are modeled, a neural network is constructed and a Lyapunov function is output. The stability structure of the system is then fitted by training the neural network. Define and minimize the Lyapunov risk function to optimize the neural network model, and use symbolic regression to transform the network output into an analytical Lyapunov function to quantify its violation of the stability condition; Verify the stability condition of the Lyapunov function. If there are counterexamples, feed them back to the function for retraining to improve the global stability guarantee of the function. For high-dimensional islanded microgrid systems, a combined neural network Lyapunov function is used to model the state of each subsystem, learn and represent the interactive coupling relationship between subsystems, and realize model sharing and collaborative stability assessment.
5. The distribution / microgrid modeling, reconfiguration, and stability control method based on claim 1, characterized in that, Stability analysis based on the Zuboff equation using neural networks includes: For distribution / microgrid modeling, the Zuboff equation is introduced; The Zubov equations of the distribution / microgrid are solved using a multilayer feedforward neural network to obtain the Lyapunov function, and a loss function is designed and utilized. The multilayer feedforward neural network is trained and optimized. Calculate the value of the Lyapunov function () for the distribution / microgrid under different topology switching, calculate the boundary of the attraction domain, and determine the attraction domain of the distribution / microgrid; Stability analysis is performed on the distribution / microgrid under different topology configurations to control the distribution / microgrid to perform topology switching operations.
6. The distribution / microgrid modeling, reconfiguration, and stability control method based on claim 1, characterized in that, Based on Lyapunov control theory, a power system neural network controller for the distribution / microgrid is designed to achieve centralized control of the microgrid, including: Based on the state-space model of the power system, a centralized control strategy is used to associate state variables with control inputs through matrix equations to predict the future state of the system. The Lyapunov function is represented by a neural network, and the stability of the power system is verified by combining it with centralized control theory; Initialize the neural network controller and Lyapunov function, and optimize the optimal control strategy and Lyapunov function using the gradient descent optimization method to achieve global optimal control.
7. The distribution / microgrid modeling, reconfiguration, and stability control method based on claim 1, used in photovoltaic grid connection scenarios, is characterized in that... Acquire and fuse time-series and topology features to perform voltage control on the distribution network, including: The distribution network is modeled as a radial diagram, and a voltage control mathematical model is established for the distribution network containing photovoltaic penetration. The voltage control problem is formulated as a Markov decision problem; The temporal and topological characteristics of the system are processed using a Long Short-Term Memory (LSTM) network and a Weighted Graph Convolutional Network (WGCN). The agent in the above Markov decision problem is trained using the Deep Deterministic Policy Gradient (DDPG) algorithm based on reinforcement learning to obtain the optimal voltage control policy.
8. The distribution / microgrid modeling, reconfiguration, and stability control method based on claim 1, characterized in that, Based on a multi-agent security reinforcement learning method, the distribution / microgrid is reconstructed, including: Construct a Markov decision process under the demand state of power distribution network reconfiguration; Construct security constraints that satisfy the distribution network by embedding security strategies; Dynamic Graph Convolutional Network (GCN) is used to encode the state characteristics of the distribution network; A parameterized policy function is constructed using a deep neural network; Construct a multi-objective value function to evaluate the long-term rewards of taking actions in the current state; Multi-agent collaborative training and optimization enable the agent to output a safe power distribution network reconfiguration topology after the objective function converges. If the topology obtained in the current iteration satisfies the preset stability criterion, it is considered that the optimization has converged and the system structure adjustment is complete; otherwise, the topology that does not meet the conditions is hidden, and the iteration continues until the synergistic optimization of performance and stability is achieved.
9. The distribution / microgrid modeling, reconfiguration, and stability control method based on claim 1, characterized in that, Based on the aforementioned security reinforcement learning, optimal primary frequency control is performed on the distribution network, including: Establish a dynamic model of the power system, including the inertia and damping characteristic model of traditional generators, the dynamic behavior model of inverter basic resources, and the model of the impact of load changes on system frequency. A frequency control strategy is designed based on a deep reinforcement learning algorithm; and the system frequency deviation is used as a reward signal to train the control strategy through interaction with the power system. Introduce Lyapunov function stability constraints into reinforcement learning algorithms; The controller is parametrically designed using a neural network; The frequency dynamic equation is discretized, and a multi-node collaborative optimization objective is proposed. The trained control strategy is deployed to the actual power system, and the control parameters are adjusted in real time through online optimization technology to adapt to the dynamic changes in the system's operating state.
10. The distribution / microgrid modeling, reconfiguration, and stability control method based on claim 1, characterized in that, Secondary voltage control in microgrids based on hybrid distributed control includes: Establish a large-signal state-space model for secondary voltage control of an islanded microgrid based on an inverter; The input-output feedback linearization process is performed on the large-signal model of the secondary voltage control state space of the islanded microgrid to obtain the voltage control input; Calculate the deviation of the i-th distributed generation unit from the output voltage value of its neighboring distributed generation units at time t, and obtain the voltage deviation of the i-th distributed generation unit at time t and its derivative at time t. Design inequality boundary constraints based on preset transient performance requirements; Applying the inequality boundary constraint to the consistency error of the i-th distributed generation unit in the islanded microgrid at time t, we obtain the constrained consistency error. An error transformation function is used to transform the constrained consistency error of the i-th distributed generation unit into an unconstrained consistency error. For the i-th distributed generation unit of the islanded microgrid at time t, a sliding mode surface based on the exponential reaching law is constructed; The unconstrained consistency error of the i-th distributed generation unit is substituted into the sliding mode surface to calculate the auxiliary control input, and the output voltage of the i-th distributed generation unit is controlled to follow the voltage reference value to stabilize the microgrid.
11. A fault ride-through control method for a photovoltaic-storage microgrid system based on the distribution / microgrid modeling, reconfiguration, and stability control method described in claim 1, characterized in that: When a fault occurs in the distribution / microgrid, the grid-connected inverter is controlled to achieve fault ride-through, including: A system model of a photovoltaic-storage microgrid system is established, and the system model is set up with an inverter circuit after the DC bus and two DC / DC conversion circuits before the DC bus. Using the system model, it is determined whether a low-voltage ride-through occurs on the grid-connected side of the photovoltaic-storage microgrid system, and the voltage drop depth and photovoltaic power level are detected. Based on the voltage drop depth and the photovoltaic power level, different control strategies are selected for fault ride-through operations according to at least two different scenarios.
12. Distribution / microgrid modeling, reconfiguration, and stability control system, including: The real-time network topology and parameter identification module for power distribution systems is used to model the distribution / microgrid as an undirected graph model based on power parameter acquisition, use physical information neural networks to estimate the impedance distance matrix, and jointly identify the network topology and line impedance parameters. The distribution / microgrid reconfiguration module is used to trigger a reconfiguration operation when the distribution / microgrid meets preset conditions. The preset conditions include: a microgrid failure, or the microgrid being in an islanded operation state with unbalanced power; or voltage or current exceeding limits; or the fault duration exceeding a preset time threshold. The method employs a multi-agent reinforcement learning approach for distribution / microgrid reconfiguration. The reconfiguration operation includes: constructing a Markov decision model with embedded safety policies; extracting state features using a dynamic graph convolutional neural network; and outputting a reconfiguration topology scheme that satisfies electrical safety constraints by multiple agents. The distribution / microgrid reconfiguration module is connected to the real-time network topology and parameter identification module of the power distribution system. The topology stabilization module is used to solve the Zubov equation based on a neural network or construct a Lyapunov function to perform stability analysis on the topology switching process. If the stability condition is not met, the process returns to S2 and repeats the reconfiguration operation until the new topology is in a stable state. The topology stabilization module is connected to the distribution / microgrid reconfiguration module. The secondary control module is used to perform secondary control of the distributed generation unit using a distributed backstepping control strategy when the new topology is stable and in islanded operation mode, so that the system converges within a predefined finite time and achieves synchronous stability of voltage and current. The secondary control module is connected to the topology stabilization module.
13. A microgrid, characterized in that, The distribution / microgrid modeling, reconfiguration, and stability control method described in any one of claims 1 to 11 is adopted.
Citation Information
Patent Citations
Island micro-grid secondary control method based on switching topology
CN113972687A
Island microgrid secondary voltage control method based on disturbance observer
CN118630824A