CN115860044A - Short-term power load prediction method based on improved squirrel search algorithm - Google Patents

Short-term power load prediction method based on improved squirrel search algorithm Download PDF

Info

Publication number
CN115860044A
CN115860044A CN202211567709.0A CN202211567709A CN115860044A CN 115860044 A CN115860044 A CN 115860044A CN 202211567709 A CN202211567709 A CN 202211567709A CN 115860044 A CN115860044 A CN 115860044A
Authority
CN
China
Prior art keywords
squirrel
algorithm
squirrels
population
neural network
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
CN202211567709.0A
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.)
State Grid Henan Electric Power Co Marketing Service Center
Original Assignee
State Grid Henan Electric Power Co Marketing Service Center
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 State Grid Henan Electric Power Co Marketing Service Center filed Critical State Grid Henan Electric Power Co Marketing Service Center
Priority to CN202211567709.0A priority Critical patent/CN115860044A/en
Publication of CN115860044A publication Critical patent/CN115860044A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to a short-term power load prediction method based on an improved squirrel search algorithm, which comprises the following steps: step 1: a squirrel search algorithm; step 2: an improved squirrel search algorithm; and step 3: testing the performance of the algorithm; and 4, step 4: a SSIWO-BP neural network short-term load prediction model; and 5: simulation experiment and analysis; the method has the advantages of improving the diversity of algorithm populations, effectively reducing the oscillation of the algorithm and the exploration and development capacity of the balance algorithm, accelerating the convergence of the algorithm, reducing errors and improving the prediction precision.

Description

Short-term power load prediction method based on improved squirrel search algorithm
Technical Field
The invention belongs to the technical field of power load prediction, and particularly relates to a short-term power load prediction method based on an improved squirrel search algorithm.
Background
In the field of computer science, the optimization problem is a problem of finding an optimal solution from all feasible solutions, the classical solution method comprises a conjugate gradient method, a branch and bound algorithm, a dynamic programming method and the like, but as the scale of the problem continuously increases, the classical solution algorithm cannot meet the requirement on time complexity, nowadays, the swarm intelligence algorithm is widely applied to the solution of the optimization problem, recently, a new swarm intelligence algorithm, namely a Squirrel Search Algorithm (SSA), is proposed, the inspiration of the swarm intelligence algorithm comes from the dynamic food-foraging behavior of squirrels, the algorithm guides squirrels to search food by defining a plurality of suboptimal solutions and a local optimal solution in each iteration so as to accelerate the convergence rate, however, the squirrel algorithm has defects in the search ability, if the squirrel algorithm cannot find a proper candidate solution in the early stage, in addition, in order to improve the global search capability of the squirrel algorithm, a jump search mechanism and a progressive search mechanism are provided to respectively increase the exploration capability of the algorithm in different search periods, but the two mechanisms can effectively improve the diversity of the algorithm population under the condition that the squirrel encounters predators, and the probability that the squirrel encounters a predator is not too high, otherwise, the process of normally searching for the optimal food by the algorithm is limited, so the search mechanism adopted after the algorithm encounters the predator is not the key point of the improvement of the algorithm; therefore, it is necessary to provide a short-term power load prediction method based on an improved squirrel search algorithm, which improves the diversity of algorithm populations, effectively reduces the concussion of the algorithm and the exploration and development capability of a balance algorithm, accelerates the convergence of the algorithm, reduces errors and improves the prediction accuracy.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a short-term power load prediction method based on an improved squirrel search algorithm, which improves the diversity of algorithm populations, effectively reduces the oscillation of the algorithm and the exploration and development capacity of a balance algorithm, accelerates the convergence of the algorithm, reduces errors and improves the prediction precision.
The purpose of the invention is realized by the following steps: a short-term power load prediction method based on an improved squirrel search algorithm comprises the following steps:
step 1: a squirrel search algorithm;
and 2, step: an improved squirrel search algorithm;
and 3, step 3: testing the performance of the algorithm;
and 4, step 4: a SSIWO-BP neural network short-term load prediction model;
and 5: and (5) simulation experiment and analysis.
The squirrel search algorithm in the step 1 specifically comprises the following steps: the squirrel search algorithm, namely SSA, is a new swarm intelligence algorithm, simulates a dynamic foraging strategy and an efficient gliding movement mode of the squirrel, the squirrel is a tree-inhabited rodent, the movement mode is mainly gliding, the gliding of the squirrel is considered as the most complex aerodynamic movement mode and is the most physical saving, the dynamic foraging behavior of the squirrel can also most effectively utilize food resources, and in the SSA algorithm, the following four necessary assumptions are provided:
(1) the method comprises the following steps Defining n squirrels in the forest, wherein each squirrel lives on one tree;
(2) the method comprises the following steps N trees in forest comprising a hickory and N fs (1<N fs Less than n) oak trees, and the rest ordinary trees;
(3) the method comprises the following steps Of the three types of trees, the hickory tree has the best food source, namely hickory nut, the oak tree has the common food source, namely acorn nut, and the common tree has no food;
(4) the method comprises the following steps Each squirrel looks for food individually and makes optimal use of food resources through dynamic foraging behavior.
The step 1 specifically comprises the following steps:
step 1.1: initializing a population: the population number in the forest is n, and the upper limit and the lower limit of the search space are respectively FS U And FS L . N squirrel individuals were randomly generated according to equation (1):
FS i =FS L +rand(1,d)×(FS U -FS L ) (i =1, 2.. Multidot.n) (1), wherein FS is i Denotes the ith th Only squirrel; rand is in [0,1 ]]A random number of (c); d is the dimension of the problem;
step 1.2: and (3) population treatment: evaluating the quality of the position of each squirrel individual through a fitness function f, inputting a decision variable, namely the position vector of the squirrel individual into the fitness function, and obtaining a corresponding result F (FS) i )=f(FS i1 ,FS i2 ,...,FS id ) (i =1, 2.. N.) is the ith th The fitness of the individual position of only the squirrel is also shownIth th The quality of the food source sought by only squirrels, then the fitness values of all squirrels are sorted in ascending order, squirrels individuals FS on the pecan tree h Individuals representing the minimum fitness value, squirrel individuals on oak FS a The representative fitness value is ranked from 2 to N fs +1 individuals, squirrel individuals on the general tree FS n The representative fitness value is ranked at N fs Fitness value individual after + 1;
step 1.3: and (3) updating the position: the process that squirrel individuals search for different kinds of food by gliding to different kinds of trees is a population position updating process, and n is randomly selected at first 1 Only the squirrel in the common tree is regulated to move towards the hickory tree, and the rest n 2 Only squirrels move towards the acorn tree, n on the acorn tree 3 Only the squirrel moves to the hickory nut tree, and the position of the squirrel is updated according to the formulas (2) to (4):
Figure BDA0003986781480000031
Figure BDA0003986781480000032
Figure BDA0003986781480000033
in the formula, t is the current iteration number; r is [0,1 ]]A random number in between; p dp Represents the probability of the occurrence of a predator, if R ≧ P dp Squirrels are safe and glide in forests looking for food if R < P dp The squirrel is forced to adopt a random walk mode to search a nearby hiding place due to the risk in the foraging process; g c The value is a fixed value of 1.9, and refers to the sliding constant of the squirrel in gliding motion; d is a radical of g Is a random sliding distance; the calculation formula is as follows:
Figure BDA0003986781480000041
in the formula, h g = (8 m) height loss after glide; sf (= 18) isA scale factor for gliding;
Figure BDA0003986781480000042
is a glide angle; the calculation formula is as follows: />
Figure BDA0003986781480000043
Wherein D is the resistance of the squirrel in gliding; l is a lift force; the specific calculation formula is as follows: />
Figure BDA0003986781480000044
Where ρ (= 1.204 kgm) -3 ) Is the air density; v (= 5.25 ms) -1 ) The squirrel gliding speed; s (= 154 cm) 2 ) Is the squirrel surface area; c D (= 0.6) is a frictional resistance coefficient; c L Is [0675,1.5 ]]Random numbers in between, representing lift coefficients; />
Step 1.4: and (3) season switching judgment: seasonal monitoring conditions introduced into the SSA are helpful for the algorithm to jump out of a local optimal solution, when the squirrel algorithm starts iterative optimization, the whole environment of the SSA algorithm is in winter, all individuals can update the positions according to the mode in the step 1.3, and after all the individuals are updated, whether the seasons change is judged according to the formulas (9) to (10):
Figure BDA0003986781480000045
Figure BDA0003986781480000046
wherein T is the maximum iteration number; t is the current iteration number; when season constant->
Figure BDA00039867814800000411
Less than the seasonal constant minimum (S) min ) Is at time, i.e. ->
Figure BDA0003986781480000047
Showing that the season is changed from winter to summer, and finding F after the season is changed h The squirrel individual will stay at the updated position, find F a And the successfully survived squirrel individuals are re-used according to the formula (11)Determining the position: />
Figure BDA0003986781480000048
The calculation formula of the Levy function is as follows: />
Figure BDA0003986781480000049
In the formula, r a 、r b Is [0,1 ]]Normal distribution random number in between; β is a constant with a value of 0.5; xi is calculated as: />
Figure BDA00039867814800000410
where Γ (x) = (x-1) |! (ii) a In summary, the flowchart of the SSA algorithm is shown in fig. 1.
The improved squirrel search algorithm in the step 2 specifically comprises the following steps: a season monitoring mechanism is introduced into a standard SSA algorithm, and the algorithm flies to an optimal solution in a mode of parallel multiple elite solutions, so that the exploration capability of the algorithm in a problem domain is greatly improved, the initial exploration of the algorithm is facilitated, but in the later convergence process, the SSA algorithm stays at a local solution for a plurality of times, the convergence is too slow, and for a high-dimensional optimization problem, the algorithm is easy to fall into the local optimal solution in the later period, which is caused by insufficient diversity of a population; the fitness value of each squirrel position describes the quality of the food it searches for, as well as their probability of survival and probability of reproduction, so that squirrels on pecan trees survive more than squirrels on oak and regular trees, and likewise, because of the better survival environment, reproduce more than squirrels on other trees, inspiring: the weed algorithm has few parameters of propagation and space diffusion mechanisms, simple structure and strong local search capability; the IWO algorithm increases the population diversity, thereby enhancing the global search capability of SSA; the invasive weed algorithm is introduced into the SSA algorithm to increase the population diversity, so that a squirrel search algorithm based on a weed breeding mechanism, namely an SSIWO algorithm, is provided.
The step 2 specifically comprises the following steps:
step 2.1: a reproduction mechanism of squirrels;
step 2.2: chaotic inertial weight: the method is characterized in that the concept of inertia weight omega is introduced into a particle swarm algorithm for the first time, and indicates that larger inertia weight is favorable for development and smaller inertia weight is favorable for exploration, because the commonly used linear descending inertia weight is too simple and has low randomness, in order to ensure that the inertia weight keeps descending trend and has randomness in each iteration, a chaotic inertia weight is introduced, firstly, a logistic mapping chaotic model is used for generating a chaotic sequence, and the specific expression is as follows:
Figure BDA0003986781480000051
wherein Z (n + 1) is the value of the currently generated chaotic series; λ is a control parameter, and when λ =4, the system is completely in a chaotic state; let λ =4, and multiply the generated chaos sequence by the linearly decreasing inertial weight to construct a chaos inertial weight, whose expression is: />
Figure BDA0003986781480000052
Wherein Z represents the generated chaotic sequence; t is the current iteration number; t is the maximum iteration number; omega 0 Is the initial inertial weight; omega f Is the final inertial weight; in general, the inertia weight ω 0 =0.9、ω f The best performance of the algorithm when = 0.4; introducing chaotic inertia weight on the basis of the formulas (2) to (4), wherein the formulas are shown as (18) to (20):
Figure BDA0003986781480000061
Figure BDA0003986781480000062
Figure BDA0003986781480000063
the notation in the formula corresponds to the formulas (2) to (4);
step 2.3: elite-random selection strategy: SSIThe WO algorithm relates to the problem that the number of the squirrels exceeds the maximum population limit after each generation of breeding, the IWO algorithm tends to a selection strategy that is sorted according to fitness values and information of poor fitness is deleted, although the good fitness has higher probability to increase population diversity, the selection strategy has larger limitation, in order to accelerate the selection and increase the population diversity, an elite-random selection strategy is selected, after the squirrels generated by each generation of breeding are sorted, only a plurality of better squirrels are kept, the rest squirrels are randomly selected until the maximum population limit is met, the squirrels which meet the requirement of large fitness value simultaneously based on the elite-random selection strategy survive because of the better survival environment, the squirrels with small fitness values are eliminated, and the final number is kept at the original scale P max
Step 2.4: SSIWO algorithm.
The step 2.1 specifically comprises the following steps:
step 2.11: determining the reproduction quantity of squirrels: according to the weed breeding characteristics, firstly, determining that squirrels can breed cubs in a better living area, such as the squirrels on pecan trees and acorns, the squirrels are rich in food sources and suitable for living and breeding, determining the breeding quantity according to the fitness value, the breeding capacity of the squirrels in the area which is more suitable for living is stronger, the breeding cubs are more numerous, the number of cubs produced by the squirrels in the father generation is in a linear relation with the fitness of the father generation, and the formula is as follows:
Figure BDA0003986781480000071
wherein F (FS) i ) Is the paternal squirrel fitness value; f. of max 、f min Maximum and minimum fitness of the population, respectively; s. the max Representing the maximum number of populations;
step 2.12: spatial diffusion: the offspring squirrel is in a normal distribution mode with the average value of 0 and the standard deviation of sigma and the Step length Step ∈ [ -sigma, sigma]Distributed around the parent squirrel search space, where the standard deviation σ changes during the iteration, with the formula:
Figure BDA0003986781480000072
in the formula, σ 0 Is the starting standard deviation; sigma f The final standard deviation; t is the maximum iteration number; t is the current iteration number; h is a nonlinear harmonic index; by adopting the method, the squirrel generates remote cubs which are distributed in the surrounding space in a mode of higher probability when the distance is closer, and meanwhile, the global and local searching capability of the algorithm is improved.
The step 2.4 specifically comprises the following steps:
step 2.41: initializing squirrel population position, population size and maximum iteration number parameters;
step 2.42: calculating population fitness, arranging in descending order, and declaring squirrels on hickory trees, oak trees and common trees;
step 2.43: randomly selecting n 1 Squirrel on ordinary tree moves to hickory, n 2 Squirrels moving only to the oak tree, n on the oak tree 3 Only the squirrel moves towards the hickory nut, and the moving mode is as the formulas (18) - (20);
step 2.44: generating and diffusing new squirrels according to the breeding mechanism of the step 2.1, wherein the positions of the squirrels are influenced by predators, and the squirrels randomly walk to find hidden places under the condition that the predators exist;
step 2.45: according to the elite-random selection strategy in the step 2.3, selecting a value with better fitness as an initial value of next generation iteration so as to ensure that the population scale is unchanged;
step 2.46: calculating a seasonal constant and a seasonal constant minimum;
step 2.47: setting seasonal variation constraint conditions, and if the conditions are met, resetting the position of the squirrel by using a formula (11);
step 2.48: and repeating the steps 2.422 to 2.47 until the maximum iteration number is reached and outputting the optimal solution.
The algorithm performance test in the step 3 specifically comprises the following steps:
step 3.1: benchmark test function: in order to test the effectiveness of the algorithm, 23 benchmark test functions are selected for experimental verification, the 23 benchmark test functions are solved by using an SSIWO algorithm and are compared with PSO, ICA, IWO, ABC and SSA, wherein each algorithm is iterated 1000 times at the maximum, the population scale is 50, the algorithm operates 30 times independently, the SSIWO algorithm is consistent with parameters in the SSA, and the maximum population scale is set to be 80;
step 3.2: test results and analysis: with the increase of problem dimensionality, the phenomenon of local optimization falling into the SSIWO rarely occurs, while the other five algorithms have good convergence effects, but the phenomenon of premature convergence occurs on individual test functions, and the robustness of the SSIWO in solving the optimization problem is high.
The SSIWO-BP neural network short-term load prediction model in the step 4 specifically comprises the following steps:
step 4.1: BP neural network: a BP neural network is a multilayer feedforward neural network trained according to the reverse propagation algorithm of error, it is the most extensive neural network that applies at present, the key feature of the network is that the signal transmits forward, predict the error of output and actual output transmits backward, in transmitting forward, the input variable is from the input layer through the hidden layer is processed, until the output layer, the neuron state of each layer only influences the neuron state of the next layer, carry on the dynamic adjustment of weight and threshold value according to the difference between actual output value and the output value of the output layer, until outputting and approaching the actual output infinitely finally;
and 4.2: data preprocessing: the input sample data type and unit are not consistent, the numerical value size is greatly different, smaller data can be submerged by larger data, information loss can be caused, the neural network is often subjected to neuron saturation if original data is directly used in the training and learning process, the situation is avoided in the prediction process, data normalization processing is required, input data and output data are normalized according to a formula (21) so that the values of all data are [ -1,1]The method comprises the following steps:
Figure BDA0003986781480000091
in the formula (II)>
Figure BDA0003986781480000092
Is a normalized value; x min Is the sample minimum; x max Is the maximum value of the sample;
step 4.3: SSIWO-BP neural network model: when the BP neural network is actually applied, the convergence speed of the network is low, the network is easy to fall into local optimization, and the problem of overfitting is easy to occur when few training samples are used, so that the global search capability of SSIWO is adopted to optimize the weight and the threshold of the BP neural network, the SSIWO is used for optimizing the BP neural network to reduce the possibility of falling into local optimization, and meanwhile, the convergence speed and the prediction accuracy of the network can be improved.
The step 4.3 comprises the following steps:
step 4.31: network initialization: determining the number of nodes of an input layer, the number of nodes of an output layer, the number of nodes of a hidden layer, a given learning rate and a neuron excitation function according to the equal input label number and the output power load dimension number which affect the power load such as meteorological factors, date types and the like, selecting an activation function as shown in a formula (22), initiating the connection weight among the output layer, the hidden layer and the output layer, initializing a threshold value of the hidden layer and a threshold value of the output layer, and sequentially setting the weight and the threshold value as omega 1 、ω 2 ,...,ω n
Figure BDA0003986781480000093
Step 4.32: initializing squirrel population: all the weights and thresholds of the BP neural network are used as the squirrel population for coding, and the population dimension D is calculated as shown in a formula (23), so that the vector X i (t)=[X i1 (t),X i2 (t),...,X iD (t)]Representing the position of the squirrel i on a D-dimensional space, the initial size of the population is N, the maximum size is N: d = I × H + H + H × O + O (23), wherein I, H, O are the number of input layer neurons, the number of hidden layer neurons and the number of output layer neurons, respectively; according to the input variable X, the connection weight omega between the input layer and the hidden layer ij And a hidden layer threshold value a, calculating hidden layer output H, and connecting a weight omega between the hidden layer and the output layer according to the hidden layer output H jk And a threshold b, wherein the formula for calculating the predicted output O of the BP neural network is as follows:
Figure BDA0003986781480000094
step 4.33: fitness function: each squirrel represents the weight and the threshold value of a group of networks, a corresponding BP neural network model is established after decoding, a sample data training model is used for simulation prediction, the root mean square error is used as the adaptability value f of the squirrel, and the calculation formula is as follows:
Figure BDA0003986781480000101
in the formula, n is the number of samples; y is i Is the observed value of sample i; o i Is the predicted value of the sample i;
step 4.34: sorting the fitness values: sorting in a descending order according to the fitness value, and recording the position of the squirrel as FS according to the fitness value ht 、FS nt 、FS at Updating the position of the squirrel according to a position updating formula;
step 4.35: growth, propagation and competition: each individual randomly generates a new squirrel according to a breeding mechanism, namely a new position in the space is generated, and the bred population and the original population evaluate the solution with the best fitness according to a competitive survival rule;
step 4.36: establishing an SSIWO-BP neural network model: repeating the steps 4.32-4.35 until an optimal solution is obtained, and generating the weight of the neural network and the threshold vector omega after decoding the optimal solution * =(ω 1 * 、ω 2 * ,...,ω n * ) Establishing an SSIWO-BP neural network model;
step 4.37: normalizing the data of the days to be measured, inputting the normalized data into the established neural network model, operating and outputting the load result of the prediction days: when the training times reach the specified times, if the loss function is converged, the neural network training is finished; if the loss function does not converge, the number of training passes is increased until the loss function converges.
The invention has the beneficial effects that: the invention is a short-term power load prediction method based on an improved squirrel search algorithm, and in use, aiming at the problem that the traditional squirrel algorithm is easy to fall into local optimum, the invention improves the global search capability of the squirrel algorithm by introducing a propagation mechanism, chaotic inertial weight and elite random selection strategy of a weed algorithm, and provides an improved squirrel search algorithm (SSIWO), wherein the introduction of the propagation mechanism of the weed algorithm improves the population diversity of the squirrel algorithm; chaotic inertial weight is combined in the position updating of the population, so that the oscillation of the algorithm and the exploration and development capacity of the balance algorithm can be effectively reduced; an elite random selection strategy further ensures population diversity and accelerates convergence of the algorithm, and experimental results of 23 benchmark test functions show that the improved squirrel-calculating method can effectively jump out of local optima; meanwhile, the convergence precision and the convergence speed are greatly improved, in order to further verify the reliability and the practicability of SSIWO, the weight and the threshold of the BP neural network are optimized by using an improved squirrel algorithm, a short-term load prediction model (SSIWO-BP) is established, the accuracy and the effectiveness of the prediction model are verified by examples, and the results show that the SSIWO-BP model can better reduce the prediction error and improve the prediction precision by comparing with the existing SSA-BP and BP neural network models; the invention has the following advantages: 1. providing a reproduction mechanism of squirrels, wherein the mechanism increases the number of candidate solutions in each iteration to improve the population diversity of the algorithm; 2. combining the chaotic inertia weight in the position updating of the population, and traversing all states in a certain range according to the rule of the population without repetition so as to reduce the oscillation of the algorithm and balance the development and exploration capacity of the algorithm; 3. introducing an elite random selection strategy, when the population number reaches the upper limit, firstly preserving a better solution, then deleting the rest solutions in a random mode, ensuring the diversity of the population and simultaneously accelerating the convergence of the algorithm, verifying the effectiveness and reliability of the SSIWO algorithm by adopting a reference test function, applying the SSIWO algorithm to the optimization of neural network parameters, and establishing an SSIWO-BP neural network model to predict the short-term power load of a place; the method has the advantages of improving the diversity of algorithm populations, effectively reducing the oscillation of the algorithm and the exploration and development capacity of the balance algorithm, accelerating the convergence of the algorithm, reducing errors and improving the prediction precision.
Drawings
FIG. 1 is a flow chart of the SSA algorithm of the present invention.
FIG. 2 is a schematic diagram showing the comparison of the two algorithm space search modes according to the present invention.
Fig. 3 is a flow chart of SSIWO algorithm of the present invention.
FIG. 4 is a two-dimensional representation of a benchmark test function according to the present invention.
FIG. 5 is a diagram illustrating the convergence analysis of the algorithms of the present invention under the standard function.
Fig. 6 is a BP neural network topology map of the present invention.
Fig. 7 is a flow chart of the SSIWO-BP neural network model of the present invention.
FIG. 8 is a graph of a linear regression curve according to the present invention.
FIG. 9 is a load prediction graph of three neural network models according to the present invention
FIG. 10 is a diagram of a benchmark test function according to the present invention.
FIG. 11 is a diagram of a benchmark test function of the present invention.
FIG. 12 is a third diagram illustrating a benchmark test function according to the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
Example 1
As shown in fig. 1 to 12, the short-term power load prediction method based on the improved squirrel search algorithm includes the following steps:
step 1: a squirrel search algorithm;
step 2: an improved squirrel search algorithm;
and step 3: testing the performance of the algorithm;
and 4, step 4: a SSIWO-BP neural network short-term load prediction model;
and 5: and (5) simulation experiment and analysis.
The step 2 specifically comprises the following steps:
step 2.1: a reproduction mechanism of squirrels;
step 2.2: chaotic inertial weight: the concept of inertial weight omega is introduced into the particle swarm optimization for the first time,and indicating that a larger inertia weight is beneficial to development, a smaller inertia weight is beneficial to exploration, because the commonly used linear decreasing inertia weight is too simple and has low randomness, in order to ensure that the inertia weight keeps a decreasing trend and has randomness in each iteration, introducing a chaotic inertia weight, firstly, using a logistic mapping chaotic model to generate a chaotic sequence, wherein the specific expression is as follows:
Figure BDA0003986781480000131
wherein Z (n + 1) is the value of the currently generated chaotic series; λ is a control parameter, and when λ =4, the system is completely in a chaotic state; let λ =4, and multiply the generated chaos sequence by the linearly decreasing inertial weight to construct a chaos inertial weight, whose expression is: />
Figure BDA0003986781480000132
Wherein Z represents the generated chaotic sequence; t is the current iteration number; t is the maximum iteration number; omega 0 Is the initial inertial weight; omega f Final inertial weight; in general, the inertia weight ω 0 =0.9、ω f The best performance of the algorithm when = 0.4; introducing chaotic inertia weight on the basis of the formulas (2) to (4), wherein the formulas are shown as (18) to (20):
Figure BDA0003986781480000133
Figure BDA0003986781480000134
Figure BDA0003986781480000135
the symbol descriptions in the formulae are consistent with formulae (2) to (4);
step 2.3: elite-random selection strategy: the SSIWO algorithm involves the problem that the maximum population limit of the rats is exceeded after each generation of breeding, and the IWO algorithm tends to sort according to fitness value and has poor adaptabilityThe selection strategy of deleting the information of the degree, although the better fitness has higher probability to increase the population diversity, the selection strategy has larger limitation, in order to increase the population diversity while accelerating the selection, an elite-random selection strategy is selected, after the squirrels generated by breeding each generation are sequenced, only a plurality of better squirrels are selected and reserved, the remaining squirrels are randomly selected until the maximum population limit is met, the selecting strategy based on elite-random selection also meets the condition that the squirrels with large fitness value survive because the better living environment is selected, the squirrels with small fitness value are eliminated, and the final number is kept at the original scale P max
Step 2.4: SSIWO algorithm, a flow chart of the algorithm is shown in fig. 3.
The step 2.1 specifically comprises the following steps:
step 2.11: determining the reproduction quantity of squirrels: according to the weed breeding characteristics, firstly, determining that squirrels can breed cubs in a better living area, such as the squirrels on pecan trees and acorns, the squirrels are rich in food sources and suitable for living and breeding, determining the breeding quantity according to the fitness value, the breeding capacity of the squirrels in the area which is more suitable for living is stronger, the breeding cubs are more numerous, the number of cubs produced by the squirrels in the father generation is in a linear relation with the fitness of the father generation, and the formula is as follows:
Figure BDA0003986781480000141
wherein F (FS) i ) Is the paternal squirrel fitness value; f. of max 、f min Maximum and minimum fitness of the population, respectively; s max Representing the maximum number of populations;
step 2.12: spatial diffusion: the offspring squirrel is in a normal distribution mode with the average value of 0 and the standard deviation of sigma and the Step length Step ∈ [ -sigma, sigma]Distributed around the parent squirrel search space, where the standard deviation σ varies during the iteration, with the formula:
Figure BDA0003986781480000142
in the formula, σ 0 Is the starting standard deviation; sigma f To be the final markTolerance; t is the maximum iteration number; t is the current iteration number; h is a nonlinear harmonic index; by adopting the method, the squirrel generates remote cubs which are distributed in the surrounding space in a mode of increasing the probability of the nearer squirrel, and meanwhile, the global and local searching capability of the algorithm is improved; the pseudocode for the SSIWO squirrel breeding mechanism is shown in algorithm 1 in the following table:
Figure BDA0003986781480000143
Figure BDA0003986781480000151
the algorithm performance test in the step 3 specifically comprises the following steps:
step 3.1: benchmark test function: in order to test the effectiveness of the algorithm, 23 benchmark test functions are selected for experimental verification, the 23 benchmark test functions are solved by using an SSIWO algorithm and are compared with PSO, ICA, IWO, ABC and SSA, wherein each algorithm is iterated 1000 times at the maximum, the population scale is 50 and independently runs 30 times, the SSIWO algorithm is consistent with parameters in the SSA, the maximum population scale is set to be 80, the experimental result is shown in figure 10 and comprises the average value (Mean) and the standard deviation (Std) of the 30 running results of each benchmark test function;
in this embodiment, the benchmark functions are shown in FIGS. 10-12, where the functions in FIG. 10 are unimodal, and these functions are used to evaluate the algorithm's developability; the functions in fig. 11 and 12 are respectively a multi-peak function and a fixed-dimension multi-peak function, which include a number of locally optimal solutions that increase exponentially with increasing problem dimension, and thus are used to evaluate the exploitability of the algorithm, and fig. 4 is a two-dimensional simplified diagram of these test functions, where F1, F2, F3, F4 are single-peak functions; f7, F9, F10 and F11 are multi-modal functions; f13, F15, F17 and F19 are fixed-dimension multi-modal functions;
step 3.2: test results and analysis: with the increase of problem dimensionality, the phenomenon of local optimization falling into the SSIWO rarely occurs, while the other five algorithms have good convergence effects, but the phenomenon of premature convergence occurs on individual test functions, and the robustness of the SSIWO in solving the optimization problem is high.
In this embodiment, as can be seen from table 4, SSIWO finds a better solution in the reference test functions F1 to F4 and F7, PSO finds a better solution only in the functions F5 and F6, and the optimization effect of other algorithms is not obvious, so that the SSIWO algorithm has higher convergence accuracy in solving the unimodal problem; as can be seen from Table 5, SSIWO finds a better solution in the benchmark test functions F8-F11; the PSO algorithm finds a better solution in F12; the ICA algorithm finds the best solution in F13, and therefore, the SSIWO algorithm performs best on multimodal problems; as can be seen from Table 6, the SSIWO algorithm finds better solutions in F14-F18, F20 and F23; the IWO algorithm finds a better solution in F19, so that the SSIWO algorithm has better effect than other five algorithms in the multi-peak problem of fixed dimension;
it can be seen from fig. 5 that IWO, PSO, ICA, ABC and SSA do not converge to an ideal value in the unimodal functions F1-F3 and F7, and the accuracy is improved while the SSIWO algorithm converges rapidly, which is enough to indicate that the development capability of the SSIWO algorithm is very strong, the SSIWO multi-peak functions F9-F11 have better convergence effect, PSO, IWO and ABC fall into local extrema, the function F10 is a continuous, rotating and inseparable multi-peak function, and is commonly used for testing the capability of the algorithm jumping out of the local extrema, the SSIWO algorithm greatly enhances the capability of resisting "premature" while maintaining the convergence speed, the convergence difference between several algorithms F15-F17 and F19 is not obvious, but it can be seen in fig. 12 that the accuracy of the SSIWO algorithm is relatively high;
in conclusion, with the increase of problem dimensionality, the phenomenon of local optimization is rarely caused by SSIWO, while the other five algorithms have good convergence effects, but the phenomenon of premature convergence occurs on individual test functions, and the robustness of SSIWO in solving the optimization problem is high.
TABLE 4 Convergence characteristic test of the four algorithms (average of 30 runs)
PSO ICA IWO ABC SSA SSIWO
F1 Mean 9.8247E-20 1.4814E-12 6.9772E-08 1.2137E-03 1.0989E-11 3.1875E-48
Std 1.7017E-19 2.5659E-12 1.2085E-07 2.0158E-03 1.9033E-11 5.5208E-48
F2 Mean 7.4415E-07 7.0018E-08 3.6507E-04 2.5197E+01 3.2690E-06 6.2324E-31
Std 1.6640E-06 1.5657E-07 8.1632E-04 5.6342E+01 7.3098E-06 1.0795E-30
F3 Mean 1.3500E-02 2.6500E-01 1.1386E-06 4.6825E+01 3.1320E-11 2.3011e-61
Std 3.0100E-02 5.9250E-01 2.5460E-06 1.0470E+02 7.0035E-11 3.9857e-61
F4 Mean 2.8000E-03 9.2150E-01 3.8854E-05 4.1288E+00 2.2746E-07 1.1413E-15
Std 6.1000E-03 2.0604E+00 8.6880E-05 9.2322E+00 5.0862E-07 2.5519E-15
F5 Mean 4.1389E+00 1.8033E+01 4.9488E+00 6.9425E+00 5.6242E+00 5.7636E+00
Std 9.2548E+00 4.0324E+01 1.1066E+01 1.5524E+01 1.2576E+01 1.2888E+01
F6 Mean 2.6876E-22 6.2188E-13 4.0940E-08 3.4000E-03 4.0650E-01 3.6440E-01
Std 6.0097E-22 1.3906E-12 9.1546E-08 7.7000E-03 9.0890E-01 8.1490E-01
F7 Mean 4.0000E-03 3.1000E-03 2.2000E-03 1.9890E-01 4.2738E-04 4.4229E-06
Std 8.9000E-03 7.0000E-03 4.8000E-03 4.4470E-01 9.5565E-04 9.8900E-06
TABLE 5 Convergence characteristic test of four algorithms (average of 30 runs)
PSO ICA IWO ABC SSA SSIWO
F8 Mean -1.5251E+03 -6.9215E+03 -1.2808E+03 -1.6183E+03 -5.4063E+02 -5.0799E+03
Std 3.4103E+02 6.5326E+02 2.8640E+03 3.6187E+03 1.2089E+02 3.1118E+02
F9 Mean 5.1738E+00 0.0000E+00 6.5667E+00 3.6091E+01 6.9149E+00 2.1487E-11
Std 1.1569E+01 0.0000E+00 1.4684E+01 8.0701E+01 1.5462E+01 4.8046E-11
F10 Mean 1.2426E-11 2.5461E-07 6.1697E-05 3.9836E+00 3.4250E-04 1.5987E-15
Std 2.7786E-11 5.6933E-07 1.3796E-04 8.9075E+00 7.6585E-04 3.5748E-15
F11 Mean 2.0018E-03 8.8012E-03 2.0157E-03 8.7103E-03 1.6032E-09 1.2643E-13
Std 4.40290E-03 1.9800E-02 1.0231E-02 1.9500E-02 3.5849E-09 2.8271E-13
F12 Mean 7.2792E-23 1.0635E-14 4.0167E-10 4.1174E+00 2.6600E-02 2.6100E-02
Std 1.6277E-22 2.3781E-14 8.9816E-10 9.2067E+00 5.9600E-02 5.8300E-02
F13 Mean 6.0923E-09 4.3268E-22 5.9594E-14 1.1439E+01 1.0350E-01 2.1790E-01
Std 1.3623E-08 9.6751E-22 1.3326E-13 2.5578E+01 2.3150E-01 4.8720E-01
TABLE 6 Convergence characteristics test of the four algorithms (average of 30 runs)
PSO ICA IWO ABC SSA SSIWO
F14 Mean 3.6271E+00 5.2549E+00 7.2169E+00 6.2587E+00 3.2791E+00 2.1159E+00
Std 3.2421E-03 2.1578E-02 6.2158E-03 1.5269E-01 2.3641E-03 3.0146E-04
F15 Mean 8.2115E-05 6.1497E-05 1.4415E-04 6.3599E-05 6.2996E-05 6.1497E-05
Std 1.8362E-04 1.3751E-04 3.2233E-04 1.4221E-04 1.4086E-04 1.3751E-04
F16 Mean -1.0316E+00 -1.0316E+00 -1.0316E+00 -1.0316E+00 -1.0316E+00 -1.0316E+00
Std 2.1562E-03 2.3649E-05 1.2567E-02 5.1237E-04 6.1237E-06 2.3478E-07
F17 Mean 0.3979E+00 0.3978E+00 0.3979E+00 0.3979E+00 0.3979E+00 0.3980E+00
Std 1.7790E-03 3.1549E-02 5.2794E-03 3.1547E-04 1.4618E-04 3.4751E-04
F18 Mean 3.0000E+00 3.0000E+00 3.0020E+00 3.0030E+00 3.0020E+00 3.0000E+00
Std 1.0145E-10 2.1466E-12 5.7961E-11 4.1354E-12 3.1546E-10 4.1623E-12
F19 Mean -2.1548E+00 -3.8544E+00 -3.8632E+00 -3.2541E+00 -2.1543E+00 -3.8550E+00
Std 4.1235E-02 1.4561E-02 4.1876E-01 5.1549E-02 2.1589E-01 1.7237E-03
F20 Mean -2.6440E+00 -2.1530E+00 -2.4060E+00 -2.8240E+00 -2.5720E+00 -3.2100E+00
Std 1.4216E+00 3.1286E+00 0.4259E+00 1.4726E+00 1.4873E+00 0.4001E+00
F21 Mean -5.2610E+00 -2.0306E+00 -2.0306E+00 -2.0306E+00 -1.6838E+00 -8.0019E+00
Std 1.1764E+00 4.5406E+00 4.5536E+00 3.5483E+00 3.7651E+00 2.4764E+00
F22 Mean -2.5237E+00 -3.0806E+00 -2.7230E+00 -7.0806E+00 -1.0873E+00 -9.8868E+00
Std 2.1627E+00 5.1239E+00 3.4819E+00 4.6523E+00 3.4505E+00 2.2190E+00
F23 Mean -9.3454e+00 -9.1458E+00 -9.2468E+00 -10.1256E+00 -10.1458E+00 -10.2764E+00
Std 2.1458E-01 1.0246E-01 2.1465E-02 3.1796E-04 1.1219E-05 3.1572E-04
The SSIWO-BP neural network short-term load prediction model in the step 4 specifically comprises the following steps:
step 4.1: BP neural network: a BP neural network is a multi-layer feedforward neural network trained according to an error back propagation algorithm, which is the most widely applied neural network at present, and is mainly characterized in that signals are transmitted in a forward direction, errors between predicted output and actual output are transmitted in a reverse direction, input variables are processed from an input layer through a hidden layer to an output layer in the forward direction, the neuron state of each layer only affects the neuron state of the next layer, dynamic adjustment of weight and threshold is carried out according to the difference value between the output value and the actual output value of the output layer until the final output is infinitely close to the actual output, the topological structure of the BP neural network is shown in figure 6, X in the figure is X, and the number of the input variables is equal to the number of the output variables 1 ,X 2 ,...,X n Is an input value of the network; y is 1 ,Y 2 ,...,Y m Is the output value of the network; omega ijjk Is the weight of the network; the BP neural network actually completes the function mapping from n independent variables to m dependent variables;
step 4.2: data preprocessing: the input sample data type and unit are not consistent, the numerical value size is greatly different, smaller data can be submerged by larger data, information loss can be caused, the neural network is often subjected to neuron saturation phenomenon if original data is directly used in the training and learning process, the data needs to be subjected to normalization processing in the prediction process, and the input data and the output data are normalized according to a formula (21) so that the values of all data are [ -1,1]The method comprises the following steps:
Figure BDA0003986781480000181
in the formula (II)>
Figure BDA0003986781480000182
Is a normalized value; x min Is the sample minimum; x max Is the maximum value of the sample;
step 4.3: SSIWO-BP neural network model: when the BP neural network is actually applied, the convergence speed of the network is low, the network is easy to fall into local optimization, and the problem of overfitting is easy to occur when few training samples are used, so that the global search capability of SSIWO is adopted to optimize the weight and the threshold of the BP neural network, the SSIWO is used for optimizing the BP neural network to reduce the possibility of falling into local optimization, and meanwhile, the convergence speed and the prediction accuracy of the network can be improved.
In the embodiment, short-term load prediction is a key technology for reliable, safe and economic operation of a power grid, power load change mainly depends on daily life and working power consumption conditions of people and is also influenced by some random factors, such as air temperature, weather types and the like, from a certain angle, the change of the short-term load has a certain rule and also has certain randomness, so that the change condition of the power load is analyzed and mined as much as possible through the conventional historical power consumption data, an important role is played in reducing prediction errors for future load requirements, the BP neural network prediction method is actually a nonlinear fitting method, has a good effect on short-term load prediction of more training samples and prediction points near space, generally, the power load condition of 24 hours in the future is predicted, the dimensionality of the samples is usually very high, a BP neural network is independently used for predicting high-dimensional power loads, and has great limitation, the gradient is lowered in high-dimensional degrees, the WO neural network algorithm is optimized, the weight of a multi-modal nonlinear function is easily subjected to local optimal solution, and the weight loss is minimized by taking the weight of the WO neural network algorithm and the weight loss as a target function.
In this embodiment, simulation experiment and analysis: in order to verify the condition of the SSIWO-BP model in short-term load prediction application, historical power load data and meteorological factor data (including the highest temperature of the day) from 1 month and 1 day to 2015 year and 1 month and 10 days in a certain area are selectedDegree, daily minimum temperature, daily average temperature, daily relative humidity, rainfall, etc.) to calculate 26544 × 11 data points, firstly, carrying out normalization processing on the data, taking the first 80% of the data as a training sample set, about 21000 × 11 sample points, taking the remaining 20% of the data as a test sample set, and using parameters of an SSIWO algorithm: p dp =0.3,G C =1.9, σ =0.9, number of initial population nP op 0=50, maximum population number nP op 1=80, the number of iterations is 500, and since the number of labels of a sample is 11, the number of labels of an input sample is 10, and the number of labels of an input sample is 1 (a load value to be predicted), the number of nodes of an input layer of the BP neural network is set to 10, the number of nodes of an output layer is set to 1, the number of nodes of an implicit layer is set to 20 according to experience, that is, the topology structure of the BP neural network is "10-20-1", and an activation function of a network intermediate layer is a Sigmoid function; the neuron activation function of the output layer is a logsig function, and the simulation test platform is Matlab R2018a; constructing a BP neural network model and an SSA-BP neural network model, comparing the models with an SSIWO-BP model, and calculating to obtain the relative error between a predicted load value and an actual power load value, wherein the load prediction error is shown in a table 7:
TABLE 7 load prediction error
Figure BDA0003986781480000191
Figure BDA0003986781480000201
According to the relative error data in table 7, the average relative error of the SSIWO-BP neural network model is calculated to be 0.016, the average error of the ssa-BP neural network model is calculated to be 0.024, and the average error of the BP neural network model is calculated to be 0.027; compared with a BP neural network and a PSO-BP neural network, the SSIWO-BP neural network model reduces prediction errors and improves prediction accuracy, a linear regression curve of an output value and an expected value of the prediction model is shown in figure 8, the output value and the expected value are normalized data, and a correlation coefficient R is 0.99417, so that the degree of fitting of the output value and the expected value of the model is high, and the training effect of the SSIWO optimized BP neural network prediction model is good; fig. 9 is a load prediction curve of three neural network models, in the graph, compared with the SSA-BP neural network, the short-term load prediction result of the SSIWO-BP neural network model is closer to the actual load, so that the optimization of the BP neural network by using SSIWO can avoid the disadvantage that the BP neural network is easy to fall into a local minimum and the training precision is not high, and improve the precision of power load prediction;
the invention improves a squirrel search algorithm based on three measures of a squirrel breeding strategy, a chaotic inertial weight and an elite-random selection strategy, tests the performance of the improved algorithm by using 23 reference test functions, and compares the performance with five algorithms of PSO, ICA, IWO, ABC and SSA, the result shows that the SSIWO algorithm is greatly improved in convergence precision and convergence speed, the robustness of the algorithm is also improved, the SSIWO is combined with a BP neural network for short-term load prediction of a power system, and is analyzed and compared with other methods, the result shows that the improved model prediction output has better fitting degree with an actual load value, the relative error is lower, the average relative error is reduced to 1.6%, the prediction output stability is better, large fluctuation does not occur, the improved model can effectively improve the precision of the short-term power load prediction of the power system, and can be applied to the field of short-term load prediction and power price prediction of power grids in other areas.
The invention is a short-term power load prediction method based on an improved squirrel search algorithm, and in use, aiming at the problem that the traditional squirrel algorithm is easy to fall into local optimum, the invention improves the global search capability of the squirrel algorithm by introducing a breeding mechanism of a weed algorithm, chaotic inertial weight and an elite random selection strategy, and provides an improved squirrel search algorithm (SSIWO), wherein the introduction of the breeding mechanism of the weed algorithm improves the population diversity of the squirrel algorithm; chaotic inertial weight is combined in the position updating of the population, so that the oscillation of the algorithm and the exploration and development capacity of the balance algorithm can be effectively reduced; an elite random selection strategy further ensures population diversity and accelerates convergence of the algorithm, and experimental results of 23 benchmark test functions show that the improved squirrel computing method can effectively jump out local optimality; meanwhile, the convergence precision and the convergence speed are greatly improved, in order to further verify the reliability and the practicability of SSIWO, the weight and the threshold of a BP neural network are optimized by using an improved squirrel algorithm, a short-term load prediction model (SSIWO-BP) is established, the correctness and the effectiveness of the prediction model are verified by an example, and the result of comparison with the existing SSA-BP and BP neural network models shows that the SSIWO-BP model can better reduce the prediction error and improve the prediction precision; the invention has the following advantages: 1. providing a reproduction mechanism of squirrels, wherein the mechanism increases the number of candidate solutions in each iteration to improve the population diversity of the algorithm; 2. in the position updating of the population, all states are traversed repeatedly according to the self rule in a certain range by combining the chaotic inertial weight so as to reduce the oscillation of the algorithm and the development and exploration capacity of the balance algorithm; 3. introducing an elite random selection strategy, when the population number reaches the upper limit, firstly preserving a better solution, then deleting the rest solutions in a random mode, ensuring the diversity of the population and simultaneously accelerating the convergence of the algorithm, verifying the effectiveness and reliability of the SSIWO algorithm by adopting a reference test function, applying the SSIWO algorithm to the optimization of neural network parameters, and establishing an SSIWO-BP neural network model to predict the short-term power load of a place; the method has the advantages of improving the diversity of algorithm populations, effectively reducing the oscillation of the algorithm and the exploration and development capacity of the balance algorithm, accelerating the convergence of the algorithm, reducing errors and improving the prediction precision.

Claims (10)

1. A short-term power load prediction method based on an improved squirrel search algorithm is characterized by comprising the following steps: it comprises the following steps:
step 1: a squirrel search algorithm;
step 2: an improved squirrel search algorithm;
and step 3: testing the performance of the algorithm;
and 4, step 4: a SSIWO-BP neural network short-term load prediction model;
and 5: and (5) simulation experiment and analysis.
2. The short-term power load prediction method based on the improved squirrel search algorithm as claimed in claim 1, wherein: the squirrel search algorithm in the step 1 specifically comprises the following steps: the squirrel search algorithm, namely SSA, is a new swarm intelligence algorithm, simulates a dynamic foraging strategy and an efficient gliding movement mode of the squirrel, the squirrel is a tree-inhabited rodent, the movement mode is mainly gliding, the gliding of the squirrel is considered as the most complex aerodynamic movement mode and is the most physical saving, the dynamic foraging behavior of the squirrel can also most effectively utilize food resources, and in the SSA algorithm, the following four necessary assumptions are provided:
(1) the method comprises the following steps Defining n squirrels in the forest, wherein each squirrel lives on one tree;
(2) the method comprises the following steps N trees in forest comprising a hickory and N fs (1<N fs Less than n) oak trees, and the rest ordinary trees;
(3) the method comprises the following steps Of the three types of trees, the hickory tree has the best food source, namely hickory nut, the oak tree has the common food source, namely acorn nut, and the common tree has no food;
(4) the method comprises the following steps Each squirrel looks for food individually and makes optimal use of food resources through dynamic foraging behavior.
3. The short-term power load prediction method based on the improved squirrel search algorithm as claimed in claim 2, wherein: the step 1 specifically comprises the following steps:
step 1.1: population initialization: the population number in the forest is n, and the upper limit and the lower limit of the search space are respectively FS U And FS L . N squirrel individuals were randomly generated according to equation (1):
FS i =FS L +rand(1,d)×(FS U -FS L ) (i =1, 2.. Multidot.n) (1), wherein FS is i Denotes the ith th Only squirrel; rand is in [0,1 ]]A random number above; d is the dimension of the problem;
step 1.2: and (3) population treatment: evaluating the quality of each individual position of squirrels through a fitness function f, and inputting a decision variable, namely the position vector of each individual squirrel into the fitness functionCorresponding result F (FS) i )=f(FS i1 ,FS i2 ,...,FS id ) (i =1, 2.. N.) is the ith th The fitness of the individual position of only the squirrel is shown, and the magnitude of the fitness value also represents the ith th The quality of the food source sought by only squirrels, then the fitness values of all squirrels are sorted in ascending order, squirrels individuals FS on the pecan tree h Individuals representing the minimum fitness value, squirrel individuals on oak FS a The representative fitness value is ranked from 2 to N fs +1 individuals, squirrel individuals on the general tree FS n Rank the representative fitness value at N fs Fitness value individual after + 1;
step 1.3: and (3) updating the position: the process that squirrel individuals search for different kinds of food by gliding to different kinds of trees is a population position updating process, and n is randomly selected at first 1 Only the squirrel in the common tree is regulated to move towards the hickory tree, and the rest n 2 Only squirrels move towards the acorn tree, n on the acorn tree 3 Only the squirrel moves to the hickory tree, and the position of the squirrel is updated according to the formulas (2) to (4):
Figure FDA0003986781470000021
Figure FDA0003986781470000022
/>
Figure FDA0003986781470000023
in the formula, t is the current iteration number; r is [0,1 ]]A random number in between; p dp Represents the probability of the occurrence of a predator, if R ≧ P dp Squirrels are safe and glide in forests looking for food if R < P dp The squirrel is forced to adopt a random walk mode to search a nearby hiding place due to the risk in the foraging process; g c The value is a fixed value of 1.9, and refers to the sliding constant of the squirrel in gliding motion; d is a radical of g To slide randomlyA distance; the calculation formula is as follows:
Figure FDA0003986781470000024
in the formula, h g = (8 m) height loss after glide; sf (= 18) is the scale factor for gliding movements;
Figure FDA0003986781470000031
is a glide angle; the calculation formula is as follows: />
Figure FDA0003986781470000032
Wherein D is the resistance of the squirrel in gliding; l is a lift force; the specific calculation formula is as follows: />
Figure FDA0003986781470000033
Where ρ (= 1.204 kgm) -3 ) Is the air density; v (= 5.25 ms) -1 ) The squirrel gliding speed; s (= 154 cm) 2 ) Is the squirrel surface area; c D (= 0.6) is a frictional resistance coefficient; c L Is [0675,1.5 ]]Random numbers in between, representing lift coefficients;
step 1.4: and (3) season switching judgment: seasonal monitoring conditions introduced into the SSA are helpful for the algorithm to jump out of a local optimal solution, when the squirrel algorithm starts iterative optimization, the whole environment of the SSA algorithm is in winter, all individuals can update the positions according to the mode in the step 1.3, and after all the individuals are updated, whether the seasons change is judged according to the formulas (9) to (10):
Figure FDA0003986781470000034
Figure FDA0003986781470000035
wherein T is the maximum iteration number; t is the current iteration number; when season constant +>
Figure FDA0003986781470000036
Less than the seasonal constant minimum (S) min ) Is at time, i.e. ->
Figure FDA0003986781470000037
Showing that the season is changed from winter to summer, and finding F after the season is changed h The squirrel individual will stay at the updated position, find F a And successfully surviving squirrel individuals are repositioned according to equation (11): />
Figure FDA0003986781470000038
The calculation formula of the Levy function is as follows: />
Figure FDA0003986781470000039
In the formula, r a 、r b Is [0,1 ]]Normal distribution random number in between; β is a constant with a value of 0.5; xi is calculated as:
Figure FDA00039867814700000310
whereΓ(x)=(x-1)!。
4. the short-term power load prediction method based on the improved squirrel search algorithm as claimed in claim 1, wherein: the improved squirrel search algorithm in the step 2 specifically comprises the following steps: a season monitoring mechanism is introduced into a standard SSA algorithm, and the algorithm flies to an optimal solution in a mode of parallel multiple elite solutions, so that the exploration capability of the algorithm in a problem domain is greatly improved, the initial exploration of the algorithm is facilitated, but in the later convergence process, the SSA algorithm stays at a local solution for a plurality of times, the convergence is too slow, and for a high-dimensional optimization problem, the algorithm is easy to fall into the local optimal solution in the later period, which is caused by insufficient diversity of a population; the fitness value of each squirrel position describes the quality of the food it searches for, as well as their probability of survival and probability of reproduction, so that squirrels on pecan trees survive more than squirrels on oak and regular trees, and likewise, because of the better survival environment, reproduce more than squirrels on other trees, inspiring: the weed algorithm has few parameters of propagation and space diffusion mechanisms, simple structure and strong local search capability; the IWO algorithm increases the population diversity, thereby enhancing the global search capability of SSA; the invasive weed algorithm is introduced into the SSA algorithm to increase the population diversity, so that a squirrel search algorithm based on a weed breeding mechanism, namely an SSIWO algorithm, is provided.
5. The short-term power load prediction method based on the improved squirrel search algorithm as claimed in claim 4, wherein: the step 2 specifically comprises the following steps:
step 2.1: a reproduction mechanism of squirrels;
step 2.2: chaotic inertial weight: the method is characterized in that the concept of inertia weight omega is introduced into a particle swarm algorithm for the first time, and indicates that larger inertia weight is favorable for development and smaller inertia weight is favorable for exploration, because the commonly used linear descending inertia weight is too simple and has low randomness, in order to ensure that the inertia weight keeps descending trend and has randomness in each iteration, a chaotic inertia weight is introduced, firstly, a logistic mapping chaotic model is used for generating a chaotic sequence, and the specific expression is as follows:
Figure FDA0003986781470000041
wherein Z (n + 1) is the value of the currently generated chaos series; λ is a control parameter, and when λ =4, the system is completely in a chaotic state; let λ =4, and multiply the generated chaos sequence by the linearly decreasing inertial weight to construct a chaos inertial weight, whose expression is: />
Figure FDA0003986781470000042
Wherein Z represents the generated chaotic sequence; t is the current iteration number; t is the maximum iteration number; omega 0 Is the initial inertial weight; omega f Is the final inertial weight; in general, the inertia weight ω 0 =0.9、ω f Algorithm performance is best when = 0.4; introducing chaotic inertial weight based on the formulas (2) - (4), wherein the formula is (18)- (20) shown below:
Figure FDA0003986781470000051
Figure FDA0003986781470000052
Figure FDA0003986781470000053
the notation in the formula corresponds to the formulas (2) to (4);
step 2.3: elite-random selection strategy: the SSIWO algorithm relates to the problem that the maximum population limit of the squirrels is exceeded after each generation of breeding, the IWO algorithm is prone to a selection strategy that the information of poor fitness is sorted according to the fitness value and deleted, although the good fitness has high probability to increase the population diversity, the selection strategy has large limitation, in order to increase the population diversity while accelerating the selection, an elite-random selection strategy is selected, after the squirrels generated by each generation of breeding are sorted, only a few good squirrels are kept, the rest squirrels are randomly selected until the maximum population limit is met, the pine individual with large fitness value based on the elite-random selection strategy can survive due to the fact that the good living environment is selected, the squirrels with small fitness value can be eliminated, and the final number can be kept at the original scale P max
Step 2.4: SSIWO algorithm.
6. The short-term power load prediction method based on the improved squirrel search algorithm as claimed in claim 5, wherein: the step 2.1 specifically comprises the following steps:
step 2.11: determining the reproduction quantity of squirrels: according to the weed breeding characteristics, it is firstly determined that squirrels can breed young animals in a better living area, such as the squirrels on pecan trees and acorns, which have rich food sources and are suitable for survival and survivalBreeding, determining the quantity of breeding according to the fitness value, wherein the breeding capacity of the regional squirrels suitable for living is stronger, the number of bred cubs is more, the number of the cubs generated by the squirrels in the parents is in a linear relation with the fitness of the parents, and the formula is as follows:
Figure FDA0003986781470000061
wherein F (FS) i ) Is the paternal squirrel fitness value; f. of max 、f min Maximum and minimum fitness of the population, respectively; s max Representing the maximum number of populations;
step 2.12: spatial diffusion: the offspring squirrel is in a normal distribution mode with the average value of 0 and the standard deviation of sigma and the Step length Step ∈ [ -sigma, sigma]Distributed around the parent squirrel search space, where the standard deviation σ varies during the iteration, with the formula:
Figure FDA0003986781470000062
in the formula, σ 0 Is the starting standard deviation; sigma f The final standard deviation; t is the maximum iteration number; t is the current iteration number; h is a nonlinear harmonic index; by adopting the method, the squirrel generates remote cubs which are distributed in the surrounding space in a mode of higher probability when the distance is closer, and meanwhile, the global and local searching capability of the algorithm is improved.
7. The short-term power load prediction method based on the improved squirrel search algorithm as claimed in claim 5, wherein: the step 2.4 specifically comprises the following steps:
step 2.41: initializing squirrel population position, population size and maximum iteration number parameters;
step 2.42: calculating population fitness, arranging in descending order, and declaring squirrels on hickory trees, oak trees and common trees;
step 2.43: randomly selecting n 1 Squirrel on ordinary tree moves to hickory, n 2 Only squirrels move towards the acorn tree, n on the acorn tree 3 Only the squirrel moves towards the hickory nut, and the moving mode is as the formulas (18) - (20);
step 2.44: generating and diffusing new squirrels according to the breeding mechanism of the step 2.1, wherein the positions of the squirrels are influenced by predators, and the squirrels randomly walk to find hidden places under the condition that the predators exist;
step 2.45: according to the elite-random selection strategy in the step 2.3, selecting a value with better fitness as an initial value of next generation iteration so as to ensure that the population scale is unchanged;
step 2.46: calculating a seasonal constant and a seasonal constant minimum;
step 2.47: setting seasonal variation constraint conditions, and if the conditions are met, resetting the position of the squirrel by using a formula (11);
step 2.48: and repeating the steps 2.422 to 2.47 until the maximum iteration number is reached and outputting the optimal solution.
8. The method of short-term power load prediction based on the improved squirrel search algorithm as claimed in claim 1, wherein: the algorithm performance test in the step 3 specifically comprises the following steps:
step 3.1: benchmark test function: in order to test the effectiveness of the algorithm, 23 benchmark test functions are selected for experimental verification, the 23 benchmark test functions are solved by using an SSIWO algorithm and are compared with PSO, ICA, IWO, ABC and SSA, wherein each algorithm is iterated 1000 times at the maximum, the population scale is 50, the algorithm operates 30 times independently, the SSIWO algorithm is consistent with parameters in the SSA, and the maximum population scale is set to be 80;
step 3.2: test results and analysis: with the increase of problem dimensionality, the phenomenon of local optimization falling into the SSIWO rarely occurs, while the other five algorithms have good convergence effects, but the phenomenon of premature convergence occurs on individual test functions, and the robustness of the SSIWO in solving the optimization problem is high.
9. The short-term power load prediction method based on the improved squirrel search algorithm as claimed in claim 1, wherein: the SSIWO-BP neural network short-term load prediction model in the step 4 specifically comprises the following steps:
step 4.1: BP neural network: a BP neural network is a multilayer feedforward neural network trained according to the reverse propagation algorithm of error, it is the most extensive neural network that applies at present, the key feature of the network is that the signal transmits forward, predict the error of output and actual output transmits backward, in transmitting forward, the input variable is from the input layer through the hidden layer is processed, until the output layer, the neuron state of each layer only influences the neuron state of the next layer, carry on the dynamic adjustment of weight and threshold value according to the difference between actual output value and the output value of the output layer, until outputting and approaching the actual output infinitely finally;
step 4.2: data preprocessing: the input sample data type and unit are not consistent, the numerical value size is greatly different, smaller data can be submerged by larger data, information loss can be caused, the neural network is often subjected to neuron saturation phenomenon if original data is directly used in the training and learning process, the data needs to be subjected to normalization processing in the prediction process, and the input data and the output data are normalized according to a formula (21) so that the values of all data are [ -1,1]The method comprises the following steps:
Figure FDA0003986781470000081
in combination with>
Figure FDA0003986781470000082
Is a normalized value; x min Is the sample minimum; x max Is the maximum value of the sample;
step 4.3: SSIWO-BP neural network model: when the BP neural network is actually applied, the convergence speed of the network is low, the network is easy to fall into local optimization, and the problem of overfitting is easy to occur when few training samples are used, so that the global search capability of SSIWO is adopted to optimize the weight and the threshold of the BP neural network, the SSIWO is used for optimizing the BP neural network to reduce the possibility of falling into local optimization, and meanwhile, the convergence speed and the prediction accuracy of the network can be improved.
10. The short-term power load prediction method based on the improved squirrel search algorithm as claimed in claim 9, wherein: the step 4.3 comprises the following steps:
step 4.31: network initialization: determining the number of nodes of an input layer, the number of nodes of an output layer, the number of nodes of a hidden layer, a given learning rate and a neuron excitation function according to the equal input label number and the output power load dimension number influencing power loads such as meteorological factors, date types and the like, selecting an activation function as shown in a formula (22), initializing connection weights among the output layer, the hidden layer and the output layer, initializing a threshold of the hidden layer and a threshold of the output layer, and sequentially setting the weights and the thresholds as omega 1 、ω 2 ,...,ω n
Figure FDA0003986781470000083
Step 4.32: initializing squirrel population: all weights and thresholds of the BP neural network are used as squirrel populations to be coded, and the population dimension D is calculated as shown in a formula (23), so that the vector X i (t)=[X i1 (t),X i2 (t),...,X iD (t)]Representing the position of the squirrel i on a D-dimensional space, the initial size of the population is N, the maximum size is N:
d = I × H + H + H × O + O (23), wherein I, H, O are the number of input layer neurons, the number of hidden layer neurons and the number of output layer neurons, respectively; according to the input variable X, the connection weight omega between the input layer and the hidden layer ij And a hidden layer threshold value a, calculating hidden layer output H, and connecting a weight omega between the hidden layer and the output layer according to the hidden layer output H jk And a threshold b, wherein the formula for calculating the predicted output O of the BP neural network is as follows:
Figure FDA0003986781470000091
step 4.33: fitness function: each squirrel represents the weight and the threshold value of a group of networks, a corresponding BP neural network model is established after decoding, a sample data training model is used for simulation prediction, the root mean square error is used as the adaptability value f of the squirrel, and a calculation formula is adoptedComprises the following steps:
Figure FDA0003986781470000092
wherein n is the number of samples; y is i Is the observed value of sample i; o i Is the predicted value of the sample i;
step 4.34: sorting the fitness values: sorting in a descending order according to the size of the fitness value, and recording the position of the squirrel as FS according to the size of the fitness value ht 、FS nt 、FS at Updating the position of the squirrel according to a position updating formula;
step 4.35: growth, propagation and competition: each individual randomly generates a new squirrel according to a breeding mechanism, namely a new position in the space is generated, and the bred population and the original population evaluate the solution with the best fitness according to a competitive survival rule;
step 4.36: establishing an SSIWO-BP neural network model: repeating the steps 4.32-4.35 until an optimal solution is obtained, and generating the weight of the neural network and the threshold vector omega after decoding the optimal solution * =(ω 1 * 、ω 2 * ,...,ω n * ) Establishing an SSIWO-BP neural network model;
step 4.37: normalizing the data of the day to be measured, inputting the normalized data into the established neural network model, operating and outputting the load result of the prediction day: when the training times reach the specified times, if the loss function is converged, the neural network training is finished; if the loss function does not converge, the number of training passes is increased until the loss function converges.
CN202211567709.0A 2022-12-07 2022-12-07 Short-term power load prediction method based on improved squirrel search algorithm Pending CN115860044A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211567709.0A CN115860044A (en) 2022-12-07 2022-12-07 Short-term power load prediction method based on improved squirrel search algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211567709.0A CN115860044A (en) 2022-12-07 2022-12-07 Short-term power load prediction method based on improved squirrel search algorithm

Publications (1)

Publication Number Publication Date
CN115860044A true CN115860044A (en) 2023-03-28

Family

ID=85670940

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211567709.0A Pending CN115860044A (en) 2022-12-07 2022-12-07 Short-term power load prediction method based on improved squirrel search algorithm

Country Status (1)

Country Link
CN (1) CN115860044A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117236137A (en) * 2023-11-01 2023-12-15 龙建路桥股份有限公司 Winter continuous construction control system for deep tunnel in high and cold area

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117236137A (en) * 2023-11-01 2023-12-15 龙建路桥股份有限公司 Winter continuous construction control system for deep tunnel in high and cold area
CN117236137B (en) * 2023-11-01 2024-02-02 龙建路桥股份有限公司 Winter continuous construction control system for deep tunnel in high and cold area

Similar Documents

Publication Publication Date Title
CN110728401B (en) Short-term power load prediction method of neural network based on squirrel and weed hybrid algorithm
CN111242302A (en) XGboost prediction method of intelligent parameter optimization module
Ahmadi et al. Learning fuzzy cognitive maps using imperialist competitive algorithm
CN104636801A (en) Transmission line audible noise prediction method based on BP neural network optimization
Otero et al. Handling continuous attributes in ant colony classification algorithms
CN113722980B (en) Ocean wave height prediction method, ocean wave height prediction system, computer equipment, storage medium and terminal
Karimzadeh Parizi et al. OWMA: An improved self-regulatory woodpecker mating algorithm using opposition-based learning and allocation of local memory for solving optimization problems
CN112529683A (en) Method and system for evaluating credit risk of customer based on CS-PNN
Pop et al. Review of bio-inspired optimization applications in renewable-powered smart grids: Emerging population-based metaheuristics
CN114330659A (en) BP neural network parameter optimization method based on improved ASO algorithm
CN108093085A (en) A kind of big data system real time service parameter adaptive adjusting method
Zhang et al. Evolving neural network classifiers and feature subset using artificial fish swarm
CN112819192A (en) Method for predicting short-term power load of RF _ GRU network based on swarm algorithm optimization
CN115860044A (en) Short-term power load prediction method based on improved squirrel search algorithm
CN109376941A (en) Energy simulation and optimization method based on artificial neural network and BIM
AlShabi et al. Artificial Intelligence applications in renewable energy systems
CN113221447A (en) Soil humidity prediction method for optimizing BP neural network based on improved genetic algorithm
CN114897204A (en) Method and device for predicting short-term wind speed of offshore wind farm
CN117217374A (en) Short-term wind power prediction method based on DBO-ELM
CN112200208B (en) Cloud workflow task execution time prediction method based on multi-dimensional feature fusion
Chen et al. A Spark-based Ant Lion algorithm for parameters optimization of random forest in credit classification
CN111563614A (en) Load prediction method based on adaptive neural network and TLBO algorithm
CN110334869A (en) A kind of mangrove forest ecological health forecast training method based on dynamic colony optimization algorithm
CN113807005B (en) Bearing residual life prediction method based on improved FPA-DBN
Maryam et al. Artificial neural network weights optimization based on imperialist competitive algorithm

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