Capacity Allocation Optimization Framework for Hydrogen Integrated Energy System Considering Hydrogen Trading and Long-Term Hydrogen Storage

As an essential part of the future national energy system, hydrogen energy has the advantages of clean, long-time scale energy storage and good complementary characteristics to electrical power, making it an important player in the low-carbon transformation of energies. However, the long timescale storage characteristics and tradability of hydrogen energy are rarely considered in existing capacity allocation optimization methods for hydrogen integrated energy systems(HIES). Meanwhile, the impact of the physical characteristics of the hydrogen storage equipment is rarely considered in the construction of HIES. Therefore, this paper proposes a new capacity allocation method for HIES in industrial park considering hydrogen trading and long-term hydrogen storage. The proposed capacity allocation optimization method is a bilevel mixed-integer linear programming model, which is solved by the reconfiguration decomposition algorithm. The nonlinear constraint problem due to the physical characteristics of the hydrogen storage device is solved by the Big-M method and the binary method. The proposed method can effectively improve the economy of HIES and reduce the cost of hydrogen production. Meanwhile, the reconstruction decomposition algorithm can effectively solve the bilevel mixed integer programing model. Case studies demonstrate that the proposed method can reduce hydrogen production economics by 28%. Considering hydrogen trading, the total investment and operating cost of HIES is reduced by 25%, while long-term hydrogen storage can reduce the cost of hydrogen production for HIES and reduce the impact of hydrogen trading fluctuations.

BT,bt battery EB,eb electrical boiler HIES hydrogen integrated energy system B. SETS δt time interval; n index of years, from 1 to N n s index of scenarios, from 1 to N s t index of dispatch periods, from 1 to N t χ index of equipments, including AC, EB, and CHP ψ index of equipments, including PV, WT, CHP, ELZ, FC, AC, EB, HS, BT, SHS C. PARAMETERS d discount rate L e/h/c/H electric/thermal/cool/hydrogen load power in season s at t I uc,pv/wt/elz/grid+ the investment cost of PV/WT/ELZ per unit capacity c ope,pv/wt/grid+ the operation and maintenance cost per unit of PV/WT c grid+ the operation and maintenance cost per unit of power purchase I grid+ the investment cost of power purchase per unit capacity c ope, elz the operating cost per unit power of ELZ c on/off, elz the startup/stop cost of the ELZ η on/off, elz the start/stop status of the electrolyser R the ideal gas constant T H gas temperature M H the relative molecular mass of hydrogen m max,shs/hs the maximum hydrogen storage mass of SHS/HS v shs,in/out the depth of hydrogen storage/release per unit capacity V hs,max the maximum volume of SHS Cap ψ,max maximum installed capacity of ψ P grid,max maximum electric power traded p pv/wt predicted unit output of PV/WT η elz/fc/ac/eb/chp efficiency of ELZ/FC/AC/EB/CHP η hs/bt/shs,+ charge efficiency of HS/BT/SHS η hs/bt/shs,-release efficiency of HS/BT/SHS γ bt/hs,loss the energy storage loss parameter of BT/HS ξ elz/fc the minimum load rate of ELZ/FC HHV H the calorific value of hydrogen v bt/hs the depth of BT/HS per unit capacity τ Lifetime D. OBJECTIVE FUNCTION c t,sell the price of hydrogen I ele the investment cost of electrical equipment J inv the equipment investment cost J ope the operation cost objective function C pv/wt/elz/fc annual investment cost of PV/WT/ELZ/FC C ac/eb/hp annual investment cost of AC/EB/HP C hs/bt/shs annual investment cost of HS/BT/SHS c ope,ac/eb/hp unit maintain cost of AC/EB/HP c t,grid+/grid-unit buy/sell electricity cost with grid I ψ unit investment cost of ψ c opeψ unit maintain cost of ψ U COH the hydrogen production cost economics indicator E. VARIABLES P pv/wt/fc/elz the power of PV/WT/FC/ELZ/ P grid+/grid-the power purchase/sale to the grid P bt+/bt-charge/release power of BT P chp/eb/ac the power of CHP/EB/AC S bt the state level of BT m elz/sell the mass of hydrogen produced by ELZ/hydrogen sold m inhs/ouths the inlet/outlet gas mass of the HS m inshs/outshs the inlet/outlet gas mass of the SHS C pv/wt the equipment capacity of PV/WT p t,shs/hs the pressure of SHS/HS at moment t n t,shs/hs the amount of hydrogen substance in SHS at moment t m s,t,shs/hs the mass of hydrogen in SHS/HS at moment t V shs/hs the volume of the SHS/HS m s,t,shs the mass of hydrogen stored in SHS at time t Cap ψ installed capacity of ψ ε elz/fc the operational status variables of ELZ/FC ε elz,on/off the startup/shutdown status variables of ELZ/FC ε grid,+/-the power purchase/sale status variables x ψ the capacity allocation status variable ψ

I. INTRODUCTION
The dependence on traditional fossil energy sources has caused the world to fall into an energy crisis. How to effectively get rid of the dependence on traditional energy sources is the main task of energy development [1]. Currently, the development of clean energy technologies and the decarbonization of energy supply are important paths to transitioning the energy crisis [2].To promote the development of new energy and improve the competitiveness of photovoltaic (PV) and wind turbine (WT) in the power market, the reduction of additional subsidies for PV and WT makes the tariff close to the traditional, which causes a decline in their income [3].
To maintain the revenue, reducing the wind and solar curtailment rate to reduce the production cost will be of practical significance. Hydrogen can enhance system flexibility, reduce the rate of wind and light abandonment and improve energy efficiency [4]. From the point of view of hydrogen production, the electricity generated by PV and WT can produce hydrogen through the electrolyzer(ELZ), which can solve the VOLUME 11, 2023 problem of wind power and photovoltaic power curtailment and promote the consumption of new energy. From the perspective of hydrogen consumption, the development of fuel cells, hydrogen stations, and other related industrial systems further promote the demand for hydrogen energy consumption in the energy market. Thus, making effective use of hydrogen energy has become particularly important. Renewable energy generation and electrolyzer hydrogen production have natural complementary characteristics, which help to consume distributed power and improve system stability at long time scales. Hydrogen energy has the advantages of a prolonged storage period and large storage scale, which can deploy renewable energy from a long time scale, increase the flexibility of multi-energy coupling in the time dimension, and realize the optimal allocation across regions and seasons. Therefore, it is significant to reduce the cost of hydrogen production and promote the development of the hydrogen energy industry. The research in this paper focuses on the optimization method of HIES capacity allocations considering the constraints of physical characteristics of hydrogen storage pieces of equipment and the average cost of hydrogen production on a long time scale.
Currently, hydrogen energy is involved in integrated energy systems by production and consumption. Designing an operational framework to achieve stable system operation development. For example, hydrogen production directly through the multi-terminal DC system of the IES reduces investment costs and line losses, thus increasing the potential for hydrogen production [5]. Some studies also consider the hydrogen energy and water cycle in the Micro Energy Grid and describe the uncertainty of new energy through a scenario generation method. Results show that it can ensure the balance between supply and demand of energy on the demand side when the structure of the power system changes and effectively improve energy utilization [6]. The authors in [7] take an integrated wind-hydrogen-thermal energy system into account and decompose the objective into two sub-problems, i.e., system operation cost optimization and electricity price game, utilizing the Nash bargaining algorithm. Such decomposition keeps the interests of each operation subject maximized while the overall interests are optimized. To study the feasibility of geothermal energy, the authors in [8] proposed a five-stage geothermal recovery and modeled a geothermalmulti-energy combined supply system containing electricity, cooling, hydrogen, and water. Results showed that the system operates with a high economy, providing a new scheme for an IES of the geothermal cycle. The authors in [9] use the dynamic multi-objective optimization algorithm to optimize the target by performing hydrogen production and seawater desalination for the photovoltaic-geothermal multi-energy system, which effectively reduces the investment cost of each piece of equipment and improves the hydrogen energy output. The authors of [10] proposed an IES dispatch method in the presence of high penetration of new energy sources. The excess power from PV and WT is stored by mixed air compression and electric hydrogen production and released when there is a peak in power consumption in the grid. At the same time, multiple optimization algorithms are integrated to optimize the scheduling of IES system operation, reduce the operating cost of the whole system, and minimize the pollution caused by air compression. The authors of [11] consider the load stochasticity of source-side renewables. The model is constructed to reduce the source-load uncertainty and improve energy efficiency by combining the distribution network and the heating network with electricity to produce hydrogen for cooperative scheduling. Part of the research considers the participation of hydrogen production in the distribution grid demand response and auxiliary methods from the distribution grid side, and constructs the optimization model of the distribution grid and distributed hydrogen production station to improve the flexibility of the distribution grid system [12], [13]. There is also research into the use of distributed optimization algorithms to solve the problem of benefit distribution among multiple entities in integrated energy systems [14]. The authors of [15] construct an optimal scheduling model for hydrogen energy integrated energy systems using information gap theory to portray the uncertainty of new energy sources. The method provides theoretical support for scheduling decisions containing uncertain IES.
In summary, most researchers focus on constructing suitable HIES according to different requirements and optimizing their scheduling strategies. However, in practical works, photovoltaic, wind power generation, as well as electric hydrogen production equipment have high investment costs and operating costs, which directly affect the practicability while constraining the operating state. The allocation capacity of the hydrogen storage tank is directly related to the hydrogen storage pressure. For example, the hydrogen storage(HS) station is generally pressurized to 35MPa to 70Mpa, while the long-term or seasonal hydrogen storage(SHS) is usually 2Mpa to 5Mpa. Therefore, the HIES optimal operation problem research should consider the capacity allocation of the equipment and the physical characteristics constraints associated with the hydrogen equipment. The authors of [16] propose a method for the optimal allocation of equipment capacity for an integrated energy system containing hydrogen-electric energy storage. The feasibility of hydrogen storage is illustrated by comparing the benefits of hydrogen storage with those of electric storage. The authors of [17] consider the problem of capacity allocation and optimal operation of hydrogen-containing islanded microgrids as a master-slave game problem. The results show that the hydrogen-containing islanded microgrid can operate stably and optimally. Hydrogen storage technology and methods are constantly improving, and hydrogen energy can be stored underground [18], such as in the usage of shale oil mines for hydrogen storage in the United States [19]. The seasonal energy storage of hydrogen energy supports a long time, large scale and wide spatial range energy transmission characteristics are the key technology to cope with the long time break of energy supply of high percentage renewable energy system [20]. Compared with pumped storage, compressed air storage, and other seasonal storage methods, hydrogen storage system structure, hydrogen storage methods, and energy conversion and utilization of various forms of characteristics, in large-scale, long-time energy storage mode have better benefits [21], [22], [23]. The authors of [24] proposed an IES scheduling model in which hydrogen production and seasonal hydrogen storage are coupled, and the optimal investment in hydrogen production is used as the objective function. The calculation results show that hydrogen energy can effectively improve the efficiency of integrated energy systems.
Nevertheless, there are still inadequate areas to consider, although the above-mentioned relevant research elements have contributed to Hydrogen integrated energy system(HIES). Firstly, previous studies usually focuses on the optimal scheduling and economic evaluation of hydrogen energy. There are relatively few studies on long-term optimal operation and capacity allocation of HIES. Secondly, the physical properties of hydrogen storage, as the substance with the smallest relative molecular mass, have a significant impact on the hydrogen storage system, and the physical properties of hydrogen at different pressures are very different. The existing main studies only consider hydrogen storage as a kind of energy storage, without considering the constraints brought by the physical properties of hydrogen storage equipment. Traditional capacity allocation optimization methods focus on the overall economic of the system. Therefore, they cannot reflect the economics of hydrogen production and hinder the development of hydrogen energy. To deal with the above challenges, this paper proposes a bilevle capacity allocation model for HIES that considers hydrogen trading and long-term hydrogen storage. The main contributions are as follows: • This paper proposes a new long-timescale capacity allocation model of HIES considering collaborative of source-load-storage. Compared with the traditional capacity allocation methods, the proposed model can reduce the operating cost and improve the economics of hydrogen production in the long term.
• Taking into account the safety and stability of HIES, this paper considers not only the operational constraints such as the start-stop of hydrogen production equipment but also the physical characteristics constraints of long-term hydrogen storage equipment. And the Big-M method and binary method are used to solve the nonlinear constraint problem brought by physical characteristics. The impact brought by hydrogen trading in the HIES capacity allocation is analyzed.
• The reconfiguration decomposition algorithm is used to solve the bilevel linear programming problem in the proposed model. The proposed method has more accurate optimization results accompanied by less computational effort.
The main structure of the paper is shown below. The main structure of the paper is shown below. The structure of the HIES is proposed in Section 2. Section 3 introduces seasonal hydrogen storage's working principle and working mode and builds a seasonal hydrogen storage operation model. The multi-objective optimization problem of HIES based on the reconstruction and decomposition algorithm is given in Section 4. Examples are provided to verify the obtained results in Section 5. Finally, Section 6 concludes this paper.

II. PROBLEM FORMULATION
The reconstruction decomposition algorithm is used to solve the HIES capacity allocation optimization model proposed in this paper considering hydrogen trading and long-term hydrogen storage. So, Structure of the HIES is presented in the first subsection. The basic formulation of the proposed capacity allocation optimization method and modeling of long-term hydrogen storage are provided in the second subsection. The detailed flowchart for using the reconfiguration decomposition algorithm in the proposed capacity allocation optimization model for HIES in the third subsection. Finally, cases are set from the objective function, hydrogen trading, and different application scenarios. The optimization effect of the proposed capacity allocation optimization model is analyzed.

III. STRUCTURE OF THE HIES
This paper mainly studies the capacity allocation of HIES. The system is primarily composed of a renewable power supply, combined heat, and power generation (CHP), and electric hydrogen production system, as shown in Fig. 1. The hydrogen production and storage device coupled with WT and PV produces hydrogen efficiently through energy conversion technology to realize high-quality and high proportion grid connection of WT and PV. When the WT and PV generation exceeds the demand of the power grid, the control system starts the AC/DC converter, and the electrolyzer(ELZ) absorbs the excess power from the PV and WT and stores it as hydrogen energy. Otherwise, the control system starts the DC/AC converter. The fuel cell supplements the lack of power, which improves the system's operating efficiency. The hydrogen energy storage devices are divided into short-term hydrogen storage devices (HS) and seasonal hydrogen storage devices (SHS). They are used to meet the daily hydrogen energy scheduling of the system and the hydrogen energy consumption under long-term operation conditions, respectively.
To improve the reliability of the system during operation. The system is able to purchase and sell electricity with the grid. To achieve flexible scheduling between multiple energy sources, CHP is added to the HIES system to meet the Heating and cooling load demand. The HIES system has interactive relationships and constraint characteristics that affect the efficiency and sustainability of coupled multi-energy utilization. Energy balance constraints for HIES are as L e = P pv + P wt + P grid+ + P fc + P bt- L e = η ac P ac (3) where (1)

IV. CAPACITY ALLOCATION OPTIMIZATION MODEL FOR HYDROGEN INTEGRATED ENERGY SYSTEM
In order to improve the utilization of hydrogen energy and to meet the security and stable supply of energy, a reasonable capacity allocation is made for the HIES, while ensuring the lowest possible investment and operation costs and hydrogen production costs [25]. But the different output characteristics of PV and WT affect the average cost of hydrogen production. The hydrogen production economic is associated with the operating power of PV, WT, and ELZ, which changes the economics of the HIES. Hence, the cost of capacity allocation and system operation cost are mutually influenced, and it is not easy to obtain the optimal economy. To solve the above problems, the bilevel MILP model is constructed. The optimization goal of the upper level is to minimize the equipment investment cost and the annual operating cost. The result of the upper level is taken as the known condition of the lower level. The result of the upper level is taken as the known condition of the lower level, and the optimization objective of the lower level is the minimum hydrogen production economic index. Through repeated iterations, the optimal annual investment and operating cost, and average hydrogen cost can be obtained. The frame diagram of the upper and lower levels is shown in Fig. 2.

A. HYDROGEN PRODUCTION ECONOMIC INDEX
The hydrogen production economic index is the cost per unit of hydrogen output. U COH indicates the ratio of the hydrogen energy production of HIES to the total investment operating cost during the construction cycle. In this paper, hydrogen energy production is obtained only through electrolyzers. The electrical power used to generate hydrogen is primarily from excess PV, WT, and purchased electricity from the grid. Hydrogen energy is obtained only from electrolytic water technology. The electrical power used to generate hydrogen is primarily from excess PV, WT, and purchased electricity from the grid.
where I ele indicates the investment cost of electrical equipment, I elz indicates the investment cost of electrolyzer,n indicates the years, from 1 to N n , s indicate scenarios, from 1 to N s , t indicates dispatch period, from 1 to N t , p(s) represents the possibility of scenario s, d indicates discount rate.
I ele = l hr (I uc,pv Cap pv + I uc,wt Cap wt ) + D ope,ele (7) c ope = c ope ,pv P pv + c ope, wt P wt + c ope,grid+ P grid+ (9) where l hr indicates the load proportion of hydrogen energy; I uc,pv/wt/elz/grid+ indicates the investment cost of PV, WT, ELZ and power purchase per unit capacity, Cap pv/wt indicates the equipment capacity of PV and WT; c ope,pv/wt/grid+ indicates the operation and maintenance cost per unit of PV and WT, and power purchase; P pv/wt/grid+ indicates the power generated by PV and WT, and the power purchased from the grid respectively. δt indicates the time interval; d indicates the annual return on investment in equipment.
C ope,elz = c ope, elz P elz + c on,elz η on,elz + c off,elz η off,elz + c degr,elz P fluc,elz (11) where c ope, elz indicates operating cost per unit power of ELZ; c on/off, elz indicates the startup/stop cost of the electrolyser; η on/off, elz indicates the start/stop status of the electrolyser; (5) indicates the cost per unit of hydrogen production in terms of the ratio of the total cost of the hydrogen-producing electrical equipment to the total amount of hydrogen produced. (6) indicates the hydrogen load ratio, which represents the ratio of hydrogen energy demand to total energy demand. (7)-(9) indicate the investment and operating costs of hydrogen production power equipment within the investment cycle. (10)-(12) indicate hydrogen production equipment's investment and operating costs.

B. HYDROGEN STORAGE SYSTEM MODEL
The hydrogen storage equipment is divided into high-pressure hydrogen storage and low-pressure hydrogen storage according to the hydrogen pressure requirement. SHS is low-pressure hydrogen storage, HS is high-pressure hydrogen storage. The hydrogen storage pressure of HS can reach 20MPa, while the storage pressure of SHS is generally 2-5MPa [26]. Mathematical modeling of hydrogen storage equipment based on the ideal gas model equation of state.
p t,shs/hs V shs/hs = n t,shs/hs RT H (13) m s,t,shs/hs = M H n t,shs/hs (14) where p t,shs/hs indicates the pressure of SHS at moment t; n t,shs/hs indicates the amount of hydrogen substance in SHS at moment t; m s,t,shs/hs indicates the mass of hydrogen in SHS at moment t; R indicates the ideal gas constant;T H indicates gas temperature; M H is the relative molecular mass of hydrogen; V shs/hs indicates the volume of the SHS/HS. At constant temperature, p t,shs and m s,t,shs in SHS are linearly related. SHS needs to meet the constraints of hydrogen storage timing characteristics, hydrogen storage pressure limit, maximum hydrogen storage and hydrogen release in operation, etc. The following SHS operation models are established in this paper. (15) is the time series relationship of hydrogen storage capacity. (16) indicates the initial capacity of shs. (17) indicates that the SHS is charged and discharged in equilibrium within a charge/discharge cycle. (18) indicates the safe operation constraint of SHS to guarantee that the pressure of SHS is within the safe range.  There is a nonlinear term form of the product of two continuous variables in (13). The nonlinear constraint is solved by the binary method and the big-M method. The methods are as follows.
where W x and m are continuous variables; δ x n indicates a binary variable; τ x n indicates the auxiliary variable; (22) represents the discretization of the continuous variable. p indicates the number of binary digits; y indicates the resolution.

C. OPTIMAL INDICATORS OF ANNUAL INVESTMENT AND OPERATING COSTS
The upper-level objective function is the minimum annual investment and operation cost of the system, including equipment investment cost, operation, and maintenance cost, electricity purchase cost, gas purchase cost, and environmental cost. The decision variables of the upper-level objective function include each equipment allocation capacity, operating power, and start/stop variables, the mathematical model of the upper-level objective function is min x,y,z J total = J inv + J ope (28) where decision variables x = [x pv , x wt , x elz , x hs , x fc , x shs , x eb , x ac , x bt , x chp ] indicates the device configuration status variable. y = [P pv , P wt , P elz , P elz,fluc , P fc , P eb , P ac , P hs , P shs , P grid + , P grid− , P chp ] indicates the continuous variable of equipment operation status. z = [ε elz,on/off , ε shs+ , ε shs− , ε grid+ , ε grid-, ε elz , ε fc ] indicates the state variable related to hydrogen production.
c ope,pv P pv + c ope,hs (P hs+ + P hs− ) + c ope,elz P elz + c on,elz ε on,elz + c off,elz ε off,elz + c ope, shs (P shs + + P shs-) + c ope,fc P fc + c ope,eb P eb + c ope,bt (P bt+ + P bt− ) + c ope, ac P ac + c degr,elz P fluc,elz + c ope ,gb P gb +c ope,wt P wt −c t,sell m sell (33) (28) indicates the annual investment operating cost. J inv is the equipment investment cost; J ope is the operation cost objective function. (29) (34) indicates that the sum of the total probabilities of each possible run scenario is 1. (35) indicates the maximum value of the installed capacity of the equipment. (36) indicates the system equipment operating power and the start-up and shutdown costs associated with the hydrogen production equipment at a minimum average hydrogen cost.
S bt,s,t = 1 − γ bt,loss S bt,s,(t−1) + P bt+,s,t η bt+ − P bt−,s,t /η bt− t m hs,s,t = 1 − γ hs,loss m hs,s,(t−1) + m inhs,s,t η hs,in − m ouths,s,t /η hs,out t (54) S bt,(s,0) = S bt,(s,24) ; m hs,(s,0) = m hs,(s,24) (55) 0 ≤ P grid+,s,t ≤ ε grid+,s,t P grid,max 0 ≤ P grid−,s,t ≤ ε grid-,s,t P grid,max (56) ε grid+,s,t + ε grid−,s,t ≤ 1 Although HS and BT have different physical characteristics, they have the same operating characteristics. (53) indicates the charging and discharging power constraint of the BT and HS. v bt/hs indicate the depth of BT/HS per unit capacity; (54) indicates the capacity constraint of the energy storage equipment. γ bt/hs,loss indicate the energy storage loss parameter of BT/HS. η hs,in/out indicate the inlet and outlet hydrogen efficiency of hs; (55) indeicates the intra-day cycle constraint of hydrogen storage; (56) indicates the power limit for the power purchase and sale to the grid. (57) indicates the state constraint on the power purchase and sale to the grid.

V. SOLVING METHODS
In this paper, the constraint and objective function models are simplified using matrices to facilitate the description of the solution method [28]. In summary, the capacity allocation problem in this paper can be simplified to an upper and lower mixed linear integer model problem. The optimal solution of the lower layer is used as the constraint of the upper optimization model, and the original problem is transformed into a mathematical programming problem with equilibrium constraints (MPEC) to be solved. However, in this paper, the variables connecting the upper and lower optimization problems are 0-1 variables. This leads to the fact that when solving the bilevel optimization model directly, the lower model does not have a strong dual relationship, which makes the conventional bilevel mixed linear integer model unable to solve the optimization model effectively. To address this problem, this paper uses a reconstruction and decomposition algorithm for the column constraint generation method to decompose the problem of this paper into a master problem(MP) and two slave problems (SP1,SP2).
The master problem is the annual investment operation cost, while the economics of hydrogen production is brought into the master problem as a constraint, and the master problem is expressed as = min x,y,z where the pairwise auxiliary variables κ and µ are introduced for decoupling in the master problem and q is the number of iterations in the master problem. The introduction of pairwise variables in the constraint equation exists and two nonlinear variables, which are linearized by using the big-M method for solving. Ax ≤ b indicates capacity allocation constraint. Ey = h + Fx is the constraint to be satisfied to guide the optimization of the production cost of hydrogen production of the system in the direction of reduction after the introduction of auxiliary variables. Others are equation constraints on the pairwise auxiliary variables. Allocation capacity obtained by MP optimization. The model of SP1 can be expressed as follows.

SP1
: where x * is the device state parameter under the optimal solution of the SP1. SP2 is to optimize the system operating cost. After obtaining the allocated capacity of the system through the MP. Use the result of SP1 as a constraint. The system operating cost of SP2 is optimized and the model can be expressed as follows.  where (x * ) is the optimization result of SP1, which indicates the system hydrogen production cost.
The convergence criterion is set to determine whether the problem is solved optimally. UB is the upper bound, which is the objective function φ (x * ) of SP2, LB is the lower bound, which is the objective function of the MP.
where δ is the convergence accuracy. The original problem is decomposed into a master problem and two subproblems, which are both mixed-integer linear programming problems, and solved using the solver in MATLAB. The algorithm-solving steps are shown in Fig. 3.

VI. CASE STUDY A. BASIC SETTING
The efficiency, lifetime, and investment cost per unit capacity of the equipment are shown in Table 1. The parameters of  ELZ efficiency is ε elz,s,t = 0.65 [29]. The lifetime of ELZ is 20 years [30]. By collecting data from the official website of China, the unit investment cost of ELZ is 13000 /kWh. The corresponding operation and maintenance cost of ELZ is 0.014 /kWh, and the start and stop costs are 0.95 /kWh and 0.048 /kWh respectively. Equipment aging cost is 0.005 /kWh [31]. Electricity sales, operation, and maintenance costs and hydrogen storage maintenance costs are respectively set to 0.75 /kWh, 0.01 /kWh, and 0.1 /kWh. Table 7 indicates the equipment operation parameters of the system, which are the maximum limit of supply power and allocation capacity, and the self-release rate of each energy storage element in the system. The advantages of SHS are longer storage time and lower maintenance cost, so the self-release rate of HS and SHS are set to 0.1 and 0.05, respectively. Table 8 indicates the corresponding time-of-use tariff. The unit capacity power curves of daily PV and WT are shown in Fig. 13-16, which indicate the curves of each load in four seasons, respectively. Fig. 17 indicates the unit capacity power generation of PV and WT at each hour in different seasons. Tables 1-2 show the results of the allocation for different targets with a hydrogen sale price of 20 yuan and the hydrogen price fluctuation volume of 10 yuan. As can be seen from tables 1-2, considering both the economics of hydrogen production and hydrogen trading can lead to better economics and promote hydrogen energy development. The proposed method is proven to be efficacious. If only the total investment operating cost target is considered, although the total investment operating cost is slightly lower, the hydrogen production economics target is too high. This indicates that the investment cost in hydrogen production equipment is too high. Currently, the high investment cost of hydrogen production equipment makes the single-objective allocation optimization method difficult to implement in practice. The method proposed in this paper optimizes the capacity of hydrogen production equipment in the HIES system, resulting in a 28% reduction in the hydrogen production economics index. It is shown that the method can meet the demand while reducing the hydrogen energy equipment investment. Meanwhile, if HIES does not consider hydrogen trading, the total investment operating cost is too high, although it can reduce the hydrogen production economics index. This paper considers hydrogen trading in the capacity allocation optimization method, which reduces the cost by 25%. It shows that expanding the hydrogen market is important for hydrogen energy development.

2) ANALYSIS OF THE IMPACT OF HYDROGEN TRADING AND SHS ON HIES
The effect of hydrogen price on HIES is analyzed first. In Fig. 4, J total indicates the total investment operating cost of the system, U COH indicates the average cost of hydrogen production, and the horizontal coordinate is the hydrogen price. As shown in Fig. 4, when the price of hydrogen is fixed and gradually increases, the total investment operating cost of HIES will gradually decrease. When the fixed hydrogen price is low, HIES with SHS has a lower total operating investment cost, but as the fixed hydrogen price increases, HIES without SHS has a lower total operating investment cost. The reason for this is that the high and stable price of hydrogen leads to profitable hydrogen sales, and HIES is allocating capacity to increase hydrogen production for sale without storage, thus reducing total investment and operating costs. However, increasing the amount of hydrogen production must increase the investment in hydrogen production equipment, and there is no SHS for long time scale scheduling, which leads to a high economic index of hydrogen production and limits the development of hydrogen energy. Meanwhile, when the low fixed hydrogen price is mainly used to meet the hydrogen demand, the long time scale scheduling of HIES containing SHS makes the economic index of hydrogen production lower, indicating that the long time scale of hydrogen storage can effectively reduce the cost of hydrogen production.
The results of the capacity allocation for each fixed hydrogen price are shown in Fig 5. In this case, the capacity of SHS is described by the storage volume. From Fig 5, it can be observed that FC is not capacity allocated at various fixed hydrogen prices. The reason for this is the high investment and operation cost of FC, which leads to poor economics of using FC to participate in HIES. The main reason is that HS requires pressurization, decompression and other related operations for hydrogen storage, resulting in higher investment and operating costs for HS. The BT is mainly used for intra-day energy storage scheduling and does not have the capability of long time scale energy storage. The time-of-day tariff set in this paper is relatively flat and it is difficult to obtain economic improvement in intra-day dispatch, which leads to BT not being considered for capacity allocation in HIES. It can be found that the capacity of ELZ gradually increases with the fixed hydrogen price, indicating that the excess ELZ is mainly used to participate in hydrogen trading. The capacity of SHS gradually decreases, indicating that HIES does not need to be allocated with high-capacity SHS when the high and stable hydrogen price can directly obtain a higher yield. Simultaneously, comparing HIES with SHS and without SHS, it can be found that more PV and WT need to be allocated in HIES without SHS, which matches the allocation cost situation in Fig 4. In terms of hydrogen use, the demand is high in winter and low in spring and autumn. Thus setting the hydrogen price low in spring and summer and high in winter. Hydrogen price fluctuation is carried out based on 20 yuan/kg, and the amount of hydrogen price fluctuation is reduced in spring and summer, maintained at 20 yuan in autumn, and raised in winter. Following the above approach, the price fluctuations of hydrogen prices are simulated on long time scales. In Fig 6, the horizontal coordinate indicates the hydrogen price fluctuation. The increase in the hydrogen price VOLUME 11, 2023  fluctuations results in a small decrease in operating investment costs. Compare the operating cost of investment with and without SHS. In the HIES system with SHS, the overall operating cost increases slightly and then decreases gradually with the increase of hydrogen price fluctuation. In the HIES system without SHS, the total investment and operation cost decreases gradually with the increase of hydrogen price fluctuation, but the decrease is small and the total investment and operation cost does not change much. At the same time, the hydrogen price fluctuation is improved, and HIES with SHS has a lower investment operation cost than HIES without SHS. In terms of the hydrogen production economy, the hydrogen production economy index of HIES without SHS is high and does not change much with the fluctuation of hydrogen prices. The hydrogen production economy index of HIES with SHS is low overall and decreases gradually with the increase of hydrogen price fluctuation. It shows that when the hydrogen price fluctuates seasonally, SHS can reduce the total investment operating cost of HIES, obtain a lower average cost of hydrogen production, and effectively smooth out the fluctuation of hydrogen price.
In Fig. 7, shs/Noshs-2/4/6/8 indicates the results of the capacity allocation with and without SHS for HIES at  hydrogen price fluctuation volumes of 2, 4, 6, and 8 yuan, respectively. From Fig. 7, it can be found that as the amount of hydrogen price fluctuation increases, it will increase the capacity demand for SHS, thus smoothing out the impact of hydrogen price fluctuation. The capacity requirements of PV, WT and ELZ in HIES systems with SHS are lower compared to the HIES without SHS. It shows that SHS can reduce the capacity allocation requirement of HIES and improve the system efficiency when there are long-timescale price fluctuations in hydrogen trading.

3) CASE ANALYSIS
The hydrogen price is set to 20 yuan/kg and the hydrogen price fluctuation is 10 yuan. Different application scenarios are set for HIES to verify the effectiveness of the proposed method and system. The cases settings are shown in Table 3.
Cases 1-5 represent different conditions of the hydrogen integrated energy systems.
• Case 1: the allocation of an hydrogen integrated energy system without considering renewable energy sources.
• Case 2: the optimal allocation of an hydrogen integrated energy system in an isolated island environment.
• Case 3: the use of electric energy only as of the energy supply method of the system with considering renewable energy sources.
• Case 4: the exclusion of seasonal hydrogen storage equipment.
• Case 5: all the conditions are considered. The annual investment and operating costs and the economics of hydrogen production were used as indicators to optimize the capacity allocation for each of the five cases. The results are shown in Table 4.  From Tables 4 and 5, Case 5 indicates the scenario where all equipment is considered, corresponding to good total investment operating costs and hydrogen production economics. Case 5 will be used as a reference for other cases. Case 1 is hydrogen production by purchasing electricity from the grid without considering renewable energy. The lack of investment cost of PV and WT leads to a low economic index of hydrogen production, but with a high total investment cost. The reason for this is that the total investment operating cost depends mainly on the electricity purchase price. When the cost of hydrogen production through power purchase is too high, it is difficult to participate in hydrogen trading, resulting in high total investment operating costs. Moreover, Case 1 relies excessively on electricity prices for regulation, resulting in less flexibility. Moreover, Case 1 relies excessively on electricity prices for regulation, resulting in less flexibility. Case 2 represents the HIES in the islanded operation state. Since the HIES cannot get electricity from the grid, it needs to increase the allocated capacity of renewable energy to meet the load demand, which leads to an increase in total investment and operation cost and hydrogen production equipment cost. Meanwhile, the increase of system capacity allocation enhances the production capacity of HIES, which reduces the total investment and operation cost of HIES by participating in hydrogen trading but cannot reduce the cost of hydrogen production equipment. Case 3 indicates that CHP is not considered and electrical energy is used to meet multiple energy supplies. The total investment operation cost is low due to the reduction of CHP configuration operation cost. At the same time, more electricity is needed to meet the cold and heat energy supply, which increases the allocation capacity of renewable energy thus leading to poor economics of hydrogen production. Reduces the flexibility of multiple energy scheduling and cannot meet the existing requirements. Case 4 indicates HIES without considering SHS. although it has good economics of hydrogen production, other forms of energy storage have higher operation and maintenance costs in long time scales compared to SHS, so the total investment operation cost is relatively high.
In summary, case 5 is more comprehensive and reasonable in terms of total investment operating costs and hydrogen production economics. Therefore, the energy analysis is conducted for case 5. In Figs. 8-10, different energy type balances are shown for a typical day of four seasons after capacity allocation optimization under Case 5. Fig. 8 shows the electrical energy balance, Fig. 9 shows the hot and cold energy balance, and Fig. 10 shows the hydrogen energy balance. In Fig. 8 is the result of the electrical load energy balance. PV and WT are complementary in terms of power, and PV power is supplemented by WT and CHP generation in the trough. To obtain better economics, electricity is purchased from the grid at times of low electricity prices. Under the condition of satisfying the basic electric load, a flexible supply of heating and cooling loads is provided through energy inter-coupling. It shows that HIES power generation is in various forms and the power supply of the HIES system has good flexibility. The ELZ is powered throughout the power supply cycle to guarantee hydrogen production, thereby reducing hydrogen costs and improving the economics of hydrogen production. After meeting the corresponding demand, the excess power is sold to the grid to reduce the total investment cost. Also, the method in this paper optimizes the capacity allocation reasonably, so that there will not be excessive sales of electricity to the grid due to excessive capacity allocation. The stable operation of the grid is guaranteed. In Fig. 9 the results of the cooling and heating energy balance are shown. In this paper, a large amount of cold load is set to be concentrated in summer, while the corresponding heat load is mainly in spring, autumn, and winter. From the Fig. 9, it can be found that the cooling and heating loads of the system of HIES are   provided by EB and CHP respectively in a complementary way. The power supply sources renewable energy generation and power purchased from the grid, and CHP consumes mainly natural gas, so the power output ratio of EB to CHP is affected by the price of natural gas. The results show that the heating load is supplied with good flexibility for different scenarios. Fig. 10 shows the hydrogen energy balance. From the Fig. 10, it can be found that the electrolyzer has a high utilization rate after capacity allocation optimization to meet the economical requirements of hydrogen production. After meeting the relevant hydrogen load in spring and summer, the additional energy is stored in the form of hydrogen energy for a long period through SHS. The hydrogen is sold in the  fall and winter when the hydrogen price is high. The results show that the HIES proposed in this paper can meet the flexible scheduling of energy in medium and long-term time scales.
The results of the algorithm iterations in Case 5 are shown in Figures 11 and 12. Fig. 11 represents the iterative process of UB and LB. Fig. 12 represents the iterative process of convergence accuracy δ. From Figs. 11-12, it can be found that UB and LB are approximated gradually with the number of iterations. At 37 iterations, UB and LB are closest, and δ obtains the minimum value, indicating that the optimal solution is obtained. The iterative results show the effectiveness of the algorithm. Further observation of the iterative process reveals that the value changes are relatively large in the beginning stage, indicating that the number of iterations and the initial value selection are related. Meanwhile, the number of iterations increases, the smaller the value of U COH , while the LB is gradually increasing. Therefore, when UB and LB are closest, the balance between the economics of hydrogen production and the total investment operating cost is obtained in terms of achieving economics, and thus both objectives are considered to be optimal.

VII. CONCLUSION
To promote the development of hydrogen energy and reduce its investment cost and operation cost. This paper proposes a   framework for the operation of the HIES considering hydrogen trading and long-term hydrogen storage, optimizing the capacity allocation and improving energy use efficiency. Main conclusions are as follows:   1) In the capacity allocation optimization framework of HIES, not only the operational constraints such as start-up and shutdown of hydrogen production equipment but also the physical characteristics constraints of long-term hydrogen storage equipment are considered. The results show that the long-term hydrogen storage facility has small space requirements and yet allows flexible dispatch on long-time scales. Theoretical support is provided for the advantages of long-timescale hydrogen storage in HIES. 2) The reconstruction and decomposition algorithm is efficient in solving the bilevel model in this paper. It can solve the non-convex problem in the model.

3)
The results of the case study show that the proposed capacity allocation optimization method can achieve better economic results in terms of hydrogen production costs while keeping the total investment and operating costs under control. The consideration of hydrogen trading in the HIES brings the total investment operating costs down further, demonstrating the importance of the hydrogen market for the development of HIES. By simulating the price fluctuation of hydrogen price on a long time scale, it is demonstrated that long-term hydrogen storage can effectively smooth out the impact of hydrogen price fluctuation and improve the robustness of HIES in terms of economics.
In future work, this paper only studied the problem of optimizing the capacity allocation of HIES. However, the impact of renewable energy and load uncertainty on HIES capacity allocation is not considered, which needs further research. CHEN SHENGYU is currently with the School of Automation Engineering, Guangdong University of Technology, Guangzhou, China. Her current research interest includes integrated energy system planning and operation. VOLUME 11, 2023