Hydrogen production system full-life capacity configuration method based on improved whale optimization algorithm
By improving the whale optimization algorithm and combining it with full life cycle modeling and hybrid mutation strategies, the problems of local optimality and premature convergence in the capacity configuration of new energy hydrogen production systems were solved, efficient and economical capacity configuration was achieved, and economic benefits and algorithm stability were improved.
Patent Information
- Application Number
- CN202511053171.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-09-16
AI Technical Summary
The capacity configuration algorithm of existing new energy hydrogen production systems is prone to falling into local optimality and does not take into account dynamic factors throughout the entire life cycle, resulting in insufficient economy. In addition, traditional intelligent algorithms have premature convergence phenomena on high-dimensional and multi-constrained problems.
An improved whale optimization algorithm is adopted in combination with full life cycle modeling. The population is initialized through Logistic-Tent chaos mapping and adversarial learning strategy. Nonlinear convergence factors, adaptive weights and Levy flight hybrid mutation operators are designed to optimize the capacity configuration of the hydrogen production system.
It achieves high-precision, long-term stable capacity configuration, improves global optimization capabilities and convergence speed, maximizes economic benefits, and increases typical daily returns by 3.18%-7.44% compared to traditional algorithms.
Smart Images

Figure CN120654969A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of new energy system capacity configuration, and in particular to a full-life capacity configuration method for a hydrogen production system based on an improved whale optimization algorithm. Background Art
[0002] As the global energy mix accelerates toward a green, low-carbon transition, traditional fossil fuel power generation faces the dual pressures of resource depletion and environmental pollution, making it difficult to meet the demands of a clean, intelligent, and innovative power system. Hydrogen, as a clean and efficient energy carrier, is becoming a crucial component of this energy transition. Its applications range from transportation to industrial production, demonstrating enormous market potential. New energy hydrogen production systems, particularly electrolysis based on wind and solar power, are attracting extensive research due to their environmental friendliness and sustainability.
[0003] In the field of renewable energy hydrogen production system optimization, existing research has attempted to use intelligent algorithms for capacity configuration modeling. For example, the paper "Capacity Optimization Configuration of Wind-Hydrogen Coupling Systems Based on an Improved Whale Algorithm" proposes a capacity configuration model for wind-solar-hydrogen storage systems based on the standard whale optimization algorithm. However, the algorithm is prone to falling into local optimality during the late iteration of the local development phase, and does not consider dynamic factors throughout the life cycle, such as equipment aging and operation and maintenance costs, resulting in insufficient economic efficiency of the configuration scheme. The paper "Application of Multi-Strategy Fusion Whale Algorithm in Microgrid Optimization" improves the search process by introducing a nonlinear convergence factor, but the improved strategy does not establish a dynamic mapping relationship between algorithm parameters and optimization stage characteristics, and still suffers from premature convergence when dealing with high-dimensional, multi-constrained hydrogen production system optimization problems.
[0004] Against this backdrop, the configuration, construction, and efficient operation of renewable energy hydrogen production systems have become a research focus in the energy sector. Traditional intelligent algorithms (such as particle swarm optimization and genetic algorithms) often suffer from slow convergence and premature convergence when solving practical problems. While the Whale Optimization algorithm offers advantages in search mechanisms, its inherent strategy limits its ability to balance global exploration and local exploitation, leading to premature convergence and overlooking potential high-quality solutions. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this paper provides a method for lifecycle capacity configuration of hydrogen production systems based on an improved whale optimization algorithm. By improving the optimization algorithm and implementing lifecycle modeling, this method addresses the economical inefficiencies of traditional hydrogen production systems and the algorithm's tendency to fall into local optimality. It achieves high-precision capacity configuration and long-term stable returns, providing an efficient and reliable solution for the planning and operation of new energy hydrogen production systems.
[0006] The technical solution of the present invention to solve the technical problem is to design a full-life capacity configuration method for a hydrogen production system based on an improved whale optimization algorithm, characterized in that the method comprises the following steps:
[0007] Step 1: Establish a full life cycle economic model based on the new energy hydrogen production system
[0008] The new energy hydrogen production system includes a renewable energy power generation unit, an electrolytic hydrogen production unit, and an electrolytic hydrogen production unit. The renewable energy power generation unit includes a wind turbine and a photovoltaic unit; the electrolytic hydrogen production unit is composed of a PEM electrolyzer and an ALK electrolyzer; the energy storage unit is composed of a lithium battery and a hydrogen storage tank; in addition, there are auxiliary voltage regulating components for regulating current and voltage. Based on the above new energy hydrogen production system, a full life cycle economic model of the system is established, specifically including a full life cycle cost model and a full life cycle revenue model;
[0009] The cost C of the system consists of initial investment cost and operating cost, where the operating cost is composed of energy cost, maintenance cost, labor cost, and transportation cost. The full life cycle cost model of the system is shown as follows:
[0010]
[0011] In the above formula, C inv is the total investment cost during the project period; E pem 、E alk 、E Li and E h are the capacity of PEM electrolyzer, ALK electrolyzer, lithium battery and hydrogen storage tank respectively; C pem (t), C alk (t) and C ae (t) are the unit capacity investment costs of the PEM electrolyzer, the unit capacity investment costs of the ALK electrolyzer, and the unit capacity investment costs of the voltage regulating auxiliary components in year t; C en is the energy cost; C ma Maintenance, labor, and transportation costs; C Li (t) is the unit capacity investment cost of lithium batteries in year t; C is the unit capacity investment cost of the hydrogen storage tank in year t; d is the income from the depreciation of the equipment at the end of the project; C1(t) and C2(t) are the electricity price and water price in year t respectively; K e (t) and K w (t) are the electricity consumption and water consumption in year t respectively; P pem (t), P alk(t) is the actual operating power of the PEM electrolyzer and ALK electrolyzer in the tth year, ΔT is the actual working time of the PEM electrolyzer and ALK electrolyzer in the tth year; α is the conversion rate of water to hydrogen; H(t) is the hydrogen production in the tth year; η(t) is the hydrogen production efficiency in the tth year; β is the conversion rate between voltage efficiency and hydrogen production efficiency; T plan Plan the project cycle; k is 8% to 12%;
[0012] The system's full life cycle revenue model is as follows:
[0013]
[0014] In the above formula, R1 is the income from hydrogen and oxygen sales, R1(t) is the income from hydrogen and oxygen sales in year t; C h (t), C o (t), Q h (t), Q o (t) are the hydrogen price, oxygen price, hydrogen production, and oxygen production in year t, respectively; R2 is the government subsidy income, and R2(t) is the government subsidy income in year t; is the price of carbon dioxide emissions from 1kW·h coal-fired power generation in year t; H(t) is the hydrogen production in year t; k p2g is the conversion coefficient of electricity to hydrogen;
[0015] Step 2: Solve the capacity configuration of the hydrogen production system based on the improved whale optimization algorithm
[0016] Step 2.1: Set the return on a typical day as the objective function, that is:
[0017]
[0018] The objective function is the fitness function of the improved whale optimization algorithm, and the whale individual that maximizes the objective function is the whale individual with the best fitness;
[0019] Then the actual operating power P of the PEM electrolyzer in year t is pem (t), actual operating power P of ALK electrolyzer alk (t), and the capacity E of the PEM electrolyzer pem 、Capacity E of ALK electrolyzer alk , lithium battery capacity E Li and hydrogen storage tank capacity E h , as the parameters to be optimized in the improved whale optimization algorithm, the constraints of each parameter to be optimized are:
[0020] 1) Power Constraints:
[0021] P wt(t)+P pv (t)<P pem (t)+P alk (t) (4)0≤P pem (t)≤E pem (5)
[0022] 0≤P alk (t)≤E alk (6)
[0023] Among them, P wt (t) and P pv (t) is the installed capacity of wind turbines and photovoltaic units in year t; P pem (t), P alk (t) are the actual operating power of PEM electrolyzer and ALK electrolyzer in year t respectively;
[0024] 2) Capacity Constraints:
[0025] E pem,min <E pem ≤E pem,pax (7)
[0026] E alk,min <E alk ≤E alk,pax (8)
[0027] E Li,min <E Li ≤E Li,max (9)
[0028] E h,min ≤E h ≤E h,max (10)
[0029] Among them, E pem,max and E pem,min are the maximum and minimum capacities of the PEM electrolyzer respectively; E alk,max and E alk,min are the maximum and minimum capacities of ALK electrolyzer respectively; E Li,max and E Li,min They are the maximum and minimum capacities of lithium batteries respectively; E h,max 、E h,min They are the maximum capacity and minimum safe reserve of hydrogen storage tanks respectively;
[0030] Step 2.2: Population initialization
[0031] Set the maximum number of iterations of the whale optimization algorithm to M max, according to the dimension d of the parameter to be optimized, the value range corresponding to each parameter to be optimized, and the set population size N, the Logistic-Tent chaotic mapping and adversarial learning strategy are used to initialize the population; the Logistic-Tent mapping equation is:
[0032]
[0033] Among them, r∈[0,4] is the chaos factor, x i ∈[-1, 1]; [·]Mod1 means performing the mod1 operation on the calculation result in [], performing a modulo operation on the iterative result to ensure that the sequence value remains in the interval [0, 1];
[0034] Randomly select the value of x0 in the range of [-1, 1] and randomly set the value of r in the range of [0, 4], and then substitute it into formula (11) for iterative operation to obtain x1, ..., x i ,…,x N The N values constitute a chaotic sequence; each value in the chaotic sequence is mapped to the d-dimensional parameter to be optimized, and a chaotic mapping population with a population size of N is obtained; the specific process of the above mapping is: the i-th value in the chaotic sequence is x i , the i-th whale individual of the chaotic mapping population is obtained by mapping, and the value range of the parameter W to be optimized is set to [x min , x max ], then the initial value of the parameter to be optimized in the i-th whale individual is x′ i :
[0035] x′ i =x min +(x max -x min )x i (12)
[0036] where x max and x min The upper and lower bounds of the search space for the parameter to be optimized;
[0037] Based on the chaotic mapping population, the opposition population is generated according to the opposition learning strategy. The initial value x of the parameter W to be optimized for the i-th whale individual in the opposition population is op for:
[0038] x op =x min +x max -x′ i (13)
[0039] Substitute the values of each parameter to be optimized for each whale individual in the chaotic mapping population and its opposing population into the full life cycle economic model of the new energy hydrogen production system in step 1, and calculate the fitness values of all individuals according to formula (3). Then, sort all whale individuals from large to small according to their fitness values, and select the first N whale individuals to form the final initial population.
[0040] Step 2.3: Population Update
[0041] Step 2.3.1: Set the position of individual whale X in the population at the completion of the mth iteration to X(m), X(m) = [X1(m), X2(m)…X d (m)],X d (m) is the value of the dth parameter to be optimized in the whale individual X when the mth iteration is completed; the position of the whale individual with the best fitness when the number of iterations m is set to During the execution of iteration step m+1, whale individual X chooses to perform one of the following: shrinking and surrounding individual position update, spiral individual position update, or search and prey individual position update. The specific process is as follows:
[0042] 1) Based on the value of the completed iteration step m, update the values of the nonlinear convergence factor a(m), the adaptive weight ω, and the coefficient vectors A and C to guide the execution process of the iteration step m+1;
[0043] Use piecewise nonlinear function to update the nonlinear convergence factor a(m):
[0044]
[0045] Update the adaptive weight ω:
[0046]
[0047] Update the time-varying spiral constant b(m):
[0048]
[0049] Where δ is the dynamic regulation factor;
[0050] Update coefficient vectors A and C:
[0051] A=2a(m)ra(m) (17)
[0052] C=2r (18)
[0053] Where A and C are random numbers between [-2, 2] and [0, 2], respectively, and r is a random number between [0, 1]. a(m) is updated according to formula (14).
[0054] 2) Generate a random number P. When P ≥ 0.5, the whale individual X performs a spiral individual position update:
[0055] X(m+1)=X * (m)+D·e b(m)l ·cos(2πl) (19)
[0056] Where l is a random number between [-1, 1], D = |X * (m)-X(m)|;
[0057] When P < 0.5, the value of |A| is determined. When |A| < 1, the whale individual X chooses to shrink and surround the individual position update. This position update method integrates the Laplace mutation strategy. The position update formula is as follows:
[0058]
[0059]
[0060] Among them, Laplace(0,1) is the Laplace operator;
[0061] When |A|≥1, the whale individual X chooses to search for the prey individual and update its position. This position update integrates the levy flight strategy. The position update formula is as follows:
[0062]
[0063] σ ν =1 (26)
[0064] X(m+1)=sX rand -A·D (27)
[0065] D=|C·s·X rand -X(m)| (28)
[0066] Where β is a constant, Г is the gamma function, s is the random step length of levy flight; X rand Indicates the position of a random individual whale in the current whale group;
[0067] Step 2.3.2: Based on the value of the random number P generated in step 2.3.1 and the method in step 2.3.1, update the position of each whale in the population when the number of iterations m is completed, and the population completes the update process of the number of iterations m+1;
[0068] Step 2.3.3: Substitute each whale individual in the population that has completed the iteration number m+1 into the full life cycle economic model of the new energy hydrogen production system in step 1, and calculate the fitness values of all whale individuals according to formula (3). The position of the whale individual with the largest fitness value is taken as the position of the whale individual with the best fitness when completing the iteration number m+1. Then increase the iteration number by 1 and repeat the process of steps 2.3.1 to 2.3.3 until the iteration number reaches M. max ;
[0069] Step 2.3: Obtain the best individual
[0070] Will complete M max The best fitness of the individuals in the iteratively updated population is compared with the best fitness value of the individuals in the population when each iterative step is completed. The position of the whale individual corresponding to the maximum value of the best fitness value is the best individual sought, that is, the optimal values of the d parameters to be optimized are obtained, and the capacity configuration of the hydrogen production system is realized.
[0071] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention is based on the full-life cycle capacity configuration method of the hydrogen production system of the improved whale optimization algorithm. First, a refined full-life cycle economic model is constructed, which comprehensively covers dynamic cost benefits such as investment, operation, maintenance, depreciation and subsidies, ensuring that the capacity configuration plan achieves maximum economic benefits throughout the project cycle. Secondly, an improved whale optimization algorithm is designed, which integrates core strategies such as chaos initialization, nonlinear convergence factor, adaptive weight and Levy flight, and hybrid mutation operator, effectively overcoming the defects of the traditional whale algorithm that is prone to falling into local optimality and premature convergence, and greatly improving the global optimization ability, convergence speed and accuracy. Under actual data, the configuration scheme obtained by the method of the present invention (IWOA) has the highest typical daily return (increased by 3.18%-7.44%) compared with the configuration method using WOA, SSA, and PSO algorithms, and the algorithm converges faster, has higher accuracy and better stability. In addition, the verification test surface of 5 test functions shows that the improved whale optimization algorithm designed by the present invention has more stable convergence performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Figure 1 This is a principle and flow chart of an improved whale optimization algorithm in an embodiment of a method for configuring the full life cycle capacity of a hydrogen production system based on the improved whale optimization algorithm of the present invention.
[0073] Figure 2 This is a graph of the economic benefits of a typical day using the improved whale optimization algorithm (IWOA), whale optimization algorithm (WOA), sparrow search algorithm (SSA) and particle swarm algorithm (PSO) in the method of the present invention in one embodiment.
[0074] Figure 3For an implementation Figure 2 Convergence curves of the four algorithms in the test function F1.
[0075] Figure 4 For an implementation Figure 2 Convergence curves of the four algorithms in the test function F2.
[0076] Figure 5 For an implementation Figure 2 Convergence curves of the four algorithms in the test function F3.
[0077] Figure 6 For an implementation Figure 2 Convergence curves of the four algorithms in the test function F4.
[0078] Figure 7 For an implementation Figure 2 Convergence curves of the four algorithms in the test function F5. DETAILED DESCRIPTION
[0079] The technical solution of the present invention is described in detail below with reference to the accompanying drawings and embodiments.
[0080] The present invention provides a method for configuring the full life cycle capacity of a hydrogen production system based on an improved whale optimization algorithm, the method comprising the following steps:
[0081] Step 1: Establish a full life cycle economic model based on the new energy hydrogen production system
[0082] The new energy hydrogen production system includes a renewable energy power generation unit, an electrolytic hydrogen production unit, and an electrolytic hydrogen production unit. The renewable energy power generation unit includes a wind turbine and a photovoltaic unit; the electrolytic hydrogen production unit is composed of a PEM electrolyzer (proton exchange membrane electrolyzer) and an ALK electrolyzer (alkaline water electrolyzer); the energy storage unit is composed of a lithium battery and a hydrogen storage tank; in addition, there are AC / DC converters, unidirectional DC / DC converters, bidirectional DC / DC converters and other voltage regulation auxiliary components for regulating current and voltage. Based on the above new energy hydrogen production system, a full life cycle economic model of the system is established, specifically including a full life cycle cost model and a full life cycle revenue model.
[0083] The cost C of the system consists of initial investment cost and operating cost, where the operating cost is composed of energy cost, maintenance cost, labor cost, and transportation cost. The full life cycle cost model of the system is shown as follows:
[0084]
[0085] In the above formula, C inv is the total investment cost during the project period; E pem、E alk 、E Li and E h are the capacity of PEM electrolyzer, ALK electrolyzer, lithium battery and hydrogen storage tank respectively; C pem (t), C alk (t) and C ae (t) are the unit capacity investment cost of the PEM electrolyzer, the unit capacity investment cost of the ALK electrolyzer and the unit capacity investment cost of the voltage regulating auxiliary components in year t. en is the energy cost; C ma Maintenance, labor, and transportation costs; C Li (t) is the unit capacity investment cost of lithium batteries in year t; C is the unit capacity investment cost of the hydrogen storage tank in year t; d is the income from the depreciation of the equipment at the end of the project. C1(t) and C2(t) are the electricity price and water price in year t respectively; K e (t) and K w (t) are the electricity consumption and water consumption in year t respectively; P pem (t), P alk (t) is the actual operating power of the PEM electrolyzer and ALK electrolyzer in the tth year, ΔT is the actual working time of the PEM electrolyzer and ALK electrolyzer in the tth year; α is the conversion rate of water to hydrogen, which is 0.111 kgH2 / kgH2o; H(t) is the hydrogen production in the tth year; η(t) is the hydrogen production efficiency in the tth year, which is 0.6; β is the conversion rate between voltage efficiency and hydrogen production efficiency, which is 1; T plan Plan the project cycle; k is usually taken as 8% to 12%.
[0086] Using water electrolysis to produce hydrogen can bring various benefits. In its early stages of development, considering its environmental benefits, policy subsidies can be given to promote its promotion. Therefore, revenue mainly comes from the sale of hydrogen and oxygen and policy subsidies. The full life cycle revenue model of this system is shown below:
[0087]
[0088] In the above formula, R1 is the income from hydrogen and oxygen sales, R1(t) is the income from hydrogen and oxygen sales in year t; C h (t), C o (t), Q h (t), Q o (t) are the hydrogen price, oxygen price, hydrogen production, and oxygen production in year t, respectively; R2 is the government subsidy income, and R2(t) is the government subsidy income in year t; is the price of carbon dioxide emissions from 1kW·h coal-fired power generation in year t; H(t) is the hydrogen production in year t; k p2g is the conversion coefficient of electricity to hydrogen, which is 0.02kgH2 / kW·h based on industry standards.
[0089] Step 2: Solve the capacity configuration of the hydrogen production system based on the improved whale optimization algorithm
[0090] Step 2.1: Set the return on a typical day as the objective function, that is:
[0091]
[0092] This objective function is the fitness function of the improved whale optimization algorithm, and the whale individual that maximizes the objective function is the whale individual with the best fitness.
[0093] Then the actual operating power P of the PEM electrolyzer in year t is pem (t), actual operating power P of ALK electrolyzer alk (t), and the capacity E of the PEM electrolyzer pem 、Capacity E of ALK electrolyzer alk , lithium battery capacity E Li and hydrogen storage tank capacity E h , as the parameters to be optimized in the improved whale optimization algorithm, the constraints (i.e., the value range) of each parameter to be optimized are:
[0094] 1) Power Constraints:
[0095] P wt (t)+P pv (t)<P pem (t)+P alk (t) (4)0≤P pem (t)≤E pem (5)
[0096] 0≤P alk (t)≤E alk (6)
[0097] Among them, P wt (t) and P pv (t) is the installed capacity of wind turbines and photovoltaic units in year t, i.e. the corresponding actual operating power; P pem (t), P alk (t) are the actual operating power of PEM electrolyzer and ALK electrolyzer in year t respectively.
[0098] 2) Capacity Constraints:
[0099] E pem,min <Epem ≤E pem,pax (7)
[0100] E alk,min <E alk ≤E alk,pax (8)
[0101] E Li,min <E Li ≤E Li,max (9)
[0102] E h,min ≤E h ≤E h,max (10)
[0103] Among them, E pem,max and E pem,min are the maximum and minimum capacities of the PEM electrolyzer respectively; E alk,max and E alk,min are the maximum and minimum capacities of ALK electrolyzer respectively; E Li,max and E Li,min They are the maximum and minimum capacities of lithium batteries respectively; E h,max 、E h,min They are the maximum capacity and minimum safe reserve of hydrogen storage tanks respectively.
[0104] Step 2.2: Population initialization
[0105] Set the maximum number of iterations of the whale optimization algorithm to M max , according to the dimension d of the parameter to be optimized (in this embodiment, d = 2×T plan +4), the value range of each parameter to be optimized, and the set population size N, use the Logistic-Tent chaotic mapping and adversarial learning strategy to initialize the population. The Logistic-Tent mapping equation is:
[0106]
[0107] Among them, r∈[0,4] is the chaos factor, x i ∈[-1, 1]. [·]Mod1 means performing the mod1 operation on the calculation result in [], performing a modulo operation on the iterative result to ensure that the sequence value remains in the interval [0, 1].
[0108] Randomly select the value of x0 in the range of [-1, 1] and randomly set the value of r in the range of [0, 4], and then substitute it into formula (11) for iterative operation to obtain x1, ..., x i ,…,x NThe N values constitute a chaotic sequence. Each value in the chaotic sequence is mapped to the d-dimensional parameter to be optimized, and a chaotic mapping population with a population size of N is obtained. The specific process of the above mapping is: the i-th value in the chaotic sequence is x i , the i-th whale individual of the chaotic mapping population is obtained by mapping, and the value range of the parameter W to be optimized is set to [x min , x max ], then the initial value of the parameter to be optimized in the i-th whale individual is x′ i :
[0109] x′ i =x min +(x max -x min )x i (12)
[0110] where x max and x min are the upper and lower bounds of the search space for the parameter to be optimized.
[0111] Based on the chaotic mapping population, the opposition population is generated according to the opposition learning strategy. The initial value x of the parameter W to be optimized for the i-th whale individual in the opposition population is op for:
[0112] x op =x min +x max -x′ i (13)
[0113] Substitute the values of each parameter to be optimized for each whale individual in the chaotic mapping population and its opposing population into the full life cycle economic model of the new energy hydrogen production system in step 1, and calculate the fitness values of all individuals according to formula (3). Then, all whale individuals are sorted from large to small according to their fitness values, and the first N whale individuals are selected to form the final initial population.
[0114] Step 2.3: Population Update
[0115] Step 2.3.1: Set the position of individual whale X in the population at the completion of the mth iteration to X(m), X(m) = [X1(m), X2(m)…X d (m)],X d (m) is the value of the dth parameter to be optimized in the whale individual X when the mth iteration is completed. The position of the whale individual with the best fitness after completing the mth iteration step is set as X * (m), During the execution of iteration step m+1, whale individual X chooses to perform one of the following: shrinking and surrounding individual position update, spiral individual position update, or search and prey individual position update. The specific process is as follows:
[0116] 1) Based on the value of the completed iteration step m, the values of the nonlinear convergence factor a(m), the adaptive weight ω, and the coefficient vectors A and C are updated to guide the execution process of the iteration step m+1.
[0117] A piecewise nonlinear function is used to update the nonlinear convergence factor a(m) to balance the global exploration and local development capabilities.
[0118]
[0119] Update the adaptive weight ω, which is used to enhance the fine search for the optimal solution in the later stages of the iteration.
[0120]
[0121] Improve the logarithmic spiral constant b so that it changes dynamically with iteration, which is called the time-varying spiral constant b(m). Update the time-varying spiral constant b(m):
[0122]
[0123] Where δ is the dynamic adjustment factor, which is a constant and is set to 0.6.
[0124] Update coefficient vectors A and C:
[0125] A=2a(m)ra(m) (17)
[0126] C=2r (18)
[0127] Where A and C are random numbers between [-2, 2] and [0, 2], respectively, and r is a random number between [0, 1]. a(m) is updated according to formula (14).
[0128] 2) Generate a random number P. When P ≥ 0.5, the whale individual X performs a spiral individual position update:
[0129] X(m+1)=X * (m)+D·e b(m)l ·cos(2πl) (19)
[0130] Where l is a random number between [-1, 1], D = |X * (m)-X(m)|;
[0131] When P < 0.5, the value of |A| is determined. When |A| < 1, the whale individual X chooses to shrink and surround the individual position update. This position update method integrates the Laplace mutation strategy. The position update formula is as follows:
[0132]
[0133] Among them, Laplace(0,1) is the Laplace operator.
[0134] When |A|≥1, whale individual X may not approach the current best whale individual, but instead randomly select a whale from the current whale group to approach it, that is, select the search predator individual position update. This position update integrates the levy flight strategy, and the position update formula is as follows:
[0135]
[0136] σ ν =1 (26)
[0137] X(m+1)=sX rand -A·D (27)
[0138] D=|C·s·X rand -X(m)| (28)
[0139] Among them, β is a constant, which is 1.5, Г is the gamma function, and s is the random step length of levy flight. rand Indicates the position of a random whale in the current whale group.
[0140] Step 2.3.2: Based on the value of the random number P generated in step 2.3.1 and the method in step 2.3.1, update the position of each whale in the population when the number of iterations m is completed, and the population completes the update process of the number of iterations m+1.
[0141] Step 2.3.3: Substitute each whale individual in the population that has completed the iteration number m+1 into the full life cycle economic model of the new energy hydrogen production system in step 1, and calculate the fitness values of all whale individuals according to formula (3). The position of the whale individual with the largest fitness value is taken as the position of the whale individual with the best fitness when completing the iteration number m+1. Then increase the iteration number by 1 and repeat the process of steps 2.3.1 to 2.3.3 until the iteration number reaches M. max .
[0142] Step 2.3: Obtain the best individual
[0143] Will complete M maxThe best fitness of the individuals in the iteratively updated population is compared with the best fitness value of the individuals in the population when each iterative step is completed. The position of the whale individual corresponding to the maximum value of the best fitness value is the best individual sought, that is, the optimal values of the d parameters to be optimized are obtained, and the capacity configuration of the hydrogen production system is realized.
[0144] Example
[0145] Taking one year's worth of wind farm (75MW installed capacity) and photovoltaic farm (75MW installed capacity) data from a city in Hebei Province, China, as an example, and taking the economic benefits of a typical day within the life cycle of an electrolyzer hydrogen production system as the research target, the method of this invention was used to calculate the full lifecycle capacity of the hydrogen production system. The results are shown in Table 1:
[0146] Table 1 Capacity configuration results
[0147]
[0148] In the comparison of different optimization algorithms, the improved whale optimization algorithm (IWOA), whale optimization algorithm (WOA), sparrow search algorithm (SSA) and particle swarm optimization algorithm (PSO) designed by the present invention are respectively used. The economic benefit curve of a typical day is shown as follows: Figure 2 As shown in . When the economic benefits of a typical day remain stable, the objective function reaches convergence. Figure 2 It can be seen that although PSO converges quickly and its optimal value remains essentially unchanged after 25 iterations, it is trapped in a local optimum. WOA reaches a stable optimal value after approximately 50 iterations. In comparison, the IWOA designed in this invention reduces the number of iterations by 15 compared to WOA. Due to the introduction of nonlinear convergence factors and the fact that the adaptive weights remain relatively large in the early stages of the iteration, IWOA is more conducive to escaping local optimal solutions during optimization and can search for optimal solutions over a wider range. Moreover, after introducing the Laplace-Cauchy hybrid mutation operator and implementing the levy flight strategy, its global optimization capabilities have also been significantly improved. The results show that compared to the typical daily returns of WOA (267,400 yuan), SSA (259,100 yuan), and PSO (256,800 yuan), the typical daily returns of IWOA (275,900 yuan) have increased by 3.18%, 6.48%, and 7.44%, respectively.
[0149] In order to verify the stability, solution speed and accuracy of the IWOA algorithm designed by the present invention, the present invention uses 5 test functions (i.e., as the objective function) to test IWOA, WOA, SSA and PSO. The function information is shown in Table 2 below, and the convergence curves of the 5 test functions are shown in the attached figure. Figure 3 , Attachment Figure 4 , Attachment Figure 5 , Attachment Figure 6 and attached Figure 7 As shown in the results, IWOA demonstrates faster convergence speed and higher convergence accuracy for both low- and high-dimensional non-zero solution test functions compared to SSA, PSO, and WOA. The results of 30 independent experiments show that IWOA can find optimal solutions for the four non-zero solution test functions, with average values near the optimal solution and very small standard deviations. This demonstrates that IWOA's more stable convergence performance is not accidental.
[0150] Table 2 Test functions
[0151]
[0152]
[0153] Any matters not described in the present invention are applicable to the prior art.
Claims
1. A full-life capacity configuration method for a hydrogen production system based on an improved whale optimization algorithm is characterized in that: The method comprises the following steps: Step 1: Establish a full life cycle economic model based on the new energy hydrogen production system The new energy hydrogen production system includes a renewable energy power generation unit, an electrolytic hydrogen production unit, and an electrolytic hydrogen production unit. The renewable energy power generation unit includes a wind turbine and a photovoltaic unit; the electrolytic hydrogen production unit is composed of a PEM electrolyzer and an ALK electrolyzer; the energy storage unit is composed of a lithium battery and a hydrogen storage tank; in addition, there are auxiliary voltage regulating components for regulating current and voltage. Based on the above new energy hydrogen production system, a full life cycle economic model of the system is established, specifically including a full life cycle cost model and a full life cycle revenue model; The cost C of the system consists of initial investment cost and operating cost, where the operating cost is composed of energy cost, maintenance cost, labor cost, and transportation cost. The full life cycle cost model of the system is shown as follows: In the above formula, C inv is the total investment cost during the project period; E pem 、E alk 、E Li and E h are the capacity of PEM electrolyzer, ALK electrolyzer, lithium battery and hydrogen storage tank respectively; C pem (t), C alk (t) and C ae (t) are the unit capacity investment costs of the PEM electrolyzer, the unit capacity investment costs of the ALK electrolyzer, and the unit capacity investment costs of the voltage regulating auxiliary components in year t; C en is the energy cost; C ma Maintenance, labor, and transportation costs; C Li (t) is the unit capacity investment cost of lithium batteries in year t; C is the unit capacity investment cost of the hydrogen storage tank in year t; d is the income from the depreciation of the equipment at the end of the project; C1(t) and C2(t) are the electricity price and water price in year t respectively; K e (t) and K w (t) are the electricity consumption and water consumption in year t respectively; P pem (t), P alk (t) is the actual operating power of the PEM electrolyzer and ALK electrolyzer in the tth year, ΔT is the actual working time of the PEM electrolyzer and ALK electrolyzer in the tth year; α is the conversion rate of water to hydrogen; H(t) is the hydrogen production in the tth year; η(t) is the hydrogen production efficiency in the tth year; β is the conversion rate between voltage efficiency and hydrogen production efficiency; T plan Plan the project cycle; k is 8% to 12%; The system's full life cycle revenue model is as follows: In the above formula, R1 is the income from hydrogen and oxygen sales, R1(t) is the income from hydrogen and oxygen sales in year t; C h (t), C o (t), Q h (t), Q o (t) are the hydrogen price, oxygen price, hydrogen production, and oxygen production in year t, respectively; R2 is the government subsidy income, and R2(t) is the government subsidy income in year t; is the price of carbon dioxide emissions from 1kW·h coal-fired power generation in year t; H(t) is the hydrogen production in year t; k p2g is the conversion coefficient of electricity to hydrogen; Step 2: Solve the capacity configuration of the hydrogen production system based on the improved whale optimization algorithm Step 2.1: Set the return on a typical day as the objective function, that is: The objective function is the fitness function of the improved whale optimization algorithm, and the whale individual that maximizes the objective function is the whale individual with the best fitness; Then the actual operating power P of the PEM electrolyzer in year t is pem (t), actual operating power P of ALK electrolyzer alk (t), and the capacity E of the PEM electrolyzer pem 、Capacity E of ALK electrolyzer alk , lithium battery capacity E Li and hydrogen storage tank capacity E h , as the parameters to be optimized in the improved whale optimization algorithm, the constraints of each parameter to be optimized are: 1) Power Constraints: P wt (t)+P pv (t)<P pem (t)+P alk (t) (4) 0≤P pem (t)≤E pem (5) 0≤P alk (t)≤E alk (6) Among them, P wt (t) and P pv (t) is the installed capacity of wind turbines and photovoltaic units in year t; P pem (t), P alk (t) are the actual operating power of PEM electrolyzer and ALK electrolyzer in year t respectively; 2) Capacity Constraints: AND pem,min <And pem ≤E pem,pax (7) AND alk,min <And alk ≤E alk,pax (8) AND Li,min <And Li ≤E Li,max (9) AND h,min ≤E h ≤E h,max (10) Among them, E pem,max and E pem,min are the maximum and minimum capacities of the PEM electrolyzer respectively; E alk,max and E alk,min are the maximum and minimum capacities of ALK electrolyzer respectively; E Li,max and E Li,min They are the maximum and minimum capacities of lithium batteries respectively; E h,max 、E h,min They are the maximum capacity and minimum safe reserve of hydrogen storage tanks respectively; Step 2.2: Population initialization Set the maximum number of iterations of the whale optimization algorithm to M max , according to the dimension d of the parameter to be optimized, the value range corresponding to each parameter to be optimized, and the set population size N, the Logistic-Tent chaotic mapping and adversarial learning strategy are used to initialize the population; the Logistic-Tent mapping equation is: Among them, r∈[0,4] is the chaos factor, x i ∈[-1, 1]; [·]Mod1 means performing the mod1 operation on the calculation result in [], performing a modulo operation on the iterative result to ensure that the sequence value remains in the interval [0, 1]; Randomly select the value of x0 in the range of [-1, 1] and randomly set the value of r in the range of [0, 4], and then substitute it into formula (11) for iterative operation to obtain x1, ..., x i ,…,x N The N values constitute a chaotic sequence; each value in the chaotic sequence is mapped to the d-dimensional parameter to be optimized, and a chaotic mapping population with a population size of N is obtained; the specific process of the above mapping is: the i-th value in the chaotic sequence is x i , the i-th whale individual of the chaotic mapping population is obtained by mapping, and the value range of the parameter W to be optimized is set to [x min , x max ], then the initial value of the parameter to be optimized in the i-th whale individual is x′ i : x′ i =x min +(x max -x min )x i (12) where x max and x min The upper and lower bounds of the search space for the parameter to be optimized; Based on the chaotic mapping population, the opposition population is generated according to the opposition learning strategy. The initial value x of the parameter W to be optimized for the i-th whale individual in the opposition population is op for: x op =x min +x max -x′ i (13) Substitute the values of each parameter to be optimized for each whale individual in the chaotic mapping population and its opposing population into the full life cycle economic model of the new energy hydrogen production system in step 1, and calculate the fitness values of all individuals according to formula (3). Then, sort all whale individuals from large to small according to their fitness values, and select the first N whale individuals to form the final initial population. Step 2.3: Population Update Step 2.3.1: Set the position of individual whale X in the population at the completion of the mth iteration to X(m), X(m) = [X1(m), X2(m)…X d (m)],X d (m) is the value of the dth parameter to be optimized in the whale individual X when the mth iteration is completed; the position of the whale individual with the best fitness when the number of iterations m is completed is set as X * (m), During the execution of iteration step m+1, whale individual X chooses to perform one of the following: shrinking and surrounding individual position update, spiral individual position update, or search and prey individual position update. The specific process is as follows: 1) Based on the value of the completed iteration step m, update the values of the nonlinear convergence factor a(m), the adaptive weight ω, and the coefficient vectors A and C to guide the execution process of the iteration step m+1; Use piecewise nonlinear function to update the nonlinear convergence factor a(m): Update the adaptive weight ω: Update the time-varying spiral constant b(m): Where δ is the dynamic adjustment factor, which is a constant; Update coefficient vectors A and C: A=2a(m)ra(m) (17) C=2r (18) Where A and C are random numbers between [-2, 2] and [0, 2], respectively, and r is a random number between [0, 1]. a(m) is updated according to formula (14). 2) Generate a random number P. When P ≥ 0.5, the whale individual X performs a spiral individual position update: X(m+1)=X * (m)+D e b(m)l ·cos(2πl) (19) Where l is a random number between [-1, 1], D = |X * (m)-X(m)|; When P < 0.5, the value of |A| is determined. When |A| < 1, the whale individual X chooses to shrink and surround the individual position update. This position update method integrates the Laplace mutation strategy. The position update formula is as follows: Among them, Laplace(0,1) is the Laplace operator; When |A|≥1, the whale individual X chooses to search for the prey individual and update its position. This position update integrates the levy flight strategy. The position update formula is as follows: s ν =1 (26) X(m+1)=sX rand -A·D (27) D=|C·s·X rand -X(m)| (28) Where β is a constant, Г is the gamma function, s is the random step length of levy flight; X rand Indicates the position of a random individual whale in the current whale group; Step 2.3.2: Based on the value of the random number P generated in step 2.3.1 and the method in step 2.3.1, update the position of each whale in the population when the number of iterations m is completed, and the population completes the update process of the number of iterations m+1; Step 2.3.3: Substitute each whale individual in the population that has completed the iteration number m+1 into the full life cycle economic model of the new energy hydrogen production system in step 1, and calculate the fitness values of all whale individuals according to formula (3). The position of the whale individual with the largest fitness value is taken as the position of the whale individual with the best fitness when completing the iteration number m+1. Then increase the iteration number by 1 and repeat the process of steps 2.3.1 to 2.3.3 until the iteration number reaches M. max ; Step 2.3: Obtain the best individual Will complete M max The best fitness of the individuals in the iteratively updated population is compared with the best fitness value of the individuals in the population when each iterative step is completed. The position of the whale individual corresponding to the maximum value of the best fitness value is the best individual sought, that is, the optimal values of the d parameters to be optimized are obtained, and the capacity configuration of the hydrogen production system is realized.
2. The method for configuring the full life cycle capacity of a hydrogen production system based on the improved whale optimization algorithm according to claim 1 is characterized in that: In step 2.3.1, β is set to 1.
5.
3. The method for configuring the full life cycle capacity of a hydrogen production system based on the improved whale optimization algorithm according to claim 1 is characterized in that: In step 2.2, d = 2 × T plan +4.
4. The method for configuring the full life cycle capacity of a hydrogen production system based on the improved whale optimization algorithm according to claim 1 is characterized in that: In step 2.3.1, the dynamic adjustment factor δ is set to 0.6.