Short-term optimal operation method of energy storage system based on space transformation genetic algorithm
By using the spatial transformation genetic algorithm in the energy storage system to convert it into a single-layer optimization configuration, the problem of non-convergence and long optimization time of the genetic algorithm when dealing with constraints is solved, and faster optimization speed and result convergence is achieved. It is equipped with large wind and light energy storage in buildings.
Patent Information
- Application Number
- CN202210625104.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-02
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2042-06-02
AI Technical Summary
Existing genetic algorithms are prone to non-convergence when dealing with the constraints of energy storage systems, and the long time for double-layer optimization configurations, resulting in slow optimization speed, especially in large wind farms and building wind and light energy storage configurations.
Using a genetic algorithm based on spatial transformation, the unconstrained encoding is converted into a coding space that satisfies the constraints, and a single-layer optimization configuration is realized, which improves the optimization speed and performs unconstrained optimization in the constrained space. Ensure that the number of feasible solutions does not decrease.
It significantly accelerates the optimization speed of energy storage systems, solves the problem of non-convergence of existing genetic algorithms when dealing with constraints, and achieves faster optimization results convergence, and is suitable for large wind farms and building wind and light energy storage configurations.
Smart Images

Figure CN114925617B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of energy storage systems, and in particular to processing constraints on energy storage systems in genetic algorithms. Background Art
[0002] The optimal configuration of clean and renewable energy capacity needs to consider the operation of the new energy system throughout its life cycle. Usually, typical days during the operation period are selected for optimal operation calculation, such as typical days in the four seasons. Therefore, the optimal configuration of capacity is a secondary optimization based on daily optimal operation, which is actually a double-layer optimal configuration.
[0003] The upper layer of the two-layer optimization configuration is capacity configuration, and the lower layer is optimization operation. There are two main problems with the two-layer optimization method: long optimization time and easy non-convergence when dealing with constraints.
[0004] When traditional genetic algorithms are used for short-term optimization operation of energy storage systems, the operating power in each period is used as the optimization variable, which greatly increases the number of optimization variables and makes convergence difficult. At the same time, the restrictions on constraints reduce the number of feasible solutions, making optimization convergence more difficult. Summary of the invention
[0005] In order to solve the above problems, the present invention discloses a short-term optimization operation method of an energy storage system based on a space transformation genetic algorithm, which can improve the optimization speed of the energy storage system.
[0006] The short-term optimal operation method of the energy storage system based on the space transformation genetic algorithm comprises the following steps:
[0007] Step 1: Establish an optimization model for the battery state of charge (SOC) and obtain the constraints:
[0008] Among them, Cbat is the battery capacity of the energy storage system.
[0009] N is the number of optimization periods, x(i) is the charge and discharge power of each period, x0 is the capacity of the battery initially charged into the battery, P max is the maximum charge and discharge power per unit time;
[0010] Step 2, initialize the charge and discharge power x(i), and calculate the fitness value in the transformation space, specifically including:
[0011] Step 2.1, transform the original variable x(i) into the optimized variable x'(i), and subtract the average value of N components from the original variable x(i) so that the optimized variable x'(i) satisfies Then proceed to step 2.2;
[0012] Step 2.2, calculate the maximum value max|x'(i)| of the optimization variable x'(i) to determine whether x'(i) satisfies the constraint condition -P max ≤x'(i)≤P max , if the conditions are met, go to step 2.3, otherwise, perform overall compression on each variable, and then go to step 2.3;
[0013] Step 2.3, calculate The maximum and minimum values of x'(i) are used to determine whether x'(i) satisfies the constraints. If the conditions are met, go to step 3, otherwise, reduce the optimization variables x'(i) proportionally and then go to step 3;
[0014] Step 3, determine whether the optimization variable x'(i) meets the termination condition. If it does, output the optimal individual and end the loop. Otherwise, perform selection, crossover, and mutation operations to generate a new generation of charge and discharge power x(i), and return to step 2.
[0015] Beneficial effects:
[0016] The present invention proposes a short-term optimization operation method for an energy storage system based on a space transformation genetic algorithm. By considering the single-layer energy storage optimization configuration of the space transformation genetic algorithm with constraints, the constraints are transformed from the coding space to the constraint space, so that the constraints are naturally satisfied and the number of feasible solutions will not be reduced. At the same time, unconstrained optimization is performed in the constraint space, which is easy to implement and converge, thereby accelerating the optimization speed of the energy storage system. The present invention solves the two major problems in the optimization of the energy storage system, that is, the existing genetic algorithm is prone to non-convergence when handling constraints and the double-layer configuration optimization time is long. The method can be used for energy storage in large wind farms and the optimal configuration of wind, solar and storage in large buildings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A flow chart of a space transformation genetic algorithm according to an embodiment of the present invention;
[0018] Figure 2 A flow chart of space transformation according to an embodiment of the present invention;
[0019] Figure 3 A curve diagram showing the relationship between the probability of a feasible solution and k according to an embodiment of the present invention;
[0020] Figure 4 A curve diagram showing the relationship between the probability of a feasible solution and kx according to an embodiment of the present invention;
[0021] Figure 5 is a c(i) curve for each time period of an embodiment of the present invention;
[0022] Figure 6 The x(i) curve optimized by the spatial transformation method according to one embodiment of the present invention;
[0023] Figure 7 Optimal and average function values for the spatial transformation method optimized for one embodiment of the present invention. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] like Figure 1 As shown, the present invention discloses a short-term optimization operation method for an energy storage system. This patent proposes a space transformation genetic algorithm based on real number coding, that is, genetic operations such as crossover and mutation are implemented in the coding space. Through space transformation, the unconstrained coding is converted into a coding space that satisfies the constraints, and the optimization index is performed in the constraint space. In this way, there is no loss of feasible solutions, which is conducive to the convergence of the optimization results; the double-layer optimization configuration based on the genetic algorithm is converted into a single-layer optimization configuration, and the proposed space transformation is used to implement the constraint processing during capacity optimization, which greatly improves the optimization speed. Generally speaking, the optimization speed of the single-layer optimization method is more than 100 times that of the double-layer optimization method.
[0026] Due to the existence of the energy storage system, the optimization variables increase. If the battery capacity of the energy storage system is CbatkWh, the minimum capacity of the battery that does not damage the battery after discharge is Cbat min , then the capacity of the battery that can be charged into the battery is x max (x max =Cbat-Cbat min ). N is the number of optimization periods, x(i) is the charge and discharge power in each period, the power is negative during discharge, c(i) is the electricity price in each period, the goal of charge and discharge power optimization is to maximize the benefits, and at the same time, the battery should return to its original state after an optimization cycle, that is, the sum of x(i) should be 0, and the battery SOC in any period cannot exceed the battery capacity. In summary, the following optimization model can be obtained, as shown in formula (1):
[0027]
[0028] Assuming that the capacity initially charged into the battery is x0, the SOC at time j can be expressed as shown in formula (2):
[0029]
[0030] Combining the above formulas, the constraints satisfied are:
[0031]
[0032] x0 is the capacity of the battery initially charged into the battery, P max It is the maximum charge and discharge power per unit time.
[0033] When the genetic algorithm is used to satisfy equation (3), the number of feasible solutions will be greatly reduced, which is not conducive to the convergence of the genetic algorithm. The traditional genetic algorithm is a common optimization algorithm. When the genetic algorithm is used for the short-term optimization operation of the energy storage system, the operating power of each period is used as the optimization variable, which greatly increases the number of optimization variables and makes convergence difficult. At the same time, the restriction of the constraints reduces the number of feasible solutions, making the optimization convergence more difficult.
[0034] The main coding methods of genetic algorithms are binary coding and real number coding. Binary coding is widely used because it is suitable for crossover and mutation operations in genetic algorithms. However, it is difficult for binary coding to handle constraints. Therefore, the commonly used method is the penalty method, which takes the constraints as the penalty term of the fitness function. However, the penalty method actually reduces the number of populations, which is not conducive to optimization convergence. Therefore, this patent adopts real number coding, which is conducive to the processing of constraints.
[0035] For this purpose, this patent studies the change in the number of feasible solutions in the genetic algorithm. From formula (3), it can be seen that the constraints and Therefore, research is needed The probability distribution of .
[0036] Assume that x(i) satisfies the uniform distribution U(-P max ,P max ), whose mean μ = 0 and variance beg The analytical solution of the distribution function is difficult. According to the central limit theorem of independent and identical distributions, when n is sufficiently large, It can be approximated to satisfy the standard normal distribution N(0,1). The probability of Right now
[0037] From formula (4), we can see that the larger n is, the smaller the probability is. Therefore, we can choose the worst case n = 24 for analysis (optimal scheduling for 24 hours a day). In addition, the probability of a feasible solution is related to P max , Cbat, x0 are also related. When P max When Cbat is constant, P is related to x0=kCbat, where k is the proportional coefficient of x0 and Cbat. To analyze the relationship between P and k, when Cbat=100, Pmax When =50, the relationship curve between P and k is shown in Figure (3).
[0038] Depend on Figure 3 It can be seen that when k = 0.5, the probability of a feasible solution is the highest.
[0039] For the equality constraint in equation (3), due to the coding accuracy and calculation accuracy issues, the equation cannot be accurately satisfied in practice. Therefore, it can be controlled within a smaller error range, as shown in equation (5):
[0040]
[0041] Where k x is the allowable error and x max Figure (4) shows the probability of a feasible solution and k x The relationship curve of k x The smaller it is, the higher the constraint accuracy is, and the lower the probability of a feasible solution is. x =0.1, P = 0.0564. This shows that if the equality constraint is controlled within the relative error range of 0.1, the number of feasible solutions will be greatly reduced. If the number of feasible solutions is to be maintained at the same level as in the unconstrained case, the population size needs to be expanded to the original times.
[0042] Based on this, the present invention proposes a genetic algorithm optimization strategy for space transformation. The basic idea is that for real number coding, when the constraints are not met, considering that the constraints in this article are relatively simple, the original encoded data is converted to a space that meets the constraints, so that any coding is a feasible solution.
[0043] like Figure 1 to Figure 2 As shown, they are respectively the transformation genetic algorithm flow chart and the space transformation flow chart of the present invention.
[0044] For the constraints in equation (3), the population is initialized, i.e., the charge and discharge power x(i), and the fitness value is calculated in the transformation space:
[0045] Let x'(i) be the optimized variable after transformation, and the transformation relationship is as shown in formula (6):
[0046]
[0047]
[0048] In formula (6), the original variable is subtracted from the average value of N components, which naturally satisfies the equality constraint of formula (7).
[0049] To determine that all x'(i) after transformation satisfy -P max ≤x'(i)≤Pmax Constraints, find the maximum value of x'(i) max|x'(i)|, if max|x'(i)|>P max , then all variables need to be scaled down proportionally, that is, x'(i) = x'(i)Cbat / max|x'(i)|.
[0050] To determine if all i=1…n satisfy Condition, find The maximum value of When this maximum value does not meet this condition, all variables are scaled down proportionally, that is, Similarly, when Minimum value of Not meeting the conditions When illustrate is a negative number with a large absolute value, and all variables are compressed according to the largest absolute value, that is, If both inequality constraints are not satisfied at the same time, all variables are compressed according to the compression ratio with the greatest compression strength:
[0051] The variables after a series of operations can satisfy all constraints.
[0052] Determine whether the termination condition is met: The termination condition is that the fitness value reaches the expected value or the number of iterations reaches the maximum value. If the condition is met, the optimal individual is output and the loop ends. If not, the following operations are performed:
[0053] Selection: Use the selection operator to select individuals with high fitness from the previous generation population. The selection operator is the roulette wheel selection method.
[0054] Mutation: The mutation operation is performed based on the mutation probability, and the smaller value of the mutation probability is 0.001 to 0.1.
[0055] Generate a new generation of population, i.e., the charge and discharge power x(i), and return to step 2 to calculate the fitness value in the transformation space until the optimal individual is obtained.
[0056] In this embodiment, the short-term optimization method of the energy storage system takes the energy storage device battery as the optimization object, and calculates the optimal optimization plan through the short-term optimization operation method, that is, controls the battery charging / discharging and the charging / discharging power in units of one hour.
[0057] To verify the feasibility of the above method, the space transformation method was tested. The population size of the tested genetic algorithm was 200, the optimization generation was 2000, the crossover probability was 0.8, the mutation probability was 0.2, and the initial value and constraint value of the state variable were as follows: P max =x max=100,x0=0. Figure 5 is the c(i) curve for 24 periods, Figure 6 and Figure 7 It is the optimization variable and optimization function value of the space transformation method.
[0058] from Figure 6 The operation results show that the battery charges when the price is low and generates electricity when the price is high, which is in line with the actual operation law; Figure 7 In are the function average values and optimal values of each generation. It can be seen that with the increase of optimization generations, the function average value tends to the optimal value, indicating that the overall chromosome tends to the optimal chromosome.
[0059] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A short-term optimal operation method for an energy storage system based on a spatial transformation genetic algorithm, characterized in that: The following steps are involved: Step 1: Establish an optimization model for the battery state of charge (SOC) and obtain the constraints: Among them, Cbat is the battery capacity of the energy storage system, N is the number of optimization periods, x(i) is the charge and discharge power of each period, x0 is the capacity of the battery initially charged into the battery, P max is the maximum charge and discharge power per unit time; Step 2, initialize the charge and discharge power x(i), and calculate the fitness value in the transformation space, specifically including: Step 2.1, replace the original variable x(i) with the optimized variable x'(i), and subtract the average value of N components from the original variable x(i) so that the optimized variable x'(i) satisfies Then proceed to step 2.2; Step 2.2, calculate the maximum value max|x'(i)| of the optimization variable x'(i) to determine whether x'(i) satisfies the constraint condition -P max ≤x'(i)≤P max , if the conditions are met, go to step 2.3, otherwise, perform overall compression on each variable, and then go to step 2.3; Step 2.3, calculate The maximum and minimum values of x'(i) are used to determine whether x'(i) satisfies the constraints. If the conditions are met, go to step 3, otherwise, scale down the optimization variable x'(i) and then go to step 3; Step 3, determine whether the optimization variable x'(i) meets the termination condition. If so, output the optimal individual and end the cycle. Otherwise, generate a new generation of charging and discharging power x(i) and return to step 2.
2. The short-term optimization operation method of the energy storage system based on the space transformation genetic algorithm according to claim 1 is characterized in that: In step 2.1, the original variable x(i) minus the average value of N components is specifically: Make the sum of the optimized variables x'(i) after the transformation of x(i) equal to 0, that is, satisfy the constraint condition 3. The short-term optimization operation method of the energy storage system based on the space transformation genetic algorithm according to claim 2 is characterized in that: In step 2.2, when the optimization variable x'(i) does not satisfy its own constraints, each variable is compressed to satisfy the constraints, and the compression ratio is Cbat / max|x'(i)|.
4. The short-term optimization operation method of the energy storage system based on the space transformation genetic algorithm according to claim 3 is characterized in that: In step 2.2, the overall compression of each variable is as follows: when max|x'(i)|>P max When , the optimization variable x'(i) is reduced proportionally, that is, x'(i) = x'(i)Cbat / max|x'(i)|.
5. The short-term optimization operation method of the energy storage system based on the space transformation genetic algorithm according to claim 4 is characterized in that: Specifically in step 2.3: calculate and when season when make If Neither the maximum nor the minimum value satisfies the constraints, that is, and When , the compression ratio with greater compression strength is selected to compress all variables.
6. The short-term optimization operation method of the energy storage system based on the space transformation genetic algorithm according to any one of claims 1 to 5, characterized in that: The termination condition in step 3 is that the fitness value reaches the expected value or the number of iterations reaches the maximum value.
7. The short-term optimization operation method of the energy storage system based on the space transformation genetic algorithm according to claim 6 is characterized in that: The method for generating a new generation population in step 3 is specifically as follows: step 3.1, using a selection operator to select individuals with high fitness from the previous generation population, the selection operator is a roulette selection method; step 3.2, performing a mutation operation according to a mutation probability, the mutation probability is 0.001 to 0.1; step 3.3, generating a new generation of charge and discharge power x(i) and calculating the fitness value in the transformation space.
