Wind and light storage coordinated configuration method based on K-means and simulated annealing genetic algorithm
By using the coordinated configuration method of wind and light storage with K-means and simulated annealing genetic algorithm in the microgrid, the problems of wind and light abandonment caused by unreasonable wind and light ratios are solved, the absorption capacity and energy utilization rate are improved, and the investment cost is reduced.
Patent Information
- Application Number
- CN202410908902.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2025-02-28
AI Technical Summary
The wind and light ratio of the existing microgrid is unreasonable, resulting in mismatch between the wind and light output and load, resulting in wind, light abandonment or load cutting, which may cause power grid failure.
The wind and light storage coordinated configuration method based on K-means and simulated annealing genetic algorithm is adopted. The wind and light power generation data is processed through the K-means algorithm, and the wind and light energy storage optimization model is established, and the solution is used using the simulated annealing genetic algorithm to optimize the configuration of wind and light energy storage.
It improves the wind and light consumption capacity and energy utilization rate, significantly reduces the system investment cost, reduces the phenomenon of wind and light abandonment, and improves the stability of the power grid.
Smart Images

Figure CN119539311A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to microgrid operation and planning technology, and in particular to a wind-solar-storage coordinated configuration method based on K-means and simulated annealing genetic algorithm. Background Art
[0002] With the progress of modern society, the scale of microgrids is getting larger and larger, and users' demand for microgrids is also getting higher and higher. At the same time, wind and solar power generation has received widespread attention and has been rapidly developed and applied. The park microgrid is powered by wind and solar power generation and the main grid. In order to maximize the load share of wind and solar power, a higher proportion of wind and solar power generation capacity needs to be configured. However, due to the mismatch between the park load and the wind and solar power generation power sequence, it may lead to power abandonment. Configuring energy storage can alleviate the problem of mismatch between load and wind and solar timing and reduce power abandonment. Considering the high cost of electrochemical energy storage, the configuration of energy storage needs to consider investment and its benefits. Therefore, studying the coordinated configuration of wind, light, and energy storage is of great significance to improving wind and solar consumption, grid stability, and system economic benefits.
[0003] K-means algorithm is a clustering algorithm, which is often used in data mining and classification tasks. In the field of energy, K-means algorithm can be used to cluster energy consumption data, identify different load types and their characteristics, and then achieve optimal scheduling of energy systems. Simulated annealing genetic algorithm is an optimization algorithm that combines simulated annealing algorithm and genetic algorithm. Genetic algorithm can maintain the diversity of solution space in the population, while simulated annealing algorithm can accept suboptimal solutions and dynamically adjust the search direction during the search process, which helps to avoid falling into the local optimal solution. Simulated annealing genetic algorithm combines the advantages of simulated annealing algorithm and genetic algorithm. It can search the solution space in a global range and perform local search through crossover and mutation operations, making the algorithm more effective and robust. Using K-means and simulated annealing genetic algorithm to configure the capacity of wind, solar and storage microgrid system can improve the system's absorption capacity and energy utilization, thereby significantly reducing the system investment cost. Summary of the invention
[0004] The purpose of the present invention is to solve the technical problem that the unreasonable wind-solar ratio in the operation and planning technology of the existing microgrid will lead to the mismatch between wind-solar output and load, thus causing wind abandonment, solar abandonment or load shedding, which is easy to cause power grid failure. A wind-solar-storage coordinated configuration method based on K-means and simulated annealing genetic algorithm is proposed.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0006] The wind-solar-storage coordination configuration method based on K-means and simulated annealing genetic algorithm includes the following steps:
[0007] Step 1: Use K-means algorithm to process wind and solar power generation data;
[0008] Step 2: Establish a wind, solar and energy storage optimization model;
[0009] Step 3: Use simulated annealing genetic algorithm to solve the model in step 2;
[0010] In step 2, when establishing the wind-solar-energy storage optimization model, it includes: setting the objective function, establishing the charge-discharge balance formula and setting constraints.
[0011] In step 1, the K-means algorithm is used to process the typical daily load data and wind and solar power generation data, as follows:
[0012] Step 1.1: Randomly select K data points as the initial cluster centroids;
[0013] Step 1.2: Assign each data point to the nearest cluster based on its distance from the centroid of each cluster.
[0014] Step 1.3: Recalculate the centroid of each cluster, that is, take the average value of all data points in the cluster as the new centroid;
[0015] Repeat steps 1.2 and 1.3 until the cluster centroid no longer changes significantly or the preset number of iterations is reached.
[0016] In step 1.2, in the process of calculating the distance from each data point to the cluster center of its category, the Euclidean distance is used as the similarity indicator to calculate the square of the distance from all original data to the cluster center of their category, which is specifically expressed as:
[0017]
[0018] In the formula, x is the data point, c is i is the i-th cluster center, d is the dimension of the data, x j and c ij are x and c respectively i The value in the j dimension.
[0019] In step 1.2, for each cluster, recalculate its cluster center. The new cluster center is the mean of all data points in the cluster. The calculation formula is as follows:
[0020]
[0021] In the formula, S i is the set of data points of the ith cluster.
[0022] In step 2, the wind-solar-energy storage optimization model established is as follows:
[0023] Planning and designing energy storage configuration requires comprehensive consideration of factors such as system economics and wind and solar power abandonment rates. The total investment cost of the power grid includes the costs of wind power generation and photovoltaic power generation. The objective function F is expressed as:
[0024]
[0025] P s , P w are the power generation of photovoltaic and wind turbine respectively, P n To purchase electricity from the main grid, E s 、E w are photovoltaic and wind power installed capacity, S New , W New To increase the amount of photovoltaic and wind power generation, C s , C w , C n are the unit costs of purchasing electricity from photovoltaic power, wind power and the main grid, S c , S w is the configuration cost of wind power and photovoltaic power, n1 is the service life of photovoltaic panels, n2 is the service life of wind turbines, n3 is the service life of energy storage, T is the number of days in a year, and the total cost of energy storage is w i :
[0026] w i =C1×SOC max +C2×E max (4)
[0027] In the formula, C1 and C2 are energy unit price and power unit price respectively, SOC max is the capacity of the energy storage battery, E max is the maximum charge and discharge power of the battery;
[0028] Establish the charge and discharge balance formula as follows:
[0029]
[0030] In the formula, E dis is the battery discharge power, E ch The battery charging power, P l is the load power consumption, P t For the amount of wasted electricity;
[0031] Set constraints as follows:
[0032] Battery capacity constraints:
[0033] soc min <soc t <socmax (6)
[0034] In the formula, soc t is the battery state of charge at the current moment, soc min With soc max They are the upper and lower limits of the battery charge, usually expressed as a percentage;
[0035] Charge and discharge limits:
[0036]
[0037] Where U dis Indicates that the battery is in charging state, U ch Indicates that the battery is in a discharging state and the battery cannot be charged and discharged at the same time;
[0038] Other constraints:
[0039]
[0040] In step 3, the simulated annealing genetic algorithm is used to solve the above model, which specifically includes the following steps:
[0041] Step 3.1: Set initialization parameters;
[0042] Step 3.2: Determine the fitness of the population;
[0043] Step 3.3: Select individuals for crossover and mutation;
[0044] Step 3.4: Determine whether to perform annealing simulation operation on individuals in the population;
[0045] Step 3.5: Determine the population fitness again;
[0046] In step 3.1, the initial parameters are set, including: initializing the annealing temperature, randomly generating the initial population, setting the maximum number of evolution generations and the termination temperature.
[0047] In step 3.1, set the initial parameters as follows:
[0048] T0 = n (9)
[0049] Where T0 is the initial annealing temperature, n is the annealing parameter;
[0050] Set the maximum number of evolution generations and the termination temperature:
[0051] m max =x (10)
[0052] T end =b (11)
[0053] In the formula, m max is the maximum evolutionary generation, x is the evolutionary generation parameter, b is the termination temperature parameter;
[0054] For each variable and parameter, random number generation can be used to initialize individuals in the initial population, with y0 being the initial solution;
[0055]
[0056] In the formula, the energy storage battery capacity SOC max 、Battery maximum charge and discharge power E max , battery discharge power E dis , Battery charging power E ch 、New photovoltaic power generation S New With the newly added wind power generation W New 、Power purchased by the main power grid P n , abandoned power P t , the current battery state of charge soc t The initial values are randomly generated.
[0057] In step 3.2, the fitness of the population is judged as follows:
[0058] Set the fitness f:
[0059]
[0060] Where F is the objective function of the wind-solar-energy storage optimization model;
[0061] If the fitness meets the requirements, the current best individual is selected as the optimal solution, the optimal configuration method of wind, solar and energy storage is obtained, and the cycle ends; if the fitness does not meet the requirements: f m <f min or m >f max , evolutionary algebra m=m+1, proceed to the next step;
[0062] f m Refers to the fitness corresponding to the evolutionary generation m; f min 、f max The upper and lower limits of fitness.
[0063] In step 3.3, individuals are selected for crossover and mutation, as follows:
[0064]
[0065] In the formula, f i 、f j is the fitness under different evolutionary generations, where P i represents the probability of individual i being selected, and N is the number of individuals in the population;
[0066] Select some mapping crossover and mutation:
[0067]
[0068] In the formula, y i and j represents two parent individuals, y1 and y2 represent two offspring individuals generated after crossover, c1 and c2 represent crossover points in multi-point crossover, both of which are initially randomly selected, and PMX represents the partial mapping crossover operation function;
[0069] y m+1 = Mutate(y1,y2) (16)
[0070] In the formula, Mutate() represents the mutation operation function, y m+1 For the mutated offspring individuals, the purpose of crossover and mutation operations is to introduce new genetic information, increase the diversity of the population, improve the global optimization ability of the search, and obtain new solutions.
[0071] In step 3.4, it is determined whether to perform annealing simulation operation on the individuals in the population, as follows:
[0072] Calculate the fitness difference △f between the new solution and the current solution:
[0073] △f=f(y m+1 )-f(y m ) (17)
[0074] If the fitness of the new solution is better, the new solution is accepted and the current solution is updated; if the fitness of the new solution is poor, the new solution is accepted with a certain probability; the new generated solution y m+1 The probability of being accepted is denoted by p α :
[0075]
[0076] In the formula, f(y i ) is the coding population y i The adaptation function is generally expressed as the objective function; μ is a constant for appropriately proportionally transforming the objective function F;
[0077] If the new solution is accepted, the annealing simulation operation is performed on the individuals in the population, and new disturbances are added to enable the possibility of continuing to search for a better solution when a worse solution is accepted;
[0078] The temperature update function corresponding to the evolutionary generation m is denoted by T m ,have:
[0079] T m =T0×e -θ×m(19)
[0080] Where, θ is the annealing temperature parameter, and θ≥1;
[0081] If the new solution is not accepted, no disturbance is added, and the current state is retained to avoid development in an undesirable direction, return to step 3.2 and repeat the above steps;
[0082] In step 3.5, determine whether the new solution meets the convergence conditions, as follows:
[0083] f min ≤f≤f max (20)
[0084] Among them, f min 、f max is the upper and lower limits of fitness. If the fitness meets the requirements, the current optimal individual is selected as the optimal solution, the optimal configuration method of wind, solar and energy storage is obtained, and the cycle ends; if m≥m max or T m ≤T end , select the current optimal individual as the approximate optimal solution;
[0085] If the fitness does not meet the requirements and m <m max , return to step 3.3 and repeat the above steps until the newly generated solution meets the conditions. The latest solution is taken as the optimal target solution, which is the optimal configuration plan for the microgrid wind, solar and energy storage.
[0086] Compared with the prior art, the present invention has the following technical effects:
[0087] 1) The starting point of the present invention is to solve the problems of wind curtailment, solar curtailment and absorption through the coordinated configuration of wind, solar and energy storage, so as to provide reliable guidance for the operation and planning of microgrids. An unreasonable wind-solar ratio will lead to a mismatch between wind and solar output and load, resulting in wind curtailment, solar curtailment or load shedding, causing economic losses and even grid failures. The present invention proposes a wind-solar-storage coordinated configuration scheme to reduce the amount of new energy curtailment based on historical electricity loads, so that the energy storage capacity and new wind and solar installed capacity that should be configured in the region can be calculated, and a more accurate microgrid energy storage optimization configuration model can be established;
[0088] 2) The present invention uses the K-means algorithm to process the initial data, then constructs a wind-solar-storage configuration model, and finally uses a simulated annealing genetic algorithm to solve it. The simulated annealing genetic algorithm combines the advantages of the simulated annealing algorithm's strong local search capability with the advantages of the genetic algorithm's strong global search capability to improve the algorithm's accuracy and optimization speed. Applying it to the optimization of microgrid energy storage configuration can reduce wind and solar power abandonment while minimizing investment costs, providing an effective planning solution for microgrids. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:
[0090] Figure 1 A flowchart of the solution algorithm of the present invention;
[0091] Figure 2 This is the K-means clustering principle diagram;
[0092] Figure 3 The photovoltaic output and clustering curve of a typical sun-down system in the embodiment;
[0093] Figure 4 The wind turbine output and clustered curve diagram of a typical sundown system in the embodiment;
[0094] Figure 5 It is the temperature drop curve of simulated annealing algorithm;
[0095] Figure 6 This is the operation diagram when no wind, solar and energy storage coordination configuration is performed in the embodiment;
[0096] Figure 7 This is an operation diagram for wind, solar and energy storage coordination configuration on a typical day under the simulated annealing genetic algorithm of the present invention in the embodiment;
[0097] Figure 8 It is a schematic diagram of the charging and discharging conditions when the wind-solar energy storage configuration is performed in the embodiment. DETAILED DESCRIPTION
[0098] The wind-solar-storage coordination configuration method based on K-means and simulated annealing genetic algorithm includes the following steps:
[0099] Step 1: Use K-means algorithm to process wind and solar power generation data;
[0100] Step 2: Establish a wind, solar and energy storage optimization model;
[0101] Step 3: Use simulated annealing genetic algorithm to solve the model in step 2;
[0102] In step 2, when establishing the wind-solar-energy storage optimization model, it includes: setting the objective function, establishing the charge-discharge balance formula and setting constraints.
[0103] In step 1, the K-means algorithm is used to process the typical daily load data and wind and solar power generation data, as follows:
[0104] Step 1.1: Randomly select K data points as the initial cluster centroids;
[0105] Step 1.2: Assign each data point to the nearest cluster based on its distance from the centroid of each cluster.
[0106] Step 1.3: Recalculate the centroid of each cluster, that is, take the average value of all data points in the cluster as the new centroid;
[0107] Repeat steps 1.2 and 1.3 until the cluster centroid no longer changes significantly or the preset number of iterations is reached.
[0108] In step 1.2, in the process of calculating the distance from each data point to the cluster center of its category, the Euclidean distance is used as the similarity indicator to calculate the square of the distance from all original data to the cluster center of their category, which is specifically expressed as:
[0109]
[0110] In the formula, x is the data point, c is i is the i-th cluster center, d is the dimension of the data, x j and c ij are x and c respectively i The value in the j dimension.
[0111] In step 1.2, for each cluster, recalculate its cluster center. The new cluster center is the mean of all data points in the cluster. The calculation formula is as follows:
[0112]
[0113] In the formula, S i is the set of data points of the ith cluster.
[0114] In step 2, the wind-solar-energy storage optimization model established is as follows:
[0115] Planning and designing energy storage configuration requires comprehensive consideration of factors such as system economics and wind and solar power abandonment rates. The total investment cost of the power grid includes the costs of wind power generation and photovoltaic power generation. The objective function F is expressed as:
[0116]
[0117] P s , P w are the power generation of photovoltaic and wind turbine respectively, P n To purchase electricity from the main grid, E s 、E w are photovoltaic and wind power installed capacity, S New , W New To increase the amount of photovoltaic and wind power generation, C s , C w , C n are the unit costs of purchasing electricity from photovoltaic power, wind power and the main grid, S c , Sw is the configuration cost of wind power and photovoltaic power, n1 is the service life of photovoltaic panels, n2 is the service life of wind turbines, n3 is the service life of energy storage, T is the number of days in a year, and the total cost of energy storage is w i :
[0118] w i =C1×SOC max +C2×E max (4)
[0119] In the formula, C1 and C2 are energy unit price and power unit price respectively, SOC max is the capacity of the energy storage battery, E max is the maximum charge and discharge power of the battery;
[0120] Establish the charge and discharge balance formula as follows:
[0121]
[0122] In the formula, E dis is the battery discharge power, E ch The battery charging power, P l is the load power consumption, P t For the amount of wasted electricity;
[0123] Set constraints as follows:
[0124] Battery capacity constraints:
[0125] soc min <soc t <soc max (6)
[0126] In the formula, soc t is the battery state of charge at the current moment, soc min With soc max They are the upper and lower limits of the battery charge, usually expressed as a percentage;
[0127] Charge and discharge limits:
[0128]
[0129] Where U dis Indicates that the battery is in charging state, U ch Indicates that the battery is in a discharging state and the battery cannot be charged and discharged at the same time;
[0130] Other constraints:
[0131]
[0132] In step 3, the simulated annealing genetic algorithm is used to solve the above model, which specifically includes the following steps:
[0133] Step 3.1: Set initialization parameters;
[0134] Step 3.2: Determine the fitness of the population;
[0135] Step 3.3: Select individuals for crossover and mutation;
[0136] Step 3.4: Determine whether to perform annealing simulation operation on individuals in the population;
[0137] Step 3.5: Determine the population fitness again;
[0138] In step 3.1, the initial parameters are set, including: initializing the annealing temperature, randomly generating the initial population, setting the maximum number of evolution generations and the termination temperature.
[0139] In step 3.1, set the initial parameters as follows:
[0140] T0 = n (9)
[0141] Where T0 is the initial annealing temperature, n is the annealing parameter;
[0142] Set the maximum number of evolution generations and the termination temperature:
[0143] m max =x (10)
[0144] T end =b (11)
[0145] In the formula, m max is the maximum evolutionary generation, x is the evolutionary generation parameter, b is the termination temperature parameter;
[0146] For each variable and parameter, random number generation can be used to initialize individuals in the initial population, with y0 being the initial solution;
[0147]
[0148] In the formula, the energy storage battery capacity SOC max 、Battery maximum charge and discharge power E max , battery discharge power E dis , Battery charging power E ch , New photovoltaic power generation S New With the newly added wind power generation W New 、Power purchased by the main power grid P n , abandoned power P t , the current battery state of charge soc tThe initial values are randomly generated.
[0149] In step 3.2, the fitness of the population is judged as follows:
[0150] Set the fitness f:
[0151]
[0152] Where F is the objective function of the wind-solar-energy storage optimization model;
[0153] If the fitness meets the requirements, the current best individual is selected as the optimal solution, the optimal configuration method of wind, solar and energy storage is obtained, and the cycle ends;
[0154] If the fitness does not meet the requirements: f m <f min or m >f max , evolutionary algebra m=m+1, proceed to the next step;
[0155] f m Refers to the fitness corresponding to the evolutionary generation m; f min 、f max The upper and lower limits of fitness.
[0156] In step 3.3, individuals are selected for crossover and mutation, as follows:
[0157]
[0158] In the formula, f i 、f j is the fitness under different evolutionary generations, where P i represents the probability of individual i being selected, and N is the number of individuals in the population;
[0159] Select some mapping crossover and mutation:
[0160]
[0161] In the formula, y i and j represents two parent individuals, y1 and y2 represent two offspring individuals generated after crossover, c1 and c2 represent crossover points in multi-point crossover, both of which are initially randomly selected, and PMX represents the partial mapping crossover operation function;
[0162] y m+1 = Mutate(y1,y2) (16)
[0163] In the formula, Mutate() represents the mutation operation function, y m+1For the mutated offspring individuals, the purpose of crossover and mutation operations is to introduce new genetic information, increase the diversity of the population, improve the global optimization ability of the search, and obtain new solutions.
[0164] In step 3.4, it is determined whether to perform annealing simulation operation on the individuals in the population, as follows:
[0165] Calculate the fitness difference △f between the new solution and the current solution:
[0166] △f=f(y m+1 )-f(y m ) (17)
[0167] If the fitness of the new solution is better, the new solution is accepted and the current solution is updated; if the fitness of the new solution is poor, the new solution is accepted with a certain probability; the new generated solution y m+1 The probability of being accepted is denoted by p α :
[0168]
[0169] In the formula, f(y i ) is the coding population y i The adaptation function is generally expressed as the objective function; μ is a constant for appropriately proportionally transforming the objective function F;
[0170] If the new solution is accepted, the annealing simulation operation is performed on the individuals in the population, and new disturbances are added to enable the possibility of continuing to search for a better solution when a worse solution is accepted;
[0171] The temperature update function corresponding to the evolutionary generation m is denoted by T m ,have:
[0172] T m =T0×e -θ×m (19)
[0173] Where, θ is the annealing temperature parameter, and θ≥1;
[0174] If the new solution is not accepted, no disturbance is added, and the current state is retained to avoid development in an undesirable direction, return to step 3.2 and repeat the above steps;
[0175] In step 3.5, determine whether the new solution meets the convergence conditions, as follows:
[0176] f min ≤f≤f max (20)
[0177] Among them, f min 、f maxis the upper and lower limits of fitness. If the fitness meets the requirements, the current optimal individual is selected as the optimal solution, the optimal configuration method of wind, solar and energy storage is obtained, and the cycle ends; if m≥m max or T m ≤T end , select the current optimal individual as the approximate optimal solution;
[0178] If the fitness does not meet the requirements and m <m max , return to step 3.3 and repeat the above steps until the newly generated solution meets the conditions. The latest solution is taken as the optimal target solution, which is the optimal configuration plan for the microgrid wind, solar and energy storage.
[0179] Example:
[0180] Taking a target park as an example, the energy storage is configured with lithium iron phosphate batteries, with a power unit price of 800 yuan / kW and an energy unit price of 1,800 yuan.
[0181] / kWh, the battery state of charge range is 10%-90%, the operating life is 10 years, the configuration costs of wind power and photovoltaic power sources are 3000 yuan / kW and 2500 yuan / kW respectively, the investment payback period is 5 years, the current installed capacity of wind and solar power is 500kW and 600kW respectively, the power purchase cost of the park from wind power and photovoltaic is 0.5 yuan / kWh and 0.4 yuan / kWh respectively, and the power purchase cost from the main grid is 1.0
[0182] Yuan / kWh. First, cluster analysis is performed on it. The specific steps are as follows:
[0183] First, the coordinated configuration model of wind, solar and storage with the lowest economic cost and abandoned wind and solar in the park is as follows:
[0184]
[0185] w i =1800×SOC max +800E max
[0186] In the formula, F is the objective function, P s , P w are the power generation of photovoltaic and wind turbine respectively, P n To purchase electricity from the main grid, S New , W New is the newly added photovoltaic and wind power generation, n1 is the service life of the photovoltaic panel, n2 is the service life of the wind turbine, n3 is the service life of the energy storage, T is the number of days in a year, and w i is the total storage cost, SOC max is the capacity of the energy storage battery, E max It is the maximum charge and discharge power of the battery.
[0187] Charge and discharge balance formula:
[0188]
[0189] In the formula, E dis is the battery discharge power, E ch The battery charging power, P l is the load power consumption, P t For wasted electricity.
[0190] Battery capacity constraints
[0191] 10% <soc t <90%
[0192] In the formula, soc t The battery state of charge at the current moment.
[0193] Charge and discharge limits:
[0194]
[0195] Where U dis Indicates that the battery is in charging state, U ch Indicates that the battery is in a discharging state and the battery cannot be charged and discharged at the same time.
[0196] Other constraints:
[0197]
[0198] Solve using simulated annealing genetic algorithm:
[0199] The first step is to set the initial parameters, including: initializing the annealing temperature, randomly generating the initial population, setting the maximum number of evolution generations and the termination temperature, as follows:
[0200] T0=n
[0201] Where T0 is the initial annealing temperature and n is the annealing parameter.
[0202] Set the maximum number of evolution generations and the termination temperature:
[0203] m max =x (10)
[0204] T end =b (11)
[0205] In the formula, m max is the maximum evolutionary generation, x is the evolutionary generation parameter, and b is the termination temperature parameter.
[0206] For each variable and parameter, random number generation can be used to initialize individuals in the initial population, with y0 being the initial solution;
[0207]
[0208] In the formula, the energy storage battery capacity SOC max 、Battery maximum charge and discharge power E max , New photovoltaic power generation S New With the newly added wind power generation W New , battery discharge power E dis , Battery charging power E ch 、Power purchased by the main power grid P n , abandoned power P t , the current battery state of charge soc t The initial values are randomly generated.
[0209] The second step is to set the fitness f, as follows:
[0210]
[0211] Where F is the objective function of the wind-solar-energy storage optimization model.
[0212] If the fitness meets the requirements, the current best individual is selected as the optimal solution, the optimal configuration method of wind, solar and energy storage is obtained, and the cycle ends; if the fitness does not meet the requirements: f m <f min or m >f max , evolutionary algebra m=m+1, proceed to the next step;
[0213] f m Refers to the fitness corresponding to the evolutionary generation m; f min 、f max The upper and lower limits of fitness.
[0214] The third step is to select individuals for crossover and mutation, as follows:
[0215]
[0216] In the formula, f i 、f j is the fitness under different evolutionary generations, P i represents the probability of individual i being selected, and N is the number of individuals in the population.
[0217] Select some mapping crossover and mutation:
[0218]
[0219] In the formula, y i and jRepresents two parent individuals, y1 and y2 represent the two offspring individuals generated after crossover, c1 and c2 represent the crossover points in multi-point crossover, which are initially randomly selected, and PMX represents the partial mapping crossover operation function.
[0220] y m+1 =Mutate(y1,y2)
[0221] In the formula, Mutate() represents the mutation operation function, y m+1 For the mutated offspring individuals, the purpose of crossover and mutation operations is to introduce new genetic information, increase the diversity of the population, improve the global optimization ability of the search, and obtain new solutions.
[0222] The fourth step is to determine whether to perform annealing simulation operation on the individuals in the population, as follows:
[0223] Calculate the fitness difference △f between the new solution and the current solution:
[0224] △f=f(y m+1 )-f(y m )
[0225] If the fitness of the new solution is better, the new solution is accepted and the current solution is updated; if the fitness of the new solution is poor, the new solution is accepted with a certain probability; the new generated solution y m+1 The probability of being accepted is denoted by p α :
[0226]
[0227] In the formula, f(y i ) is the coding population y i The adaptation function is generally expressed as the objective function; μ is a constant for appropriately proportionally transforming the objective function F.
[0228] If the new solution is accepted, the annealing simulation operation is performed on the individuals in the population, and new disturbances are added to enable the possibility of continuing to search for a better solution when a worse solution is accepted;
[0229] The temperature update function corresponding to the evolutionary generation m is denoted by T m ,have:
[0230] T m =T0×e -θ×m
[0231] Wherein, θ is the annealing temperature parameter, and θ≥1.
[0232] If the new solution is not accepted, no disturbance is added, and the current state is retained to avoid development in an undesirable direction, return to the second step and recalculate the fitness:
[0233] fmin ≤f≤f max
[0234] Among them, f min 、f max is the upper and lower limits of fitness. If the fitness meets the requirements, the current optimal individual is selected as the optimal solution, the optimal configuration method of wind, solar and energy storage is obtained, and the cycle ends; if m≥m max or T m ≤T end , select the current best individual as the approximate optimal solution; if the fitness does not meet the requirements and m <m max , then the evolutionary algebra m=m+1, return to step 3.3 and repeat the above steps until the newly generated solution meets the conditions. The latest solution is taken as the optimal target solution, which is the optimal configuration scheme for the microgrid wind, solar and energy storage.
[0235] like Figure 6 As shown, when no wind, solar and storage coordination configuration is performed, the daily power purchase amount is 5717.7kW, the total power supply cost is 8484.4 yuan, 252.34kW of wind and solar power are abandoned, and the average power supply cost per unit of power is 0.7274 yuan. According to the above steps, the optimal solution for the coordinated configuration of wind, solar and storage in the microgrid can be obtained: configure a battery with a capacity of 1000kWh and a power limit of 360kW, install a total wind power of 692.2kWh, and do not install additional photovoltaic power sources. The abandoned wind and solar power is reduced to zero while the investment cost is the lowest. The daily power purchase amount is 1572.7kWh, the total power supply cost is 8070.5 yuan, and the average power supply cost per unit of power is 0.6919. The configuration plan is as follows Figure 7 , Figure 8 .
Claims
1. A wind-solar-storage coordination configuration method based on K-means and simulated annealing genetic algorithm, characterized in that: The following steps are involved: Step 1: Use K-means algorithm to process wind and solar power generation data; Step 2: Establish a wind, solar and energy storage optimization model; Step 3: Use simulated annealing genetic algorithm to solve the model in step 2; In step 2, when establishing the wind-solar-energy storage optimization model, it includes: setting the objective function, establishing the charge-discharge balance formula and setting constraints.
2. The method according to claim 1, characterized in that In step 1, the K-means algorithm is used to process the typical daily load data and wind and solar power generation data, as follows: Step 1.1: Randomly select K data points as the initial cluster centroids; Step 1.2: Assign each data point to the nearest cluster based on its distance from the centroid of each cluster. Step 1.3: Recalculate the centroid of each cluster, that is, take the average value of all data points in the cluster as the new centroid; Repeat steps 1.2 and 1.3 until the cluster centroid no longer changes significantly or the preset number of iterations is reached.
3. The method according to claim 2, characterized in that In step 1.2, in the process of calculating the distance from each data point to the cluster center of its category, the Euclidean distance is used as the similarity indicator to calculate the square of the distance from all original data to the cluster center of their category, which is specifically expressed as: In the formula, x is the data point, c is i is the i-th cluster center, d is the dimension of the data, x j and c ij are x and c respectively i The value in the j dimension.
4. The method according to claim 2, characterized in that: In step 1.2, for each cluster, recalculate its cluster center. The new cluster center is the mean of all data points in the cluster. The calculation formula is as follows: In the formula, S i is the set of data points of the ith cluster.
5. The method according to claim 1, characterized in that In step 2, the wind-solar-energy storage optimization model established is as follows: Planning and designing energy storage configuration requires comprehensive consideration of factors such as system economics and wind and solar power abandonment rates. The total investment cost of the power grid includes the costs of wind power generation and photovoltaic power generation. The objective function F is expressed as: P s , P w are the power generation of photovoltaic and wind turbine respectively, P n To purchase electricity from the main grid, E s 、E w are the installed capacity of photovoltaic and wind power respectively, S New , W New To increase the amount of photovoltaic and wind power generation, C s , C w , C n are the unit costs of purchasing electricity from photovoltaic power, wind power and the main grid, S c , S w is the configuration cost of wind power and photovoltaic power, n1 is the service life of photovoltaic panels, n2 is the service life of wind turbines, n3 is the service life of energy storage, T is the number of days in a year, and the total cost of energy storage is w i : In i =C1×SOC max +C2×E max (4) In the formula, C1 and C2 are energy unit price and power unit price respectively, SOC max is the capacity of the energy storage battery, E max is the maximum charge and discharge power of the battery; Establish the charge and discharge balance formula as follows: In the formula, E dis is the battery discharge power, E ch The battery charging power, P l is the load power consumption, P t For the amount of wasted electricity; Set constraints as follows: Battery capacity constraints: soc min <soc t <soc max (6) In the formula, soc t is the battery state of charge at the current moment, soc min With soc max They are the upper and lower limits of the battery charge, usually expressed as a percentage; Charge and discharge limits: Where U dis Indicates that the battery is in charging state, U ch Indicates that the battery is in a discharging state and the battery cannot be charged and discharged at the same time; Other constraints:
6. The method according to claim 1, characterized in that In step 3, the simulated annealing genetic algorithm is used to solve the above model, which specifically includes the following steps: Step 3.1: Set initialization parameters; Step 3.2: Determine the fitness of the population; Step 3.3: Select individuals for crossover and mutation; Step 3.4: Determine whether to perform annealing simulation operation on individuals in the population; Step 3.5: Determine the population fitness again; In step 3.1, the initial parameters are set, including: initializing the annealing temperature, randomly generating the initial population, setting the maximum number of evolution generations and the termination temperature.
7. The method according to claim 6, characterized in that In step 3.1, set the initial parameters as follows: T0 = n (9) Where T0 is the initial annealing temperature, n is the annealing parameter; Set the maximum number of evolution generations and the termination temperature: m max =x (10) T end =b (11) In the formula, m max is the maximum evolutionary generation, x is the evolutionary generation parameter, b is the termination temperature parameter; For each variable and parameter, random number generation can be used to initialize individuals in the initial population, with y0 being the initial solution; In the formula, the energy storage battery capacity SOC max 、Battery maximum charge and discharge power E max , battery discharge power E dis , Battery charging power E ch , New photovoltaic power generation S New With the newly added wind power generation W New 、Power purchased by the main power grid P n , abandoned power P t , the current battery state of charge soc t The initial values are randomly generated.
8. The method according to claim 6, characterized in that In step 3.2, the fitness of the population is judged as follows: Set the fitness f: Where F is the objective function of the wind-solar-energy storage optimization model; If the fitness meets the requirements, the current best individual is selected as the optimal solution, the optimal configuration method of wind, solar and energy storage is obtained, and the cycle ends; if the fitness does not meet the requirements: f m <f min or m >f max , evolutionary algebra m=m+1, proceed to the next step; f m Refers to the fitness corresponding to the evolutionary generation m; f min 、f max The upper and lower limits of fitness.
9. The method according to claim 6, characterized in that In step 3.3, individuals are selected for crossover and mutation as follows: In the formula, f i 、f j is the fitness under different evolutionary generations, where P i represents the probability of individual i being selected, and N is the number of individuals in the population; Select some mapping crossover and mutation: In the formula, y i and j represents two parent individuals, y1 and y2 represent two offspring individuals generated after crossover, c1 and c2 represent crossover points in multi-point crossover, both of which are randomly selected initially, and PMX represents the partial mapping crossover operation function; y m+1 = Mutate(y1,y2) (16) In the formula, Mutate() represents the mutation operation function, y m+1 For the mutated offspring individuals, the purpose of crossover and mutation operations is to introduce new genetic information, increase the diversity of the population, improve the global optimization ability of the search, and obtain new solutions.
10. The method according to claim 6, characterized in that In step 3.4, it is determined whether to perform annealing simulation operation on the individuals in the population, as follows: Calculate the fitness difference △f between the new solution and the current solution: △f=f(y m+1 )-f(y m ) (17) If the fitness of the new solution is better, the new solution is accepted and the current solution is updated; if the fitness of the new solution is poor, the new solution is accepted with a certain probability; the new generated solution y m+1 The probability of being accepted is denoted by p α : In the formula, f(y i ) is the coding population y i The adaptation function is generally expressed as an objective function; μ is a constant for appropriately scaling the objective function F; If the new solution is accepted, the annealing simulation operation is performed on the individuals in the population, and new disturbances are added to enable the possibility of continuing to search for a better solution when a worse solution is accepted; The temperature update function corresponding to the evolutionary generation m is denoted by T m ,have: T m =T0×e -θ×m (19) Where, θ is the annealing temperature parameter, and θ≥1; If the new solution is not accepted, no disturbance is added, and the current state is retained to avoid development in an undesirable direction, and return to step 3.
2. Repeat the above steps; In step 3.5, determine whether the new solution meets the convergence conditions, as follows: f min ≤f≤f max (20) Among them, f min 、f max is the upper and lower limits of fitness. If the fitness meets the requirements, the current optimal individual is selected as the optimal solution, the optimal configuration method of wind, solar and energy storage is obtained, and the cycle ends; if m≥m max or T m ≤T end , select the current optimal individual as the approximate optimal solution; If the fitness does not meet the requirements and m <m max , return to step 3.3 and repeat the above steps until the newly generated solution meets the conditions. The latest solution is taken as the optimal target solution, which is the optimal configuration plan for the microgrid wind, solar and energy storage.
Citation Information
Cited By
Wind and light storage collaborative optimization configuration method and system based on multi-objective optimization algorithm
CN121618543A