CN114565259A - Power distribution network line loss calculation method for optimizing BP neural network by improving sparrow search - Google Patents
Power distribution network line loss calculation method for optimizing BP neural network by improving sparrow search Download PDFInfo
- Publication number
- CN114565259A CN114565259A CN202210171261.4A CN202210171261A CN114565259A CN 114565259 A CN114565259 A CN 114565259A CN 202210171261 A CN202210171261 A CN 202210171261A CN 114565259 A CN114565259 A CN 114565259A
- Authority
- CN
- China
- Prior art keywords
- sparrow
- neural network
- dimension
- iteration
- population
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 241000287127 Passeridae Species 0.000 title claims abstract description 170
- 238000013528 artificial neural network Methods 0.000 title claims abstract description 86
- 238000004364 calculation method Methods 0.000 title claims abstract description 59
- 238000005457 optimization Methods 0.000 claims abstract description 25
- 230000000739 chaotic effect Effects 0.000 claims abstract description 17
- 238000010845 search algorithm Methods 0.000 claims abstract description 17
- 230000004927 fusion Effects 0.000 claims abstract description 7
- 238000005259 measurement Methods 0.000 claims abstract description 4
- 238000000034 method Methods 0.000 claims description 28
- 210000002569 neuron Anatomy 0.000 claims description 19
- 239000011159 matrix material Substances 0.000 claims description 17
- 238000012545 processing Methods 0.000 claims description 12
- 230000008859 change Effects 0.000 claims description 8
- 230000035772 mutation Effects 0.000 claims description 4
- 102100029469 WD repeat and HMG-box DNA-binding protein 1 Human genes 0.000 claims description 3
- 101710097421 WD repeat and HMG-box DNA-binding protein 1 Proteins 0.000 claims description 3
- 230000002159 abnormal effect Effects 0.000 claims description 3
- 150000001875 compounds Chemical class 0.000 claims description 3
- 238000001914 filtration Methods 0.000 claims description 3
- 238000013507 mapping Methods 0.000 claims description 3
- 230000008569 process Effects 0.000 claims description 3
- 230000011218 segmentation Effects 0.000 claims description 3
- 230000007704 transition Effects 0.000 claims description 3
- 238000007781 pre-processing Methods 0.000 abstract 1
- 230000006870 function Effects 0.000 description 20
- 238000012360 testing method Methods 0.000 description 7
- 238000012549 training Methods 0.000 description 7
- 230000000694 effects Effects 0.000 description 5
- 238000010801 machine learning Methods 0.000 description 4
- 238000007726 management method Methods 0.000 description 4
- 238000002790 cross-validation Methods 0.000 description 3
- 230000009467 reduction Effects 0.000 description 3
- 238000011160 research Methods 0.000 description 3
- 230000004913 activation Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000018109 developmental process Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- OKTJSMMVPCPJKN-UHFFFAOYSA-N Carbon Chemical compound [C] OKTJSMMVPCPJKN-UHFFFAOYSA-N 0.000 description 1
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 229910052799 carbon Inorganic materials 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 238000004134 energy conservation Methods 0.000 description 1
- 238000009472 formulation Methods 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 238000003062 neural network model Methods 0.000 description 1
- 230000001737 promoting effect Effects 0.000 description 1
- 238000012706 support-vector machine Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/063—Operations research, analysis or management
- G06Q10/0639—Performance analysis of employees; Performance analysis of enterprise or organisation operations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/004—Artificial life, i.e. computing arrangements simulating life
- G06N3/006—Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/044—Recurrent networks, e.g. Hopfield networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/084—Backpropagation, e.g. using gradient descent
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N7/00—Computing arrangements based on specific mathematical models
- G06N7/08—Computing arrangements based on specific mathematical models using chaos models or non-linear system models
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/067—Enterprise or organisation modelling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/06—Energy or water supply
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y04—INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
- Y04S—SYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
- Y04S10/00—Systems supporting electrical power generation, transmission or distribution
- Y04S10/50—Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Human Resources & Organizations (AREA)
- General Physics & Mathematics (AREA)
- Strategic Management (AREA)
- Economics (AREA)
- Health & Medical Sciences (AREA)
- Entrepreneurship & Innovation (AREA)
- General Business, Economics & Management (AREA)
- Artificial Intelligence (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Evolutionary Computation (AREA)
- Data Mining & Analysis (AREA)
- Development Economics (AREA)
- Tourism & Hospitality (AREA)
- Marketing (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Molecular Biology (AREA)
- Computational Linguistics (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Educational Administration (AREA)
- Game Theory and Decision Science (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Computational Mathematics (AREA)
- Algebra (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Public Health (AREA)
- Water Supply & Treatment (AREA)
- Primary Health Care (AREA)
Abstract
The invention discloses a power distribution network line loss calculation method for improving sparrow search and optimizing a BP (back propagation) neural network, which comprises the steps of continuously collecting data of a plurality of required historical moments through a power grid advanced measurement system, and preprocessing the data; secondly, inputting the preprocessed data of each historical moment into a BP (back propagation) neural network for prediction to obtain the predicted line loss rate of each historical moment, constructing a BP neural network loss function model by combining the predicted line loss rate with the data, and further performing optimization solution by a sparrow search algorithm which is improved by chaotic initialization and t-distribution variation fusion to obtain an optimized BP neural network; finally, the data collected in real time are input into the optimized BP neural network for prediction to obtain the real-time predicted line loss rate.
Description
Technical Field
The invention belongs to the technical field of power distribution network optimization, and particularly relates to a power distribution network line loss calculation method for improving a sparrow search optimization BP neural network.
Background
In the transmission process of a power grid, electric energy passes through each power element and generates a part of active loss due to factors such as impedance, the part of active loss is line loss, the ratio of the line loss to the power supply amount is line loss rate, the line loss is one of important indexes of the power grid, accurate calculation of theoretical line loss can provide data support for fine management and formulation of energy-saving and loss-reducing measures of power grid enterprises, the aim of double carbon is achieved by assistance, and the call for green development of energy conservation and emission reduction in China is responded. With the development of power systems, the structure of a power distribution network is gradually complicated, the data volume of the power grid is larger and larger, and the method for calculating the line loss more accurately has important significance.
The research on the line loss calculation of the power grid can be traced back to the thirties of the twentieth century, researchers in various countries put forward various methods for calculating the line loss of the power distribution network, the line loss calculation methods for the power distribution network can be divided into two major categories till now, one is that the traditional theoretical calculation methods and related improved algorithms which are widely applied are put forward according to physical models, the traditional theoretical calculation methods comprise a root-mean-square current method, an equivalent resistance method, an average current method, a power flow method and the like, the methods are based on the physical model of the power grid, and required data comprise current, voltage, line resistance, distribution network topology and the like; and a calculation method provided by using the learning capability of machine learning on large-scale data, such as a calculation method based on a support vector machine, a neural network, a heuristic algorithm and the like, and a line loss calculation model is trained by learning a large amount of data.
The line loss calculation result is that the power grid is firstly seen from a traditional line loss calculation method based on a physical model, the formula of a loss formula calculation method such as an equivalent resistance method is simple, and the method is a line loss calculation method which is used by a power supply enterprise for many years, but a plurality of simplification and estimation parts exist, so that the problem that the line loss calculation precision is not high and a certain gap exists between the line loss calculation precision and the actual line loss calculation precision is caused, and the management level and the loss reduction efficiency of the power supply enterprise are influenced; in the traditional algorithm, the load flow calculation method is relatively high in accuracy, but has the problem of high requirements on the quality of original data, besides load electric quantity, the load flow calculation also needs to know the topological structure of a network and the resistance of a line, but the low-voltage distribution network is often difficult to acquire the information due to the complex structure, so that the method is limited in applicable voltage level. In the existing machine learning method for calculating the line loss of the power distribution network, a standard BP neural network model is a relatively mature main calculation method, but the problem that hidden layer weights and thresholds lack effective adjustment exists, so that the calculation accuracy of the line loss of the power distribution network has a further improved space.
The line loss of the power distribution network is used as an important economic and technical index of the power grid, and the theoretical calculation precision of the power distribution network has great influence on the planning rationality, the operation economy, the management level and the establishment of loss reduction measures of the power grid. The calculation method based on the machine learning algorithm is a popular method for the current power grid line loss calculation research, wherein a neural network is used as a model of the machine learning algorithm, can carry out sufficient adaptive learning on related information and store knowledge, has strong fault tolerance performance, has the capability of carrying out very complex logic operation and fitting nonlinear relation, is the most main calculation method in the current line loss research, but has some defects. The invention aims to solve the problem that a standard BP neural network calculation method is easy to fall into local optimization and further improve the calculation precision of the line loss of a power distribution network, and selects a Sparrow Search Algorithm to optimize the Algorithm of the BP neural network to establish a power distribution network line loss calculation model according to the excellent group optimization effect of a Sparrow Search Algorithm (SSA), but the Sparrow Search Algorithm still has the problems of possible falling into local optimization and weak global Search capability.
Disclosure of Invention
In order to solve the problem that a standard BP neural network calculation method is easy to fall into local optimum and further improve the accuracy of power distribution network line loss calculation, the invention provides a power distribution network line loss calculation method based on improved sparrow search optimization BP neural network.
The technical scheme of the invention is a power distribution network line loss calculation method for optimizing a BP neural network by improving sparrow search, which is characterized by comprising the following steps of:
step 1: continuously acquiring the summary active reactive electric quantity at a plurality of historical moments, the load point active reactive electric quantity at a plurality of historical moments and the line loss rate at a plurality of historical moments through a power grid advanced measurement system;
step 2: respectively and sequentially carrying out abnormal data removing processing, missing data filling processing, repeated data filtering processing and data standardization processing on the summary table active reactive electric quantities at a plurality of historical moments, the load point active reactive electric quantities at a plurality of historical moments and the line loss rates at a plurality of historical moments to obtain the preprocessed summary table active reactive electric quantities at a plurality of historical moments, the preprocessed load point active reactive electric quantities at a plurality of historical moments and the preprocessed line loss rates at a plurality of historical moments;
and step 3: introducing a BP (back propagation) neural network, inputting the total table active reactive electric quantity of each preprocessed historical moment and the load point active reactive electric quantity of each preprocessed historical moment into the BP neural network for prediction to obtain the predicted line loss rate of each historical moment, constructing a BP neural network loss function model by combining the line loss rate of each preprocessed historical moment, and further performing optimization solution by a modified sparrow search algorithm through chaotic initialization and t-distribution variation fusion to obtain the optimized BP neural network;
and 4, step 4: inputting the real-time collected summary table active reactive electric quantity and the real-time collected load point active reactive electric quantity into the optimized BP neural network for prediction to obtain a real-time predicted line loss rate;
preferably, the loss function model in step 3 is specifically defined as:
in the formula, YiIs the sample line loss rate of the i-th sample, yiThe line loss rate is calculated for the ith sample, n is the total number of samples, and the loss function is the calculated mean square error.
And 3, further performing optimization solution through a sparrow search algorithm improved by chaotic initialization and t distribution variation fusion to obtain an optimized BP neural network, wherein the optimized object of the improved sparrow optimization algorithm is the weight and the threshold of the BP neural network, and the specific steps are as follows:
and 3.1, setting the size of the sparrow population, the maximum iteration times, the upper weight boundary, the lower weight boundary, the upper threshold boundary, the lower threshold boundary, the safety value, the proportion of discoverers and the proportion of cautionary users.
The dimension D of the improved sparrow optimization algorithm is as follows:
D=m×n+n×l+n+l
in the formula, m is the number of neurons in an input layer of the BP neural network, n is the number of neurons in an implicit layer of the BP neural network, and l is the number of neurons in an output layer of the BP neural network.
The sparrow population may be represented as:
wherein XiFor sparrow population at the ith iteration,xi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tmFor the maximum number of iterations of the population, P is an element [1, P ∈]P is the number of sparrows in the population, D is equal to [1, D ]]D is the dimension to be optimized, namely the total number of the network weight and the threshold, and when D belongs to [1, mxn ∈]When x isi,p,dIs the connection weight between the input layer and the hidden layer in the neural network, when d belongs to [ m x n +1, m x n + n]When xi,p,dFor the hidden layer threshold in the neural network, when d is in the range of [ m × n + n +1, m × n + n + n × l]When xi,p,dIs the connection weight between the hidden layer and the output layer in the neural network, when d belongs to [ m × n + n + n × l +1, m × n + n + n × l + l]When xi,p,dThe method comprises the following steps of (1) setting an output layer threshold value in a neural network, wherein m is the number of neurons in an input layer of a BP neural network, n is the number of neurons in a hidden layer of the BP neural network, and l is the number of neurons in an output layer of the BP neural network;
initializing the sparrow population by adopting Bernoulli chaotic mapping, wherein the formula is as follows:
wherein x isi,p,dPosition, x, of dimension d of the p-th sparrow position at the i-th iterationi+1,p,dThe position of the d-th dimension of the position of the p-th sparrow in the (i + 1) -th iteration is defined as lambda epsilon (0,1) as a segmentation parameter. The dimension of the chaotic matrix is the same as that of a sparrow population matrix, and the chaotic matrix is generated and then is carried to the upper and lower boundaries of a weight threshold value, so that the chaotic initialized sparrow population is obtained.
And 3.2, defining a fitness function and calculating an initial individual fitness value. The fitness function is used for explaining the calculation accuracy of the model, the individual fitness value is obtained by taking the position corresponding to the individual as a weight and a threshold value and then carrying the weight and the threshold value into the neural network for calculation, and the specific fitness function is as follows:
in the formula, YiThe sample line loss rate of the ith sample,yithe line loss rate is calculated for the ith sample, n is the total number of samples, and the loss function is the calculated mean square error.
FiThe fitness values of all sparrow populations at the ith iteration and the optimal fitness value f of the sparrow individualbThe corresponding sparrow positions are optimization targets, namely weights and thresholds of the neural network, and then the individual fitness values of all sparrows can be expressed as:
in the formula (f)i,p([xi,p,1,...,xi,p,d,...,xi,p,d]) Representing the individual fitness value, x, of the p-th sparrow at the ith iterationi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tmFor the maximum number of iterations of the population, P is an element [1, P ∈]P is the number of sparrows in the population, D is equal to [1, D ]]And D is the dimension to be optimized, namely the total number of the network weight and the threshold.
And 3.3, dividing the sparrows in the sparrow searching algorithm into a finder, a jointer and an alerter, wherein the finder and the jointer dynamically change but have constant proportion, and different types of sparrows have different updated position rules.
The sparrows are rich in resources in the population, namely the fitness value is high, and the sparrows are responsible for searching food and leading the participants, when danger occurs, the alarm of the sparrows is higher than the early warning value, and the discoverer leads the participants to turn to a safe area. The position is updated as follows:
in the formula, xi+1,p,dThe position of the d-th dimension, x, of the p-th sparrow position at the i +1 th iterationi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tmFor the maximum number of iterations of the population, P is an element [1, P ∈]P is the number of sparrows in the population, D is equal to [1, D ]]D is the dimension to be optimizedThat is, the total number of network weights and thresholds, c is a random constant, and c belongs to (0,1)],tmFor maximum number of iterations, r is a random number obeying a normal distribution, I1×dAll 1 matrices of 1xd, ST being the security value, R2For a warning value, R2∈[0,1];
Changing an exponential decrement factor into a normally distributed random number, introducing a global optimal fitness value of the last iteration into an updating formula of a finder, simultaneously having better global search capability in the early stage of the iteration and better local search capability in the later stage according to the characteristic that a nonlinear decrement inertia weight is better, and adopting the following weight omega according to an algorithm:
where i is the current iteration number, tmIs the maximum number of iterations.
The improved discoverer location update formula is as follows:
in the formula, xi+1,p,dThe position of the d-th dimension, x, of the p-th sparrow position at the i +1 th iterationi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tmFor the maximum number of iterations of the population, P is an element [1, P ∈]P is the number of sparrows in the population, D is equal to [1, D ]]D is the dimension to be optimized, i.e. the total number of the network weight and the threshold, omega is the inertia weight,for global optimal fitness of the last iteration, rand (0,1) is normally distributed randomly, r is a random number obeying normally distribution, and I1×dAll 1 matrices of 1xd, ST being the security value, R2For a warning value, R2∈[0,1]。
The participants will compete for food following the discoverer with the best resources, the less well suited sparrow location will be, and the less energy participants may go to other areas looking for food. The position is updated as follows:
in the formula, xi+1,p,dThe position of the d-th dimension, x, of the p-th sparrow position at the i +1 th iterationi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tmFor the maximum number of iterations of the population, P belongs to [1, P ]]P is the number of sparrows in the population, D is equal to [1, D ]]D is the dimension to be optimized, namely the total number of the network weight and the threshold,the d-th dimension global worst position of the p-th sparrow position at the ith iteration,is the global optimum position of the d-th dimension of the p-th sparrow position in the (i + 1) th iteration, c is a random constant, and c belongs to (0,1)],A+1xd matrix of elements 1 and-1, A+=AT(A AT)-1,I1×dIs a full 1 matrix of 1 xds.
Individuals on the position comparison edge in the alarm can be transferred to a safety zone, and individuals in the safety zone randomly change positions in the safety zone. The position is updated as follows:
in the formula, xi+1,p,dThe position of the d-th dimension, x, of the p-th sparrow position at the i +1 th iterationi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tmFor the maximum number of iterations of the population, P is an element [1, P ∈]P is the number of sparrows in the population, D is equal to [1, D ]]D is the dimension to be optimized, namely the total number of the network weight and the threshold,for the global optimal position of the d-th dimension of the p-th sparrow position at the ith iteration,is the d-dimensional global worst position of the p-th sparrow position at the ith iteration, s is a random number obeying (0,1) normal distribution and used for controlling the step length, h is a constant between-1 and represents the individual moving direction, fiIs the current individual fitness value, fi bCurrent global optimum fitness value, fi wIs the current global worst fitness value. ε prevents the denominator from being 0.
Step 3.4, generating a random number, and judging whether t-distribution sparrow population variation is carried out or not;
the t distribution is an intermediate transition form of Gaussian distribution and Cauchy distribution, and can be converted into other distribution matrixes by adjusting the degree of freedom n. The mutation process is as follows:
in the formula (I), the compound is shown in the specification,the position of the d-dimension of the p-th sparrow position after the variation of the t distribution at the ith iteration, xi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tmFor the maximum number of iterations of the population, P is an element [1, P ∈]P is the number of sparrows in the population, D is equal to [1, D ]]D is the dimension to be optimized, i.e. the total number of network weights and thresholds, t (i) is the t distribution with the degree of freedom i, rand is the random number generated by the iteration, pr is the dynamic selection probability, omega1For dynamic selection of the probability upper bound, ω2Selecting probability changes for dynamicsAmplitude.
When the sparrow search algorithm starts iteration, the iteration times are small, the t distribution is close to Cauchy distribution, and the algorithm has strong global search capability; when the iteration times are continuously increased, the t distribution is close to Gaussian distribution, and the algorithm has strong local search capability. Therefore, the sparrow search algorithm carries out population variation by using t distribution, the global search capability is enhanced at the initial stage, the local search capability is enhanced at the later stage, and the convergence accuracy of the algorithm is improved.
And 3.5, calculating individual fitness values of the two populations before and after the variation, acquiring the current optimal value of the two populations, comparing the current optimal value with the last time, and updating the global optimal value if the global optimal value is better.
Step 3.6, repeating the steps 3.3-3.5 until the maximum iteration number is reached, and stopping; the final global optimal position, i.e. the optimal individual fitness value fb([xi,p,1,...,xi,p,d,...,xi,p,D]Corresponding position [ x ]i,p,1,xi,p,2,...,xi,p,D]Building a complete network model as weight and threshold inputs to a neural network, xi,p,dThe position of the d-dimension of the position of the p-th sparrow in the ith iteration is shown, and p is the sparrow corresponding to the optimal fitness.
The method effectively solves the problem of BP neural network adjustment, improves the network convergence speed, further improves the calculation precision of the line loss of the power distribution network, and provides data support for realizing fine management of the power grid and promoting energy-saving and loss-reducing work.
Drawings
FIG. 1: is a flow chart of the method of the present invention;
FIG. 2: improving a BP neural network training flow chart of sparrow search optimization;
FIG. 3: cross validation results of ten folds;
FIG. 4: comparing the SSA-BP neural network line loss calculation result with the sample value;
FIG. 5: comparing the BtSSA-BP line loss calculation result with the sample value;
FIG. 6: calculating an error curve of the SSA-BP neural network line loss;
FIG. 7 is a schematic view of: calculating an error curve of line loss of the BtSSA-BP neural network;
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail with reference to the following embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to test the effect of the line loss calculation method designed by the invention, the original data collected by the example is the electricity consumption data of 396 days from 9 months in 2019 to 9 months in 2020 in a certain platform area of the Zhuhai city, the line loss calculation model designed by the invention is trained by the platform area data, and the calculation result is compared with the sample result to evaluate the effect. The total table and the sub-table of the transformer area have 5 metering points, the input characteristic variables are active and reactive electric quantities of the metering points, and the output characteristic variables are daily line loss rate, wherein the input characteristic variables are active and reactive electric quantities of the metering points, and the output characteristic variables are 1.
The data collected are shown in table 1.
Table 1 electric network acquisition of partial raw data
A power distribution network line loss calculation method based on an improved sparrow search optimization BP neural network is characterized by comprising the following steps:
step 1: continuously acquiring the summary active reactive electric quantity at a plurality of historical moments, the load point active reactive electric quantity at a plurality of historical moments and the line loss rate at a plurality of historical moments through a power grid advanced measurement system;
step 2: respectively and sequentially carrying out abnormal data removing processing, missing data filling processing, repeated data filtering processing and data standardization processing on the total table active and reactive electric quantity at a plurality of historical moments, the load point active and reactive electric quantity at a plurality of historical moments and the line loss rate at a plurality of historical moments to obtain the total table active and reactive electric quantity at a plurality of preprocessed historical moments, the load point active and reactive electric quantity at a plurality of preprocessed historical moments and the line loss rate at a plurality of preprocessed historical moments to obtain a sample data set of 10 multiplied by 396;
and step 3: introducing a BP (back propagation) neural network, inputting the total table active reactive electric quantity of each preprocessed historical moment and the load point active reactive electric quantity of each preprocessed historical moment into the BP neural network for prediction to obtain the predicted line loss rate of each historical moment, constructing a BP neural network loss function model by combining the line loss rate of each preprocessed historical moment, and further performing optimization solution by a modified sparrow search algorithm through chaotic initialization and t-distribution variation fusion to obtain the optimized BP neural network;
the loss function model in step 3 is specifically defined as:
in the formula, YiIs the sample line loss rate of the i-th sample, yiThe line loss rate is calculated for the ith sample, n is the total number of samples, and the loss function is the calculated mean square error.
And 3, further performing optimization solution through a sparrow search algorithm improved by chaotic initialization and t distribution variation fusion to obtain an optimized BP neural network, wherein the optimized object of the improved sparrow optimization algorithm is the weight and the threshold of the BP neural network, and the specific steps are as follows:
step 3.1, according to the sample data, the number m of the neurons in the input layer is 10, the number l of the neurons in the output layer is 1, and the hidden layer firstly calculates n is log according to an empirical formula 210 is approximately equal to 3, then a ten-fold cross-validation method is adopted to determine the number of hidden layer nodes with the best effect near the value, namely, the sample data set is averagely divided into 10 parts, training and testing are carried out for 10 times, 9 parts of samples in the sample data set are used as a training set and 1 part of samples are used as a testing set each time, and the sample data set must be guaranteed to be the training set and the testing setThe training set and the testing set of each time are different from each other, the whole sample data set participates in training and testing, and the hidden layer number with the minimum corresponding calculation error is taken. The ten-fold cross-validation result for the sample set is shown in fig. 3, and the number of hidden layer nodes can be determined to be 3. The structure of the BP neural network is 10-3-1, the learning rate α of the BP neural network is set to be 0.01, the calculation precision e is 0.01, the maximum iteration number is 10000, the hidden layer activation function is a Sigmoid function, the output layer activation function is a purelin function, and the back propagation training function is a thingdx function.
The sparrow population scale is set to be 20, the maximum iteration number is 30, the upper weight boundary is 5, the lower weight boundary is-5, the upper threshold boundary is 5, the lower threshold boundary is-5, the safety value is 0.6, the ratio of discoverers to surrmers is 0.7, and the ratio of surrmers to surrmers is 0.2.
The dimension D of the improved sparrow optimization algorithm is as follows:
D=m×n+n×l+n+l
in the formula, m ═ 10 is the number of input layer neurons of the BP neural network, n ═ 3 is the number of hidden layer neurons of the BP neural network, and l ═ 1 is the number of output layer neurons of the BP neural network.
Sparrow populations may be represented as:
wherein, XiFor sparrow population at the ith iteration, xi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tm30 is the maximum number of iterations of the population, P ∈ [1, P ∈ [ ]]P20 is the number of sparrows in the population, D is equal to [1, D ]]D is 37, namely the dimension to be optimized, namely the total number of the network weight values and the threshold values, and when D belongs to [1, m is multiplied by n]When xi,p,dIs the connection weight between the input layer and the hidden layer in the neural network, when d belongs to [ m x n +1, m x n + n]When xi,p,dFor the hidden layer threshold in the neural network, when d is in the range of [ m × n + n +1, m × n + n + n × l]When xi,p,dIs the connection weight between the hidden layer and the output layer in the neural network, when d belongs to [ m × n + n + n × l +1, m × n + n + n × l + l]When xi,p,dThe method is characterized in that the threshold value of an output layer in a neural network is defined, m is 10 and n is 3, and l is 1, wherein the number of neurons of the input layer of the BP neural network is defined as the number of neurons of an implicit layer of the BP neural network;
initializing the sparrow population by adopting Bernoulli chaotic mapping, wherein the formula is as follows:
wherein x isi,p,dPosition, x, of dimension d of the p-th sparrow position at the i-th iterationi+1,p,dThe position of the d-th dimension of the p-th sparrow position in the (i + 1) -th iteration is represented by λ e (0,1) which is a segmentation parameter, and λ is 0.4. The dimension of the chaotic matrix is the same as that of a sparrow population matrix, and the chaotic matrix is generated and then is carried to the upper and lower boundaries of a weight threshold value, so that the chaotically initialized sparrow population is obtained.
And 3.2, defining a fitness function and calculating an initial individual fitness value. The fitness function is used for explaining the calculation accuracy of the model, the individual fitness value is obtained by taking the position corresponding to the individual as a weight and a threshold value and then carrying the weight and the threshold value into the neural network for calculation, and the specific fitness function is as follows:
in the formula, YiIs the sample line loss rate of the i-th sample, yiFor the calculated line loss rate of the ith sample, n-396 is the total number of samples, and the loss function is the calculated mean square error.
FiThe fitness values of all sparrow populations at the ith iteration and the optimal fitness value f of the sparrow individualbThe corresponding sparrow positions are the optimization targets, namely the weights and the threshold values of the neural network, and the individual fitness values of all sparrows can be expressed as follows:
in the formula (f)i,p([xi,p,1,...,xi,p,d,...,xi,p,d]) Representing the individual fitness value, x, of the p-th sparrow at the ith iterationi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tm30 is the maximum number of iterations of the population, P ∈ [1, P ∈ [ ]]P20 is the number of sparrows in the population, D is the E [1, D ∈]And D is 37, namely the dimension to be optimized, namely the total number of the network weight and the threshold.
And 3.3, dividing the sparrows in the sparrow searching algorithm into a finder, a jointer and an alerter, wherein the finder and the jointer dynamically change but do not change the proportion, and different types of sparrows have different updating position rules.
The sparrow is rich in resources in the population, namely the fitness value is high, and the sparrow is responsible for searching food and leading the participators, when danger occurs, the alarm of the sparrow individual is higher than the early warning value, and the discoverer leads the participators to go to a safe area. The position is updated as follows:
in the formula, xi+1,p,dThe position of the d-th dimension, x, of the p-th sparrow position at the i +1 th iterationi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tm30 is the maximum number of iterations of the population, P ∈ [1, P ∈]P20 is the number of sparrows in the population, D is the E [1, D ∈]D is 37, namely the dimension to be optimized, namely the total number of the network weight values and the threshold values, c is a random constant, and c belongs to (0,1)]R is a random number following a normal distribution, I1×D1 matrix of 1x37, ST ═ 0.6 is the guard value, R2Is a random constant, R, for the early warning value2∈[0,1];
Changing an exponential decrement factor into a normally distributed random number, introducing a global optimal fitness value of the last iteration into an updating formula of a finder, simultaneously having better global search capability in the early stage of the iteration and better local search capability in the later stage according to the characteristic that a nonlinear decrement inertia weight is better, and adopting the following weight omega according to an algorithm:
where i is the current iteration number, tm30 is the maximum number of iterations.
The improved discoverer location update formula is as follows:
in the formula, xi+1,p,dThe position of the d-th dimension, x, of the p-th sparrow position at the i +1 th iterationi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tm30 is the maximum number of iterations of the population, P ∈ [1, P ∈]P20 is the number of sparrows in the population, D is the E [1, D ∈]D-37 is the dimension to be optimized, i.e. the total number of network weights and thresholds, ω is the inertial weight,for the global optimal fitness of the last iteration, rand (0,1) is normally distributed randomly, r is a random number obeying the normally distribution, I1×D1 matrix of 1x37, ST ═ 0.6 is the guard value, R2As a precaution value, is a random constant, R2∈[0,1]。。
The participants will compete for food following the discoverer with the best resources, the less well suited sparrow location will be, and the less energy participants may go to other areas looking for food. The position is updated as follows:
in the formula, xi+1,p,dThe position of the d-th dimension, x, of the p-th sparrow position at the i +1 th iterationi,p,dFor the position of the d-th dimension of the position of the p-th sparrow at the ith iteration, i belongs to [1, t ]m],tm30 is the maximum number of iterations of the population, P ∈ [1, P ∈]P20 is the number of sparrows in the population, D is the E [1, D ∈]D is 37, which is the dimension to be optimized, i.e. the total number of network weights and thresholds,the d-th dimension global worst position of the p-th sparrow position at the ith iteration,is the global optimum position of the d-th dimension of the p-th sparrow position in the (i + 1) th iteration, c is a random constant, and c belongs to (0,1)],A+1x37 matrix of elements 1 and-1, A+=AT(A AT)-1,I1×DAn all 1 matrix of 1x 37.
Individuals on the position comparison edge in the alarm can be transferred to a safety zone, and individuals in the safety zone randomly change positions in the safety zone. The position is updated as follows:
in the formula, xi+1,p,dThe position of the d-th dimension, x, of the p-th sparrow position at the i +1 th iterationi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tm30 is the maximum number of iterations of the population, P ∈ [1, P ∈]P20 is the number of sparrows in the population, D is the E [1, D ∈]D is 37, which is the dimension to be optimized, i.e. the total number of network weights and thresholds,the global optimal position of the d-th dimension of the p-th sparrow position at the ith iteration,is the d-dimensional global worst position of the p-th sparrow position at the ith iteration, s is a random number obeying (0,1) normal distribution and used for controlling the step length, and h is a constant between-1 and 1Denotes the direction of movement of the individual, fiIs the current individual fitness value, fi bCurrent global optimum fitness value, fi wIs the current global worst fitness value. 10 ∈ ═ 10-8The prevented denominator is 0.
Step 3.4, generating a random number, and judging whether t-distribution sparrow population variation is carried out or not;
the t distribution is an intermediate transition form of Gaussian distribution and Cauchy distribution, and can be converted into other distribution matrixes by adjusting the degree of freedom n. The mutation process is as follows:
in the formula (I), the compound is shown in the specification,the position of the d-dimension of the p-th sparrow position after the variation of the t distribution at the ith iteration, xi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tm30 is the maximum number of iterations of the population, P ∈ [1, P ∈]P20 is the number of sparrows in the population, D is the E [1, D ∈]D37 is the dimension to be optimized, i.e. the total number of network weights and thresholds, t (i) is the t distribution with degree of freedom i, rand is the random number generated by the iteration, pr is the dynamic selection probability, ω is10.5 is the upper limit of the dynamic selection probability, ω2The dynamic selection probability variation amplitude is 0.1.
When the sparrow search algorithm starts iteration, the iteration times are small, the t distribution is close to Cauchy distribution, and the algorithm has strong global search capability; when the iteration times are continuously increased, the t distribution is close to Gaussian distribution, and the algorithm has strong local search capability. Therefore, the sparrow search algorithm carries out population variation by using t distribution, the global search capability is enhanced at the initial stage, the local search capability is enhanced at the later stage, and the convergence accuracy of the algorithm is improved.
And 3.5, calculating individual fitness values of the two populations before and after the variation, acquiring the current optimal value of the two populations, comparing the current optimal value with the last time, and updating the global optimal value if the global optimal value is better.
Step 3.6, repeating the steps 3.3-3.5 until the maximum iteration number is reached, and stopping; the final global optimal position, i.e. the optimal individual fitness value fb([xi,p,1,...,xi,p,d,...,xi,p,D]Corresponding position [ x ]i,p,1,xi,p,2,...,xi,p,D]Building a complete network model as weight and threshold inputs for neural networks, xi,p,dThe position of the d-dimension of the position of the p-th sparrow in the ith iteration is shown, and p is the sparrow corresponding to the optimal fitness.
And 4, step 4: inputting the real-time collected summary table active reactive electric quantity and the real-time collected load point active reactive electric quantity into the optimized BP neural network for prediction to obtain a real-time predicted line loss rate;
in order to illustrate the effect of the line loss calculation method designed by the invention, the calculation result of the BtSSA-BP method is compared with the calculation result of the SSA-BP method, the comparison of the line loss rate of the test sample and the theoretical line loss rate calculated by the two methods is respectively shown in fig. 4 and 5, and the calculation error curves of the two methods are respectively shown in fig. 6 and 7. As can be seen from the figure, the calculation result of the line loss calculation method based on BtSSA-BP provided by the invention is superior to the results of a standard BP neural network and SSA-BP, and the MSE and R of the SSA-BP calculation method20.15576 and 0.80484, respectively, and the MSE and R of the BtSSA-BP line loss calculation method of the invention20.12067 and 0.84881 respectively, the two indexes show that the error is reduced, the fitting degree is increased, and the method can effectively improve the calculation accuracy of the line loss of the power distribution network.
The method for calculating the line loss of the power distribution network based on the improved sparrow search optimization BP neural network is described in detail above. The principles and embodiments of the present invention have been described herein using several examples, which are presented only to assist in understanding the method and its core concepts of the present invention; meanwhile, for those skilled in the art, based on the idea of the present invention, there may be variations in the specific embodiments and applications, and in summary, the present disclosure should not be construed as a limitation of the present invention, and those skilled in the art should include modifications, equivalent substitutions, improvements and the like without inventive labor.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, but not to limit it: while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (2)
1. A power distribution network line loss calculation method for optimizing a BP neural network by improving sparrow search is characterized by comprising the following steps:
step 1: continuously acquiring the summary table active and reactive electric quantity at a plurality of historical moments, the load point active and reactive electric quantity at a plurality of historical moments and the line loss rate at a plurality of historical moments through a power grid advanced measurement system;
step 2: respectively and sequentially carrying out abnormal data removing processing, missing data filling processing, repeated data filtering processing and data standardization processing on the summary table active reactive electric quantities at a plurality of historical moments, the load point active reactive electric quantities at a plurality of historical moments and the line loss rates at a plurality of historical moments to obtain the preprocessed summary table active reactive electric quantities at a plurality of historical moments, the preprocessed load point active reactive electric quantities at a plurality of historical moments and the preprocessed line loss rates at a plurality of historical moments;
and step 3: introducing a BP (back propagation) neural network, inputting the total table active reactive electric quantity of each preprocessed historical moment and the load point active reactive electric quantity of each preprocessed historical moment into the BP neural network for prediction to obtain the predicted line loss rate of each historical moment, constructing a BP neural network loss function model by combining the line loss rate of each preprocessed historical moment, and further performing optimization solution by a modified sparrow search algorithm through chaotic initialization and t-distribution variation fusion to obtain the optimized BP neural network;
and 4, step 4: and inputting the real-time collected summary table active reactive electric quantity and the real-time collected load point active reactive electric quantity into the optimized BP neural network for prediction to obtain a real-time predicted line loss rate.
2. The method for calculating the line loss of the power distribution network of the improved sparrow search optimized BP neural network according to claim 1, wherein the loss function model in the step 3 is specifically defined as:
in the formula, YiSample line loss rate, y, for the ith sampleiCalculating the line loss rate of the ith sample, wherein n is the total number of samples, and the loss function is the calculated mean square error;
and 3, further performing optimization solution through a sparrow search algorithm improved by chaotic initialization and t distribution variation fusion to obtain an optimized BP neural network, wherein the optimized object of the improved sparrow optimization algorithm is the weight and the threshold of the BP neural network, and the specific steps are as follows:
step 3.1, setting the size of the sparrow population, the maximum iteration times, the upper weight boundary, the lower weight boundary, the upper threshold boundary, the lower threshold boundary, the safety value, the proportion of discoverers and the proportion of cautionary users;
the dimension D of the improved sparrow optimization algorithm is as follows:
D=m×n+n×l+n+l
in the formula, m is the number of neurons in an input layer of the BP neural network, n is the number of neurons in an implicit layer of the BP neural network, and l is the number of neurons in an output layer of the BP neural network;
sparrow populations may be represented as:
wherein, XiIs sparrow population at the ith iteration, xi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tmFor the maximum number of iterations of the population, P is an element [1, P ∈]P is the number of sparrows in the population, D is equal to [1, D ]]D is the dimension to be optimized, namely the total number of the network weight and the threshold, and when D belongs to [1, mxn ∈]When xi,p,dIs the connection weight between the input layer and the hidden layer in the neural network, when d belongs to [ m x n +1, m x n + n]When xi,p,dFor the hidden layer threshold in the neural network, when d is in the range of [ m × n + n +1, m × n + n + n × l]When xi,p,dIs the connection weight between the hidden layer and the output layer in the neural network, when d belongs to [ m × n + n + n × l +1, m × n + n + n × l + l]When xi,p,dThe method comprises the following steps of (1) setting an output layer threshold value in a neural network, wherein m is the number of input layer neurons of a BP neural network, n is the number of hidden layer neurons of the BP neural network, and l is the number of output layer neurons of the BP neural network;
initializing the sparrow population by adopting Bernoulli chaotic mapping, wherein the formula is as follows:
wherein x isi,p,dPosition, x, of dimension d of the p-th sparrow position at the i-th iterationi+1,p,dThe position of the d dimension of the position of the p sparrow in the (i + 1) th iteration is shown, and the lambda epsilon (0,1) is a segmentation parameter; the dimension of the chaotic matrix is the same as that of a sparrow population matrix, and the chaotic matrix is generated and then is carried to the upper and lower boundaries of a weight threshold value, so that a chaotically initialized sparrow population is obtained;
step 3.2, defining a fitness function and calculating an initial individual fitness value; the fitness function is used for explaining the calculation accuracy of the model, the individual fitness value is obtained by taking the position corresponding to the individual as a weight and a threshold value and then carrying the weight and the threshold value into the neural network for calculation, and the specific fitness function is as follows:
in the formula, YiIs the sample line loss rate of the i-th sample, yiCalculating the line loss rate of the ith sample, wherein n is the total number of samples, and the loss function is the calculated mean square error;
Fithe fitness values of all sparrow populations at the ith iteration and the optimal fitness value f of the sparrow individualbThe corresponding sparrow positions are the optimization targets, namely the weights and the threshold values of the neural network, and the individual fitness values of all sparrows can be expressed as follows:
in the formula (f)i,p([xi,p,1,...,xi,p,d,...,xi,p,d]) Representing the individual fitness value, x, of the p-th sparrow at the ith iterationi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tmFor the maximum number of iterations of the population, P is an element [1, P ∈]P is the number of sparrows in the population, D is equal to [1, D ]]D is the dimension to be optimized, namely the network weight and the total number of the threshold values;
3.3, dividing the sparrows in the sparrow search algorithm into discoverers, joiners and cautionars, wherein the discoverers and the joiners change dynamically but do not change in proportion, and different types of sparrows have different updated position rules;
the sparrow is rich in resources in the population, namely the fitness value is high, and the sparrow is responsible for searching food and leading the participators, when danger occurs, the alarm of the sparrow individual is higher than the early warning value, and the discoverer leads the participators to go to a safe area; the position is updated as follows:
in the formula, xi+1,p,dThe p-th sparrow position in the (i + 1) th iterationPosition of d-th dimension, xi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tmFor the maximum number of iterations of the population, P is an element [1, P ∈]P is the number of sparrows in the population, D is equal to [1, D ]]D is the dimension to be optimized, namely the total number of the network weight and the threshold, c is a random constant, and c belongs to (0,1)],tmFor maximum number of iterations, r is a random number obeying a normal distribution, I1×dAll 1 matrices of 1xd, ST being the security value, R2As a warning value, R2∈[0,1];
Changing an exponential decrement factor into a normally distributed random number, introducing a global optimal fitness value of the last iteration into an updating formula of a finder, simultaneously having better global search capability in the early stage of the iteration and better local search capability in the later stage according to the characteristic that a nonlinear decrement inertia weight is better, and adopting the following weight omega according to an algorithm:
where i is the current iteration number, tmIs the maximum number of iterations;
the improved discoverer location update formula is as follows:
in the formula, xi+1,p,dThe position of the d-th dimension, x, of the p-th sparrow position at the i +1 th iterationi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tmFor the maximum number of iterations of the population, P is an element [1, P ∈]P is the number of sparrows in the population, D is equal to [1, D ]]D is the dimension to be optimized, i.e. the total number of the network weight and the threshold, omega is the inertia weight,for the global optimal fitness of the last iteration, rand (0,1) is normally randomly distributed, rTo obey a normally distributed random number, I1×dAll 1 matrices of 1xd, ST being the security value, R2For a warning value, R2∈[0,1];
The participants compete for food along with the discoverer with the best resources, the lower the fitness of the sparrows, the lower the energy of the participants possibly go to other areas to search for food; the position is updated as follows:
in the formula, xi+1,p,dThe position of the d-th dimension, x, of the p-th sparrow position at the i +1 th iterationi,p,dFor the position of the d-th dimension of the position of the p-th sparrow at the ith iteration, i belongs to [1, t ]m],tmFor the maximum number of iterations of the population, P is an element [1, P ∈]P is the number of sparrows in the population, D is equal to [1, D ]]D is the dimension to be optimized, namely the total number of the network weight and the threshold,the d-th dimension global worst position of the p-th sparrow position at the ith iteration,is the global optimum position of the d-th dimension of the p-th sparrow position in the (i + 1) th iteration, c is a random constant, and c belongs to (0,1)],A+1xd matrix of elements 1 and-1, A+=AT(A AT)-1,I1×dAn all 1 matrix of 1 xd;
individuals on the position comparison edge in the alarm can be transferred to a safety zone, and the individuals in the safety zone randomly change positions in the safety zone; the position is updated as follows:
in the formula, xi+1,p,dIs the (i + 1) th iterationPosition of dimension d, x, at the position of the p-th sparrowi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tmFor the maximum number of iterations of the population, P is an element [1, P ∈]P is the number of sparrows in the population, D is equal to [1, D ]]D is the dimension to be optimized, namely the total number of the network weight and the threshold,for the global optimal position of the d-th dimension of the p-th sparrow position at the ith iteration,is the d-dimensional global worst position of the p-th sparrow position at the ith iteration, s is a random number obeying (0,1) normal distribution and used for controlling the step length, h is a constant between-1 and represents the individual moving direction, fiFor the current value of the individual fitness value,the current global optimal fitness value is then used,is the current global worst fitness value; ε prevents the denominator from being 0;
step 3.4, generating a random number, and judging whether t-distribution sparrow population variation is carried out or not;
the t distribution is an intermediate transition form of Gaussian distribution and Cauchy distribution, and can be converted into other distribution matrixes by adjusting the degree of freedom n; the mutation process is as follows:
in the formula (I), the compound is shown in the specification,the position of the d-dimension of the p-th sparrow position after the variation of the t distribution at the ith iteration, xi,p,dThe position of the d-th dimension of the p-th sparrow position at the ith iteration, i ∈ [1, t [ ]m],tmFor the maximum number of iterations of the population, P belongs to [1, P ]]P is the number of sparrows in the population, D is equal to [1, D ]]D is the dimension to be optimized, i.e. the total number of network weights and thresholds, t (i) is the t distribution with the degree of freedom i, rand is the random number generated by the iteration, pr is the dynamic selection probability, omega1For dynamic selection of the probability upper bound, ω2Selecting a probability variation amplitude for the dynamics;
when the sparrow search algorithm starts iteration, the iteration times are small, the t distribution is close to Cauchy distribution, and the algorithm has strong global search capability; when the iteration times are continuously increased, the t distribution is close to Gaussian distribution, and the algorithm has strong local searching capacity; therefore, the sparrow search algorithm carries out population variation by using t distribution, the global search capability is enhanced at the initial stage, the local search capability is enhanced at the later stage, and the convergence accuracy of the algorithm is improved;
step 3.5, calculating individual fitness values of the two populations before and after mutation, acquiring the current optimal value of the two populations, comparing the current optimal value with the last time, and updating the global optimal value if the global optimal value is better;
step 3.6, repeating the steps 3.3-3.5 until the maximum iteration number is reached, and stopping; the final global optimal position, i.e. the optimal individual fitness value fb([xi,p,1,...,xi,p,d,...,xi,p,D]) Corresponding position [ x ]i,p,1,xi,p,2,...,xi,p,D]Building a complete network model as weight and threshold inputs to a neural network, xi,p,dThe position of the d dimension of the position of the p sparrow in the ith iteration is shown, and p is the sparrow corresponding to the optimal fitness.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210171261.4A CN114565259A (en) | 2022-02-24 | 2022-02-24 | Power distribution network line loss calculation method for optimizing BP neural network by improving sparrow search |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210171261.4A CN114565259A (en) | 2022-02-24 | 2022-02-24 | Power distribution network line loss calculation method for optimizing BP neural network by improving sparrow search |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114565259A true CN114565259A (en) | 2022-05-31 |
Family
ID=81715000
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210171261.4A Pending CN114565259A (en) | 2022-02-24 | 2022-02-24 | Power distribution network line loss calculation method for optimizing BP neural network by improving sparrow search |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114565259A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114936715A (en) * | 2022-06-20 | 2022-08-23 | 中北大学 | Fruit freshness prediction method and system based on smell information and storage medium |
CN115099652A (en) * | 2022-07-05 | 2022-09-23 | 东北电力大学 | Single electric heating load regulation capacity evaluation method based on SSA-DBP neural network |
CN115150284A (en) * | 2022-06-13 | 2022-10-04 | 上海工程技术大学 | Communication network topology optimization method and system based on improved sparrow algorithm |
CN116663645A (en) * | 2023-06-01 | 2023-08-29 | 淮阴工学院 | Motor rotor system fault diagnosis method based on Sine-SSA-BP |
-
2022
- 2022-02-24 CN CN202210171261.4A patent/CN114565259A/en active Pending
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115150284A (en) * | 2022-06-13 | 2022-10-04 | 上海工程技术大学 | Communication network topology optimization method and system based on improved sparrow algorithm |
CN114936715A (en) * | 2022-06-20 | 2022-08-23 | 中北大学 | Fruit freshness prediction method and system based on smell information and storage medium |
CN114936715B (en) * | 2022-06-20 | 2024-05-14 | 中北大学 | Fruit freshness prediction method, system and storage medium based on smell information |
CN115099652A (en) * | 2022-07-05 | 2022-09-23 | 东北电力大学 | Single electric heating load regulation capacity evaluation method based on SSA-DBP neural network |
CN116663645A (en) * | 2023-06-01 | 2023-08-29 | 淮阴工学院 | Motor rotor system fault diagnosis method based on Sine-SSA-BP |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114565259A (en) | Power distribution network line loss calculation method for optimizing BP neural network by improving sparrow search | |
CN108846517B (en) | Integration method for predicating quantile probabilistic short-term power load | |
CN108920812B (en) | Machining surface roughness prediction method | |
CN111738512A (en) | Short-term power load prediction method based on CNN-IPSO-GRU hybrid model | |
CN109242236B (en) | PMU primary frequency modulation load prediction method based on correlation full-connection neural network and LSTM | |
CN106251001A (en) | A kind of based on the photovoltaic power Forecasting Methodology improving fuzzy clustering algorithm | |
CN113762603B (en) | Photovoltaic base station short-term photovoltaic power prediction method based on improved sparrow algorithm optimization | |
CN104732300B (en) | A kind of neutral net wind power short term prediction method theoretical based on Fuzzy divide | |
CN103105246A (en) | Greenhouse environment forecasting feedback method of back propagation (BP) neural network based on improvement of genetic algorithm | |
CN110751318A (en) | IPSO-LSTM-based ultra-short-term power load prediction method | |
CN110866640A (en) | Power load prediction method based on deep neural network | |
CN110264079A (en) | Hot-rolled product qualitative forecasting method based on CNN algorithm and Lasso regression model | |
CN110675278A (en) | Photovoltaic power short-term prediction method based on RBF neural network | |
CN113219871B (en) | Curing room environmental parameter detecting system | |
CN112329990A (en) | User power load prediction method based on LSTM-BP neural network | |
CN113555881A (en) | Wind power plant frequency modulation fan sequencing method | |
CN113780664A (en) | Time sequence prediction method based on TDT-SSA-BP | |
CN110829411A (en) | Flexible power distribution network operation domain observation method considering alternating current power flow | |
Li et al. | A recognition method of plate shape defect based on RBF-BP neural network optimized by genetic algorithm | |
CN109408896A (en) | A kind of anerobic sowage processing gas production multi-element intelligent method for real-time monitoring | |
CN111612227A (en) | Load prediction method based on K-means clustering and bat optimization neural network | |
CN115689001A (en) | Short-term load prediction method based on pattern matching | |
CN109615142A (en) | A kind of wind farm wind velocity combination forecasting method based on wavelet analysis | |
Wen et al. | Short-term load forecasting with bidirectional LSTM-attention based on the sparrow search optimisation algorithm | |
CN113902492A (en) | Time-sharing electricity price prediction method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |