Microgrid capacity optimization method based on improved sparrow search algorithm
By improving the sparrow search algorithm and combining it with strategies such as chaotic reverse learning and dynamic weighting factors, the problems of insufficient convergence accuracy and easy getting trapped in local optima in microgrid capacity optimization are solved, achieving more efficient microgrid capacity configuration and improving system stability and economy.
Patent Information
- Application Number
- CN202411776045.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2026-02-06
AI Technical Summary
Existing sparrow search algorithms for microgrid capacity optimization suffer from insufficient convergence accuracy and a tendency to get trapped in local optima, making it difficult to guarantee the safe, stable operation and economic efficiency of the system.
An improved Sparrow Search Algorithm (ISSA) that integrates chaotic inverse learning strategy, golden sine formula, dynamic weighting factor, Lévy flight, hybrid mutation perturbation strategy and greedy strategy is adopted to construct a microgrid capacity optimization model. Combined with price-based demand response and time-of-use pricing theory, the microgrid operation control is optimized.
This improved the convergence accuracy and speed of the algorithm, reduced the overall power generation cost of the microgrid, enhanced the stability and economy of the system, and ensured the reliability and security of the microgrid.
Smart Images

Figure CN121484837A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of micro-grid capacity optimization configuration, and more particularly to a micro-grid capacity optimization method based on an improved sparrow search algorithm. BACKGROUND
[0002] With the continuous development of society, the consumption of traditional fossil fuels is increasing, and the development and utilization of renewable energy represented by photovoltaic and wind power is of great significance. Due to environmental factors, the output power of wind power and photovoltaic power is unstable, and the application of large-scale photovoltaic and wind power has a negative impact on the safe and stable operation of micro-grid. The application of energy storage system can solve the above problems and improve the stability of micro-grid. Therefore, under the premise of ensuring the stable operation of micro-grid, capacity configuration optimization is of great significance to improve the reliability and economy of micro-grid operation.
[0003] Using various intelligent optimization algorithms for micro-grid power optimization configuration can effectively reduce the comprehensive power generation cost of micro-grid and improve the stability of the system, which has become one of the important means for solving capacity optimization configuration. In the existing technology, in the 43rd issue of 2022 of Solar Energy, "Independent Micro-grid Capacity Optimization Configuration Based on Improved Gray Wolf Algorithm" establishes a wind-light-storage-wood micro-grid optimization configuration model, introduces a Cauchy mutation improved gray wolf algorithm, and solves the optimal configuration scheme of micro-grid; in the 44th issue of 2023 of Solar Energy, "Optimal Configuration of Light Storage Micro-grid Based on Improved Ant Colony Dynamic Programming" constructs an optimal configuration model of a light storage micro-grid containing a hybrid energy storage system, and uses an improved ant colony dynamic programming algorithm to solve it; in the 23rd issue of 2023 of Science, Technology and Engineering, "Capacity Optimization Configuration of Wind-Solar-Storage System Containing Hybrid Energy Storage" uses an improved particle swarm optimization algorithm to optimize the capacity configuration of a micro-grid model containing a battery and a gravity energy storage device; in the 56th issue of 2023 of China Electric Power, "Hydrogen Energy Storage Capacity Optimization Configuration Based on Improved Cat Swarm Algorithm" constructs a hybrid micro-grid system containing hydrogen energy storage, and uses an improved cat swarm algorithm to solve the capacity optimization configuration model of the system.
[0004] The above existing technology still has the problems of insufficient convergence precision of the sparrow search algorithm and easy falling into local optimum, and at the same time, under the condition of ensuring the safe and stable operation of the micro-grid system, optimizing the capacity configuration of the grid-connected micro-grid is a problem that technicians in the field urgently need to solve.
[0005] The patent with the existing patent publication number CN116316636A discloses a micro-grid optimization scheduling method based on sparrow search algorithm, which comprises inputting various parameters of a micro-grid optimization scheduling system, establishing a target function of the micro-grid optimization operation with the lowest economic cost and pollutant emission cost, determining the operation constraint condition of the micro-grid optimization operation target function, building a micro-grid optimization scheduling model according to the micro-grid optimization operation target function and the operation constraint condition, and solving the micro-grid optimization scheduling model by using the improved sparrow search algorithm. The patent introduces adaptive t-distribution and dynamic selection probability P, which increases the complexity of the algorithm and may cause the algorithm to slow down in convergence speed when approaching the global optimal solution, making it difficult to quickly converge to the optimal solution. The complex algorithm also increases the cost. SUMMARY
[0006] The present application mainly aims at the capacity optimization configuration problem of the grid-connected micro-grid in the prior art, establishes a mathematical model of the micro-grid distributed power supply and a price-type demand response mathematical model, proposes a micro-grid operation control strategy considering the flatness degree of electricity cost and the time-of-use electricity price theory, establishes a capacity optimization configuration model with the lowest equal annual value comprehensive cost as the objective function under the condition of ensuring the safe and stable operation of the system, and proposes an improved sparrow search algorithm by fusing the chaos reverse learning strategy, the golden sine formula, the dynamic weight factor, the Levy flight, the hybrid mutation disturbance strategy and the greedy strategy in view of the insufficient convergence accuracy and the problem of easily falling into local optimum of the sparrow search algorithm SSA.
[0007] To achieve the above-mentioned purposes, the technical solutions of the present application are as follows:
[0008] A micro-grid capacity optimization method based on an improved sparrow search algorithm, comprising the following steps:
[0009] S1. According to the mathematical model of the micro-grid distributed power supply and the price-type demand response mathematical model, a micro-grid capacity optimization model is established with the lowest equal annual value comprehensive cost as the objective function, and a micro-grid hybrid energy storage system is constructed.
[0010] S2. According to the standardized degree of electricity cost and the time-of-use electricity price theory, a micro-grid operation control model is proposed.
[0011] S3. In view of the insufficient convergence accuracy and the problem of easily falling into local optimum of the sparrow search algorithm SSA, an improved sparrow search algorithm ISSA is proposed by fusing the chaos reverse learning strategy, the golden sine formula, the dynamic weight factor, the Levy flight, the hybrid mutation disturbance strategy and the greedy strategy.
[0012] S4. The ISSA is used to reasonably configure the number of each distributed power supply of the micro-grid.
[0013] Further, in the step S1, the expression of the objective function of the microgrid capacity optimization configuration model is:
[0014] min C total = C inc + C omc + C erc + C pc - C sr - C gs
[0015] In the above formula, C total is the equal annual value comprehensive cost; C inc is the equal annual value initial investment cost; C omc is the annual operation and maintenance cost; C erc is the equal annual value equipment replacement cost; C pc is the electricity purchase cost; C sr is the electricity sale income; C gs is the government subsidy annual value;
[0016] Constraint conditions:
[0017]
[0018] In the above formula, N i is the number of the i-th power supply; N i_max is the maximum configuration number of the i-th power supply; SOC b is the battery state of charge; SOC b_max , SOC b_min are the upper and lower limits of the battery state of charge; SOC c is the super capacitor state of charge; SOC c_max , SOC c_min are the upper and lower limits of the super capacitor state of charge; P b_max , P b_min are the upper and lower limits of the battery charging and discharging power; P c_min , P c_max are the upper and lower limits of the super capacitor charging and discharging power; P L is the load power; P WT is the actual output power of the wind turbine; P PV is the actual output power of the photovoltaic array; P HESS is the hybrid energy storage system power; P G is the microgrid and grid exchange power; P G_max is the maximum transmission power of the tie line; C surplus is the energy surplus rate; C surplus_max is the maximum energy surplus rate.
[0019] Further, in the step S2, the microgrid operation control strategy includes:
[0020] S5, first acquire real-time data of wind turbine, photovoltaic array, battery and super capacitor;
[0021] S6, then calculate unbalanced power ΔP(t), its expression is:
[0022] ΔP(t)=P WT (t)+P PV (t)-P L (t)
[0023] In the above formula, P WT (t) is the actual output power of wind turbine at t; P PV (t) is the actual output power of photovoltaic array at t; P L (t) is the load power at t;
[0024] S7, when ΔP(t)>0, the photovoltaic array and wind turbine store energy in the hybrid energy storage system (HESS) and sell the remaining electricity to the power grid;
[0025] S8, judge whether t reaches the set value, when t is less than the set value, return to S5; when t reaches the set value, end.
[0026] Further, in the step S7, when ΔP(t)<0, at this time wind and light power generation cannot meet the load demand, when the standardized degree of electricity cost is less than the electricity purchase cost, the HESS supplies power for the load, if there is a shortage, the power grid is supplemented, otherwise, the microgrid directly purchases electricity from the power grid to supply power for the load, and then charges the HESS, and the step S8 is executed.
[0027] Further, in the step S3, the step of initializing the population by the chaotic reverse learning strategy is: after initialization by chaotic mapping, the opposite population of the current population is generated by using the reverse learning strategy to expand the initial population range; the opposite population generated by the reverse learning strategy and the initial population generated by the chaotic mapping are sorted according to fitness, and the individuals with the top 50% fitness are selected as the initial population, so that the initial population is as evenly distributed as possible and has good diversity, and the expression of the chaotic reverse learning strategy is:
[0028]
[0029] In the above formula, X' i,j is the sparrow position information; b j is the lower limit of the search space boundary; a j is the upper limit of the search space boundary; x k is the Circle chaotic mapping sequence value; mod is the remainder function; a and b are control parameters; the chaotic orbit state value range is (0, 1); is the reverse sparrow individual position.
[0030] Further, in the step S3, the position update formula of the discoverer is improved by using the golden sine formula, and the improved formula is:
[0031]
[0032] In the above formula, t is the iteration number; X i,j is the current sparrow position information; r1 and r2 are random numbers, r1 ∈ [0, 2π], and r2 ∈ [0, π]; is the global optimal position obtained in the tth generation; R is a warning value, R ∈ [0, 1]; S T is a safety value, S T ∈ [0.5, 1]; Q is a random number subject to normal distribution; L is a matrix whose elements are all 1; c1 and c2 are golden sine division coefficients;
[0033] The position update formula of the follower is improved by using the dynamic weight factor and the Levy flight strategy, and the improved formula is:
[0034]
[0035] In the above formula, ψ is the dynamic weight factor; T is the maximum iteration number; s is the Levy flight random step length; β is a number between 0 and 2; μ and ν are subject to normal distribution; is the local optimal position obtained by the discoverer in the t+1th generation; N is the number of sparrow population;
[0036] In each iteration, after all sparrows complete position update, the optimal individual is selected for disturbance update by using the hybrid mutation disturbance strategy, and the expression of the hybrid mutation disturbance strategy based on the mixture of Cauchy distribution, Gaussian distribution and t distribution is:
[0037]
[0038] In the above formula, ω is the disturbance control factor; C(0, 1) is the standard Cauchy distribution; t(3) is the t distribution with a degree of freedom of 3; G(0, 1) is the standard Gaussian distribution; is the new position after disturbance.
[0039] Further, in the step S3, the updated solution is filtered by using the greedy strategy, and the better position after hybrid mutation disturbance is retained, and the expression is:
[0040]
[0041] In the above formula, f(x) is the fitness function.
[0042] Further, in the step S4, the number of each distributed power source of the micro-grid is reasonably configured by using the ISSA, including the following steps:
[0043] S9, meteorological, load data and initialization algorithm parameters are input first, and the initial population is initialized by using a chaos reverse learning strategy;
[0044] S10, according to the improved formula sparrow position, the updated capacity configuration is obtained;
[0045] S11, a hybrid mutation disturbance strategy and a greedy strategy are used to jump out of the local optimum, so that the capacity configuration advances towards the optimal solution, and the optimization is iterated until the maximum iteration number, and the optimal capacity configuration of the micro-grid is output.
[0046] Further, in the step S11, when the maximum optimization number is not reached, the finder position, the follower position and the alarm position are updated in turn, the hybrid mutation disturbance and the greedy strategy are executed again, and the step S10 is returned.
[0047] Further, in the step S11, after the finder and the follower complete the position update, 10% to 20% of the sparrows in the population are randomly selected as early warning agents, and the early warning agent position update formula is:
[0048]
[0049] In the above formula, γ is a random number satisfying a normal distribution; θ is a random number in a specified range, θ∈[-1, 1]; ε is a very small parameter to prevent the denominator from being 0; f i is the fitness value of the ith sparrow individual; f g , f w is the global optimal fitness value and the worst fitness value of the tth generation sparrow population.
[0050] Compared with the prior art, the beneficial effects of the present application are as follows:
[0051] 1. The present application establishes a micro-grid equal annual value comprehensive cost minimum as an objective function, comprehensively considers system price type demand response, energy storage system flatness degree electric cost and time-of-use electricity price, and constructs a micro-grid capacity optimization configuration model. In view of the problems of insufficient convergence precision and easy falling into local optimum of the sparrow search algorithm, an improved sparrow search algorithm is proposed, which firstly adopts a chaos reverse learning strategy to make the initial population uniformly distributed; secondly introduces a golden sine formula to improve the convergence precision of the algorithm; thirdly introduces a dynamic weight factor to improve the dynamic performance of the algorithm and improve the global search ability; finally uses a hybrid mutation disturbance strategy and a greedy strategy to jump out of the local optimum. The algorithm has higher convergence precision and faster convergence speed, and can effectively reduce the comprehensive power generation cost of the micro-grid; by proposing a micro-grid hybrid energy storage system, the stability of the micro-grid is improved, so that the capacity configuration optimization is carried out under the premise of ensuring the stable operation of the micro-grid, which has important significance for improving the reliability and economy of the micro-grid operation.
[0052] 2. The present application will be compared with the ISSA, sparrow search algorithm, grey wolf optimization algorithm and whale optimization algorithm, and the performance of the ISSA will be verified, and the capacity optimization configuration solution will be solved by taking the actual data of a certain region as the object, and the practicability of the model and the ISSA will be verified. BRIEF DESCRIPTION OF DRAWINGS
[0053] Figure 1 for a micro-grid hybrid energy storage system structure;
[0054] Figure 2 for a micro-grid operation control strategy;
[0055] Figure 3 for a micro-grid capacity optimization configuration flowchart;
[0056] Fig. 4(a) is a function F1 convergence curve;
[0057] Fig. 4(b) is a function F2 convergence curve;
[0058] Fig. 4(c) is a function F3 convergence curve;
[0059] Fig. 4(d) is a function F4 convergence curve;
[0060] Fig. 4(e) is a function F5 convergence curve;
[0061] Fig. 5(a) is an annual hourly wind speed;
[0062] Fig. 5(b) is an annual hourly solar irradiance;
[0063] Fig. 5(c) is an annual hourly temperature;
[0064] Fig. 5(d) is an annual hourly electricity load;
[0065] Figure 6 is a load optimization curve;
[0066] Figure 7 is a capacity optimization convergence curve;
[0067] Table 1 is a test function table;
[0068] Table 2 is a table of test results of different functions;
[0069] Table 3 is a time-of-use electricity price table;
[0070] Table 4 is a device cost parameter table;
[0071] Table 5 is an economic table of different operation control strategies;
[0072] Table 6 is an optimization configuration result table. DETAILED DESCRIPTION
[0073] To clearly illustrate the technical features of the present invention, the present invention will be described in detail below through specific embodiments and in conjunction with the accompanying drawings or tables.
[0074] Many specific details are set forth in the following description in order to provide a full understanding of this application. However, this application may also be implemented in other ways different from those described herein. Therefore, the scope of protection of this application is not limited to the specific embodiments disclosed below.
[0075] Example 1
[0076] like Figure 3 As shown, a microgrid capacity optimization method based on an improved sparrow search algorithm includes the following steps:
[0077] S1. Based on the mathematical model of distributed power generation and the price-based demand response mathematical model of microgrid, a microgrid capacity optimization model is established with the objective function of minimizing the equivalent annual comprehensive cost, and a microgrid hybrid energy storage system is constructed.
[0078] S2. Based on the theory of standardized levelized cost of electricity and time-of-use pricing, a microgrid operation control model is proposed.
[0079] S3. Considering the problems of insufficient convergence accuracy and easy getting trapped in local optima in the Sparrow Search Algorithm SSA, an improved Sparrow Search Algorithm ISSA is proposed, which integrates chaotic reverse learning strategy, golden sine formula, dynamic weight factor, Lévy flight, hybrid mutation perturbation strategy and greedy strategy.
[0080] S4. Utilize ISSA to rationally configure the number of distributed power sources in the microgrid.
[0081] like Figure 1 As shown, the microgrid system consists of a photovoltaic power generation system, a wind power generation system, a hybrid energy storage system (HESS), and AC and DC loads. Its mathematical model is as follows:
[0082] Mathematical model of wind power generation
[0083]
[0084] In the above formula, P WT P represents the actual output power of the wind turbine generator. wn The power at a given point on the discrete power curve of the wind turbine is given by N points; v is the average wind speed; L n (x) is the interpolation function;
[0085] Mathematical model of photovoltaic array power generation
[0086]
[0087] In the above formula, PPV P represents the actual output power of the photovoltaic array. vn G represents the standard output power; G represents the actual optical radiation intensity; G n δ is the standard light radiation intensity; T is the power temperature coefficient; c T represents the current temperature. n The standard ambient temperature is 25℃.
[0088] like Figure 1 As shown, in this embodiment, the hybrid energy storage system consists of a battery and a supercapacitor. Compared to a single battery energy storage system, the hybrid energy storage system can utilize the complementarity and rapid adjustment performance between different energy storage devices to achieve a better smoothing effect. The output power of the hybrid energy storage system can be expressed as:
[0089]
[0090] In the above formula, P b V is the output power of the battery. b_t I is the battery voltage at time t; b_t P represents the battery current at time t. c This refers to the output power of the supercapacitor; SOC c_t SOC c_t+Δt The state of charge of a supercapacitor before and after charging and discharging; E c Δt represents the rated capacitance of the supercapacitor; Δt represents the time step.
[0091] The state of charge (SOC) of a hybrid energy storage system can be expressed as:
[0092]
[0093] In the above formula, η c η f For battery charging and discharging efficiency; P b_c (t), P b_f (t) represents the charging and discharging power of the battery; E b ΔP is the battery's rated capacity. c E represents the charging and discharging power of the supercapacitor. c,t Let t be the capacitance of the supercapacitor at time t;
[0094] The price-based demand response model is as follows:
[0095]
[0096] In the above formula, P L_i For demand response afterload; P 0_i L represents the demand response preload at time i; ij β represents the cross-elasticity coefficient at time i and time j; iiFor the weight of self-elasticity influence; β ij The cross-elasticity influence weights; C 0_i(j) Electricity price before demand response; ΔC load_i(j) This represents the price difference in electricity before and after the demand response.
[0097] Example 2
[0098] like Figure 3 As shown, to ensure the safe and reliable operation of the microgrid and improve its economic efficiency, the objective function and constraints of the established optimization model are as follows:
[0099] objective function
[0100] minC total =C inc +C omc +C erc +C pc -C sr -C gs
[0101] In the above formula, C total C is the equivalent annual comprehensive cost; inc C is the initial investment cost at an equivalent annual value. omc Annual operating and maintenance costs; C erc C is the cost of replacing equipment with equivalent annual value. pc For electricity purchase cost; C sr For electricity sales revenue; C gs Annual value of government subsidies;
[0102] Microgrid constraints
[0103]
[0104] In the above formula, N i N represents the number of the i-th type of power source; i_max The maximum number of configurations for the i-th power supply type; SOC b State of charge (SOC) of the battery. b_max SOC b_min The upper and lower limits of the battery's state of charge; SOC c State of charge (SOC) of the supercapacitor. c_max SOC c_min These are the upper and lower limits of the state of charge of the supercapacitor; P b_max P b_min P represents the upper and lower limits of the battery's charge and discharge power. c_min P c_max The upper and lower limits of the charging and discharging power of the supercapacitor; P L P represents the load power. WT P represents the actual output power of the wind turbine generator. PVP represents the actual output power of the photovoltaic array. HESS Power of the hybrid energy storage system; P G For power exchange between the microgrid and the grid; P G_max C is the maximum transmission power of the tie line; surplus Energy surplus rate; C surplus_max This represents the maximum energy surplus rate.
[0105] The levelized cost of electricity (LCOE) based on the life-cycle cost theory can be expressed as:
[0106]
[0107] In the above formula, C LCOE For HESS levelized cost of electricity; C sum E represents the total investment cost of HESS over its life cycle. sum This represents the total power generation of the HESS over its lifespan.
[0108] Combining time-of-use pricing theory and the levelized cost of electricity (LCOE) of energy storage systems, a microgrid operation control strategy is derived. This strategy controls microgrid operation by comparing the LCOE of energy storage batteries with the grid price at that moment. Figure 2 As shown, the microgrid operation control strategy includes the following steps:
[0109] S5. First, acquire real-time data from wind turbines, photovoltaic arrays, batteries, and supercapacitors;
[0110] S6. Next, calculate the unbalanced power ΔP(t), the expression of which is:
[0111] ΔP(t)=P WT (t)+P PV (t)-P L (t)
[0112] In the above formula, P WT (t) represents the actual output power of the wind turbine at time t; P PV (t) represents the actual output power of the photovoltaic array at time t; P L (t) represents the load power at time t;
[0113] S7. When ΔP(t)>0, it means that wind and solar power generation can meet the load demand and there is surplus electricity. The photovoltaic array and wind turbine store energy in the hybrid energy storage system (HESS) and sell the surplus electricity to the grid. When ΔP(t)<0, wind and solar power generation cannot meet the load demand. If the levelized cost of electricity is less than the purchase cost, the HESS supplies power to the load. If there is a shortfall, the grid will make up the difference. Otherwise, the microgrid directly purchases electricity from the grid to supply power to the load, then charges the HESS, and executes step S8.
[0114] S8. Determine if t has reached the set value. If t is less than the set value, return to S5. If t has reached the set value, end the process.
[0115] To address the issues of insufficient convergence accuracy and susceptibility to local optima in the Sparrow Search algorithm, an improved version is proposed. First, a chaotic back-learning strategy is employed to ensure a uniform initial population distribution. Second, the golden sine formula is added to improve the algorithm's convergence accuracy. Third, a dynamic weighting factor is introduced to enhance the algorithm's dynamic performance and global search capability. Finally, a hybrid mutation perturbation strategy and a greedy strategy are used to escape local optima.
[0116] To address the issue of uneven population distribution and low diversity in the initial population generation of the sparrow search algorithm, which negatively impacts the algorithm's convergence speed and solution accuracy, a chaotic back-learning strategy is proposed to generate the initial sparrow population. Chaotic mappings possess characteristics such as randomness, nonlinearity, ergodicity, and periodicity. When dealing with complex problems with multiple local optima, this strategy enhances the randomness and diversity of the population, resulting in a more balanced distribution of the population across the search space and facilitating the algorithm's search for the global optimum. Initialization using the Circle chaotic mapping can be represented as:
[0117]
[0118] In the above formula, X' i,j b is the location information of the sparrow; j a is the lower bound of the search space boundary; j x represents the upper bound of the search space; k is the chaotic mapping sequence value of Circle; mod is the modulo function; a, b are control parameters; the chaotic orbit state value range is (0,1).
[0119] After initialization using chaotic mapping, a reverse learning strategy is then employed to generate an opposing population to expand the initial population range, which can be represented as:
[0120]
[0121] In the above formula, This represents the reverse position of a sparrow individual.
[0122] The opposing population generated by the reverse learning strategy and the initial population generated by the chaotic mapping are ranked by fitness. The top 50% of individuals with the highest fitness are selected as the initial population to obtain an initial population that is as evenly distributed as possible and has good diversity, thereby improving the quality of the initial population.
[0123] In the traditional sparrow search algorithm, the discoverer's convergence speed is too fast, which can easily lead to low optimization accuracy. Therefore, this invention introduces the golden sine formula to improve the discoverer's position update formula:
[0124]
[0125] In the above formula, t is the number of iterations; X i,j This represents the current sparrow's position information; r1 and r2 are random numbers, where r1∈[0,2π] and r2∈[0,π]. S is the globally optimal position obtained in generation t; R is the warning value, R∈[0,1]; S T For a safe value, S T ∈[0.5, 1]; Q is a random number following a normal distribution; L is a matrix with all elements equal to 1; c1 and c2 are the golden sine coefficients; τ is the golden ratio. The initial values of m and u are set to π and -π, respectively. Subsequently, m and u change as the target value changes, and c1 and c2 are updated accordingly.
[0126] The improved discoverer position update formula uses the golden sine segmentation coefficient to narrow the search space, guiding individuals to gradually approach the optimal value and ensuring the convergence of the algorithm. Introducing the historical optimal position helps enhance information exchange and global search capabilities among individual algorithms, thereby improving the accuracy of the algorithm.
[0127] In the SSA algorithm, as the algorithm converges rapidly, sparrows with lower fitness will be unable to obtain food, while followers with higher fitness will quickly fly towards the optimal position. This shrinks the search area for these sparrows, thus reducing search accuracy. To address this issue, a dynamic weighting factor and a Lévy flight strategy are introduced. The dynamic weighting factor balances global exploration and local exploitation, while the Lévy flight strategy, with its randomness and ergodicity, enhances the diversity of individual sparrow search directions, thereby better exploring the global search space. The dynamic weighting factor can be expressed as:
[0128]
[0129] In the above formula, T represents the maximum number of iterations;
[0130] Levi's flight random step size is:
[0131]
[0132] In the above formula, β is a number between [0,2], usually taken as β=1.5; μ and ν are normally distributed.
[0133] The updated follower formula is:
[0134]
[0135] In the above formula, t+1 represents the local optimal position obtained by the discoverer; N is the population size of sparrows;
[0136] After the discoverers and followers complete their position updates, 10%–20% of the sparrows in the population are randomly selected as early warning sparrows, and their position update formula is as follows:
[0137]
[0138] In the above formula, γ is a random number that satisfies a normal distribution; θ is a random number within a specified range, θ∈[-1, 1]; ε is a parameter to prevent the denominator from being zero; f i f is the fitness value of the i-th sparrow individual; g f w Let be the global optimal fitness value and the worst fitness value of the sparrow population in generation t.
[0139] In each iteration, after all sparrows have completed their position updates, a mixed mutation perturbation strategy is used to select the optimal individual for further perturbation updates. The functions of the Cauchy distribution, t-distribution, and Gaussian distribution can be expressed as:
[0140]
[0141] In the above formula, n represents the degrees of freedom.
[0142] In the early stages of iteration, the Cauchy distribution has a wide probability density range and a large perturbation control factor ω, allowing for greater perturbation of individual sparrows and preventing premature convergence, thus improving the algorithm's global exploration capability. In the later stages of iteration, the Gaussian distribution has a relatively wide probability density in the middle and a smaller ω, which is conducive to the algorithm's precise local search and improves its local exploration capability. In the middle stages of iteration, the t-distribution is between the Cauchy and Gaussian distributions, with a moderate ω, allowing for appropriate perturbation of individual sparrows and enabling the algorithm to smoothly transition from global exploration to local exploration.
[0143] The mixed variation perturbation strategy based on Cauchy distribution, Gaussian distribution, and t-distribution can be expressed as:
[0144]
[0145] In the above formula, ω is the disturbance control factor; C(0,1) is the standard Cauchy distribution; t(3) is the t distribution with 3 degrees of freedom; G(0,1) is the standard Gaussian distribution; This is the new position after the disturbance.
[0146] Meanwhile, to ensure the population moves towards the optimal solution, a greedy strategy is introduced to filter and select updated solutions, retaining the better positions after mixed mutation perturbation, thereby improving the quality of the optimal solution. Specifically, this is expressed as follows:
[0147]
[0148] In the above formula, f(x) is the fitness function;
[0149] In summary, the microgrid capacity optimization configuration process is as follows: Figure 3 As shown.
[0150] First, input meteorological and load data and initialize algorithm parameters; second, use a chaotic back-learning strategy for initialization; then, obtain the updated capacity configuration based on the improved formula for sparrow positions; then, use a hybrid mutation perturbation strategy and a greedy strategy to escape local optima and ensure that the capacity configuration moves towards the optimal solution; finally, continuously iterate to find the optimal solution until the maximum number of iterations is reached, and output the optimal capacity configuration of the microgrid.
[0151] Example 3
[0152] The effectiveness and superiority of the proposed improved algorithm and strategy were verified by simulation. To test the optimization ability of the ISSA algorithm, MATLAB was used for algorithm testing. Five test functions were used to conduct 30 independent tests on the improved Sparrow Search Algorithm (ISSA), SSA, Grey Wolf Optimization Algorithm (GWO), and Whale Optimization Algorithm (WOA). The population size was set to 200, and the number of iterations was set to 500. The function information is shown in Table 1, the statistical test results are shown in Table 2, and the convergence curves of the test functions are shown in Figure 4.
[0153]
[0154] Table 1
[0155]
[0156]
[0157] Table 2
[0158] As shown in Table 2, all four algorithms were able to achieve optimal solutions to some extent in 30 experiments. By comparing the average and standard deviation of the four algorithms, it can be seen that the average of ISSA is closest to the optimal solution, and its standard deviation is very small, indicating that ISSA not only has higher convergence accuracy but also better stability.
[0159] As can be seen from the convergence curves of the five test functions in Figure 4, compared with SSA, GWO and WOA, the ISSA algorithm has higher convergence accuracy and faster convergence speed in solving the test functions.
[0160] Based on a price-based demand response model using time-of-use pricing, peak shaving and valley filling are implemented for the annual load of a certain region. Local meteorological and load data are shown in Figure 5, time-of-use pricing is shown in Table 3, and load optimization results are shown in [Table 3]. Figure 6Specifically, after considering demand response, the load power during off-peak hours increased to 176kW, while the load power during peak hours decreased to 185kW. The original load power difference was approximately 84kW, which was reduced to approximately 53kW after optimization, representing a 36.9% reduction in load power difference.
[0161]
[0162]
[0163] Table 3
[0164] The selected parameters for distributed power sources are shown in Table 4. In the microgrid system, the power temperature factor δ of the photovoltaic array is 0.0047, the charging and discharging efficiency of the battery is 0.85, and the normal operating range of SOC is 25%–90%. The supercapacitor has a charging efficiency of 0.95, a discharging efficiency of 0.98, and a normal operating range of SOC of 20%–90%. The system discount rate r is 4.75%, the government subsidy coefficient is 0.02 yuan / kWh, the population size and iteration count are both set to 100, the maximum transmission power of the tie line is 150kW, and the maximum energy surplus rate is 5%.
[0165]
[0166] Table 4
[0167] To verify the effectiveness of the microgrid hybrid energy storage operation and control strategy of this invention, an economic comparison test was conducted based on one year's meteorological and load data of the local area, comparing it with the two-charge-two-discharge operation and control strategy. The economic situation of different operation and control strategies is shown in Table 5. As can be seen from Table 5, the operation and control strategy proposed in this paper has a lower equivalent annual comprehensive cost compared with the two-charge-two-discharge operation and control strategy, with a levelized cost of electricity of 0.36 yuan / kWh, which meets the standard of 0.3-0.4 yuan / kWh for large-scale application of energy storage, thus achieving better economic efficiency.
[0168]
[0169] Table 5
[0170] To further verify the superiority of the microgrid capacity optimization method, a comparative method was used to optimize the microgrid capacity configuration using four algorithms: ISSA, SSA, GWO, and WOA. The capacity optimization configuration results are shown in Table 6. Figure 7As shown in Table 6, ISSA achieves the highest solution accuracy and has a faster convergence speed, while SSA, GWO, and WOA get stuck in local optima. Table 6 also shows that the ISSA algorithm provides lower annualized comprehensive cost, per kilowatt-hour cost, and energy surplus rate compared to other algorithms. Specifically, the annualized comprehensive cost is reduced by 6.39%, 7.35%, and 11.68% compared to SSA, GWO, and WOA, respectively, significantly improving the system's economic efficiency.
[0171]
[0172] Table 6
[0173] Obviously, the embodiments described above are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A microgrid capacity optimization method based on an improved sparrow search algorithm, characterized in that, Includes the following steps: S1. Based on the mathematical model of distributed power generation and the price-based demand response mathematical model of microgrid, a microgrid capacity optimization model is established with the objective function of minimizing the equivalent annual comprehensive cost, and a microgrid hybrid energy storage system is constructed. S2. Based on the theory of standardized levelized cost of electricity and time-of-use pricing, a microgrid operation control model is proposed. S3. Based on the problems of insufficient convergence accuracy and easy getting trapped in local optima in the Sparrow Search Algorithm SSA, an improved Sparrow Search Algorithm ISSA is proposed, which integrates chaotic reverse learning strategy, golden sine formula, dynamic weight factor, Lévy flight, hybrid mutation perturbation strategy and greedy strategy. S4. Utilize ISSA to rationally configure the number of distributed power sources in the microgrid.
2. The microgrid capacity optimization method based on the improved sparrow search algorithm according to claim 1, characterized in that, In step S1, the objective function of the microgrid capacity optimization configuration model is expressed as follows: minC total =C inc +C omc +C erc +C pc -C sr -C gs In the above formula, C total C is the equivalent annual comprehensive cost; inc C is the initial investment cost at an equivalent annual value. omc Annual operating and maintenance costs; C erc C is the cost of replacing equipment with equivalent annual value. pc For electricity purchase cost; C sr For electricity sales revenue; C gs Annual value of government subsidies; Constraints: In the above formula, N i N represents the number of the i-th type of power source; i_max The maximum number of configurations for the i-th power supply type; SOC b State of charge (SOC) of the battery. b_max SOC b_min The upper and lower limits of the battery's state of charge; SOC c State of charge (SOC) of the supercapacitor. c_max SOC c_min These are the upper and lower limits of the state of charge of a supercapacitor; P b_max P b_min P represents the upper and lower limits of the battery's charge and discharge power. c_min P c_max The upper and lower limits of the charging and discharging power of the supercapacitor; P L P represents the load power. WT P represents the actual output power of the wind turbine generator. PV P represents the actual output power of the photovoltaic array. HESS Power of the hybrid energy storage system; P G For power exchange between the microgrid and the grid; P G_max C is the maximum transmission power of the tie line; surplus Energy surplus rate; C surplus_max This represents the maximum energy surplus rate.
3. The microgrid capacity optimization method based on the improved sparrow search algorithm according to claim 1, characterized in that, In step S2, the microgrid operation control strategy includes the following steps: S5. First, acquire real-time data from wind turbines, photovoltaic arrays, batteries, and supercapacitors; S6. Next, calculate the unbalanced power ΔP(t), the expression of which is: ΔP(t)=P WT (t)+P PV (t)-P L (t) In the above formula, P WT (t) represents the actual output power of the wind turbine at time t; P PV (t) represents the actual output power of the photovoltaic array at time t; P L (t) represents the load power at time t; S7. When ΔP(t)>0, the photovoltaic array and wind turbine store energy in the hybrid energy storage system HESS and sell the surplus electricity to the grid; S8. Determine whether t has reached the set value. If t is less than the set value, return to S5; if t reaches the set value, end.
4. The microgrid capacity optimization method based on the improved sparrow search algorithm according to claim 3, characterized in that, In step S7, when ΔP(t) < 0, when the standardized electricity cost is less than the electricity purchase cost, the HESS supplies power to the load. If there is a shortfall, it is made up by the grid. Otherwise, the microgrid directly purchases electricity from the grid to supply power to the load, then charges the HESS, and then executes step S8.
5. The microgrid capacity optimization method based on the improved sparrow search algorithm according to claim 1, characterized in that, In step S3, the step of initializing the population using the chaotic reverse learning strategy is as follows: after initialization using chaotic mapping, the reverse learning strategy is used to generate an opposing population to expand the initial population range; the opposing population generated by the reverse learning strategy and the initial population generated by chaotic mapping are sorted by fitness, and the individuals with the top 50% fitness are selected as the initial population to obtain an initial population that is as evenly distributed as possible and has good diversity. The expression of the chaotic reverse learning strategy is: In the above formula, X i ' ,j b is the location information of the sparrow; j a is the lower bound of the search space boundary; j x represents the upper bound of the search space. k is the chaotic mapping sequence value of Circle; mod is the modulo function; a, b are control parameters; the chaotic orbit state value range is (0,1); This represents the reverse position of a sparrow individual.
6. The microgrid capacity optimization method based on the improved sparrow search algorithm according to claim 1, characterized in that, In step S3, the discoverer's position update formula is improved using the golden sine formula as follows: In the above formula, t is the number of iterations; X i,j This represents the current sparrow's position information; r1 and r2 are random numbers, where r1∈[0,2π] and r2∈[0,π]. S is the globally optimal position obtained in generation t; R is the warning value, R∈[0,1]; S T For a safe value, S T ∈[0.5, 1]; Q is a random number following a normal distribution; L is a matrix with all elements equal to 1; c1 and c2 are the golden sine segmentation coefficients; By utilizing dynamic weighting factors and the Lévy flight strategy, the follower position update formula is improved as follows: In the above formula, ψ is the dynamic weighting factor; T is the maximum number of iterations; s is the Lévy flight random step size; β is a number between [0,2]; μ and ν follow a normal distribution; t+1 represents the local optimal position obtained by the discoverer; N is the population size of sparrows; In each iteration, after all sparrows have completed their position updates, a hybrid mutation perturbation strategy is used to select the optimal individual for perturbation updates. This strategy, based on Cauchy, Gaussian, and t-distributions, is expressed as follows: In the above formula, ω is the disturbance control factor; C(0,1) is the standard Cauchy distribution; t(3) is the t distribution with 3 degrees of freedom; G(0,1) is the standard Gaussian distribution; This is the new position after the disturbance.
7. A microgrid capacity optimization method based on an improved sparrow search algorithm according to claim 6, characterized in that, In step S3, a greedy strategy is used to filter the updated solutions, retaining the better positions after the mixed mutation perturbation. The expression is as follows: In the above formula, f(x) is the fitness function.
8. A microgrid capacity optimization method based on an improved sparrow search algorithm according to claim 1, characterized in that, In step S4, the number of distributed power sources in the microgrid is rationally configured using ISSA, including the following steps: S9. First, input the meteorological and load data and initialize the algorithm parameters, and then use the chaotic reverse learning strategy to initialize the population; S10. Based on the improved formula for the position of the sparrow, obtain the updated capacity configuration; S11. By using a hybrid mutation perturbation strategy and a greedy strategy to escape local optima, the capacity configuration moves towards the optimal solution. The optimization is continuously iterated until the maximum number of iterations is reached, and the optimal capacity configuration of the microgrid is output.
9. A microgrid capacity optimization method based on an improved sparrow search algorithm according to claim 8, characterized in that, In step S11, if the maximum number of optimization attempts has not been reached, the positions of the discoverer, follower, and vigilant are updated sequentially, then a hybrid mutation perturbation and greedy strategy are executed, and the process returns to step S10.
10. A microgrid capacity optimization method based on an improved sparrow search algorithm according to claim 9, characterized in that, In step S11, after the discoverers and followers complete their position updates, 10%–20% of the sparrows in the population are randomly selected as early warning sparrows. The position update formula for these early warning sparrows is as follows: In the above formula, γ is a random number that satisfies a normal distribution; θ is a random number within a specified range, θ∈[-1, 1]; ε is a parameter to prevent the denominator from being zero; f i f is the fitness value of the i-th sparrow individual; g f w Let be the global optimal fitness value and the worst fitness value of the sparrow population in generation t.
Citation Information
Patent Citations
Micro-grid optimization scheduling method based on sparrow search algorithm
CN116316636A