Multi-energy coupling hydrogen-based micro-grid system double-layer capacity configuration method based on chameleon group algorithm

By combining the chameleon swarm algorithm with equipment aging modeling and dual-layer capacity configuration, the problems of neglecting equipment lifespan and low optimization efficiency in multi-energy coupled hydrogen-based microgrid systems are solved, thereby extending equipment lifespan and improving system stability, and optimizing equipment lifespan and solution accuracy.

CN121308035APending Publication Date: 2026-01-09JILIN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511407196.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-29
Publication Date
2026-01-09

AI Technical Summary

Technical Problem

Existing multi-energy coupled hydrogen-based microgrid systems suffer from problems such as neglecting equipment lifespan leading to increased operating costs, low efficiency and insufficient accuracy in optimization algorithms, and failure to effectively balance economy and reliability in equipment capacity configuration.

Method used

A two-level capacity configuration method based on the chameleon swarm algorithm is adopted, combined with mixed integer linear programming, and considering equipment aging modeling. The equipment capacity configuration is optimized through the tracking, localization and attack phases of the chameleon swarm algorithm. Combining short-term and long-term optimization objectives, the equipment operation strategy is optimized using the MILP solver.

Benefits of technology

It improves equipment lifespan and system stability, optimizes equipment lifespan, enhances solution accuracy and efficiency, and achieves a balance between economy and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121308035A_ABST
    Figure CN121308035A_ABST
Patent Text Reader

Abstract

The invention provides a capacity configuration method for a multi-energy coupling hydrogen-based micro-grid system based on a chameleon group algorithm, which considers a coupling relationship between long-period capacity configuration and short-period scheduling optimization of a micro-grid, realizes common optimization of two optimization problems, and solves the problems of low optimization result precision and low efficiency of an existing scheme. According to the optimization strategy provided by the invention, the influence of equipment life attenuation on the result is considered, and the relationship between the aging index and the to-be-optimized variable is represented in the modeling process; the minimum annual operation cost, including investment, operation, aging and replacement cost, is used as an optimization target, and a reliability index is also taken into a constraint, so that stable operation of the micro-grid system is ensured; a chameleon group algorithm and mixed integer linear programming are put forward as upper and lower layer optimization algorithms, a proper optimization strategy is combined, and a commercial solver is utilized to jointly form a double-layer micro-grid scheduling framework.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of comprehensive energy micro-grid optimization. BACKGROUND

[0002] With the development of hydrogen energy and renewable energy technology and the promotion of national policy, hydrogen-based micro-grid systems have ushered in a new round of development. In multi-energy coupled hydrogen-based microgrids, determining the capacity of micro-grid devices is the premise and key to stable operation of the system. According to whether a grid-connected link is added, hydrogen-based microgrids can be divided into islanded and grid-connected types. Both systems are powered by renewable energy to loads, and a hybrid hydrogen storage system composed of fuel cells, hydrogen storage tanks, and electrolytic cells is used to realize hydrogen production and utilization in combination with a battery energy storage system to balance instantaneous power. At the same time, the system can collect heat generated during device operation to supply heat to the load, realizing micro-grid combined heat and power supply.

[0003] In recent years, great progress has been made in the optimization of economic and reliable capacity configuration of multi-energy coupled hydrogen-based microgrid systems. With more in-depth research on modeling of microgrid device systems, device operation dynamics can be more accurately represented; for different application scenarios of microgrids, scholars have proposed various operation strategies according to different needs, aiming to improve the adaptability and diversity of the solution strategy, and at the same time, different solution algorithms have been proposed and improved to improve the reliability of the results. However, the existing microgrid capacity configuration strategies still have the following problems: (1) In the modeling of microgrid devices, capacity configuration is a long-term optimization problem, and the service life of the device needs to be considered in the modeling stage. From the perspective of optimization, extending the service life of the device will shorten the replacement cycle of the device and increase the operating cost of the microgrid if the service life of the device is ignored in the optimization; (2) In the determination of the objective function, in order to reduce the operating cost of the microgrid, economic optimization is mainly targeted, however, to ensure the stable operation of the system, the reliability index cannot be ignored, in addition, the coupling characteristics of capacity configuration and dispatching optimization need to be considered in the optimization strategy; (3) The existing algorithms have the problems of low solution efficiency and insufficient accuracy, and innovation is needed in the algorithm to ensure the solution accuracy while maximizing the solution efficiency. SUMMARY

[0004] To solve the above technical problems, the application provides a multi-energy coupled hydrogen-based microgrid system double-layer capacity configuration method based on a chameleon swarm algorithm, which regards capacity configuration and dispatching optimization as two coupled optimization problems, considers the service life attenuation of the device in the modeling part, and considers the economic efficiency and reliability of the microgrid in the optimization target. At the same time, a more accurate and efficient chameleon swarm algorithm is used in combination with mixed integer linear programming (MILP) to efficiently realize the capacity configuration of the hydrogen-based microgrid.

[0005] The application is implemented by the following technical scheme: A double-layer capacity configuration strategy of a multi-energy coupling hydrogen-based micro-grid system based on a chameleon swarm algorithm, comprising the following steps: Step 1: establishing a corresponding mechanism and aging model for an energy storage system in the multi-energy coupling hydrogen-based micro-grid system, including electrolytic cells, fuel cells, hydrogen storage tanks, heat storage tanks and storage batteries; selecting the installed capacity of wind and light renewable energy in the multi-energy coupling hydrogen-based micro-grid system and , the number of electrolytic cells and fuel cells and , the capacity of hydrogen storage tanks and heat storage tanks and , and the capacity of storage batteries as optimization objects; Step 2: if it is the first iteration, randomly initializing the position of each chameleon individual in the chameleon swarm, each position being a solution vector composed of the above optimization objects, and taking the initialized position of the chameleon individual as a candidate solution; if it is not the first iteration, iteratively solving based on the chameleon swarm algorithm to obtain the position of the chameleon individual as a candidate solution; taking the obtained candidate solution as a known condition for lower-level optimization solving; Step 3: based on the short-term operation reality and constraint conditions of the micro-grid equipment, establishing a lower-level operation strategy, and the optimization goal is to minimize the sum of the operation and maintenance cost and the equipment aging cost of the multi-energy coupling hydrogen-based micro-grid system, while meeting the reliability operation constraint, the power balance constraint, the heat balance constraint, the hydrogen storage balance constraint, the energy storage equipment constraint and the maximum and minimum power constraint of the equipment operation of the multi-energy coupling hydrogen-based micro-grid system; Step 4: according to the set solving period, iteratively solving the lower-level optimization problem by using a solver for MILP optimization problems, obtaining a final solution of the lower level, and passing the solution back to the upper-level optimization; Step 5: based on the long-term operation reality and constraint conditions of the micro-grid equipment, establishing an upper-level operation strategy, and the optimization goal is to minimize the total annual economic cost related to investment, operation, aging and replacement, based on the solution after the lower-level optimization in step 4, taking the optimization goal as a fitness function to calculate the fitness of the corresponding solution of all chameleon individuals, obtaining an individual optimal solution and a global optimal solution; Step 6: judging whether the optimization completion condition is met, if yes, obtaining the optimal configuration capacity, otherwise, returning to step 2.

[0006] When the number of iterations of the chameleon swarm algorithm reaches the maximum number, or when the optimal chameleon individual fitness does not change for a certain number of generations, it is determined that the optimization is completed; otherwise, the iteration information needs to be updated and the optimization continues in step 2; after the optimization is completed, the optimal solution containing the optimization objects is obtained.

[0007] Furthermore, the steps in step 1 for establishing the corresponding mechanism and aging model of the energy storage system in the multi-energy coupled hydrogen-based microgrid system are as follows: 1) Modeling the voltage-current relationship in a proton exchange membrane electrolyzer: (1) In equation (1), This represents the reversible voltage of a single electrolytic cell. , and This represents the fit coefficient of the formula. Indicates the operating temperature. and express The voltage and current of the electrolytic cell at all times. This represents the area of ​​the proton exchange membrane; t k Power of the electrolytic cell Represented as: (2) In equation (2), Indicates the number of electrolytic cells; t k Heat generated by the electrolytic cell at all times Represented as: (3) t k The amount of hydrogen produced by the electrolyzer at any given time Represented as: (4) In equation (4), Indicates Faraday efficiency. Denotes Faraday's constant. express t k Time and the previous time t k-1 The time interval.

[0008] Based on the above relationships, we can t k The amount of hydrogen produced by the electrolyzer at any given time and t k Electrolyzer power at all times The fit is a linear relationship: (5) In equation (5), This represents the fitting coefficient between the hydrogen production of the electrolyzer and the power of the electrolyzer.

[0009] 2) Modeling the heat generation, hydrogen consumption, and power generation of the fuel cell: The heat generation model for fuel cells is as follows: (6) In equation (6), Indicating fuel cells in t k Heat generation at all times and express t k The voltage and current of the fuel cell at all times are constant. Indicates the number of fuel cells; The hydrogen consumption of fuel cells is fitted to a linear relationship with the power generation: (7) 3) Modeling the hydrogen storage tank: Hydrogen is stored in the hydrogen storage tank using compressed hydrogen. t k Pressure inside the hydrogen storage tank at all times Represented as: (8) In equation (8), express t k The amount of hydrogen required at the load end at any given time. express t k The amount of hydrogen required for a fuel cell at all times. express t k The amount of hydrogen produced by the electrolyzer at any given time. , , These represent the ideal gas constant, the internal gas temperature of the hydrogen storage tank, and the volume of the hydrogen storage tank, respectively. t k The relative content of gas in the hydrogen storage tank at any given time can be expressed as: (9) In equation (9), This indicates the maximum pressure that the hydrogen storage tank can withstand; 4) Modeling the thermal storage tank: The internal heat storage content of the thermal storage tank is modeled as follows: (10) In equation (10), and These represent the efficiency of the fuel cell electrolyzer, respectively. express t k The amount of heat stored in the thermal storage tank at all times. express t k The thermal load of the system at all times.

[0010] t k The relative content of heat energy inside the thermal storage tank at any given time is: (11) In equation (11), This indicates the maximum amount of heat that the thermal storage tank can store.

[0011] 5) Using empirical formula fitting, the voltage aging model of the electrolytic cell is modeled as follows: (12) In equation (12), and These represent voltage losses caused by prolonged operation and start-up / shutdown of the electrolytic cell, respectively. and These represent the voltage loss coefficients caused by prolonged operation and start-up / shutdown of the electrolytic cell, respectively. 6) The voltage aging model for the fuel cell is as follows: (13) In equation (13), , , and These represent the voltage losses of the fuel cell caused by power changes, high-power operation, idling operation, and start-stop operation, respectively. , , and These represent the voltage loss coefficients of the fuel cell caused by power changes, high-power operation, idling operation, and start-stop, respectively.

[0012] 7) Using the maximum number of battery cycles, the aging model of the battery is as follows: (14) In equation (14), Indicates battery capacity. and These represent the initial and final capacities of the battery, respectively. and These represent the maximum number of battery cycles and, respectively. t k The number of times the time loops.

[0013] 8) Modeling the battery: The internal energy content of the battery is modeled as follows: (15) In equation (15), and These represent the battery's charging and discharging power, express t k The internal electrical energy of the battery is constantly being stored. express t k Time and the previous time t k-1 The time interval; and These represent the charging and discharging efficiency of the battery, respectively. t k The relative content of electrical energy inside the battery at any given time is: (16) In equation (16), This indicates the battery's electrical capacity.

[0014] Furthermore, step 2 includes the following: like Figure 2 As shown, this invention describes the chameleon swarm optimization algorithm.

[0015] First, define the number of individual chameleons in a chameleon colony as... That is, the number of candidate solutions that need to be updated in each iteration; the color dimension of each chameleon individual is... That is, the dimension of the candidate solution vector; In the first iteration, the initial position of each chameleon is generated according to the following formula: (17) In equation (17), y 0 i,j Indicates the first i The first chameleon individual in the... j The initial position of each dimension. u j This indicates the chameleon's position is at the _____th ... j The upper boundary in each dimension l j This indicates the chameleon's position is at the _____th ... j The lower bound in each dimension r This represents a random number that takes values ​​in the range [0,1]. The Chameleon Swarm Algorithm mimics the chameleon's predation pattern, proceeding in three stages: tracking, locating, and attacking. First, a mathematical description of the tracking phase: (18) In equation (18), the subscript The algebraic number representing the iterations of the chameleon group. Representing the t After the nth iteration i The first chameleon individual j Position in each dimension; Indicates the first t After the nth iteration i The first chameleon individual in the... j The optimal value for each dimension over several generations Indicates the first t After the next iteration, the chameleon herd was in the... j The optimal value for each dimension over several generations This represents the probability that a chameleon senses its prey, typically taken as 0.1. and These represent adjustable parameters of the algorithm, with values ​​of 0.25 and 1.50 respectively. r 1. r 2. r 3 and r i These are random numbers that take values ​​within the interval [0,1]. This represents a random value between -0.5 and 0.5; sgn is the sign function. μ The parameter is a function defined as the number of iterations, which decreases as the number of iterations increases. The update formula is as follows: (19) In equation (19), , and These represent the adjustable coefficients of the algorithm, taking values ​​of 3.5, 3.0, and 1.0 respectively. e It is a natural constant. This indicates the current iteration number of the chameleon swarm. Indicates the maximum number of iterations; Next, a mathematical description of the localization phase: (20) In equation (20), Indicates the first t The second iteration i The central position of each dimension of an individual chameleon; No. t The second iteration iThe coordinates of the rotation center of each individual chameleon are calculated using the following formula: (twenty one) In equation (21), This represents the coefficient matrix corresponding to a single rotation transformation of a chameleon, rotating it from its original position around a spatial axis of a certain dimension. No. t The second iteration i The center coordinates of an individual chameleon are calculated using the following formula: (twenty two) In equation (22), Representing the t During the nth iteration i The location of each individual chameleon; Finally, a mathematical description of the attack phase is provided: (twenty three) (twenty four) In equations (23) and (24), Indicates the first i The first chameleon individual j Vi in the t The new speed after +1 iteration and These represent adjustable parameters of the algorithm, with values ​​of 1.75 and 1.75 respectively. This is equivalent to the chameleon's movement speed when the attack occurs. The velocity-inertia coefficient is represented by the following update formula: (25) (26) In equation (26), This indicates an adjustable parameter, typically set to 1.0.

[0016] The above algorithm is To optimize the candidate solution vector of the problem, i.e. a capacity configuration scheme, after completing the iterative calculation in this step, each candidate solution is used as known for subsequent optimization.

[0017] Furthermore, the steps in step 3 for establishing the lower-level operation strategy based on the short-term operational realities and constraints of the microgrid equipment are as follows: The lower-level optimization is a scheduling problem with a single sampling interval of 1 hour, an optimization time of 1 day, and a total optimization time of 1 year (365 days). The lower-level optimization objective is modeled as follows: (27) In equation (27), This represents the objective function for lower-level optimization, which is the sum of the equipment's lower-level operation and maintenance costs and aging costs. This represents the operation and maintenance cost during the tk time period. This represents the equipment aging cost during the tk period; the subscript pv represents photovoltaic cells, wt represents wind turbines, b represents batteries, el represents electrolyzers, and fc represents fuel cells. The power balance constraint is modeled as follows: (28) In equation (28), and They are respectively t k Power curtailed during specific time periods and power reduction due to load shedding; P load ( t k )represent t k Power at the load end during the time period; The constraint modeling of energy storage devices is as follows: (29) (30) (31) (32) (33) (34) In equations (29) to (34), the superscripts min and max represent the minimum and maximum values ​​of the corresponding indicators, respectively. and These represent the start and end times of the optimization, respectively.

[0018] The maximum and minimum power constraints for equipment operation are: (35) (36) (37) In equations (35) to (37), This is an auxiliary binary variable representing the equipment; 1 indicates the equipment is working, and 0 indicates it is not working. The subscript... q Representing different devices. ch This indicates the battery's charging status. dis Indicates the battery discharge status; In addition, it is necessary to establish operating status constraints for the equipment: (38) (39) To ensure reliable system operation, the reliability index equivalent loss factor ELF is introduced: (40) The relevant constraints are then modeled as follows: (41) Furthermore, step 4 includes the following: In the lower-level optimization problem, the solution vector corresponding to each chameleon individual in the upper level is taken as a known quantity. The power of wind and solar renewable energy is directly calculated based on the input environmental parameters (including temperature, irradiance, and wind speed). The variables to be optimized include the operating power of the electrolyzer and fuel cell. and The charging and discharging power of the battery and wind and solar power curtailment and load reduction power This forms a 6-dimensional vector; To solve the lower-level optimization problem, the modeling language YALMIP was used to call the commercial Cplex solver to quickly solve the above 6-dimensional vector in Matlab. Each solution to the optimization problem represents the completion of a day's scheduling, and the hourly operating power of each device within a day is obtained.

[0019] Since this invention takes into account the annual operating cost, the scheduling needs to be performed 365 times (or 366 times) consecutively. The optimization result is an 8760×6 matrix representing the operating power of the equipment and the lower-level cost obtained based on it. Then, the result is returned to the upper-level optimization to continue solving.

[0020] Furthermore, step 5 includes the following: After knowing the optimization results of the lower level, the fitness of the configuration schemes corresponding to all chameleon individuals is calculated. This process models the fitness function of the upper-level optimization objective, i.e., the chameleon swarm algorithm, as follows: (42) In equation (42), C upper This represents the fitness function of the upper-level optimization, which is the sum of the lower-level costs, investment costs, and replacement costs of the microgrid operation. Indicates equipment investment cost, Indicates the cost of equipment replacement. This indicates the unit investment cost of each piece of equipment. and These represent the unit capacity cost of the hydrogen tank and the heat storage tank, respectively. Indicates the capital recovery coefficient.Y This indicates the estimated service life of the microgrid system, typically taken as 20 years. This indicates the voltage decay of the equipment over one year of operation. This indicates the amount of voltage decay that occurred during the operation of the equipment until it was scrapped. This indicates the total number of cycles a battery operates for one year.

[0021] The beneficial effects of this invention are as follows: This invention provides a capacity configuration method for a multi-energy coupled hydrogen-based microgrid system based on the chameleon swarm algorithm. First, the structure of the multi-energy coupled hydrogen-based microgrid system is established to clarify the energy supply, consumption, and storage devices within the microgrid, and the conversion relationships between different physical quantities such as power, heat generation, and hydrogen production are established. Second, the mechanism and aging model of the microgrid devices are modeled and described to extend the service life of the microgrid devices from an optimization perspective. Then, the iterative process of the chameleon swarm algorithm is detailed, describing the candidate solution update process of the capacity configuration scheme from three stages: tracking, location, and attack. Compared with other heuristic algorithms, this algorithm has stronger global search capabilities, faster iteration, higher solution accuracy, and can effectively avoid getting trapped in local optima, exhibiting strong robustness. Third, a two-layer capacity configuration strategy is designed based on the chameleon swarm algorithm, utilizing upper and lower layers of optimization, considering both long and short time domains, prioritizing economic optimization while supplementing with reliable operation, ensuring the continuous and stable operation of the microgrid. Finally, the entire optimization solution process is improved.

[0022] This invention, based on the chameleon swarm optimization algorithm, applies a two-layer optimization configuration strategy to the field of multi-energy coupled hydrogen-based microgrids. It considers the coupling and mutual influence between capacity configuration and scheduling strategies, achieving optimal short- and long-term scheduling from the perspective of optimization algorithms. Simultaneously, it considers the impact of equipment aging and long-term reliability assurance, maintaining stable microgrid operation. This process not only improves the accuracy of capacity configuration optimization but also maximizes solution efficiency, intuitively demonstrating the update process of the optimization strategy. Attached Figure Description

[0023] Figure 1 This is a block diagram of an island-style hydrogen-based microgrid system. Figure 2 This is an iterative flowchart for the chameleon swarm algorithm; Figure 3 A flowchart illustrating the iterative process for configuring the capacity of a hydrogen-based microgrid's two-layer structure.

[0024] Figure 4 A comparison chart showing the capacity configuration of the Chameleon Swarm Optimization algorithm with other algorithms (Particle Swarm Optimization and Grey Wolf Optimization). Detailed Implementation

[0025] This invention proposes a two-layer capacity configuration method for a multi-energy coupled hydrogen-based microgrid system based on the chameleon swarm algorithm. The technical solutions in the embodiments of this invention will be clearly and completely described and discussed below with reference to the accompanying drawings. Obviously, what is described here is only a part of the examples of this invention, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the protection scope of this invention.

[0026] The application principle of the present invention will be described in detail below with reference to the accompanying drawings.

[0027] Figure 1 This is a structural block diagram of a typical application scenario of the present invention. The diagram represents a microgrid application scenario under islanded conditions. If grid-connected operation is required, simply add a grid-connected unit to the original block diagram. To increase the accuracy of the microgrid capacity configuration model, the present invention not only performs mechanistic modeling of the energy storage units in the microgrid system, but also establishes their respective lifetime decay models, extending the service life of the equipment from an optimization perspective.

[0028] Figure 2 This is an iterative flowchart of the chameleon swarm algorithm in this invention. The iterative process mimics the hunting characteristics of chameleons and is divided into three stages: the first stage is the localization stage, representing the process of the chameleon swarm searching for prey; the second stage is the tracking stage, representing the process of the chameleons adjusting their positions appropriately after finding prey to facilitate an attack; and the third stage is the attack stage, representing the process of the chameleons using their tongues to attack and capture their prey after preparation. The algorithm uses mathematical descriptions of these processes, causing each chameleon to undergo three position changes before reaching its final position.

[0029] Figure 3 This is an iterative flowchart of the two-layer capacity configuration strategy applied in this invention. When the program starts executing, it first needs to determine the constraint parameters of the optimization algorithm, the relevant parameters of the Chameleon algorithm, and the environmental parameters related to the load data, as the background information required for capacity configuration. Secondly, based on the microgrid's operating background, it needs to generate initial population information and, combined with the set upper and lower layer optimization strategies, obtain the first set of optimization results. Then, based on the obtained first set of results, it continuously iterates. Finally, it needs to set an appropriate loop termination condition to determine whether the optimization is complete. If the condition is met, the final capacity configuration result is obtained; if not, the algorithm parameters are updated and iterative optimization continues. The process is summarized step by step as follows: Step 1: Establish the corresponding mechanism and aging model for the energy storage system in the microgrid; Step 2: In the first iteration, candidate solutions are generated; otherwise, the chameleon swarm algorithm is used to iterate over the candidate solutions. Step 3: Determine the optimization strategy for the lower layer of the microgrid; Step 4: Iteratively solve the lower-layer optimization problem of the microgrid using the MILP algorithm; Step 5: Determine the microgrid upper-layer optimization strategy and calculate the fitness of individual chameleons; Step 6: Determine whether to terminate the loop. If not, return to step 2.

[0030] Finally, an example verification based on this algorithm is presented. The environmental information related to wind and solar power generation used in the verification, including temperature, light intensity, and wind speed, are all from a publicly available dataset published by the state for 2019-2020, and the power load used is from a location in Belgium. Some of the economic parameters used in the algorithm are shown in Table 1, and the remaining parameters were converted.

[0031] Table 1 Table 2 shows the capacity configuration results of the hydrogen-based microgrid obtained by the chameleon swarm algorithm.

[0032] Table 2 Fan (kW) Photovoltaic (kW) Battery (kWh) Fuel cell (pack) Electrolyzer (pack) Hydrogen storage tank (bar) Heat storage tank (kWh) 38 15 150 9 8 249 252 Figure 4 This paper presents a performance comparison between the Chameleon Swarm Optimization (CSO) algorithm proposed in this invention and the classic Particle Swarm Optimization (PSO) algorithm and the Grey Wolf algorithm commonly used in the microgrid field. Compared with the PSO algorithm, the Chameleon Swarm Optimization (CSO) algorithm achieves a lower objective function value and converges faster under the same number of iterations; however, within the set convergence criteria and iteration limit, the PSO algorithm fails to meet the convergence requirements. Compared with the Grey Wolf algorithm, the Chameleon Swarm Optimization (CSO) algorithm can stably converge to the global optimum and exhibits a smaller solution quality variance in multiple independent runs. The Chameleon Swarm Optimization (CSO) algorithm adopts a three-stage optimization process of "tracking-locating-attacking," which can achieve an adaptive balance between global exploration and local exploitation, effectively reducing the risk of premature convergence; although the Grey Wolf algorithm decreases faster in the early stages, it is prone to getting trapped in local optima and obtaining suboptimal solutions. Overall, the Chameleon Swarm Optimization (CSO) algorithm outperforms the compared algorithms in terms of convergence rate, solution quality, and robustness.

Claims

1. A two-layer capacity configuration method for a multi-energy coupled hydrogen-based microgrid system based on the chameleon swarm algorithm, characterized in that, The method includes the following steps: Step 1: Establish corresponding mechanism and aging models for the energy storage system in the multi-energy coupled hydrogen-based microgrid system, including the electrolyzer, fuel cell, hydrogen storage tank, thermal storage tank, and battery; select the installed capacity of wind and solar renewable energy in the multi-energy coupled hydrogen-based microgrid system. and Number of electrolyzers and fuel cells and The capacity of hydrogen storage tanks and thermal storage tanks and and the capacity of the storage battery As an optimization target; Step 2: If it is the first iteration, randomly initialize the position of each chameleon in the chameleon swarm. Each position is the solution vector composed of the above optimization objects. Use the initialized chameleon positions as candidate solutions. If it is not the first iteration, iterate based on the chameleon swarm algorithm to obtain the chameleon positions as candidate solutions. Use the obtained candidate solutions as known conditions for the next level of optimization. Step 3: Based on the short-term operation and constraints of the microgrid equipment, establish a lower-level operation strategy. The optimization objective is to minimize the sum of the operation and maintenance cost and equipment aging cost of the multi-energy coupled hydrogen-based microgrid system, while satisfying the reliability operation constraints, power balance constraints, thermal balance constraints, hydrogen storage balance constraints, energy storage equipment constraints, and maximum and minimum power constraints of the multi-energy coupled hydrogen-based microgrid system. Step 4: According to the set solution cycle, use the solver for mixed integer linear programming optimization problems to iteratively solve the lower-level optimization problem, obtain the final solution of the lower level, and pass the solution back to the upper-level optimization. Step 5: Based on the long-term operation and constraints of the microgrid equipment, establish an upper-level operation strategy. The optimization objective is to minimize the total annual economic cost related to investment, operation, aging, and replacement. Based on the solution optimized in Step 4, calculate the fitness of the solution corresponding to all individual chameleons using the optimization objective as the fitness function, and obtain the individual optimal solution and the overall optimal solution. Step 6: Determine whether the optimization completion conditions are met. If they are met, the optimal configuration capacity is obtained; otherwise, return to step 2. When the number of iterations of the chameleon swarm algorithm reaches the maximum, or when the fitness of the best chameleon individual does not change for several consecutive generations, the optimization is considered complete; otherwise, the iteration information needs to be updated and the process returns to step 2 to continue optimization; after optimization, the optimal solution containing the optimized object is obtained.

2. The two-layer capacity configuration method for a multi-energy coupled hydrogen-based microgrid system based on the chameleon swarm algorithm according to claim 1, characterized in that, Step 1 involves establishing the corresponding mechanism and aging model for the energy storage system in a multi-energy coupled hydrogen-based microgrid system, as follows: 1) Modeling the voltage-current relationship in a proton exchange membrane electrolyzer: (1) In equation (1), This represents the reversible voltage of a single electrolytic cell. , and This represents the fit coefficient of the formula. Indicates the operating temperature. and express The voltage and current of the electrolytic cell at all times. This represents the area of ​​the proton exchange membrane; t k Power of the electrolytic cell Represented as: (2) In equation (2), Indicates the number of electrolytic cells; t k Heat generated by the electrolytic cell at all times Represented as: (3) t k The amount of hydrogen produced by the electrolyzer at any given time Represented as: (4) In equation (4), Indicates Faraday efficiency. Denotes Faraday's constant. express t k Time and the previous time t k-1 The time interval; Based on the above relationships, we can t k The amount of hydrogen produced by the electrolyzer at any given time and t k Electrolyzer power at all times The fit is a linear relationship: (5) In equation (5), This represents the fitting coefficient between the hydrogen production of the electrolyzer and the power of the electrolyzer; 2) Modeling the heat generation, hydrogen consumption, and power generation of the fuel cell: The heat generation model for fuel cells is as follows: (6) In equation (6), Indicating fuel cells in t k Heat generation at all times and express t k The voltage and current of the fuel cell at all times are constant. Indicates the number of fuel cells; The hydrogen consumption of fuel cells is fitted to a linear relationship with the power generation: (7) 3) Modeling the hydrogen storage tank: Hydrogen is stored in the hydrogen storage tank using compressed hydrogen. t k The internal pressure of the hydrogen storage tank at all times Represented as: (8) In equation (8), express t k The amount of hydrogen required at the load end at any given time. express t k The amount of hydrogen required for a fuel cell at all times. express t k The amount of hydrogen produced by the electrolyzer at any given time. , , These represent the ideal gas constant, the internal gas temperature of the hydrogen storage tank, and the volume of the hydrogen storage tank, respectively. t k The relative content of gas in the hydrogen storage tank at any given time can be expressed as: (9) In equation (9), This indicates the maximum pressure that the hydrogen storage tank can withstand; 4) Modeling the thermal storage tank: The internal heat storage content of the thermal storage tank is modeled as follows: (10) In equation (10), and These represent the efficiency of the fuel cell electrolyzer, respectively. express t k The amount of heat stored in the thermal storage tank at all times. express t k The thermal load of the system at all times; t k The relative content of heat energy inside the thermal storage tank at any given time is: (11) In equation (11), This indicates the maximum amount of heat that the thermal storage tank can store. 5) Using empirical formula fitting, the voltage aging model of the electrolytic cell is modeled as follows: (12) In equation (12), and These represent voltage losses caused by prolonged operation and start-up / shutdown of the electrolytic cell, respectively. and These represent the voltage loss coefficients caused by prolonged operation and start-up / shutdown of the electrolytic cell, respectively. 6) The voltage aging model for the fuel cell is as follows: (13) In equation (13), , , and These represent the voltage losses of the fuel cell caused by power changes, high-power operation, idling operation, and start-stop operation, respectively. , , and These represent the voltage loss coefficients of the fuel cell due to power changes, high-power operation, idling operation, and start-stop, respectively. 7) Using the maximum number of battery cycles, the aging model of the battery is as follows: (14) In equation (14), Indicates battery capacity. and These represent the initial and final capacities of the battery, respectively. and These represent the maximum number of battery cycles and, respectively. t k The number of loops at any given time; 8) Modeling the battery: The internal energy content of the battery is modeled as follows: (15) In equation (15), and These represent the battery's charging and discharging power, express t k The internal electrical energy of the battery is constantly being stored. express t k Time and the previous time t k-1 The time interval; and These represent the charging and discharging efficiency of the battery, respectively. t k The relative content of electrical energy inside the battery at any given time is: (16) In equation (16), This indicates the battery's electrical capacity.

3. The two-layer capacity configuration method for a multi-energy coupled hydrogen-based microgrid system based on the chameleon swarm algorithm according to claim 2, characterized in that, The iterative solution process based on the chameleon swarm algorithm is as follows: First, define the number of individual chameleons in a chameleon colony as... That is, the number of candidate solutions that need to be updated in each iteration; the color dimension of each chameleon individual is... That is, the dimension of the candidate solution vector; In the first iteration, the initial position of each chameleon is generated according to the following formula: (17) In equation (17), y 0 i,j Indicates the first i The first chameleon individual in the... j The initial position of each dimension. u j This indicates the chameleon's position is at the _____th ... j The upper boundary in each dimension l j This indicates the chameleon's position is at the _____th ... j The lower bound in each dimension r This represents a random number that takes values ​​in the range [0,1]. The Chameleon Swarm Algorithm mimics the chameleon's predation pattern, proceeding in three stages: tracking, locating, and attacking. First, a mathematical description of the tracking phase: (18) In equation (18), the subscript The algebraic number representing the iterations of the chameleon group. Representing the t After the nth iteration i The first chameleon individual j Position in each dimension; Indicates the first t After the nth iteration i The first chameleon individual in the... j The optimal value for each dimension over several generations Indicates the first t After the next iteration, the chameleon herd was in the... j The optimal value for each dimension over several generations This represents the probability that a chameleon senses its prey, typically taken as 0.

1. and These represent adjustable parameters of the algorithm, with values ​​of 0.25 and 1.50 respectively. r 1. r 2. r 3 and r i These are random numbers that take values ​​within the interval [0,1]. This represents a random value between -0.5 and 0.5; sgn is the sign function. μ The parameter is a function defined as the number of iterations, which decreases as the number of iterations increases. The update formula is as follows: (19) In equation (19), , and These represent the adjustable coefficients of the algorithm, taking values ​​of 3.5, 3.0, and 1.0 respectively. e It is a natural constant. This indicates the current iteration number of the chameleon swarm. Indicates the maximum number of iterations; Next, a mathematical description of the localization phase: (20) In equation (20), Indicates the first t The second iteration i The central position of each dimension of an individual chameleon; No. t The second iteration i The coordinates of the rotation center of each individual chameleon are calculated using the following formula: (21) In equation (21), This represents the coefficient matrix corresponding to a single rotation transformation of a chameleon, rotating it from its original position around a spatial axis of a certain dimension. No. t The second iteration i The center coordinates of an individual chameleon are calculated using the following formula: (22) In equation (22), Representing the t During the nth iteration i The location of each individual chameleon; Finally, a mathematical description of the attack phase is provided: (23) (24) In equations (23) and (24), Indicates the first i The first chameleon individual j Vi in the t The new speed after +1 iteration and These represent adjustable parameters of the algorithm, with values ​​of 1.75 and 1.75 respectively. This is equivalent to the chameleon's movement speed when the attack occurs. The velocity-inertia coefficient is represented by the following update formula: (25) (26) In equation (26), This indicates an adjustable parameter, typically set to 1.0; The above algorithm is To optimize the candidate solution vector of the problem, i.e. a capacity configuration scheme, after completing the iterative calculation in this step, each candidate solution is used as known for subsequent optimization.

4. The two-layer capacity configuration method for a multi-energy coupled hydrogen-based microgrid system based on the chameleon swarm algorithm according to claim 3, characterized in that, Step 3, which establishes the lower-level operation strategy based on the short-term operational realities and constraints of the microgrid equipment, is as follows: The lower-level optimization is a scheduling problem with a single sampling interval of 1 hour, an optimization time of 1 day, and a total optimization time of 1 year. The lower-level optimization objective is modeled as follows: (27) In equation (27), This represents the objective function for lower-level optimization, which is the sum of the equipment's lower-level operation and maintenance costs and aging costs. This represents the operation and maintenance cost during the tk time period. This represents the equipment aging cost during the tk period; the subscript pv represents photovoltaic cells, wt represents wind turbines, b represents batteries, el represents electrolyzers, and fc represents fuel cells. The power balance constraint is modeled as follows: (28) In equation (28), and They are respectively t k Power curtailed during specific time periods and power reduction due to load shedding; P load ( t k )represent t k Power at the load end during the time period; The constraint modeling of energy storage devices is as follows: (29) (30) (31) (32) (33) (34) In equations (29) to (34), the superscripts min and max represent the minimum and maximum values ​​of the corresponding indicators, respectively. and These represent the start and end times of the optimization, respectively. The maximum and minimum power constraints for equipment operation are: (35) (36) (37) In equations (35) to (37), This is an auxiliary binary variable representing the equipment; 1 indicates the equipment is working, and 0 indicates it is not working. The subscript... q Represents different devices. ch This indicates the battery's charging status. dis Indicates the battery discharge status; In addition, it is necessary to establish operating status constraints for the equipment: (38) (39) To ensure reliable system operation, the reliability index equivalent loss factor ELF is introduced: (40) The relevant constraints are then modeled as follows: (41)。 5. The two-layer capacity configuration method for a multi-energy coupled hydrogen-based microgrid system based on the chameleon swarm algorithm according to claim 4, characterized in that, In step 4, the iterative steps for solving the lower-level optimization problem by the solver of the MILP optimization problem are as follows: In the lower-level optimization problem, the solution vector corresponding to each chameleon individual in the upper level is taken as a known quantity. The power of wind and solar renewable energy is directly calculated based on the input environmental parameters, including temperature, irradiance, and wind speed. The variables to be optimized include the operating power of the electrolyzer and fuel cell. and The charging and discharging power of the battery and wind and solar power curtailment and load reduction power The above-mentioned variables to be optimized form a 6-dimensional vector; To solve the lower-level optimization problem, the modeling language YALMIP was used to call the commercial Cplex solver to quickly solve the above 6-dimensional vector in Matlab. Each solution to the optimization problem represents the completion of a day's scheduling, and the hourly operating power of each device within a day is obtained.

6. The two-layer capacity configuration method for a multi-energy coupled hydrogen-based microgrid system based on the chameleon swarm algorithm according to claim 4, characterized in that, Based on the optimized solution from step 4, the fitness of all chameleon individuals is calculated using the optimization objective as the fitness function. The method for obtaining the optimal solutions for individuals and the overall optimal solutions is as follows: After knowing the optimization results of the lower level, the fitness of the configuration schemes corresponding to all chameleon individuals is calculated. This process models the fitness function of the upper-level optimization objective, i.e., the chameleon swarm algorithm, as follows: (42) In equation (42), C upper This represents the fitness function of the upper-level optimization, which is the sum of the lower-level costs, investment costs, and replacement costs of the microgrid operation. Indicates equipment investment cost, Indicates the cost of equipment replacement. This indicates the unit investment cost of each piece of equipment. and These represent the unit capacity cost of the hydrogen tank and the heat storage tank, respectively. Indicates the capital recovery coefficient. Y This indicates the estimated service life of the microgrid system, typically taken as 20 years. This indicates the voltage decay of the equipment over one year of operation. This indicates the amount of voltage decay that occurred during the operation of the equipment until it was scrapped. This indicates the total number of cycles a battery operates for one year.