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 PDF

Info

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
Application number
CN202210171261.4A
Other languages
Chinese (zh)
Inventor
丁李
谢沅霏
孔政敏
刘智伟
陈超洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan University WHU
Original Assignee
Wuhan University WHU
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Wuhan University WHU filed Critical Wuhan University WHU
Priority to CN202210171261.4A priority Critical patent/CN114565259A/en
Publication of CN114565259A publication Critical patent/CN114565259A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0639Performance analysis of employees; Performance analysis of enterprise or organisation operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial 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]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N7/00Computing arrangements based on specific mathematical models
    • G06N7/08Computing arrangements based on specific mathematical models using chaos models or non-linear system models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/067Enterprise or organisation modelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply
    • YGENERAL 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
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS 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/00Systems supporting electrical power generation, transmission or distribution
    • Y04S10/50Systems 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

Power distribution network line loss calculation method for optimizing BP neural network by improving sparrow search
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:
Figure BDA0003518106540000031
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:
Figure BDA0003518106540000032
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:
Figure BDA0003518106540000041
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:
Figure BDA0003518106540000042
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:
Figure BDA0003518106540000051
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:
Figure BDA0003518106540000052
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:
Figure BDA0003518106540000053
where i is the current iteration number, tmIs the maximum number of iterations.
The improved discoverer location update formula is as follows:
Figure BDA0003518106540000061
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,
Figure BDA0003518106540000062
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:
Figure BDA0003518106540000063
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,
Figure BDA0003518106540000064
the d-th dimension global worst position of the p-th sparrow position at the ith iteration,
Figure BDA0003518106540000065
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:
Figure BDA0003518106540000066
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,
Figure BDA0003518106540000071
for the global optimal position of the d-th dimension of the p-th sparrow position at the ith iteration,
Figure BDA0003518106540000072
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:
Figure BDA0003518106540000073
Figure BDA0003518106540000074
in the formula (I), the compound is shown in the specification,
Figure BDA0003518106540000075
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
Figure BDA0003518106540000081
Figure BDA0003518106540000091
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:
Figure BDA0003518106540000101
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:
Figure BDA0003518106540000111
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:
Figure BDA0003518106540000112
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:
Figure BDA0003518106540000113
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:
Figure BDA0003518106540000121
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:
Figure BDA0003518106540000122
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:
Figure BDA0003518106540000131
where i is the current iteration number, tm30 is the maximum number of iterations.
The improved discoverer location update formula is as follows:
Figure BDA0003518106540000132
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,
Figure BDA0003518106540000133
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:
Figure BDA0003518106540000134
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,
Figure BDA0003518106540000135
the d-th dimension global worst position of the p-th sparrow position at the ith iteration,
Figure BDA0003518106540000136
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:
Figure BDA0003518106540000141
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,
Figure BDA0003518106540000142
the global optimal position of the d-th dimension of the p-th sparrow position at the ith iteration,
Figure BDA0003518106540000143
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:
Figure BDA0003518106540000144
Figure BDA0003518106540000145
in the formula (I), the compound is shown in the specification,
Figure BDA0003518106540000146
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:
Figure FDA0003518106530000011
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:
Figure FDA0003518106530000021
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:
Figure FDA0003518106530000022
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:
Figure FDA0003518106530000031
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:
Figure FDA0003518106530000032
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:
Figure FDA0003518106530000033
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:
Figure FDA0003518106530000041
where i is the current iteration number, tmIs the maximum number of iterations;
the improved discoverer location update formula is as follows:
Figure FDA0003518106530000042
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,
Figure FDA0003518106530000046
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:
Figure FDA0003518106530000043
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,
Figure FDA0003518106530000044
the d-th dimension global worst position of the p-th sparrow position at the ith iteration,
Figure FDA0003518106530000045
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:
Figure FDA0003518106530000051
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,
Figure FDA0003518106530000052
for the global optimal position of the d-th dimension of the p-th sparrow position at the ith iteration,
Figure FDA0003518106530000053
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,
Figure FDA0003518106530000054
the current global optimal fitness value is then used,
Figure FDA0003518106530000055
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:
Figure FDA0003518106530000056
Figure FDA0003518106530000057
in the formula (I), the compound is shown in the specification,
Figure FDA0003518106530000058
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.
CN202210171261.4A 2022-02-24 2022-02-24 Power distribution network line loss calculation method for optimizing BP neural network by improving sparrow search Pending CN114565259A (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (5)

* Cited by examiner, † Cited by third party
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