Keywords

1 Introduction

With the “carbon peak-carbon neutral” goal proposed, power, transportation, and production links to speed up the transition to a deep low-carbon clean, hydrogen energy as an important clean energy, several developed countries have promoted the development of hydrogen energy industry as a national strategy. China also plans to include hydrogen energy in the energy category [1]. And from the central to the local issued a number of renewable energy to promote the development of hydrogen and hydrogen vehicles [2, 3]. Now, during the Beijing Winter Olympic Games, hydrogen energy has been fully demonstrated in this Beijing Winter Olympic Games, including more than 1,000 hydrogen-powered vehicles, equipped with more than 30 hydrogen refueling stations, in order to ensure the demand for hydrogen energy for the Winter Olympic Games, construction of large-scale hydrogen production projects in Zhangjiakou and other places. From the perspective of hydrogen demand, hydrogen-powered vehicles are more suitable for the “three north” winter low-temperature environment than electric vehicles because of their fast hydrogenation speed, long range and environmental friendliness, in recent years, it has gained wide attention and developed rapidly [4]. Hydrogen stations will also proliferate in the future, as they are a prerequisite for the rapid development of hydrogen-powered cars. The integration of renewable energy hydrogen production and power generation into the grid will not only enable new energy consumption and promote green energy development, but also be in line with the current situation of the Zhangjiakou region's energy supply for the Beijing Winter Olympic Games. Therefore, hydrogen production system based on renewable energy and supported by DC microgrid will be the best way to achieve low-carbon environmental protection, and zero-carbon power plus hydrogen energy is the only way to optimize the energy structure in the future [5], this has also become the current hot spot of scholars.

Literature [6] optimizes the operation of the comprehensive energy system of the hydrogen production unit containing wind power, which can meet the needs of electricity, hydrogen and heat at the same time. Reference [7] established a two-tier model for configuration optimization of grid connected offshore wind power hydrogen energy system, and studied the configuration and economy of the system by means of net present value. Literature [8] designed a hybrid new energy system including wind power, photovoltaic and hydrogen energy storage, and used the objective fitness function to model, and achieved good capacity optimization results Literature [9] designed the hydrogen energy storage system with heat balance system, established the wind hydrogen hybrid system, and proposed the optimal allocation method of hydrogen energy storage capacity of wind hydrogen hybrid system considering the uncertainty of heat balance. The above research optimizes the static capacity configuration of the integrated energy system containing hydrogen energy, and there is no subsequent dynamic optimization of the static configuration.

Literature [10] cooperates with three main body of the scene, based on the Nash negotiation theory, the operation model is established. Finally, through example verification, the operational operation of the proposed cooperative operation can be greatly improved. And the overall benefits of the cooperation alliance. Literature [11] is optimized by hydrogen energy-natural gas multi-energy storage systems, and the economics and environmental protection of electric hydrogen and electricity gas are verified. Literature [12] constructed the optimal scheduling model of wind hydrogen system with the optimization objective of hydrogen production efficiency, solved the optimal hydrogen production power by using artificial bee colony algorithm, and verified the effectiveness of the proposed method through simulation analysis. Literature [13] established the optimal scheduling model of integrated energy system with hydrogen production system with the goal of minimizing operation cost and environmental cost, and solved the optimal daily operation scheduling scheme of the system by using NSGA-II algorithm., Literature [14] proposed a low-carbon operation method of integrated energy system considering electrothermal flexible load and fine modeling of hydrogen energy. The static capacity configuration of hydrogen production equipment is not considered in the above literature.

Literature [15] established an island microgrid model including hydrogen production system and cogeneration, used robust optimization method to deal with the uncertainty related to photovoltaic output, electric load and heat load demand, and verified the effectiveness of the robust optimization used to deal with relevant risks, but static configuration optimization was not considered in the system. Literature [16] is electrically and hydrogen into the energy carrier, and a double-layer mixed integer planning model is proposed. The upper layer model is intended to improve system economy, optimize the device configuration to meet regional energy demand; The lower layer model aims to minimize the average cost of hydrogen production in order to promote the development of hydrogen. Among them, in the upper equipment capacity configuration, the economy of the system is the goal to determine whether the equipment is put into construction, rather than determining the equipment to be put into construction first and then optimizing the optimal capacity. Literature [17] uses a two-stage distributed robust optimization model to deal with the uncertainty of load. In the first stage, it optimizes the equipment safety capacity and time in the integrated energy system. In the second stage, it mainly optimizes and determines the “worst” operation scenario that the integrated energy system may encounter in the future and optimizes the system operation scheduling. Literature [18] For the renewable energy area integrated energy system to improve economic and scheduling flexibility, a double robust game model is proposed, and multi-target whale optimization algorithm is used to address constraint complex mixing integers nonlinear planning issues, verify the feasibility of the model and the effectiveness of the algorithm of the model by case analysis. The system in the above two documents did not consider hydrogen energy. Based on this, aiming at the uncertain load and renewable energy output, a two-stage distributed robust optimization model based onH2-RES system is established. Firstly, the capacity of hydrogen production system is statically optimized, and then the dynamic operation of the system is scheduling optimized.

During the operating scheduling of theH2-RES system, the flexible load of the electric load can be changed by changing its own size and time period, and further optimizing the smooth load curve to improve the operational flexibility and economic benefits ofH2-RES.Literature [19] For the problem of low-carbon economy optimization operation in the integrated energy system of hydrogen energy to energy conversion medium, the impact of flexible load on adjustment system optimization operation, and established flexible load model. Literature [20] established IES two-stage distribution robust optimization scheduling model considering flexible loads, verifying that flexible loads can improve the economic benefits of the IES system operation.

Based on the existing literature, this paper takes the hydrogen production system from renewable energy sources as the research object. Firstly, the capacity of the hydrogen production system is optimized for the uncertainty of renewable energy sources and the local electric load and hydrogen load. After the static configuration optimization, the daily operation scheduling of the hydrogen production system from renewable energy sources is optimized. For the uncertainty of renewable energy, considering the investment cost of hydrogen production system and the impact of the flexible load of electric load participating in the electric load regulation on the optimal operation of the system. A two-stage distributed robust optimization model of hydrogen production system from renewable energy driven by the worst scenario is constructed and applied to practical engineering projects, which has good feasibility.

The structure of the remainder of this paper is as follows. Section 2 introduce the structure and model of renewable energy hydrogen production system, Sects. 3 and 4 respectively introduce the objective function and model of static configuration and dynamic scheduling of the system, Sects. 5 and 6 respectively introduce the two-stage robust programming model and its solution method of the system, and Sect. 7 introduces the case analysis of the method proposed in this paper.

2 H2-RES Structure and Model

Figure 1 shows the complete structure diagram of renewable energy hydrogen production system. It mainly includes fan, photovoltaic, storage battery, power grid, alkaline water electrolyzer, hydrogen compressor, hydrogen storage tank, etc. Part of the fans and photovoltaic power generation is used for residential power load, and the other part is used for hydrogen load of hydrogen fuel vehicles. The hydrogen produced by the electrolytic cell is compressed by the hydrogen compressor and then sent to the hydrogen storage tank. The compressed hydrogen gas is transported to the hydrogenation station through the hydrogen long pipe trailer to supply the hydrogen demand of hydrogen fuel vehicles. The battery in the system plays a buffer role. When the available energy is insufficient, it is discharged through the battery first. If the electric load and hydrogen load are still not met, it is necessary to purchase electricity from the power grid. When there is still electricity left after the electricity load and hydrogen load can be met by generating electricity from renewable energy, the battery can be charged or sold to the power grid according to the actual situation. In order to deal with the uncertainty of wind and solar output, the worst scenario driven distributed robust method is used to optimize the system. In terms of power load demand, flexible load is considered in this paper.

Fig. 1.
figure 1

H2-RES structure

3 The H2-RES Capacity Configuration Phase

The capacity configuration stage of H2-RES is mainly to configure the optimal capacity of electrolytic cell, hydrogen compressor and hydrogen storage tank in the hydrogen production system. The goal is to minimize the daily average investment cost on the premise that the system can operate normally under all the worst probability scenarios:

$$ min\,F_{1} = \frac{{\rho_{ED} M_{ED} + \rho_{HC} M_{HC} + \rho_{HS} M_{HS} }}{N} $$
(1)

In the formula, \(\uprho _{{{\text{ED}}}}\) represents the unit capacity investment cost of the electrolyzer, \(\uprho _{{{\text{HC}}}}\) represents the unit capacity investment cost of the hydrogen compressor, \(\uprho _{{{\text{HS}}}}\) represents the unit capacity investment cost of the hydrogen storage tank; \({\text{M}}_{{{\text{ED}}}}\), \({\text{M}}_{{{\text{HC}}}}\), \({\text{M}}_{{{\text{HS}}}}\) represents the capacity of the electrolyzer cell, hydrogen compressor and hydrogen storage tank respectively, and N represents the total number of days in a year, taking 365 days.

The upper and lower limits of the capacity of the electrolyzer, hydrogen compressor and hydrogen storage tank are as follows:

$$ 0 \le M_{ED} \le M_{ED,max} $$
(2)
$$ 0 \le M_{HC} \le M_{HC.max} $$
(3)
$$ 0 \le M_{HS} \le M_{HS,max} $$
(4)

\({\text{M}}_{{{\text{ED}},{\text{max}}}}\), \({\text{M}}_{{{\text{HC}},{\text{max}}}}\), \({\text{M}}_{{{\text{HS}},{\text{max}}}}\) represents the maximum capacity of the electrolyzer, hydrogen compressor, and hydrogen storage tank, respectively.

4 The H2-RES Optimal Scheduling Phase

After determining the optimal capacity configuration of the hydrogen production system in the first stage, the next stage is to optimize the operation and scheduling of the hydrogen production system from renewable energy based on the optimal capacity of the hydrogen production system determined in the first stage. In view of the characteristics of difficult prediction and strong randomness of fan and photovoltaic output, the “worst” operation scenario that may be encountered by the microgrid is considered and the economy of its operation is estimated, and the flexible load in the electric load is considered to improve the economy of the system.

4.1 Flexible Electrical Load Model

The electrical load in the hydrogen production system of renewable energy includes flexible electrical load and rigid electrical load. The flexible electrical load is mainly used to regulate the overall load curve of the system and improve the overall energy consumption level of the system on the premise of meeting the basic rigid electrical load of the system. In order to tap the scheduling potential of flexible electric load and improve the economy of the system, two flexible load mathematical models are established, namely transferable and reducible flexible load.

4.1.1 Transferable Electric Load Model

The load can be transferred according to the real-time electricity price, the user carries on the transfer to some non-essential time period load, for example washing machine, water heater and so on. And the working hours of the transferable load and the size of the transfer time have no time continuity constraints, and have higher flexibility, the total power of the pre-and post-dispatch transferable loads must satisfy uniform invariance on the transferable interval \(\left[ {{\text{t}}_{{{\text{start}}}} ,{\text{t}}_{{{\text{end}}}} } \right]\).

$$ \mathop \sum \limits_{t = 1}^{T} F_{t}^{tr} \Delta t = \mathop \sum \limits_{{t = t_{start} }}^{{t_{end} }} P_{t}^{tr} \Delta t $$
(5)
$$ b_{t}^{tr} P_{min}^{tr} \le P_{t}^{tr} \le b_{t}^{tr} P_{max}^{tr} $$
(6)

In the formula: \({\text{F}}_{{\text{t}}}^{{{\text{tr}}}}\) and \({\text{P}}_{{\text{t}}}^{{{\text{tr}}}}\) denote the power of the transferable electric load at t time before and after the transfer respectively, \({\text{P}}_{{{\text{min}}}}^{{{\text{tr}}}}\) and \({\text{P}}_{{{\text{max}}}}^{{{\text{tr}}}}\) denote the transferable minimum electric load and the transferable maximum electric load respectively, \({\text{b}}_{{\text{t}}}^{{{\text{tr}}}}\) is the 0-1 variable, which represents the transition state of the transferable electrical load t period and \({\text{b}}_{{\text{t}}}^{{{\text{tr}}}} = 1\) means that the electric transfer load occurs during the time period.

When electric load transfer, the user is transfer compensation adjustment

$$ C_{tr} = r_{tr} \mathop \sum \limits_{t = 1}^{T} b_{t}^{tr} P_{t}^{tr} $$
(7)

In the formula: \({\text{r}}_{{{\text{tr}}}}\) represents the unit compensation price of the transferable electric load.

4.1.2 Reduction of Electric Load Model

Reducible electric load refers to a certain reduction of load power within the allowable range without changing the purpose of users’ power consumption, which alleviates the tension of energy consumption. The reducible load in each period after dispatching can be expressed as:

$$ {\text{P}}_{{\text{t}}}^{{{\text{cu}}}} = \left( {1 - {\text{b}}_{{\text{t}}}^{{{\text{cu}}}}\upvarepsilon _{{\text{t}}} } \right){\text{F}}_{{\text{t}}}^{{{\text{cu}}}} $$
(8)

In the formula: \({\text{F}}_{{\text{t}}}^{{{\text{cu}}}}\) and \({\text{P}}_{{\text{t}}}^{{{\text{cu}}}}\) for t time can reduce the electrical load before and after the reduction of electrical load power, \({\text{b}}_{{\text{t}}}^{{{\text{cu}}}}\) for 0-1 variables, that can reduce the electrical load cut state, the load can be reduced by t when \({\text{b}}_{{\text{t}}}^{{{\text{cu}}}}\) is equal to 1, \(\upvarepsilon _{{\text{t}}}\) represents the reduction of the load at t time, \(0 \leqslant {\upvarepsilon }_{{\text{t}}} \leqslant 1 \), when \(\upvarepsilon _{{\text{t}}} = 1\) represents the complete reduction of the load.

$$ {\text{C}}_{{{\text{cu}}}} = {\text{r}}_{{{\text{cu}}}} \mathop \sum \limits_{{{\text{t}} = 1}}^{{\text{T}}} {\text{b}}_{{\text{t}}}^{{{\text{cu}}}} \left( {{\text{P}}_{{\text{t}}}^{{{\text{cu}}}} - {\text{F}}_{{\text{t}}}^{{{\text{cu}}}} } \right) $$
(9)

In the formula: \({\text{r}}_{{{\text{cu}}}}\) represents the unit power compensation cost that can reduce the electrical load.

4.2 Objective Function

The optimization objective of the second stage is to minimize the total cost under the operation of the hydrogen production system with renewable energy, and finally determine the start-up and shutdown plan of each unit, the power generation capacity, the charge and discharge plan of the energy storage system, and the power purchase and sales plan for trading with the power grid. The total cost includes the power purchase and sale expenses with the power grid, the flexible power load dispatching compensation cost of the microgrid, and the operation and maintenance expenses of the battery and hydrogen production system.

$$ min\,F_{2} = C_{grid} + C_{dr} + C_{op} $$
(10)

In the formula: \({\text{C}}_{{{\text{grid}}}}\), \({\text{C}}_{{{\text{dr}}}}\), \({\text{C}}_{{{\text{op}}}}\) represents the transaction costs between the power grid, flexible load compensation costs, the operation and maintenance costs of equipment.

  1. (1)

    transaction cost between system and power grid

Transaction costs between the system and the grid include the purchase of electricity to the grid and the sale of electricity to the grid

$$ C_{grid} = \mathop \sum \limits_{t = 1}^{T} l_{t}^{buy} P_{t}^{buy} - l_{t}^{sell} P_{t}^{sell} $$
(11)

In the formula: \({\text{l}}_{{\text{t}}}^{{{\text{buy}}}}\) represents the purchase price of t time Grid, \({\text{l}}_{{\text{t}}}^{{{\text{sell}}}}\) represents the sale price of t time grid, \({\text{P}}_{{\text{t}}}^{{{\text{buy}}}}\), \({\text{P}}_{{\text{t}}}^{{{\text{buy}}}}\) represents the purchase and sale power of t time system.

  1. (2)

    flexible electric load dispatch compensation cost

The flexible power load dispatching compensation cost mainly includes the power load compensation cost which can be reduced and the power load compensation cost which can be transferred:

$$ C_{dr} = C_{tr} + C_{cu} $$
(12)

In the formula: \({\text{C}}_{{{\text{tr}}}}\), \({\text{C}}_{{{\text{cu}}}}\) respectively represents the transferable electric power compensation cost and can reduce the electric power compensation cost, its specific mathematical model is shown in the formula (7) and formula (9).

  1. (3)

    system equipment operation and maintenance costs

System equipment operation and maintenance costs mainly include the main components of the system operation and maintenance costs. The main components of the hydrogen production system are based on the unit power consumption, and the storage battery is based on the charge/discharge capacity. The model is as follows:

$$ C_{OP} = C_{OP}^{EH} + C_{OP}^{BAT} $$
(13)
$$ {\text{C}}_{{{\text{OP}}}}^{{{\text{EH}}}} = \mathop \sum \limits_{{{\text{t}} = 1}}^{{\text{T}}} {\text{r}}_{{{\text{OP}}}}^{{{\text{EH}}}} ({\text{P}}_{{\text{t}}}^{{{\text{ED}}}} + {\text{P}}_{{\text{t}}}^{{{\text{HC}}}} ) $$
(14)
$$ {\text{C}}_{{{\text{OP}}}}^{{{\text{BAT}}}} = \mathop \sum \limits_{{{\text{t}} = 1}}^{{\text{T}}} {\text{r}}_{{{\text{OP}}}}^{{{\text{BAT}}}} ({\text{P}}_{{\text{t}}}^{{{\text{BATC}}}} + {\text{P}}_{{\text{t}}}^{{{\text{BATD}}}} ) $$
(15)

In the formula: \({\text{C}}_{{{\text{OP}}}}^{{{\text{EH}}}}\), \({\text{C}}_{{{\text{OP}}}}^{{{\text{BAT}}}}\) represents the operation and maintenance cost of hydrogen production equipment and storage battery respectively; \({\text{r}}_{{{\text{OP}}}}^{{{\text{EH}}}}\), \({\text{r}}_{{{\text{OP}}}}^{{{\text{BAT}}}}\) represents the unit operation and maintenance cost of hydrogen production system and storage battery respectively; \({\text{P}}_{{\text{t}}}^{{{\text{ED}}}}\), \({\text{P}}_{{\text{t}}}^{{{\text{HC}}}}\) represents the consumption power of electrolyzer and hydrogen press at time t, \({\text{P}}_{{\text{t}}}^{{{\text{BATC}}}}\), \({\text{P}}_{{\text{t}}}^{{{\text{BATD}}}}\) represents the charge and discharge power of battery at time t.

4.3 Constraints

The constraints of the optimal scheduling model ofH2-RES mainly include power balance constraints, power storage equipment constraints and hydrogen production system constraints.

  1. (1)

    Power balance constraint

    $$ \begin{aligned} P_{t}^{WD} + P_{t}^{PV} + P_{t}^{BATD} + P_{t}^{BUY} & = P_{t}^{EL} + P_{t}^{tr} + P_{t}^{cu} + P_{t}^{BATC} \\ & \quad + P_{t}^{ED} + P_{t}^{HC} + P_{t}^{SELL} \\ \end{aligned} $$
    (16)

In the formula: \({\text{P}}_{{\text{t}}}^{{{\text{WD}}}}\), \({\text{P}}_{{\text{t}}}^{{{\text{PV}}}}\) represents the fan output power and photovoltaic output power at time t respectively; \({\text{P}}_{{\text{t}}}^{{{\text{BATC}}}}\), \({\text{P}}_{{\text{t}}}^{{{\text{BATD}}}}\) represents the battery charge/discharge power at time t respectively; \({\text{P}}_{{\text{t}}}^{{{\text{BUY}}}}\), \({\text{P}}_{{\text{t}}}^{{{\text{SELL}}}}\) indicates the purchasing power and selling power between the hydrogen production system and the power grid at time t, \({\text{P}}_{{\text{t}}}^{{{\text{EL}}}}\), \({\text{P}}_{{\text{t}}}^{{{\text{tr}}}}\), \({\text{P}}_{{\text{t}}}^{{{\text{cu}}}}\) represents the rigid electric load at time t, the transferable electric load and the reduced electric load respectively, and \({\text{P}}_{{\text{t}}}^{{{\text{ED}}}}\), \({\text{P}}_{{\text{t}}}^{{{\text{HC}}}}\) represents the consumed electric power of the electrolyzer and the hydrogen compressor at time t.

  1. (2)

    Constraint of storage equipment

    $$ \left\{ {\begin{array}{*{20}l} {E_{1} = \eta_{0} E_{BAT} + \eta_{ch} P_{t}^{BATC} - \frac{{P_{t}^{BATD} }}{{\eta_{dis} }}} \hfill \\ {E_{k} = E_{k - 1} + \eta_{ch} P_{k}^{BATC} - \frac{{P_{k}^{BATD} }}{{\eta_{dis} }},2 \le k \le 24} \hfill \\ {\eta_{\min } E_{BAT} \le E_{t} \le \eta_{\max } E_{BAT} ,1 \le t \le 24} \hfill \\ {0 \le P_{t}^{BATC} \le I_{t}^{ch} P_{\max }^{BATC} } \hfill \\ {0 \le P_{t}^{BATD} \le I_{t}^{dis} P_{\max }^{BATD} } \hfill \\ {0 \le I_{t}^{ch} + I_{t}^{dis} \le 1} \hfill \\ {\sum\limits_{t = 1}^{T} {\eta_{ch} P_{t}^{BATC} \Delta t} - \sum\limits_{t = 1}^{T} {\frac{{P_{t}^{BATD} }}{{\eta_{dis} }}\Delta t = 0} } \hfill \\ {E_{T} = \eta_{0} E_{BAT} } \hfill \\ \end{array} } \right. $$
    (17)

In the formula, \({\text{E}}_{1}\), \({\text{E}}_{{\text{t}}}\) denote the capacity of the battery in the first time period and t the t time period battery capacity, \({\text{E}}_{{{\text{BAT}}}}\) denote the total capacity of the battery, \({\text{E}}_{{\text{T}}}\) denote the capacity of the battery in the last time period of a dispatch period, \(\upeta _{0}\), \(\upeta _{{{\text{min}}}}\), \(\upeta _{{{\text{max}}}}\) represents the ratio coefficient of initial capacity, the minimum energy storage coefficient and the maximum energy storage coefficient, \(\upeta _{{{\text{ch}}}}\), \(\upeta _{{{\text{dis}}}}\) represents the efficiency of charge/discharge energy, \({\text{I}}_{{\text{t}}}^{{{\text{ch}}}}\), \({\text{I}}_{{\text{t}}}^{{{\text{dis}}}}\) represent the Battery t time charge and discharge energy mark bit 0-1 variable.

  1. (3)

    Constraints of hydrogen production system

The hydrogen production system consists of an electrolytic cell, a Hydrogen compressor, and a hydrogen storage tank.

  1. Electrolytic cell model

At present, the most commonly used electrolyzer in industrial production is alkaline water electrolyzer, which has fast reaction speed and mature technology. The hydrogen production efficiency of the electrolyzer and the power of the electrolyzer can be regarded as a linear relationship under stable operation [21]. The unit hydrogen production rate is assumed to be \(\upeta _{{{\text{H}}_{2} }}\), kg/(kW h),The hydrogen yield \({\text{m}}_{{\text{t}}}^{{{\text{H}}_{2} }}\) at t time is the product of the hydrogen yield \(\upeta _{{{\text{H}}_{2} }}\) and the power \({\text{P}}_{{\text{t}}}^{{{\text{ED}}}}\) input to the cell [22]:

$$ m_{t}^{{H_{2} }} = \eta_{{H_{2} }} P_{t}^{ED} $$
(18)

The electrolyzer shall meet the minimum safe power and maximum power constraints during operation:

$$ P_{min}^{ED} \le P_{t}^{ED} \le P_{max}^{ED} $$
(19)

In the formula: \({\text{P}}_{{{\text{min}}}}^{{{\text{ED}}}}\), \({\text{P}}_{{{\text{max}}}}^{{{\text{ED}}}}\) respectively represents the minimum safe power and the maximum operating power when the electrolyzer is running.

At the same time, the electrolytic cell should also meet the power climbing constraints:

$$ \left| {P_{t + 1}^{ED} - P_{t}^{ED} } \right| \le P_{rp}^{ED} $$
(20)

In the formula: \({\text{P}}_{{{\text{rp}}}}^{{{\text{ED}}}}\) indicates the maximum climbing power of the electrolyzer.

  1. Hydrogen compressor model

To facilitate storage and transportation, hydrogen is compressed into high pressure hydrogen using Hydrogen compressor, and the power consumption of the hydrogen compressor [23] needs to be satisfied:

$$ P_{t}^{HC} = \frac{{R_{{H_{2} }} m_{t}^{{H_{2} }} T_{in} \kappa }}{{3600\eta_{HC} \left( {\kappa - 1} \right)}}\left[ {\left( {P_{out} /P_{in} } \right)^{{\frac{\kappa - 1}{\kappa }}} - 1} \right] $$
(21)
$$ 0 \le P_{t}^{HC} \le P_{max}^{HC} $$
(22)

In the formula: \({\text{R}}_{{{\text{H}}_{2} }}\) is the specific heat capacity of hydrogen Changshu, \({\text{T}}_{{{\text{in}}}}\) is the compressor input hydrogen temperature, \(\upeta _{{{\text{HC}}}}\) is the compressor efficiency, \(\upkappa \) is the isentropic index of hydrogen, \({\text{P}}_{{{\text{out}}}} /{\text{P}}_{{{\text{in}}}}\) is the compression ratio.

  1. Hydrogen storage tank model

The hydrogen storage tank is used to store the compressed hydrogen, and its mathematical model and constraints are:

$$ \left\{ {\begin{array}{*{20}l} {m_{1}^{HS} = \rho_{0} M_{HS} + m_{1}^{{H_{2} }} - L_{1}^{{H_{2} }} } \hfill \\ {m_{k}^{HS} = m_{k - 1}^{HS} + m_{k}^{{H_{2} }} - L_{k}^{{H_{2} }} ,2 \le k \le 24} \hfill \\ {\rho_{\min } M_{HS} \le m_{t}^{HS} \le \rho_{\max } M_{HS} ,1 \le t \le 24} \hfill \\ {m_{T}^{HS} = \rho_{0} M_{HS} } \hfill \\ \end{array} } \right. $$
(23)

In the formula, \({\text{m}}_{1}^{{{\text{HS}}}}\) represents the hydrogen storage capacity of the hydrogen storage tank in the first period of the dispatching period, \({\text{m}}_{{\text{k}}}^{{{\text{HS}}}}\) represents the hydrogen storage capacity of the hydrogen storage tank in the k period of the dispatching period, \({\text{m}}_{{\text{T}}}^{{{\text{HS}}}}\) represents the hydrogen storage capacity of the hydrogen storage tank in the last period of the dispatching period, \(\uprho _{0}\), \(\uprho _{{{\text{min}}}}\), \(\uprho _{\max }\) represents the initial hydrogen storage ratio coefficient, the minimum hydrogen storage ratio coefficient and the maximum hydrogen storage ratio coefficient respectively, and \({\text{M}}_{{{\text{HS}}}}\) represents the total capacity of the hydrogen storage tank.

5 Two-Stage Robust Programming Model for H2-RES

The first stage of the two-stage distributed robust optimization model based on renewable energy hydrogen production system proposed in this paper is to optimize the capacity of the hydrogen production system according to the local renewable energy characteristics, electric load and hydrogen load, including the capacity configuration of electrolytic cell, hydrogen compressor and hydrogen storage tank. The optimization goal is the construction cost. The second stage is to optimize the real-time scheduling scheme with the lowest system operation cost under the “worst” operation scenario that the system may encounter in the future. Then feed back the optimization results of the second stage to the first stage to further formulate the best planning scheme. The two-stage planning model is shown in Fig. 2.

Fig. 2.
figure 2

Two-stage programming model

The two-stage robust optimization model is as follows:

$$ F_{3} = \mathop {min}\limits_{x} \left\{ {F_{1} + \mathop {max}\limits_{u} \mathop {min}\limits_{y} \left\{ {F_{2} } \right\}} \right\} $$
(24)

In the formula: x is the decision variable of the first stage, that is, the capacity configuration of the hydrogen production system; u is the scene of the worst scenery; y is the decision variable of the second stage, that is, after the configuration of the hydrogen production system and the worst-case scenario of the most economic scheduling scheme.

In this paper, we use the k-means Clustering Method to reduce M wind power and photovoltaic power scenes into typical discrete scenes with uncertain and random characteristics \({\text{u}}1,{\text{u}}2, \ldots ,{\text{uk}}\), the occurrence probabilities of various scenarios are obtained to simulate the output uncertainty of renewable energy. The initial probability of each discrete scenario is expressed in \({\text{p}}_{{\text{k}}}^{0}\).

The purpose of scene reduction analysis is to replace a large number of complex scene features with a small number of representative scenes, and construct an uncertain set to describe the distribution of scenery output. The comprehensive norm constraint set composed of [22] 1-norm and ∞-norm restricts the probability distribution of renewable energy output scenario, as shown in Eq. (25).

$$ \Omega = \left\{ {p_{k} \left| {\begin{array}{*{20}c} {p_{k} \ge 0,k = 1,2, \ldots ,K} \\ {\mathop \sum \limits_{k = 1}^{10} p_{k} = 1} \\ {\mathop \sum \limits_{k = 1}^{10} \left| {p_{k} - p_{k}^{0} } \right| \le \lambda_{1} } \\ {\mathop {max}\limits_{k = 1,2, \ldots ,K} \left| {p_{k} - p_{k}^{0} } \right| \le \lambda_{\infty } } \\ \end{array} } \right.} \right\} $$
(25)

In the formula: \(\Omega\) is the probability distribution feasible region of renewable energy output scene, where \({\text{P}}_{{\text{k}}}\) is the probability of the typical scene \({\text{u}}_{{\text{k}}}\), which \(\uplambda _{1} ,\uplambda _{\infty }\) is the probability allowable deviation value of 1-norm and ∞-norm respectively, which can be obtained from Eq. (26).

$$ \left\{ {\begin{array}{*{20}c} {\lambda_{1} = \frac{k}{2M}\ln \frac{2k}{{1 - \alpha_{1} }}} \\ {\lambda_{\infty } = \frac{1}{2M}\ln \frac{2k}{{1 - \alpha_{\infty } }}} \\ \end{array} } \right. $$
(26)

In the formula: \(\upalpha _{1} ,\upalpha _{\infty }\) is the confidence level of 1-norm and ∞-norm uncertainty probability respectively.

The two-stage distribution robust optimization model is a min max min structure. In order to facilitate analysis, the worst scenario of renewable energy output is represented by the worst probability distribution of renewable energy output. The two-stage distribution robust model of the proposed system can be transformed into the following form:

$$ F_{3} = \mathop {min}\limits_{x} \left\{ {F_{1} + \max \left\{ {\mathop \sum \limits_{k = 1}^{10} p_{k} \mathop {min}\limits_{y} \left\{ {F_{2} } \right\}} \right\}} \right\} $$
(27)

6 Two-Stage Robust Model Solving Method

To solve the two-stage distributed robust optimization problem, a column constraint generation algorithm (C & CG) is used to solve the decomposition problem. Compared with Benders decomposition algorithm, C & CG algorithm has fewer iterations and higher accuracy. C & CG algorithm is used to decompose the two-stage distributed robust problem into main problem and sub-problem.

The main problem is to solve the optimal capacity allocation of the hydrogen production system based on the probability distribution of the initial worst-case scenario, and to obtain the maximum real-time operating cost with the lowest operating cost as the objective in the worst-case scenario, and provide a lower bound for the model:

$$ \left\{ {\begin{array}{*{20}l} {min\,A^{T} x + U} \hfill \\ {U \ge \mathop \sum \limits_{k = 1}^{10} p_{k} min\left\{ {B^{T} y_{k} } \right\}} \hfill \\ \end{array} } \right. $$
(28)

In the formula, \(A^{T}\) is the coefficient matrix of the primary decision variable, x is the primary decision variable, U is the auxiliary variable of the main problem objective function and \(B^{T}\) is the coefficient matrix of the secondary decision variable.

Based on the optimal capacity configuration of the hydrogen production system solved by the main problem, the sub problem calculates the operation with the lowest operation cost as the goal in each scenario in parallel, and provides the upper bound value to the model. The worst scene probability is updated in the probability distribution feasible region Ω of the data-driven wind and solar output scenario, and the scheduling optimization of the system is carried out. The sub problem can be expressed as:

$$ \mathop {max}\limits_{{\left\{ {p_{k} } \right\} \in \Omega }} \mathop \sum \limits_{k = 1}^{K} P_{k}^{q} \left[ {\mathop {min}\limits_{{y_{k} \in \left( {x,p_{k} } \right)}} \left( {B^{q} } \right)^{T} y_{k}^{q} } \right] $$
(29)

The iterative solution process of the main problem and sub problem by using C & CG algorithm is as follows:

Step 1: Initialization, set the maximum number of iterations \({\text{n}}_{{{\text{max}}}}\); convergence accuracy \(\upzeta = 10^{ - 3}\), the number of initialization iterations n = 1, set the scenery output benchmark scenario \({\text{u}}_{0}\) as the worst scenario \({\text{u}}_{{\text{q}}}\), initialization \({\text{U}} = + \infty\), The upper bound of the objective function is \({\text{U}} = + \infty\) and the lower bound is \({\text{L}} = - \infty\), the historical data are clustered to obtain K discrete scenes with typical time and the initial probability distribution \({\text{p}}_{{\text{k}}}^{0}\).

Step 2: substitute the worst scenario \({\text{u}}_{{\text{q}}}\) into the main problem for solution, obtain the optimal capacity solution \({\text{x}}^{{\text{q}}}\) of the hydrogen production system, and take the optimal solution obtained from the main problem as a new lower bound \({\text{L}}^{{\text{q}}}\).

Step 3: substitute \({\text{x}}^{{\text{q}}}\) into the subproblem and consider the uncertainty of wind power output, and calculate the output plan of each unit when the operation cost is the lowest in each scenario in the subproblem in parallel.

Step 4: find the wind power output expectation and corresponding decision variables \({\text{y}}^{{\text{q}}}\) that maximize the operation cost in the probability distribution feasible region \(\Omega\) of the data-driven wind power output scene, take the sum of the sub problem optimization result \( \mathop \sum \nolimits_{{{\text{k}} = 1}}^{{\text{K}}} {\text{P}}_{{\text{k}}}^{{\text{q}}} \left[ {({\text{B}}^{{\text{q}}} )^{{\text{T}}} {\text{y}}_{{\text{k}}}^{{\text{q}}} } \right] \) and the main problem result \(\left( {{\text{A}}^{{\text{q}}} } \right)^{{\text{T}}} {\text{x}}^{{\text{q}}}\) as the upper bound, and update the bad scene \({\text{u}}_{{{\text{q}} + 1}}\) and probability distribution \({\text{P}}_{{\text{k}}}^{{{\text{q}} + 1}}\).

Step 5: determine \({\text{U}}^{{\text{q}}} - {\text{L}}^{{\text{q}}} \le\upvarepsilon \) whether satisfied, if satisfied, the iteration convergence and get the optimal solution; If not satisfied, then update the worst scenario and its probability, n = n + 1, and return to step 2 (Fig. 3).

Fig. 3.
figure 3

Solution flow of two-stage robust optimization model

The framework of two-stage distributed robust optimization model based onH2-RES is shown in Fig. 4.

Fig. 4.
figure 4

The whole frame

7 Case Analysis

7.1 Basic Data and Model Parameters

In order to verify the feasibility of the model and method in this paper, an example is constructed based on the actual data of Chongli renewable energy large-scale hydrogen production project in Zhangjiakou, Hebei Province. Taking the renewable energy hydrogen production system shown in Fig. 1 as the research object, CPLEX commercial solver is used for modeling and solving in matlab 2020a.

In Zhangjiakou renewable energy hydrogen production project, there are three fans and one photovoltaic array. The rated power of each fan is 2 MW and the rated power of photovoltaic array is 3 MW. Set the optimal scheduling cycle as 24 h, and take 1 h as the unit period. The renewable energy output data of the past one year is taken and reduced to 10 typical discrete renewable energy output scenarios with uncertain and random characteristics by K-means clustering method, and the corresponding probability of each scenario is obtained to drive the two-stage distributed robust optimization model of H2-RES. The data of renewable energy output before and after clustering is shown in Figs. 5 and 6. Figure 5 (a) and (b) respectively show the historical data of fan output and photovoltaic output in the past year Fig. 6 shows the 10 types of renewable energy output scenarios obtained by clustering.

Fig. 5.
figure 5

Historical data of available in process energy output

Fig. 6.
figure 6

Clustering results of renewable energy output

During the 2022 Winter Olympic Games, more than 400 hydrogen buses were applied to Zhangjiakou competition area, and their daily hydrogen load was supplied by the renewable energy hydrogen production project in Zhangjiakou area. This paper selects the hydrogen load and electric load of typical days and the renewable energy output data of the next day predicted according to the historical renewable energy output data, and makes a case analysis on the dynamic scheduling optimization after the static configuration ofH2-RES hydrogen production system in the first stage. Figure 7 shows typical daily load demand and predicted renewable energy output data.

The purchase and sale price in the calculation case adopts the pricing method of time of use price. The prices of electricity purchased and sold in different time periods are shown in Fig. 8.

Fig. 7.
figure 7

Load daily demand and renewable energy force prediction data

Fig. 8.
figure 8

Purchase electricity-based electricity price

The parameter values of main equipment of the H2-RES system are shown in Table 1.

Table 1. Important parameter values of H2-RES.

7.2 Analysis of Optimizing Static Configuration Stage

In this paper, the historical scenery output data are clustered by K-means method, and 10 groups of initial scenes and their probabilities are obtained. The comprehensive norm constraint set is used to constrain the probability distribution of wind and solar output scenarios, in which the 1-norm constraint confidence is set to 0.5 and ∞-norm constraint confidence is set to 0.99. Build a two-stage robust optimization model forH2-RES system. The static configuration of hydrogen production system obtained by iteration according to C & CG algorithm is shown in Table 2.

The capacity configuration of the optimized hydrogen production system is close to that in the actual project. The capacity of the actual hydrogen production system in Zhangjiakou renewable energy hydrogen production project is shown in Table 3. According to the configuration obtained from the simulation of the example, it is suggested to increase the capacity of the hydrogen storage tank in the project to 220–250kg.

Table 2. Optimized capacity configuration of hydrogen production system
Table 3. Actual capacity of hydrogen production system on site

7.3 Flexible Electric Load Optimization Analysis

The response of electric load demand after considering flexible load is shown in Fig. 9. The blue bar represents the electric load predicted at the dispatching time, the orange bar represents the flexible electric load that can be transferred at the dispatching time, the yellow bar represents the flexible electric load that can be reduced at the dispatching time, and the red curve represents the electric load after considering the flexible load, which can also be expressed as the electric load after demand response.

It can be seen from the figure that the transferable electric load in period 1, period 3, period 5, period 7, period 9–10 and period 22–24 is transferred to period 14–21, and the reducible load in period 2, period 4, period 6, period 8–9 and period 11–21 is reduced on the basis of meeting the acceptable reduction times of users. It effectively smoothes the power load curve of the system, and then improves the wind power consumption and economic benefits of the dispatching plan.

Fig. 9.
figure 9

Response of electric load demand

7.4 Optimized Dynamic Dispatching Operation Analysis

Based on the capacity configuration of hydrogen production system, the dynamic dispatching operation ofH2-RES system is optimized. The optimal operation strategy of each unit of the system is shown in Fig. 10. The blue bar represents the renewable energy output plan, the orange bar represents the power purchase plan of the system to the power grid, the green bar represents the power sales plan of the system to the power grid, and the yellow bar represents the charging and discharging plan of the battery. Above the horizontal axis represents the charging plan, below the horizontal axis represents the discharge plan, the purple bar represents the power consumption plan of the hydrogen production system, and the red curve represents the power load after demand response.

It can be seen from the figure that in these 24 periods, most of the power output of renewable resources is used for the power consumption of hydrogen production system. In periods 1–7 and 14, the output of renewable energy can not meet the power load and power consumption of hydrogen production system. It is necessary to purchase power from the power grid to meet the power demand. In periods 10, 12–13, 15 and 17, 22–24, the output of renewable energy can fully meet the electrical load and the electrical power required by the hydrogen production system, and the excess electricity is used to sell electricity to the power grid and charge the battery. In this strategy, more electricity is purchased to charge the battery in the first and seventh periods when the output of the available energy is insufficient and the electricity price is low, and the battery is discharged in the eighth to ninth periods, the eleventh periods, the fourteenth periods and the eighteenth to twenty-first periods when the output of the available energy cannot meet the required electric power, so as to achieve the effect of peak shaving and valley filling. The charging and capacity status of the battery are shown in Fig. 11. The total capacity of the battery set in this paper is 1000 kW, the minimum capacity is limited to 100 kW and the maximum capacity is limited to 900 kW. The maximum charging and discharging power is 400KW. It can be seen that the charging power of the battery reaches the maximum charging state in period 1, 11 and 17, and the discharging power reaches the maximum discharging state in period 6 and 21. The capacity of the storage battery is 300 kW at the beginning of the dispatching period, reaches the allowable maximum capacity state in 11, 13 and 18 periods, and returns to the initial state at the last moment of the dispatching period.

Fig. 10.
figure 10

Electric power optimal operation strategy

Fig. 11.
figure 11

Battery charging and discharging power and electric quantity status

7.5 Hydrogen Load Supply Situation

The hydrogen load supply is shown in Fig. 12. The green curve represents the real-time change of hydrogen in the hydrogen storage tank during the 24-h dispatching period, the red curve represents the change of hydrogen load during the 24-h dispatching period, and the blue curve represents the real-time change of hydrogen production of the hydrogen production system during the 24-h dispatching period. During the period 1–7, the hydrogen production of the hydrogen production system has excess hydrogen load. The excess hydrogen is stored in the hydrogen storage tank. It can be seen that the hydrogen in the hydrogen storage tank has been increasing. During the period 8, the hydrogen load has excess hydrogen production. At this time, the hydrogen in the hydrogen storage tank makes up for the hydrogen load. There is little difference between the hydrogen load and the hydrogen production during the period 9–13. In the period 14–21, except for the period 18, the hydrogen load is more than the hydrogen output, and the hydrogen load is far more than the hydrogen output in the period 15 and 19. In this period, the hydrogen load in the hydrogen storage tank is used to supplement the hydrogen load, the hydrogen load in the period 22–23 is nearly equal to the hydrogen output, and the hydrogen output in the period 24 is more than the hydrogen load, It can be seen that the hydrogen storage tank plays a role in maintaining the stability of hydrogen load during the whole dispatching period.

The capacity status of the hydrogen storage tank is shown in Fig. 13. It can be seen that the initial capacity proportion of the hydrogen storage tank is 0.25. When the hydrogen production of the hydrogen production system exceeds the hydrogen load, the hydrogen capacity status in the hydrogen storage tank will increase, otherwise it will decrease. In the last period of the dispatching period, the capacity status of the hydrogen storage tank will return to the initial capacity proportion, ensuring the normal and stable operation of the hydrogen storage tank in the next dispatching cycle.

Fig. 12.
figure 12

Hydrogen load supply situation

Fig.13.
figure 13

Capacity status of hydrogen storage tank

8 Conclusion

This paper takes the hydrogen production system from renewable energy sources (H2-res) as the research object, fully considers the uncertainty of wind and solar output and the flexible load of electric load, and establishes a two-stage distributed robust optimization model. In the first stage, the system economy is taken as the optimization objective to determine the capacity of the hydrogen production system. The second stage takes the system operation cost as the goal, aims to optimize the real-time scheduling of the system, and uses the CCG algorithm to solve it. Finally, an example is given to verify the effectiveness of the proposed model, and the following conclusions are drawn:

  1. (1)

    Different from the previous two-stage distributed robust optimization of pre scheduling and re scheduling of microgrid system, this paper is the static configuration of H2-RES system considering the uncertainty of wind and solar output and the two-stage distributed robust optimization model of system dynamic scheduling based on static configuration.

  2. (2)

    The flexible load of electric load is considered in the operation optimization of H2-RES system, which can reduce the cost of dispatching scheme and improve the economic benefit of the system.

  3. (3)

    By considering the wind solar output scenario under the worst scenario, the capacity of the hydrogen production system obtained through the iteration of the algorithm is very close to the actual project, which can provide practical application value.