Optimal scheduling method for vehicle-grid interactive operation based on improved whale-sparrow algorithm
By improving the whale-sparrow algorithm to solve the vehicle network model, the problem that the whale algorithm in the existing technology is easily trapped in the local optimal solution, and the optimal vehicle network operation optimization scheduling strategy is achieved within the preset total time.
Patent Information
- Application Number
- CN202411827611.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-01
AI Technical Summary
In the prior art, the single use of whale algorithm to solve optimization problems is easily trapped in the local optimal solution, resulting in unsatisfactory search results and it is difficult to obtain the optimal operation optimization scheduling strategy within the preset total time.
The improved whale-sparrow algorithm is adopted to construct the electric vehicle behavior model and vehicle network model under the interaction of vehicle network, and combine the Monte Carlo method to randomly simulate electric vehicle users to generate charging and discharge power. The improved whale-sparrow algorithm is used to solve the vehicle network model to obtain the vehicle network operation optimization scheduling strategy.
After improving the whale-sparrow algorithm based on the whale algorithm, it has strong evolutionary ability, fast search ability and strong optimization ability. It can find the optimal operation optimization scheduling strategy within the preset total time to avoid falling into the local optimal solution.
Smart Images

Figure CN119740321A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power grid optimization, and in particular to a vehicle-grid interactive operation optimization scheduling method based on an improved whale-sparrow algorithm. Background Art
[0002] With the gradual increase in the penetration rate of electric vehicles and renewable energy, the disordered charging of large-scale electric vehicles and the intermittent fluctuations in the output of distributed power sources will lead to an increase in the peak-to-valley difference of the power grid and a significant increase in the pressure on the power grid. If V2G technology is used to reasonably regulate the charging and discharging behavior of electric vehicles and give full play to the value of its mobile energy storage equipment, it will not only help the power grid reduce the peak-to-valley difference and improve the stability of the power system, but also help users save electricity costs and obtain economic benefits.
[0003] In the prior art, using only the whale algorithm to solve optimization problems may easily fall into a local optimal solution, resulting in unsatisfactory search results. Summary of the invention
[0004] Technical purpose: In view of the defects in the prior art, the present invention discloses a vehicle-grid interactive operation optimization scheduling method based on the improved whale-sparrow algorithm, which obtains the optimal operation optimization scheduling strategy within a preset total time.
[0005] Technical solution: In order to achieve the above technical objectives, the present invention adopts the following technical solution.
[0006] A vehicle-grid interactive operation optimization scheduling method based on an improved whale-sparrow algorithm comprises the following steps:
[0007] S1. Construct an electric vehicle behavior model under vehicle-grid interaction. The electric vehicle behavior model includes daily mileage fitting, electric vehicle initial SOC fitting, probability density function fitting of station entry time, and probability density function fitting of station departure time;
[0008] S2. Construct the objective function and constraints of the vehicle-grid model, take the power exchange cost between the vehicle-grid and the external power grid and the depreciation cost of the electric vehicle battery as the optimization target, and construct the objective function;
[0009] S3. Within the preset total time, a number of electric vehicle users are randomly simulated according to the electric vehicle behavior model to generate the charging and discharging power of each electric vehicle; the established vehicle-grid model is solved based on the improved whale-sparrow algorithm to obtain the vehicle-grid operation optimization scheduling strategy.
[0010] Preferably, the relationship between the initial SOC and the daily mileage is fitted, wherein the daily mileage fitting formula is:
[0011]
[0012] Among them, f d (x) is the daily mileage of the fitted electric vehicle, σ d is the variance of the initial SOC; μ d is the normal distribution mean of the initial SOC;
[0013] The initial SOC fitting formula of electric vehicles can be expressed as:
[0014]
[0015] Among them, SOC init SOC is the initial state of charge of the electric vehicle entering the station; q is the expected charge of the electric vehicle; d r is the daily mileage of electric vehicles; d e Rated mileage for electric vehicles.
[0016] Preferably, the probability density function fitting formula of the pit stop time is:
[0017]
[0018] Among them, f s (x) is the probability density function of the fitted pit stop time, μ s is the normal distribution mean of the pit stop time, σ s is the variance of pit stop time;
[0019] The probability density function fitting formula of the departure time is:
[0020]
[0021] Among them, f p (x) is the probability density function of the fitted departure time, σ p is the variance of departure time, μ p is the mean of the normal distribution of departure time.
[0022] Preferably, the calculation formula of the objective function is:
[0023]
[0024] in, are the power exchange cost between the vehicle grid and the external power grid and the aging cost of the electric vehicle battery; T is the total time step; P is the electricity price exchanged between the vehicle grid and the external grid unit; t grid Exchange power between the vehicle grid and the external grid; b is the battery loss cost per unit power during the discharge process; is the discharge power of the i-th electric vehicle at time t; η d The discharge efficiency of electric vehicles.
[0025] Preferably, the constraints include:
[0026] Power balance constraints:
[0027] P t PV +P t WP +P t EV,dis -P t EV,cha =P t grid
[0028] Among them, P t PV , P t WP , P t EV,dis , P t EV,cha With P t grid They are the photovoltaic active power, wind power active power, electric vehicle discharge power, electric vehicle charging power and the exchange power between the vehicle grid and the external power grid at time t.
[0029] Power constraints between the vehicle grid and the external grid:
[0030]
[0031] in, They are the upper and lower limits of the power exchanged between the vehicle grid and the external grid respectively;
[0032] Electric vehicle constraints:
[0033]
[0034] in, is the battery state of charge of the i-th electric vehicle at time t, is the battery charge state of the i-th electric vehicle at time t+1; C i,ev is the rated capacity of the electric vehicle battery; η c charging efficiency for electric vehicles; are the upper and lower limits of the charging and discharging power of the i-th electric vehicle at time t; SOC i,leave SOC is the state of charge of the electric vehicle when it leaves the station; i,q is the expected charge of the user when leaving the station, is the charging power of the i-th electric vehicle at time t, is the discharge power of the i-th electric vehicle at time t, is the charging and discharging power of the i-th electric car at time t.
[0035] Preferably, the solution of the improved whale-sparrow algorithm comprises the following steps:
[0036] S31. Input vehicle-grid interaction data, including preset total time, unit exchange electricity price between the grid and external grid, battery loss cost, electric vehicle charging and discharging efficiency, photovoltaic active power, and wind power active power;
[0037] S32, define individual whales and populations, define the position vector of individual whales as X = [P t EV,dis P t EV,cha P t grid ], P t EV,dis , P t EV,cha With P t grid are the electric vehicle discharge power, electric vehicle charging power and the power exchanged between the vehicle network and the external power grid at time t respectively; and N individuals are randomly generated, the position vector X is composed of N whale individuals, and the whale population vector is obtained;
[0038] S33, according to a = 2-2θ / iter max 、A=2ar1-a、C=2r2Calculate a、A、C;r1 and r2 are random numbers between [0,1];a is the convergence factor;θ is the index of the number of iterations;A、C are coefficients;
[0039] S34, randomly generate numbers p and α between [0, 1], calculate the fitness value of the individual whale, obtain the corresponding optimal individual whale, and retain the current optimal whale position, that is, the power exchange cost between the vehicle grid and the external power grid and the depreciation cost of the electric vehicle battery are minimized; the calculation formula of the fitness value is the objective function;
[0040] S35, if p < 0.5, directly go to S36, if p ≥ 0.5, combine the sparrow algorithm to perform predation, and update the position according to the position update formula of the discoverer, joiner, and scout;
[0041] S36. If the coefficient vector |A| is less than 1, then surround the prey according to X(θ+1)=X * (θ)-AD updates the position; if |A|>1, search globally for prey, according to X(θ+1)=X rand (θ)-AD update position; where X(θ+1) is the position of the individual whale in the θ+1th generation; X *(θ) is the optimal whale position in the θth generation; X rand (θ) is the current position of a whale randomly selected from the population at the θth generation;
[0042] S37, if α < 0.5, fill the whale group in the archive set by random sampling, return to S33, if α ≥ 0.5, proceed to the next step;
[0043] S38, the position update is completed, and the fitness value is recalculated. If it is better than the previously retained optimal whale position, the current optimal solution is updated;
[0044] S39: Determine whether the algorithm meets the requirements for the end of the number of iterations, that is, whether the maximum number of iterations iter is reached max If satisfied, the optimal electric vehicle charging and discharging power, the power exchanged between the power grid and the external power grid and the minimum cost at each time are output, indicating that the algorithm has found the optimal solution, otherwise it returns to S33 and enters the next cycle.
[0045] Preferably, the archive set in S37 refers to: the individuals eliminated during the iteration process form an archive set, and the number of the archive set population is kept fixed. After each iterative update, the archive set is updated, but the number of the population is kept constant.
[0046] Beneficial effect: The improved whale-sparrow algorithm of the present invention solves the vehicle network model and obtains the optimal operation optimization scheduling strategy within the preset total time. The improved whale-sparrow algorithm combines the sparrow algorithm on the basis of the whale algorithm, and has strong evolutionary ability, fast search ability, and strong optimization ability. Adding an archive set can maintain population diversity and avoid falling into a local optimal solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 is a flow chart of the method of the present invention;
[0048] Figure 2 This is a schematic diagram of the vehicle network;
[0049] Figure 3 Flowchart for improving the whale-sparrow algorithm. DETAILED DESCRIPTION
[0050] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0051] As attached Figure 1 and attached Figure 2As shown, a vehicle-grid interactive operation optimization scheduling method based on an improved whale-sparrow algorithm in this embodiment includes the following steps:
[0052] S1. Constructing an electric vehicle behavior model under vehicle-grid interaction. The electric vehicle behavior model includes daily mileage fitting, electric vehicle initial SOC fitting, station entry time probability density function fitting, and station departure time probability density function fitting. The construction of the electric vehicle behavior model includes the following steps:
[0053] S11. Collect some electric vehicle operation data, including initial SOC, daily mileage, station entry time, station departure time, etc. Collect electric vehicle operation data in accordance with GB / T32960 "Technical Specifications for Electric Vehicle Remote Service Management System".
[0054] S12. Process and clean the collected data. When collecting electric vehicle operation data, you may encounter problems such as sensor failure, blocked vehicle GPS signal reception, and shielded 4G / 5G communication signals. These problems will cause a certain degree of missing or abnormal values in the collected data. For different types of abnormal data, interpolation or average method is usually used to replace abnormal values.
[0055] S13. Fitting the relationship between the initial SOC and the daily mileage based on the historical operation data, wherein the daily mileage fitting formula is:
[0056]
[0057] Among them, f d (x) is the daily mileage of the fitted electric vehicle, x is the daily mileage, σ d is the variance of the initial SOC; μ d is the normal distribution mean of the initial SOC.
[0058] The initial SOC fitting formula of electric vehicles can be expressed as:
[0059]
[0060] Among them, SOC init SOC is the initial state of charge of the electric vehicle entering the station; q is the expected charge of the electric vehicle; d r is the daily mileage of electric vehicles; d e Rated mileage for electric vehicles.
[0061] S14. Based on the historical operation data, the probability density function of the pit stop time is fitted. The fitting formula of the probability density function of the pit stop time is:
[0062]
[0063] Among them, f s (x) is the probability density function of the fitted pit stop time, μ s is the normal distribution mean of the pit stop time, σ s is the variance of the pit stop time.
[0064] S15. Based on the historical operation data, the probability density function of the departure time is fitted. The fitting formula of the probability density function of the departure time is:
[0065]
[0066] Among them, f p (x) is the probability density function of the fitted departure time, σ p is the variance of departure time, μ p is the mean of the normal distribution of departure time.
[0067] S2. Construct the objective function and constraints of the vehicle-grid model, take the power exchange cost between the vehicle-grid and the external power grid and the depreciation cost of the electric vehicle battery as the optimization target, and construct the objective function; the objective function is used to reflect the economic efficiency of the power grid operation and the enthusiasm of users;
[0068] The calculation formula of the objective function is:
[0069]
[0070] in, are the power exchange cost between the vehicle grid and the external grid and the aging cost of the electric vehicle battery; T is the total time step, which is 24 hours; P is the electricity price exchanged between the vehicle grid and the external grid unit; t grid Exchange power between the vehicle grid and the external grid; b is the battery loss cost per unit power during the discharge process; is the discharge power of the i-th electric vehicle at time t; η d The discharge efficiency of electric vehicles.
[0071] The constraints include:
[0072] 1. Power balance constraints:
[0073] P t PV +P t wP +P t EV,dis -P t EV,cha =P t grid(8)
[0074] Among them, P t PV , P t WP , P t EV,dis , P t EV,cha With P t grid They are the photovoltaic active power, wind power active power, electric vehicle discharge power, electric vehicle charging power and the power exchanged between the vehicle grid and the external power grid at time t.
[0075] 2. Power constraints between the vehicle grid and the external grid:
[0076]
[0077] in, They are the upper and lower limits of the power exchanged between the vehicle grid and the external power grid respectively.
[0078] 3. Electric vehicle restrictions:
[0079]
[0080] in, is the battery charge state of the i-th electric car at time t, where time t is the current time, is the battery charge state of the i-th electric vehicle at time t+1, and time t+1 is the next moment; C i,ev is the rated capacity of the electric vehicle battery; η c charging efficiency for electric vehicles; are the upper and lower limits of the charging and discharging power of the i-th electric vehicle at time t; SOC i,leave SOC is the state of charge of the electric vehicle when it leaves the station; i,q is the expected charge of the user when leaving the station, is the charging power of the i-th electric vehicle at time t, is the discharge power of the i-th electric vehicle at time t, is the charging and discharging power of the i-th electric car at time t.
[0081] S3. Within the preset total time, a number of electric vehicle users are randomly simulated according to the electric vehicle behavior model to generate the charging and discharging power of each electric vehicle; the established vehicle-grid model is solved based on the improved whale-sparrow algorithm to obtain the vehicle-grid operation optimization scheduling strategy;
[0082] According to the electric vehicle behavior model constructed in S1, the Monte Carlo method is used to randomly simulate a number of electric vehicle users to generate the charging and discharging power of each electric vehicle; the charging and discharging power of the electric vehicle here refers to the charging and discharging power within the preset total time, and the vehicle-grid operation optimization scheduling strategy includes how to decompose the charging and discharging power within the preset total time into the optimal electric vehicle charging and discharging power at each time t;
[0083] In the improved whale-sparrow algorithm, in the early stage of whale hunting, each whale starts from its starting point and randomly explores to find prey. Once a whale finds the current optimal position, it is regarded as the optimal whale. Through mutual attraction and information exchange within the whale group, other whales will gradually move closer to the position of this optimal whale, continuously narrowing the encirclement until the target prey is locked. The position update follows the following formula:
[0084] X(θ+1)=X * (θ)-AD (11)
[0085] The distance formula between the optimal whale position and other whale positions is:
[0086] D=|CX * (θ)-X(θ)| (12)
[0087] A=2ar1-a (13)
[0088] C=2r2 (14)
[0089] a=2-2θ / iter max (15)
[0090] Among them, θ is the current iteration number; X * (θ) is the optimal whale position in the θth generation; X(θ) is the individual whale position in the θth generation; X(θ+1) is the individual whale position in the θ+1th generation; r1 and r2 are random numbers between [0, 1]; a is the convergence factor, which decreases from 2 to 0 as the number of iterations increases; iter max is the maximum number of iterations; θ is the index of the number of iterations; A and C are coefficients, and D is the distance from the individual position of the whale in the θth generation to the optimal whale position of the individual position of the whale in the θth generation;
[0091] The individuals eliminated during the iteration process are used to form an archive set, and the number of archive set populations is kept fixed. After each iteration, the archive set is updated, but the population number is kept constant. When α < 1, that is, the number of iterations reaches 3 and the optimal individual is not updated, the whale group is filled in the archive set by random sampling, which is conducive to maintaining diversity. The position update is as follows:
[0092] X(θ+1)=X *(θ)+r1[X best (θ)-X na (θ)] (16)
[0093] Where: X na (θ) is an individual randomly selected from the archive set, X best (θ) is the optimal position.
[0094] Combine the whale bubble net preying method with the sparrow search algorithm. Divide the foraging whale group into discoverers, joiners, and scouts, and update their positions. During the foraging process, the discoverer with a better fitness value will find food first. The discoverer's position update is as follows:
[0095]
[0096] Where: It represents the value after iteration t times; iter max is the maximum number of iterations; Q is a random number that follows a normal distribution; L is a 1×d matrix, in which each element is 1; R and ST represent the alarm value and the preset safety threshold, respectively, where the alarm value is obtained randomly. α is a random number between [0, 1];
[0097] The joiner keeps a close eye on the discoverer, and when the discoverer finds better food, he will immediately compete for the food. The position update formula of the joiner is as follows:
[0098]
[0099] Where: A represents a 1×d matrix, each element value in A is randomly assigned to 1 or -1, A + =A T (AA T ) -1 . For the worst position, is the best position of the finder after iteration, and N is the population size;
[0100] The scout is responsible for detecting dangers in the environment. The scout's position update formula is as follows:
[0101]
[0102] Where: β is a random number, which follows a normal distribution, with a mean of 0 and a variance of 1; K is a control factor, which is a random number; f i Indicates the current fitness value; f g 、f w They represent the current global optimal fitness value and the current global worst fitness value respectively; ε is a minimum value. is the current optimal position of the population,
[0103] In the process of whales searching for prey, when the value of parameter A is |A|>1, the individual whales will no longer follow the optimal whale position to update their positions, but will randomly search for prey according to their current positions and update their positions. This method increases the search range of the whales, realizes the global search for prey, and prevents falling into the local optimal solution. This method improves the optimization performance of the whale algorithm. The mathematical model of this process is as follows:
[0104] D rand =|C·X rand (θ)-X(θ)| (20)
[0105] X(θ+1)=X rand (θ)-AD (21)
[0106] Among them, X rand (θ) is the current position of a whale randomly selected from the population at the θth generation, 1≤θ≤iter max .
[0107] like Figure 3 As shown in the figure, the solution process of the improved whale-sparrow algorithm specifically includes the following steps:
[0108] S31. Input vehicle-grid interaction data, including preset total time, unit exchange price between the grid and external grid, battery loss cost, electric vehicle charging and discharging efficiency, photovoltaic active power, and wind power active power; wherein the total time is a preset value, i.e., a preset period of time in the future;
[0109] S32, define individual whales and populations, define the position vector of individual whales as X = [P t EV,dis P t EV,cha P t grid ], P t EV,dis , P t EV,cha With P t grid They are the electric vehicle discharge power, electric vehicle charging power, and the exchange power between the vehicle network and the external power grid at time t. N individuals are randomly generated, and the position vector X is composed of N whale individuals, and the whale population vector is obtained.
[0110] S33, according to a = 2-2θ / iter max 、A=2ar1-a、C=2r2Calculate a、A、C;
[0111] S34, randomly generate numbers p and α between [0, 1], calculate the fitness value of the individual whale, obtain the corresponding optimal individual whale, and retain the current optimal whale position, that is, the power exchange cost between the vehicle grid and the external power grid and the depreciation cost of the electric vehicle battery are minimized; the calculation formula of the fitness value is the objective function minf;
[0112] S35, if p < 0.5, directly go to S36, if p ≥ 0.5, combine the sparrow algorithm to perform predation, and update the position according to the position update formula of the discoverer, joiner, and scout;
[0113] S36. If the coefficient vector |A| is less than 1, then surround the prey according to X(θ+1)=X * (θ)-AD updates the position; if |A|>1, search globally for prey, according to X(θ+1)=X rand (θ)-AD update position;
[0114] S37, if α < 0.5, fill the whale group in the archive set by random sampling, return to S33, if α ≥ 0.5, proceed to the next step;
[0115] S38, the position update is completed, and the fitness value is recalculated. If it is better than the previously retained optimal whale position, the current optimal solution is updated;
[0116] S39: Determine whether the algorithm meets the requirements for the end of the number of iterations, that is, whether the maximum number of iterations iter is reached max If satisfied, the optimal electric vehicle charging and discharging power, the power exchanged between the power grid and the external power grid and the minimum cost at each time are output, indicating that the algorithm has found the optimal solution, otherwise it returns to S33 and enters the next cycle.
[0117] The method described in the present invention fully considers the impact of electric vehicle charging and discharging behavior on the vehicle grid and battery loss, coordinates the charging and discharging of electric vehicles with distributed power sources such as photovoltaic and wind power to optimize the operation state of the power grid, maintains economy, minimizes battery loss, and realizes efficient interaction between the vehicle grid and electric vehicles.
[0118] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A vehicle-grid interactive operation optimization scheduling method based on an improved whale-sparrow algorithm, characterized in that: The following steps are involved: S1. Construct an electric vehicle behavior model under vehicle-grid interaction. The electric vehicle behavior model includes daily mileage fitting, electric vehicle initial SOC fitting, probability density function fitting of station entry time, and probability density function fitting of station departure time; S2. Construct the objective function and constraints of the vehicle-grid model, take the power exchange cost between the vehicle-grid and the external power grid and the depreciation cost of the electric vehicle battery as the optimization target, and construct the objective function; S3. Within the preset total time, a number of electric vehicle users are randomly simulated according to the electric vehicle behavior model to generate the charging and discharging power of each electric vehicle; the established vehicle-grid model is solved based on the improved whale-sparrow algorithm to obtain the vehicle-grid operation optimization scheduling strategy.
2. According to claim 1, a vehicle-grid interactive operation optimization scheduling method based on an improved whale-sparrow algorithm is characterized by: The relationship between the initial SOC and the daily mileage is fitted, where the daily mileage fitting formula is: Among them, f d (x) is the daily mileage of the fitted electric vehicle, σ d is the variance of the initial SOC; μ d is the normal distribution mean of the initial SOC; The initial SOC fitting formula of electric vehicles can be expressed as: Among them, SOC init SOC is the initial state of charge of the electric vehicle entering the station; q is the expected charge of the electric vehicle; d r is the daily mileage of electric vehicles; d e Rated mileage for electric vehicles.
3. According to claim 1, a vehicle-grid interactive operation optimization scheduling method based on an improved whale-sparrow algorithm is characterized by: The probability density function fitting formula of the pit stop time is: Among them, f s (x) is the probability density function of the fitted pit stop time, μ s is the normal distribution mean of the pit stop time, σ s is the variance of pit stop time; The probability density function fitting formula of the departure time is: Among them, f p (x) is the probability density function of the fitted departure time, σ p is the variance of departure time, μ p is the mean of the normal distribution of departure time.
4. The vehicle-grid interactive operation optimization scheduling method based on the improved whale-sparrow algorithm according to claim 1 is characterized by: The objective function is calculated as follows: in, are the power exchange cost between the vehicle grid and the external power grid and the aging cost of the electric vehicle battery; T is the total time step; Exchange electricity prices between the vehicle grid and external grid units; Exchange power between the vehicle grid and the external grid; b is the battery loss cost per unit power during the discharge process; is the discharge power of the i-th electric vehicle at time t; η d The discharge efficiency of electric vehicles.
5. The vehicle-grid interactive operation optimization scheduling method based on the improved whale-sparrow algorithm according to claim 1 is characterized by: The constraints include: Power balance constraints: in, and They are the photovoltaic active power, wind power active power, electric vehicle discharge power, electric vehicle charging power and the exchange power between the vehicle grid and the external power grid at time t. Power constraints between the vehicle grid and the external grid: in, They are the upper and lower limits of the power exchanged between the vehicle grid and the external grid respectively; Electric vehicle constraints: in, is the battery state of charge of the i-th electric vehicle at time t, is the battery charge state of the i-th electric vehicle at time t+1; C i,ev is the rated capacity of the electric vehicle battery; η c charging efficiency for electric vehicles; are the upper and lower limits of the charging and discharging power of the i-th electric vehicle at time t; SOC i,leave SOC is the state of charge of the electric vehicle when it leaves the station. i,q is the expected charge of the user when leaving the station, is the charging power of the i-th electric vehicle at time t, is the discharge power of the i-th electric vehicle at time t, is the charging and discharging power of the i-th electric car at time t.
6. The vehicle-grid interactive operation optimization scheduling method based on the improved whale-sparrow algorithm according to claim 1 is characterized by: The solution of the improved whale-sparrow algorithm includes the following steps: S31. Input vehicle-grid interaction data, including preset total time, unit exchange electricity price between the grid and external grid, battery loss cost, electric vehicle charging and discharging efficiency, photovoltaic active power, and wind power active power; S32. Define individual whales and populations, and define the position vector of individual whales as and are the electric vehicle discharge power, electric vehicle charging power and the power exchanged between the vehicle network and the external power grid at time t respectively; and N individuals are randomly generated, the position vector X is composed of N whale individuals, and the whale population vector is obtained; S33, according to a = 2-2θ / iter max 、A=2ar1-a、C=2r2Calculate a、A、C;r1 and r2 are random numbers between [0,1];a is the convergence factor;θ is the index of the number of iterations;A、C are coefficients; S34, randomly generate numbers p and α between [0, 1], calculate the fitness value of the individual whale, obtain the corresponding optimal individual whale, and retain the current optimal whale position, that is, the power exchange cost between the vehicle grid and the external power grid and the depreciation cost of the electric vehicle battery are minimized; the calculation formula of the fitness value is the objective function; S35, if p<0.5, directly go to S36, if p≥0.5, combine the sparrow algorithm to perform predation, and update the position according to the position update formula of the discoverer, joiner, and scout; S36. If the coefficient vector |A|<1, then surround the prey according to X(θ+1)=X * (θ)-AD updates the position; if |A|>1, search globally for prey, according to X(θ+1)=X rand (θ)-AD update position; where X(θ+1) is the position of the individual whale in the θ+1th generation; X * (θ) is the optimal whale position in the θth generation; X rand (θ) is the current position of a whale randomly selected from the population at the θth generation; S37, if α < 0.5, fill the whale group in the archive set by random sampling, return to S33, if α ≥ 0.5, proceed to the next step; S38, the position update is completed, and the fitness value is recalculated. If it is better than the previously retained optimal whale position, the current optimal solution is updated; S39: Determine whether the algorithm meets the requirements for the end of the number of iterations, that is, whether the maximum number of iterations iter is reached max If satisfied, the optimal electric vehicle charging and discharging power, the power exchanged between the power grid and the external power grid and the minimum cost at each time are output, indicating that the algorithm has found the optimal solution, otherwise it returns to S33 and enters the next cycle.
7. The vehicle-grid interactive operation optimization scheduling method based on the improved whale-sparrow algorithm according to claim 6 is characterized by: The archive set in S37 refers to: the individuals eliminated during the iteration process form an archive set, and the number of archive set populations is kept fixed. After each iteration update, the archive set is updated, but the population number is kept constant.
Citation Information
Cited By
Improved resistance heating furnace temperature control method based on sparrow search algorithm
CN121829132A