Hybrid load flow calculation method and device based on cross entropy algorithm
Through the deep integration of cross-entropy algorithm, policy gradient algorithm and importance sampling, the contradiction between efficiency and accuracy of traditional power flow calculation methods in high-dimensional nonlinear problems is solved, and efficient, stable and robust power flow calculation of the power system is achieved, which adapts to the dynamic adjustment of new energy access.
Patent Information
- Application Number
- CN202510671299.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-09-09
AI Technical Summary
Traditional power flow calculation methods have problems such as low sampling efficiency, unstable parameter convergence, insufficient high-dimensional adaptability, and contradiction between sample efficiency and accuracy when dealing with high-dimensional nonlinear problems, random load fluctuations and distributed energy access. They are unable to meet the dynamic adjustment and robustness requirements of modern power systems.
A hybrid power flow calculation method based on the cross-entropy algorithm is adopted. Through system modeling and parameter initialization, it combines sample generation and elite screening guided by the entropy algorithm, optimization target design of the policy gradient algorithm, sample reuse and distribution fusion of importance sampling, dynamic feedback and real-time calibration to achieve collaborative processing of global and local optimization, dynamically adjust sample weights, prevent matrix singularity, and improve computational efficiency and accuracy.
It achieves efficient and robust optimization in high-dimensional and complex scenarios, shortens calculation time, improves the stability and accuracy of the power system, reduces the probability of voltage exceeding the limit and the risk of line overload, and improves the adaptability to fluctuations in renewable energy output and load.
Smart Images

Figure CN120613731A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of optimization algorithms and machine learning, and specifically relates to a hybrid power flow calculation method and device based on a cross entropy algorithm. Background Art
[0002] Traditional power flow calculation methods, such as the Newton-Raphson method and the PQ decomposition method (rapid decoupling algorithm), are widely used in power system steady-state analysis. However, their limitations are becoming increasingly apparent when dealing with high-dimensional nonlinear problems, random load fluctuations, and the integration of distributed energy resources. Existing technologies are insufficiently capable of quantifying the uncertainty of renewable energy output and load fluctuations, making it difficult to meet the dynamic adjustment and robustness requirements of modern power systems. The following are some of the specific problems they face:
[0003] 1. Low sampling efficiency:
[0004] Traditional cross-entropy methods rely on fixed distribution assumptions (such as a single Gaussian distribution). In high-dimensional systems, they require the generation of numerous redundant samples to meet accuracy requirements, significantly increasing computational time. For example, in a power grid with 1,000 nodes, traditional methods might require the generation of millions of samples, taking several hours and making it difficult to meet real-time requirements.
[0005] 2. Parameter convergence is unstable:
[0006] Fixed learning rates and static distribution models can easily cause algorithms to fall into local optima, leading to significant errors, especially in non-Gaussian and multi-peak distribution scenarios. For example, the actual power output of a wind power generation system over a specific time period typically follows a Weibull distribution (Weibull wind speed distribution), and load fluctuations can exhibit bimodal characteristics. Traditional single Gaussian models cannot accurately capture these complex distribution characteristics.
[0007] 3. Insufficient high-dimensional adaptability:
[0008] As the scale of grid nodes expands, traditional methods struggle to capture the complex correlations between variables, and the curse of sampling dimensionality becomes prominent. For example, in high-dimensional systems containing renewable energy, nonlinear coupling between variables can lead to singular covariance matrices, further exacerbating computational complexity.
[0009] 4. Contradiction between sample efficiency and accuracy:
[0010] The traditional cross entropy method requires a large number of samples in high-dimensional space, while the policy gradient method requires multiple iterations due to high variance, resulting in high computational cost.
[0011] Attempts to improve existing technologies include combining cross-entropy with policy gradients, which uses a cross-entropy algorithm to perform global search and then combines it with a policy gradient algorithm for local optimization. However, it still suffers from the problem of low sampling efficiency in high-dimensional nonlinear optimization problems; combining policy gradients with importance sampling, which improves the sample utilization of the policy gradient algorithm through importance sampling, but the combination of policy gradients and importance sampling focuses on local policy optimization and lacks the ability to dynamically explore the global probability distribution of the solution space; a multi-objective optimization framework, which combines multi-objective optimization with a cross-entropy algorithm to improve robustness to the uncertainty of renewable energy output and load fluctuations, but significantly increases computing resource consumption. It can be seen that none of the above methods systematically solves the problem of balancing efficiency and accuracy in high-dimensional complex scenarios. Therefore, there is an urgent need for a new optimization method that takes into account efficiency, robustness, and adaptability to meet the challenges of complex optimization problems. Summary of the Invention
[0012] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0013] A hybrid power flow calculation method based on a cross entropy algorithm includes:
[0014] Step 1: System modeling and parameter initialization: define the state space, action space and objective function according to the specific application scenario, and set and initialize the power grid parameters;
[0015] Step 2: Entropy algorithm-guided sample generation and elite screening: Optimize grid parameters through probability distribution iteration, quickly approach the global optimal solution, generate high-quality sample sets, and screen elite sample sets;
[0016] Step 3: Design and implement the optimization objectives of the policy gradient algorithm; based on the optimized grid parameters, design and build the policy gradient algorithm;
[0017] Step 4: Sample reuse and distribution fusion for importance sampling. By setting up a dual buffer mechanism consisting of an elite sample buffer and a new sample buffer, historical high-quality samples are dynamically integrated with new samples explored by the policy gradient algorithm. The fusion weight is calculated to select high-contribution samples. The integrated sample set provides high-quality input for subsequent parameter updates, and the proposed distribution parameters are adjusted based on the KL divergence.
[0018] Step 5: Parameter update and convergence judgment: Update the mean and covariance parameters of the Gaussian mixture model based on the elite sample set, and determine whether the optimization has converged by calculating the difference between the objective functions of adjacent iterations or judging the maximum number of iterations;
[0019] Step 6: Dynamic feedback and real-time calibration. Obtain the real-time operating parameters of the current power grid from the monitoring and data acquisition system or synchronized phasor measurement device. Compare the Gaussian mixture model parameters obtained after the iteration termination in the convergence judgment in step 5 with the real-time operating parameters. Calculate the voltage amplitude error and power imbalance deviation. Dynamically calibrate the importance weights of the elite samples in the cross entropy algorithm based on the voltage amplitude error and power imbalance deviation.
[0020] Step 7: Substitute the parameters obtained in step 6 into the power flow calculation equation to perform power flow calculation.
[0021] A hybrid power flow calculation device based on a cross entropy algorithm includes the following modules:
[0022] System modeling and parameter initialization module, which defines the state space, action space and objective function according to the specific application scenario, and sets and initializes the power grid parameters;
[0023] The sample generation and elite screening module guided by the entropy algorithm optimizes the grid parameters through probability distribution iteration, quickly approaches the global optimal solution, generates high-quality sample sets, and screens elite sample sets;
[0024] The optimization target design and implementation module of the policy gradient algorithm designs and builds the policy gradient algorithm based on the optimized power grid parameters;
[0025] The sample reuse and distribution fusion module of importance sampling dynamically fuses historical high-quality samples with new samples explored by the policy gradient algorithm by setting up a dual buffer mechanism consisting of an elite sample buffer and a new sample buffer. It calculates the fusion weights and selects high-contribution samples. The fused sample set provides high-quality input for subsequent parameter updates and adjusts the proposed distribution parameters based on the KL divergence.
[0026] The parameter update and convergence judgment module updates the mean and covariance parameters of the Gaussian mixture model based on the elite sample set, and determines whether the optimization has converged by calculating the difference between the objective functions of adjacent iterations or determining the maximum number of iterations;
[0027] The dynamic feedback and real-time calibration module obtains the real-time operating parameters of the current power grid from the monitoring and data acquisition system or synchronized phasor measurement device, compares the Gaussian mixture model parameters obtained after the iteration termination in the convergence judgment in step 5 with the real-time operating parameters, calculates the voltage amplitude error and power imbalance deviation, and dynamically calibrates the importance weights of the elite samples in the cross entropy algorithm based on the voltage amplitude error and power imbalance deviation;
[0028] The power flow calculation module substitutes the parameters obtained in step 6 into the power flow calculation equation to perform power flow calculation.
[0029] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the hybrid power flow calculation method based on the cross entropy algorithm are implemented.
[0030] A non-transitory computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the hybrid power flow calculation method based on the cross entropy algorithm.
[0031] The present invention has the following beneficial effects:
[0032] The optimization method proposed in this paper, which is based on the collaborative processing of the cross-entropy algorithm (CE), the policy gradient algorithm, and the importance sampling method (Cross-Entropy Method-Policy Gradient Method-Importance Sampling Method), has achieved significant breakthroughs in computational efficiency, optimization accuracy, robustness, and engineering practicality through the deep integration and dynamic coordination mechanism of these three types of algorithms. The specific effects are as follows:
[0033] (1) Collaborative optimization mechanism: The present invention uses the cross entropy algorithm to perform global search, the policy gradient algorithm to perform local optimization, and the importance sampling method to improve sample utilization, thereby achieving collaborative processing of global and local optimization. Specifically, the cross entropy algorithm generates an initial solution through importance sampling, the policy gradient algorithm performs local optimization on this basis, and the importance sampling method dynamically adjusts the sampling distribution to ensure that the sample contribution in the high-probability area is higher. Among them, the cross entropy method guides policy exploration: the cross entropy algorithm is used to optimize the importance distribution, generate a high-quality sample set, and guide the policy gradient update direction; the policy gradient method optimizes the target distribution: the importance distribution parameters are adjusted through the policy gradient to make it close to the expected distribution of the optimal strategy; the importance sampling method improves sample reuse: the historical samples are re-weighted based on the importance weight, repeated sampling is reduced, and the sample utilization rate is improved.
[0034] (2) Dynamic Sampling Strategy: This paper introduces a dynamically adjusted importance distribution function, optimizes sample weight distribution based on KL divergence (relative entropy), and combines it with an elite sample feedback mechanism to reduce invalid sampling. By calculating the KL divergence between the target distribution and the importance distribution in real time and dynamically adjusting the sample weights, the sampling process is concentrated in high-probability areas, improving sample utilization in high-dimensional space.
[0035] (3) Parameter Adaptive Update Mechanism: This paper designs a learning rate adaptive adjustment rule based on gradient information and historical iteration data to accelerate convergence and avoid local optimality. At the same time, a covariance shrinkage strategy is introduced to add a regularization term to the high-dimensional covariance matrix to prevent matrix singularity and improve the stability of parameter estimation. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1Flowchart of the hybrid power flow calculation method based on the cross entropy algorithm of the present invention;
[0037] Figure 2 This is the interactive logic diagram of the cross entropy algorithm, policy gradient algorithm and importance sampling method. DETAILED DESCRIPTION
[0038] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only intended to illustrate the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
[0039] like Figure 1 As shown, the hybrid power flow calculation method based on the cross entropy algorithm of the present invention includes:
[0040] Step 1: System modeling and parameter initialization, including: defining the state space, action space and objective function according to the specific application scenario, setting and initializing the grid parameters, and providing the basic framework and initial parameters for subsequent steps. Specifically including:
[0041] Step 1.1, Parameter definition: Based on the specific application scenario (such as power dispatch), define the following elements:
[0042] (1) State space (variables used to describe the current state of the system): grid node voltage V, generator output P, and reactive power load demand Q consumed by users or equipment at each node;
[0043] (2) Action space (executable decision variables): generator output adjustment ΔP, reactive power compensation device switching instructions;
[0044] (3) Objective function (function that quantifies the optimization objective): Minimize the voltage over-limit probability and line overload risk, expressed as:
[0045] ;
[0046] in, is the objective function, N is the dimension of voltage-related variables (number of nodes), is the voltage amplitude at node i, is the nominal voltage, is the voltage threshold, is the weight coefficient, is the dimension of the power-related variable (number of lines or devices), is the active power of line k, The upper limit of the power capacity of the line or equipment.
[0047] Step 1.2, grid parameter setting and initialization:
[0048] (1) Cross entropy method parameters: Gaussian mixture model (GMM) component number K=3, sample number , elite sample ratio ; Initial mean and covariance Set based on prior knowledge or uniform distribution;
[0049] (2) Policy gradient method parameters: The policy network is a 3-layer or 4-layer fully connected network (50-dimensional input layer, 1 or 2 64-dimensional hidden layers according to different situations, and 20-dimensional output layer), the initial learning rate , entropy regularization coefficient ;
[0050] (3) Importance sampling parameters: dynamic fusion coefficient The entropy regularization coefficient decays linearly from the initial value of 0.7 to 0.3 with the number of iterations. , convergence threshold =10 -5 , maximum number of iterations .
[0051] Step 2: Sample generation and elite screening guided by entropy algorithm: Optimize grid parameters through probability distribution iteration, quickly approach the global optimal solution, generate high-quality sample sets, and screen elite sample sets for subsequent optimization. Specifically, it includes:
[0052] Step 2.1, generate the initial sample set;
[0053] According to the current importance probability distribution function The probability distribution of the current system state (such as the joint distribution of node voltage and line power) is modeled by the Gaussian mixture model (GMM). The generated samples are more concentrated in areas that may affect the safety or economy of the system (such as high-risk areas of voltage exceeding the limit or line overload). The sample set is generated. ,in, is the sample size, Indicates the state samples (such as the joint state of node voltage and line power), is the sample serial number. For example:
[0054] (1) In path planning, generate Random paths;
[0055] (2) In power dispatching, generate The combination of generator output P and load demand.
[0056] Step 2.2, evaluate the samples and select the elite set;
[0057] (1) Calculate the objective function value of each sample (For example, path length and system risk index are essentially evaluation indicators of the objective function, used to quantify the quality of samples);
[0058] (2) Press Sort, before selection The samples of ; is the proportion of elite samples, For elite samples; Refers to the sum of the Gaussian components ( ) in proportion Select samples;
[0059] (3) Calculate the importance weight of elite samples :
[0060] ;
[0061] in, is the target distribution function, The proposed probability distribution density function in the sample The value at are the parameters of the proposed distribution, is the weight coefficient affected by KL divergence (relative entropy), is the KL divergence, which measures the target distribution With the proposed distribution The difference between For the The importance weight of each elite sample. It is used to dynamically adjust the contribution of elite samples in parameter updates, mainly to achieve two goals: first, through the ratio , compensate the target distribution With the proposed distribution The deviation between them ensures the unbiasedness of the sample expectation estimate; secondly, through the exponential term Penalty Proposal Distribution With target distribution The difference between the two, guiding the proposed distribution parameters Towards Get closer and improve sampling efficiency.
[0062] Step 3: Design and implement the optimization objectives of the policy gradient algorithm: Based on the optimized grid parameters, design and construct a policy gradient algorithm. This algorithm optimizes the grid operation strategy in real time to address the dual uncertainties of renewable energy output and load demand, ensuring stable operation and economic dispatch of the power system under random disturbances. Its role is to optimize the policy network parameters based on elite samples and improve local decision-making capabilities. Specifically, it includes:
[0063] Step 3.1, strategy update: Based on the elite sample set, use the policy gradient algorithm to optimize the policy network parameters . Specifically including:
[0064] Step 3.1.1, calculate the gradient:
[0065] ;
[0066] in, is the strategy parameter The expected gradient of is the expectation of the distribution g, is the policy function, To propose a distribution, are the parameters of the proposed distribution, is the gradient of the logarithmic policy, is the importance weight, is the cumulative reward function, which means that Discount accumulator for departures.
[0067] Step 3.1.2: Add entropy regularization to prevent the strategy from converging prematurely:
[0068] ;
[0069] in, and The current time step , time step The strategy parameters, is the learning rate (step size), is the regularization coefficient, which is used to balance the optimization of the objective function and the strength of the regularization constraint. is the gradient operator, which represents the policy parameters Gradient operation. , is the regularization loss term, where is the log probability of the strategy.
[0070] Step 3.2, dynamic learning rate adjustment: adjust the learning rate according to the KL divergence and gradient amplitude:
[0071] ;
[0072] in, is the dynamic learning rate at time step t, is the initial learning rate, is the adjustment coefficient, KL divergence is used to measure the two probability distributions and The difference between them is quantified by KL divergence to prevent policy mutation. Too large, learning rate It will be compressed exponentially, thus stabilizing the training. is the norm of the value function gradient, The parameters are The value function of .
[0073] Step 4: Sample reuse and distribution fusion for importance sampling: By setting up a dual buffer mechanism consisting of an elite sample buffer and a new sample buffer, historical high-quality samples are dynamically integrated with new samples explored by the policy gradient algorithm, and the fusion weights are calculated to screen high-contribution samples. The fused sample set provides high-quality input for subsequent parameter updates, and the proposed distribution parameters are adjusted based on the KL divergence to ensure that the sampling process is concentrated in high-probability areas, improving global search efficiency.
[0074] Importance sampling relies on the proposed distribution to generate samples, but its performance is affected by the choice of distribution. The policy gradient method optimizes the policy parameters , indirectly adjust the policy function , gradually approaching the target distribution (such as the distribution corresponding to the optimal power flow solution). The policy gradient algorithm optimizes the policy by maximizing cumulative rewards, while the importance sampling method leverages the optimized policy to generate higher-quality samples, forming a closed loop of "policy improvement-sampling optimization." This synergistic mechanism enables rapid convergence and stable control of power grid states in power flow calculations.
[0075] Step 4.1, setting up the double buffer mechanism, includes:
[0076] Elite Sample Buffer : Store elite samples generated by the cross entropy method;
[0077] New Sample Buffer : Stores new samples explored by the policy gradient method (such as paths generated by the random perturbation policy).
[0078] Step 4.2, sample fusion and reuse, includes:
[0079] (1) Calculate fusion weight:
[0080] ;
[0081] in, is the dynamic fusion coefficient, and its iteration number decays linearly from the initial value 0.7 to 0.3 with the iteration number. For the The weight of the samples, The probability density function of the target distribution in the sample The value at is the probability density function of the proposed distribution, is the probability density function of the strategy distribution, balancing the weights of the proposal distribution and the strategy distribution in the denominator, and its value range is [0, 1].
[0082] (2) Select high-weight samples from the double buffer (such as ) are added to the sample pool for the next iteration to reduce repeated sampling.
[0083] Step 5, parameter update and convergence judgment, updates the mean and covariance parameters of the Gaussian mixture model based on the elite sample set, and determines whether the optimization has converged by calculating the difference between adjacent iteration objective functions or judging the maximum number of iterations. Specifically:
[0084] Step 5.1, update the Gaussian mixture model (GMM) parameters;
[0085] Update the Gaussian mixture model (GMM) parameters based on the elite sample set, mean and covariance as follows:
[0086] ;
[0087] ;
[0088] in, is the posterior probability that the sample belongs to the k-th quantity, is the weight of the i-th sample, reflecting the importance of the sample in parameter updating, For samples Belong to The posterior probability (membership degree) of a Gaussian distribution, is the feature vector of the i-th sample, For the The mean of a Gaussian distribution, is the covariance regularization term, where is the regularization coefficient, is the identity matrix.
[0089] Step 5.2, convergence judgment: If the difference between the objective functions of adjacent iterations , or reach , terminate the iteration; otherwise, return to step 2 and enter the next round of collaborative optimization. is the objective function, and is the iteration parameter, is the absolute value of the objective function change, is the convergence threshold, used to determine whether the optimization has converged. Step 5 finally outputs the updated GMM parameters and the convergence status flag.
[0090] The interactive logic diagram of the three methods is as follows Figure 2 As shown in the figure, the cross entropy algorithm serves as the core optimization layer, responsible for global parameter optimization. It generates high-probability samples through iteration and screens out high-quality solution sets that meet the constraints of the power system. The policy gradient algorithm serves as the dynamic adjustment layer, receiving elite samples from the cross entropy and strengthening the exploration of key parameters by transmitting elite samples. The importance sampling method serves as the feedback optimization layer, returning the error information of the sampling results as feedback to the cross entropy module to adjust the probability distribution of the next round of parameter optimization.
[0091] Step 6: Dynamic feedback and real-time calibration: Get the real-time operating parameters of the current power grid (such as voltage amplitude) from the SCADA system (supervisory control and data acquisition system) or PMU (synchronized phasor measurement unit) , active power imbalance , reactive power unbalance Compare the power flow calculation results (Gaussian mixture model parameters) obtained after the iteration termination in the convergence judgment in step 5 with the real-time operation parameters to calculate the voltage amplitude error and power imbalance deviation. Dynamically calibrate the importance weight of the elite samples in the cross entropy algorithm based on the voltage amplitude error and power imbalance deviation. Obtain the importance weights of elite samples after dynamic calibration , forming a hybrid mode of "offline optimization-online calibration". The present invention can form an "optimization-calibration-feedback" closed loop, solving the problem of long-term error accumulation caused by parameter fixation in traditional methods.
[0092] Step 7: Substitute the parameters obtained in step 6 into the power flow calculation equation to perform power flow calculation. Specifically, the parameters in step 5 (including the modified Gaussian mixture model mean) are , covariance ) and the importance weight of the elite samples after dynamic calibration obtained in step 6 and real-time operating parameters (voltage amplitude , active and reactive power imbalance , ) into the power flow calculation equation to solve the node voltage distribution and line power flow. The specific process is as follows:
[0093] Step 7.1, data preprocessing;
[0094] Normalize the parameters after dynamic calibration to ensure numerical stability. As probability weights, weighted fusion of grid parameters (generator output) under multiple scenarios , reactive compensation ), generate the comprehensive operation state vector of each node . is the voltage amplitude at node i, is the voltage phase angle of node i, is the input active power of node i, is the input reactive power of node i, i is the target node number, and its value range is 1 to N, where N is the total number of system nodes.
[0095] Step 7.2, equation construction;
[0096] The node power balance equation adopts the improved Newton-Raphson method equation:
[0097] ;
[0098] in, is the input active power of node i, is the input reactive power of node i, is the conductance between nodes i and j, is the susceptance between nodes i and j, , is the voltage phase angle of node i, is the voltage phase angle at node j, is the voltage amplitude at node i, is the target node, For other nodes, is the total number of nodes, For nodes The voltage amplitude.
[0099] Step 7.3, parameter substitution and solution;
[0100] The integrated running state vector The voltage amplitude in , phase angle As the initial value, combined with real-time power data ( ) is the active power imbalance of node i, is the reactive power unbalance of node i, and the modified Jacobian matrix is solved iteratively:
[0101] ;
[0102] ;in, is the power deviation vector, To include and The Jacobian matrix of the partial derivatives, The voltage phase angle and amplitude correction value is obtained by iteratively solving the Jacobian matrix to obtain the node voltage distribution . Updated by Newton iteration method , until the power deviation vector meets the convergence condition , is the convergence threshold. After the iteration converges, the line power flow can be calculated based on the node voltage and admittance:
[0103] ;
[0104] in, is the line active power, is the line reactive power, Number the line.
[0105] Step 7.4, result output;
[0106] The output includes the voltage amplitude of each node , phase angle , Line active power , reactive power The results of the current calculations.
[0107] The following is iterative optimization and result analysis:
[0108] 1. Description of iterative results:
[0109] (1) Convergence speed: The cross-entropy method-policy gradient method-importance sampling method converges after 30 iterations (objective function value J = 0.12), while the traditional cross-entropy method requires 60 iterations (objective function value J = 0.15);
[0110] (2) Stability: The fluctuation amplitude of the convergence curve of the cross-entropy method-policy gradient method-importance sampling method is reduced by 70%, indicating that the dynamic learning rate and entropy regularization effectively suppress oscillations.
[0111] 2. Performance quantitative indicators:
[0112] (1) Computational efficiency: The time required for a single iteration is reduced from 42 minutes for the traditional cross-entropy method to 18 minutes (accelerated by GPU);
[0113] (2) Optimization accuracy: The voltage over-limit probability estimation error was reduced from 3.5% to 1.2%, and the line overload risk was reduced by 40%;
[0114] (3) Robustness: Under load data with 20% noise, the scheduling deviation only increases by 1.5% (8.2% for the traditional method).
[0115] The present invention is further described below by simulation in conjunction with specific applications of the embodiments of the present invention:
[0116] Data preprocessing and scenario construction:
[0117] 1. System transformation:
[0118] This embodiment uses the IEEE 118 node power system model (a standard test system for power system simulation) as a reference model. The reference model consists of three voltage levels: 138kV, 230kV, and 345kV, interconnected by transformers. The reference model is first connected to the new energy system, and then the abnormal data is injected.
[0119] New energy access: Five doubly-fed wind turbines are deployed at nodes 8, 19, 42, 76, and 104, with a single unit capacity of 10 MW each; four photovoltaic arrays are connected at nodes 15, 28, 50, and 89, with a single station capacity of 5 MW each, and the new energy penetration rate reaches 38%.
[0120] Abnormal data injection: simulates measurement noise (±5% Gaussian error) and 10% random abnormal data (such as sudden power changes and communication interruptions). Simulated measurement noise (±5% Gaussian error) is a Gaussian-distributed (normally distributed) random noise added to all measurement data (such as power, voltage, and current). The noise amplitude is ±5% of the true value. The 10% random abnormal data injects a more severe abnormality by randomly selecting 10% of the data points from all measurement data.
[0121] 2. Preprocessing process:
[0122] Data cleaning: Adaptive threshold filtering using the cross-entropy algorithm dynamically identifies abnormal data (e.g., samples with power mutations exceeding ±20%). A robust regression model is used to correct noisy data and restore the original distribution characteristics. The robust regression model can be the Huber loss function (a loss function commonly used in regression tasks, a combination of squared error loss and absolute error loss). Scenario clustering: K-means clustering (K-means is a classic unsupervised clustering algorithm widely used for pattern extraction) is performed on wind and solar power output (referring to the output power of wind power and photovoltaic power generation) and load fluctuation data (k=5) to extract typical operating modes. The differences between scenarios are quantified based on KL divergence, and redundant scenarios are eliminated (reduction rate 32%).
[0123] Cross entropy algorithm model construction:
[0124] 1. Probability distribution modeling:
[0125] Define the set of decision variables , including 118 node voltage amplitudes , phase angle and 9 new energy output .
[0126] Construct a mixture probability distribution:
[0127] ;
[0128] Among them, Beta distribution constrains the voltage amplitude (0.95~1.05 pu), and skewed Gaussian describes the asymmetric characteristics of wind and solar power output. Used to model node voltage amplitudes in power systems The probability distribution of the voltage is constrained to be within the safe range Inside, Description Output of distributed power sources (such as wind power generation, photovoltaic power generation) asymmetric probability characteristics. The voltage value of the i-th node obeys the Beta distribution. For the The shape parameter of the Beta distribution of the node voltage controls the distribution shape. For the The power output of each distributed generation unit obeys the skewed Gaussian distribution.
[0129] 2. Optimization mechanism:
[0130] Elite sample screening: The top 20% low-loss scenarios are retained in each iteration, and discrete variables (such as transformer tap step size) are optimized using a quantum rotating gate strategy.
[0131] Parameter Adaptive Update: Distribution Parameters Iterate according to the following rules:
[0132] ;
[0133] in, is the parameter value at time step t, is the parameter value after gradient update, the purpose is to optimize the objective function , is the learning rate, which controls the step size of parameter updates, High-quality samples selected through screening mechanisms (such as performance evaluation and fitness ranking) are called "elite samples". is the elite sample under the current probability distribution model Table 1 is the parameter evolution table of the cross entropy algorithm, which shows the key parameter configurations and dynamic adjustment process of the cross entropy algorithm at each stage.
[0134] Table 1
[0135] Policy gradient algorithm processing:
[0136] 1. Strategic network design:
[0137] State Space: ,in, The maximum voltage deviation indicates the maximum deviation of the voltage of all nodes in the power system from the rated value within a certain period of time. The line load ratio (LLR) is the ratio of the actual transmission power of the power line to its thermal stability capacity (rated capacity), usually expressed as a percentage. is the standard deviation of active power fluctuation, which is used to quantify the uncertainty or volatility of power in the system (such as renewable energy output or load demand).
[0138] Action Space: ,in, They represent the sampling weight distribution for “voltage sensitive area”, “new energy intensive area” and “load center area” respectively;
[0139] Reward function: ;in, is the status The reward function under the state is used to quantify the power system The operating performance under and is the weight coefficient, is the root mean square error, The voltage limit violation count indicates the total number of times the node voltage in the system exceeds the safety range (such as ±5% of the nominal value) within a certain period of time.
[0140] 2. Strategy Optimization:
[0141] Gradient update via importance sampling weighted strategy:
[0142] ;
[0143] in, is the objective function Parameters The gradient of , used to optimize the policy or value function parameters, To average the gradient estimates of N trajectories (or samples), is the importance weight, which is used to correct the probability deviation of the trajectory sampled from the old strategy Q to the current strategy P, is the log probability gradient, For cumulative returns, For parameters gradient.
[0144] Importance sampling method dynamic correction:
[0145] 1. Recommended distribution design:
[0146] Layered suggested distribution: ;in, Scenario weights assigned to the policy network, covariance matrix Dynamically adjusted by the radial basis kernel function. is the mixing coefficient (weight) of the kth Gaussian component, is the mean vector of the kth Gaussian component, indicating the center position of the distribution, is the covariance matrix of the kth Gaussian component, is the probability density function of the kth Gaussian distribution (normal distribution).
[0147] 2. Variance control:
[0148] Calculating importance weights , and introduce weight clipping (Clip threshold ); Clip threshold refers to a critical value set in data processing or algorithms to limit the value range of a variable (such as gradient, signal amplitude, pixel value, etc.). When the variable exceeds the threshold, it will be "truncated" or "scaled" to the threshold range to prevent extreme values from causing problems; when the weight variance exceeds the threshold When , the cross entropy model is retrained and the distribution parameters are reset (loop feedback mechanism). is the probability density function value of the target distribution, is the probability density function value of the proposed distribution.
[0149] Comparison and analysis of experimental data:
[0150] After completing the full implementation of the hybrid algorithm, to verify its effectiveness, this experiment conducted multi-dimensional tests on a modified IEEE118 node system on a unified hardware platform and under identical initial conditions. A fixed random seed ensured that both the traditional and new methods were subjected to identical wind and solar fluctuation sequences, namely, time-series fluctuations in wind and photovoltaic (PV) power output, load disturbances, and an N-1 fault scenario. EMTP (Electromagnetic Transient Program) simulation results were used as the ground truth. The comparative data in Table 2 below reveals the core advantages of the cross-entropy, policy gradient, and importance sampling synergy: its global probabilistic evolution capability significantly compresses the high-dimensional solution space, the intelligent guidance of the policy network reduces invalid sampling, and the dynamic weight correction overcomes the "accuracy-efficiency" trade-off inherent in traditional Monte Carlo methods. The experimental results clearly demonstrate the breakthrough performance of the proposed method in addressing the dual challenges of power system randomness and complexity.
[0151] Table 2
[0152] Table 2 compares the parameters of the hybrid power flow calculation method based on the cross-entropy algorithm of the present invention with those of traditional methods. The various metrics in Table 2 demonstrate that the hybrid power flow calculation method based on the cross-entropy algorithm of the present invention significantly improves the accuracy of probabilistic power flow calculations (voltage amplitude calculation accuracy: root mean square error of node voltage; power distribution accuracy: prediction error of line power). The cross-entropy algorithm's elite screening focuses on high-probability scenarios, reducing the RMSE by 77.4% compared to the traditional Newton-Monte Carlo method. Dynamic weight correction using importance sampling reduces the error in modeling renewable energy output fluctuations by 62%. The error in modeling renewable energy output fluctuations is the root mean square error between predicted and actual output. Breakthroughs have been made in computational time efficiency, memory usage efficiency, and convergence efficiency. Policy gradient-guided intelligent sampling (a core module of the present method, which dynamically adjusts sampling directions using the policy gradient algorithm in reinforcement learning to prioritize exploration of high-reward areas, but it should be noted that "intelligent sampling" is only part of the hybrid algorithm and requires the combined effect of cross-entropy and importance sampling) reduces inefficient exploration and accelerates convergence by 4.8 times. Memory usage is reduced by 57%, enabling real-time online computation (<5 seconds per iteration). The system demonstrates enhanced robustness to sudden changes in renewable energy output. In an extreme scenario where wind power output plummets by 50%, the number of voltage-limited nodes drops from seven in the traditional approach to zero. KL divergence monitoring enables self-adaptation to fault scenarios, achieving a 98.7% fault detection rate for the number of (N-1) out-of-limit nodes. This demonstrates the superiority of the proposed method in complex power grids.
[0153] Data preprocessing improves the quality of input data through cross-entropy threshold cleaning and scene clustering; the cross-entropy model realizes global probability evolution, the policy gradient optimizes local decision-making, and importance sampling suppresses variance, forming a closed-loop optimization.
[0154] Measured data show that the method of the present invention compresses the power flow calculation error to 0.007pu in an IEEE 118-node system with a new energy penetration rate of 38%, providing core technical support for building a highly resilient smart grid.
[0155] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk drives, CD-ROMs, optical storage devices, etc.) containing computer-usable program code. The solutions in the embodiments of the present invention may be implemented using various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.
[0156] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0157] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0158] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.
[0159] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0160] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
Claims
1. A hybrid power flow calculation method based on the cross entropy algorithm, characterized in that: include: Step 1: System modeling and parameter initialization: define the state space, action space and objective function according to the specific application scenario, and set and initialize the power grid parameters; Step 2: Sample generation and elite screening guided by entropy algorithm; Iteratively optimize power grid parameters through probability distribution, quickly approach the global optimal solution, generate high-quality sample sets, and screen elite sample sets; Step 3: Design and implement the optimization objectives of the policy gradient algorithm; based on the optimized grid parameters, design and build the policy gradient algorithm; Step 4: Sample reuse and distribution fusion for importance sampling. By setting up a dual buffer mechanism consisting of an elite sample buffer and a new sample buffer, historical high-quality samples are dynamically integrated with new samples explored by the policy gradient algorithm. The fusion weight is calculated to select high-contribution samples. The integrated sample set provides high-quality input for subsequent parameter updates, and the proposed distribution parameters are adjusted based on the KL divergence. Step 5: Parameter update and convergence judgment: Update the mean and covariance parameters of the Gaussian mixture model based on the elite sample set, and determine whether the optimization has converged by calculating the difference between the objective functions of adjacent iterations or judging the maximum number of iterations; Step 6: Dynamic feedback and real-time calibration. Obtain the real-time operating parameters of the current power grid from the monitoring and data acquisition system or synchronized phasor measurement device. Compare the Gaussian mixture model parameters obtained after the iteration termination in the convergence judgment in step 5 with the real-time operating parameters. Calculate the voltage amplitude error and power imbalance deviation. Dynamically calibrate the importance weights of the elite samples in the cross entropy algorithm based on the voltage amplitude error and power imbalance deviation. Step 7: Substitute the parameters obtained in step 6 into the power flow calculation equation to perform power flow calculation.
2. The hybrid power flow calculation method based on the cross entropy algorithm according to claim 1 is characterized in that: In step 1, the state space includes: grid node voltage V, generator output P, and reactive power load demand Q consumed by users or devices at each node; the action space includes: generator output adjustment ΔP and reactive power compensation device switching instructions; the objective function includes: minimizing the voltage over-limit probability and line overload risk, expressed as: ; in, is the objective function, N is the dimension of voltage-related variables, is the voltage amplitude at node i, is the nominal voltage, is the voltage threshold, is the weight coefficient, is the dimension of power-related variables, is the active power of line k, The upper limit of the power capacity of the line or equipment.
3. The hybrid power flow calculation method based on the cross entropy algorithm according to claim 2 is characterized in that: In step 1, the parameter setting and initialization include: Cross entropy method parameters: Gaussian mixture model components K=3, number of samples , elite sample ratio ; Initial mean and covariance Set based on prior knowledge or uniform distribution; Policy gradient method parameters: The policy network is a 3-layer or 4-layer fully connected network, including a 50-dimensional input layer, one or two 64-dimensional hidden layers and a 20-dimensional output layer according to different situations; the initial learning rate , entropy regularization coefficient ; Importance Sampling Parameters: Dynamic Fusion Coefficient The entropy regularization coefficient decays linearly from the initial value of 0.7 to 0.3 with the number of iterations. , convergence threshold =10 -5 , maximum number of iterations .
4. The hybrid power flow calculation method based on the cross entropy algorithm according to claim 3 is characterized in that: Step 2 includes: Step 2.1, generate the initial sample set; specifically, based on the current importance probability distribution function, use the Gaussian mixture model to model the probability distribution of the current system state, and generate samples that are more concentrated in areas that may affect the safety or economy of the system, generating a sample set ,in, is the number of samples generated, For the state samples, is the sample serial number; Step 2.2, evaluate the samples and select the elite set; specifically, calculate the objective function value of each sample ;according to Sort, before selection The samples of ; Calculate the importance weight of elite samples : ; in, is the proportion of elite samples, For elite samples, For Each of the Gaussian components is proportional to Select samples; is the target distribution function, The probability density function of the proposed distribution in the sample The value at is the weight coefficient of the KL divergence, is the KL divergence, which measures the target distribution With the proposed distribution The difference between For the The weight of the samples.
5. The hybrid power flow calculation method based on the cross entropy algorithm according to claim 4 is characterized in that: Step 3 includes: Step 3.1, strategy update: Based on the elite sample set, use the policy gradient algorithm to optimize the policy network parameters : Step 3.1.1, calculate the gradient: ; in, is the strategy parameter The expected gradient of is the expectation of the distribution g, is the policy function, To propose a distribution, are the parameters of the proposed distribution, is the gradient of the logarithmic policy, is the importance weight, is the cumulative reward function, which means that Discount accumulators for departures; Step 3.1.2: Add entropy regularization to prevent the strategy from converging prematurely: ; in, and The current time step , time step The strategy parameters, is the learning rate, is the regularization coefficient, which is used to balance the optimization of the objective function and the strength of the regularization constraint. For the policy parameters The gradient operator, , is the regularization loss term, where is the log probability of the strategy; Step 3.2, dynamic learning rate adjustment: adjust the learning rate according to the KL divergence and gradient amplitude: ; in, is the time step The dynamic learning rate, is the initial learning rate, is the adjustment coefficient, is the KL divergence, is the norm of the value function gradient, The parameters are The value function of .
6. The hybrid power flow calculation method based on the cross entropy algorithm according to claim 5 is characterized in that: In step 4, the double buffer mechanism includes: an elite sample buffer and a new sample buffer; The sample fusion and reuse includes: calculating the fusion weight and selecting high-weight samples from the double buffer to add to the sample pool of the next iteration; the calculation formula of the fusion weight is as follows: ; in, is the dynamic fusion coefficient, and its iteration number decays linearly from the initial value 0.7 to 0.3 with the iteration number. is the weight of the i-th sample, The probability density function of the target distribution in the sample The value at is the probability density function of the proposed distribution, is the probability density function of the strategy distribution.
7. The hybrid power flow calculation method based on the cross entropy algorithm according to claim 6 is characterized in that: Step 5 includes: Step 5.1, update the Gaussian mixture model parameters based on the elite sample set, mean and covariance as follows: ; ; in, is the posterior probability that the sample belongs to the k-th quantity, is the weight of the i-th sample, For samples Belong to The posterior probability of a Gaussian distribution, is the feature vector of the i-th sample, For the The mean of a Gaussian distribution, is the covariance regularization term, where is the regularization coefficient, is the identity matrix; Step 5.2, convergence judgment: If the difference between the objective functions of adjacent iterations , or reach , terminate the iteration; otherwise, return to step 2 and enter the next round of collaborative optimization; where, is the objective function, and is the iteration parameter, is the absolute value of the objective function change, is the convergence threshold, which is used to determine whether the optimization has converged.
8. The hybrid power flow calculation method based on the cross entropy algorithm according to claim 7 is characterized in that: Step 7 includes: taking the parameters of step 5 and the importance weights of the elite samples obtained after dynamic calibration in step 6 Substitute the real-time operating parameters into the power flow calculation equation to solve the node voltage distribution and line power flow, specifically: Step 7.1, data preprocessing; normalize the parameters after dynamic calibration; and weight the importance of elite samples. As the probability weight, the grid parameters under multiple scenarios are weighted and integrated to generate the comprehensive operation state vector of each node ,in, is the voltage amplitude at node i, is the voltage phase angle of node i, is the input active power of node i, is the input reactive power of node i, i is the target node number, ranging from 1 to N, and N is the total number of system nodes; Step 7.2, equation construction; the node power balance equation uses the improved Newton-Raphson method equation: ; in, is the input active power of node i, is the input reactive power of node i, is the conductance between nodes i and j, is the susceptance between nodes i and j, , is the voltage phase angle of node i, is the voltage phase angle at node j, is the voltage amplitude at node i, is the target node, For other nodes, is the total number of nodes, For nodes The voltage amplitude; Step 7.3, parameter substitution and solution; the comprehensive operating state vector The voltage amplitude in , phase angle As the initial value, combined with real-time power data ( ) is the active power imbalance of node i, is the reactive power unbalance of node i, and the modified Jacobian matrix is solved iteratively: ; ; in, is the power deviation vector, To include and The Jacobian matrix of the partial derivatives, is the correction value of voltage phase angle and amplitude; the node voltage distribution is obtained by iterative solution of Jacobian matrix ; Updated by Newton iteration method , until the power deviation vector meets the convergence condition , is the convergence threshold; after the iteration converges, the line power flow is calculated based on the node voltage and admittance, specifically: ; in, is the line active power, is the line reactive power, Number the line; Step 7.4, result output.
9. A hybrid power flow calculation device based on a cross entropy algorithm, characterized in that: Includes the following modules: System modeling and parameter initialization module, which defines the state space, action space and objective function according to the specific application scenario, and sets and initializes the power grid parameters; The sample generation and elite screening module guided by the entropy algorithm optimizes the grid parameters through probability distribution iteration, quickly approaches the global optimal solution, generates high-quality sample sets, and screens elite sample sets; The optimization target design and implementation module of the policy gradient algorithm designs and builds the policy gradient algorithm based on the optimized power grid parameters; The sample reuse and distribution fusion module of importance sampling dynamically fuses historical high-quality samples with new samples explored by the policy gradient algorithm by setting up a dual buffer mechanism consisting of an elite sample buffer and a new sample buffer. It calculates the fusion weights and selects high-contribution samples. The fused sample set provides high-quality input for subsequent parameter updates and adjusts the proposed distribution parameters based on the KL divergence. The parameter update and convergence judgment module updates the mean and covariance parameters of the Gaussian mixture model based on the elite sample set, and determines whether the optimization has converged by calculating the difference between the objective functions of adjacent iterations or determining the maximum number of iterations; The dynamic feedback and real-time calibration module obtains the real-time operating parameters of the current power grid from the monitoring and data acquisition system or synchronized phasor measurement device, compares the Gaussian mixture model parameters obtained after the iteration termination in the convergence judgment in step 5 with the real-time operating parameters, calculates the voltage amplitude error and power imbalance deviation, and dynamically calibrates the importance weights of the elite samples in the cross entropy algorithm based on the voltage amplitude error and power imbalance deviation; The power flow calculation module substitutes the parameters obtained in step 6 into the power flow calculation equation to perform power flow calculation.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the hybrid power flow calculation method based on the cross entropy algorithm according to any one of claims 1 to 8 are implemented.
11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the hybrid power flow calculation method based on the cross entropy algorithm as claimed in any one of claims 1 to 8 are implemented.
Citation Information
Cited By
Regional power grid elastic optimization scheduling method and system supported by distributed power supply
CN120955816A
Large-scale data feature extraction method, system and equipment based on average field
CN120995088A
Harmonic power flow probability evaluation method and system based on skewed Gaussian mixture model
CN121071406A
Modeling method of statistical hybrid model in big data distributed scene
CN121807937A
Variable-pitch load shedding control method and system for floating type wind generating set
CN122260842A