Keywords

1 Research Status

1.1 Research Status of Microgrid Capacity Optimization Configuration

In recent years, with the construction of complementary microgrid optimization projects, my country has overcome many technical difficulties in energy. In the energy development stage, the “Eleventh Five-Year Plan for Energy Development” in 2007 proposed a renewable energy industrialization project [1], by reducing construction costs and adopting renewable energy as a key development technology on a large scale. Make full use of the abundant renewable energy sources such as wind energy, solar energy, biomass energy, etc., to drive the development of energy industrial production, and realize the scope construction. This is also the first time that the “distributed energy supply system” has been identified as the key to develop cutting-edge technologies. In terms of electric energy, the energy system adopts the dispatching method to realize the interactive operation between renewable energy such as wind and light and the energy storage system. In terms of electric energy demand, the complementary electric energy system realizes the co-generation of cooling, heating and electricity, and configures and operates in an optimal way according to the load demand, so as to realize the coordinated operation between energy sources [2]. In 2016, the country proposed the “Internet+” smart energy model, and the development time was determined in the interval of 2016–2030 [3]. Therefore, in the future, the complementary model will occupy an extremely important position in energy utilization.

In the aspect of capacity optimization design of microgrid, many scholars have made in-depth research on it. Qi Yan and other scholars have used intelligent algorithms such as the improved gray wolf algorithm and particle swarm algorithm to study the scheduling problem and economic optimization of the microgrid system from the perspective of intelligence, so as to obtain the optimal solution of the microgrid [4, 5]. Due to the late start of microgrid technology and related technologies have not yet matured, the investment in technology will generate huge costs, so economy is the key inspection criterion [6, 7]. Shao Zhifang and other scholars comprehensively considered the power supply side and the load side, studied the configuration optimization of the coordinated operation of the supply and demand sides of the off-grid microgrid, and obtained the configuration result with the minimum cost of the distributed microgrid system [8]. Zhang Zhiwen et al. took the remote areas of Guizhou as the background, and studied the capacity optimization configuration scheme of wind, solar, water, and storage power stations [9]. Tan Ying and other scholars have achieved the goal of reducing pollutant emissions by introducing renewable energy on the basis of diesel generators [10].

1.2 Research Status of Hydrogen Energy Technology

Hydrogen energy is a green and efficient secondary energy, so in the future, hydrogen energy will inevitably become an important part of my country's energy structure. At the same time, the relevant links of hydrogen production, hydrogen storage and hydrogen consumption have great economic value. As an intermediate medium, hydrogen energy can realize the conversion between electric energy and other energy sources. It is an ideal energy medium and can realize large-scale application of energy storage medium in the future [11].

A large number of foreign scholars and researchers use hydrogen as a renewable resource to generate energy savings. Hydrogen is a novel energy storage method. By combining with wind power and photovoltaic power generation systems, the impact of distributed power generation systems on the power grid can be improved [12, 13]. In remote mountainous areas, traditional resources cannot guarantee power quality, and the investment cost is high. As an energy carrier and conversion medium, hydrogen has the advantages of hydrogen-hydrogen refueling station-hydrogen bus construction.

The United States is the first country to use hydrogen and fuel cells as energy sources. Around the 1960s and 1970s, the United States had put forward the concept of “hydrogen economy”. The United States has solved a series of technical problems in the hydrogen industry through a large amount of human and financial investment. In 1990, the United States formulated the “Five-Year Plan for Hydrogen Energy Research and Development”, and in 1996, the “Hydrogen Energy Prospects Act” was promulgated, with the purpose of creating the universality of hydrogen energy. In 2012, US President Barack Obama submitted a financial plan totaling 3.8 trillion US dollars, of which 6.3 billion yuan was used for the development and construction of hydrogen energy, automotive alternative fuels and other projects. As of 2019, the United States has adopted hydrogen fuel vehicles as commercial vehicles, and at the same time has invested heavily in related hydrogen energy innovations. A series of events have proved that the hydrogen energy industry occupies an extremely important position in the energy development of the United States.

The EU is also one of the early regions involved in the field of hydrogen energy, and the EU has taken hydrogen energy as an important guarantee for energy security and transformation. In 1956, the University of Cambridge invented the total temperature alkaline fuel cell, which opened the prelude to the development of fuel cells. The EU has promulgated a series of policies to ensure the development and construction of the hydrogen energy industry, and plans to reach 33% of power generation by renewable energy in 2020, 45% by 2030, and 50% by 2040., the proportion of power generation will reach 97% in 2050 [14]. In 2011, Germany built the world’s first wind-hydrogen power station with a power generation scale of 6 MW. In 2013, the German Audi company built a 6-megawatt E-Gas power conversion hydrogen project, marking that Audi became the world's first automobile company to use renewable energy. In 2019, Germany invested a total of 250 million euros in research on hydrogen energy vehicle projects, and plans to build 400 hydrogen energy filling stations by 2030.

China is also a big country in the use of hydrogen energy. In the “Energy Technology Revolution Innovation Action Plan (2016–2030)” [25], hydrogen energy has been classified as a key project of the energy technology revolution, and the construction and development of the hydrogen energy industry has also been included in my country. Energy strategy: My country has always focused on replacing some fossil fuels such as coal and oil by abandoning wind, water and other renewable energy sources, which can reduce costs and improve stability, which is more conducive to the construction of the hydrogen energy industry system and the construction of a national hydrogen energy industry network.

The continuous development of hydrogen energy technology has not only carried out in-depth research in key laboratories of universities, but also built a large number of hydrogen energy industry demonstration projects. In terms of hydrogen energy demonstration projects, it is mainly for applications in distributed power generation and new energy vehicles. Up to now, the number of hydrogen energy stations in operation in China has reached 14, which are located in Shanghai, Beijing, Guangdong and other places, and the first hydrogen refueling station in China that uses wind-solar hybrid electrolysis of water to produce hydrogen has been in Dalian has been completed, and the scale level has reached 70 MPa, which can provide energy for hydrogen vehicles in the three northeastern provinces [15].

2 Microgrid Structure and Modeling Research

2.1 Microgrid Structure

Complementary microgrid is based on the characteristics of various distributed power sources to perform joint power generation, thereby effectively avoiding the disadvantage of poor reliability of a single power source. Through the differences in the output characteristics of distributed power sources such as wind power generation, photovoltaic power generation and lithium-ion batteries, they are combined into a complementary micro-grid system to ensure that the output power of the micro-grid remains balanced at various time periods and under different conditions, and improve the micro-grid. System stability: The complementary microgrid takes its own structural characteristics as a reference, and obtains the effects of the lowest total cost, the best power supply reliability and stability. Figure 1 is the microgrid architecture diagram of the research object of this paper. Among them, wind turbines and solar cells are the main power sources of the system, which are set to maintain the maximum output power all the time, and the lithium-ion battery system is the backup power supply of the system. When the output of wind turbines and solar cells is insufficient, the stable operation of the microgrid system is guaranteed.

Fig. 1.
figure 1

Overall structure of the wind-solar-hydrogen integrated microgrid system

2.2 Distributed Power Model

2.2.1 Fan Model

Wind power generation is a process of energy conversion. First, wind energy is converted into mechanical energy of a motor by a fan and then converted into electrical energy. At present, three-phase permanent magnet synchronous generators are mostly used in small wind power generation systems, and grid-connected generators such as double-feedback asynchronous generators, cage asynchronous generators, and permanent magnet synchronous generators are also widely used [16].

The size of the wind speed directly determines the power generation of the wind turbine, because the wind resource has relatively large fluctuation and randomness. At present, domestic and foreign scholars have carried out a lot of research on the distribution of wind speed, among which the most representative is the two-parameter Weibull distribution model [17]. This model has a good fit to the wind speed, and the probability density formula is as follows:

$$ f(v) = \frac{k}{c}(\frac{v}{c})^{k - 1} \cdot \exp \left[ { - (\frac{v}{c})^{k} } \right] $$
(1)

where: v represents the wind speed here; k represents the Weibull shape factor, \(k > 0\); c represents the Weibull scale parameter, \(c > 1\); \(v_{c}\) represents the cut-out wind speed; \(v_{e}\) represents the rated wind speed.

The Weibull shape factor, the scale parameter is calculated as follows:

$$ f(v) = \frac{k}{c}(\frac{v}{c})^{k - 1} \cdot \exp \left[ { - (\frac{v}{c})^{k} } \right] $$
(2)
$$ c = \overline{v}/[\Gamma (1 + 1/k)] $$
(3)

where \(\sigma\) represents the standard deviation; \(\overline{v}\) represents the average wind speed; \(\Gamma\) represents the Gamma function.

The functional relationship between the output power of the wind turbine and the wind speed can be obtained as the output power function [4]:

$$ P_{WT} (v) = \left\{ {\begin{array}{*{20}l} {0,} \hfill & {0 \le v < v_{ci} } \hfill \\ {P_{r} \frac{{v - v_{ci} }}{{v_{r} - v_{ci} }},} \hfill & {v_{ci} \le v < v_{r} } \hfill \\ {P_{r} ,} \hfill & {v_{r} \le v < v_{\infty } } \hfill \\ \end{array} } \right. $$
(4)

In the formula: \(P_{WT}\) represents the real-time power generated by the fan; v represents the real-time wind speed; \(v_{ci}\) represents the cut-in wind speed; \(v_{\infty }\) represents the cut-out wind speed; \(v_{r}\) represents the rated wind speed.

Fans are mainly divided into two categories: fixed pitch fans and variable pitch fans. The pitch of the fixed pitch fan cannot be changed, so when the actual wind speed is greater than the rated wind speed, the power output of the fan will decrease instead; since the variable pitch fan can change its own pitch, when the wind speed is greater than the rated wind speed, its output power remains rated Power does not change. In this paper, the variable pitch fan is selected as the research object (Table 1; Fig. 2).

Table 1. Air fan parameters
Fig. 2.
figure 2

Power output curve of the wind power generator

2.2.2 Photovoltaic Model

As a kind of renewable energy, solar energy comes from the energy generated by the continuous nuclear fusion reaction inside the sun [18]. It can be regarded as a kind of energy with huge reserves and no pollution. With the continuous consumption of fossil resources, photovoltaic power generation has received more and more attention due to its cleanliness and pollution-free. Photovoltaic power generation has the characteristics of safety, no resource consumption, random installation, and simple construction. The principle of solar photovoltaic power generation is to use the photovoltaic effect (Photovoltaic effect) [19] generated when semiconductor materials receive light, thereby converting light energy into direct current electricity.

There are many factors that affect the output power of photovoltaic cells, such as light intensity, temperature of photovoltaic cells, panel shadows, etc. [30]. The output power of photovoltaic cells is as follows:

$$ P_{pv} (t) = P_{STC} \frac{{L_{C} (t)}}{{L_{STC} }}[1 + \mu (T_{C} - T_{STC} )] $$
(5)

In the formula: \(P_{pv}\) represents the actual power generated by the solar photovoltaic panel; \(P_{STC}\) represents the rated power of the solar photovoltaic panel; \(L_{C}\) represents the current ambient light intensity; \(L_{STC}\) represents the light intensity in the ideal environment, 1 kW/m2; \(\mu\) represents the power temperature coefficient, − 0.0047 °C; \(T_{C}\) represents the solar photovoltaic panel during operation Surface temperature; \(T_{STC}\) indicates the surface temperature of the solar photovoltaic panel in an ideal environment.

Among them, the comprehensive calculation of real-time temperature and light intensity is adopted through the HOMER Pro simulation software, as follows:

$$ T_{C} = T_{a} + (T_{C,noct} - T_{a,noct} )(\frac{{G_{T} }}{{G_{T,noct} }})(1 - \frac{{\eta_{c} }}{\tau a}) $$
(6)

In the formula, \(T_{a}\) represents the actual temperature; \(T_{C,noct}\) represents the photovoltaic panel temperature under the rated state; \(T_{a,noct}\) represents the actual temperature defined by NOCT; \(G_{T}\) represents the light intensity; \(G_{T,noct}\) represents the light intensity defined by NOCT; \(\eta_{c}\) represents the efficiency of the solar photovoltaic panel; \(\tau ,a\) indicates the care for the penetration and absorption rate of solar photovoltaic panels.

2.2.3 Lithium-Ion Battery

The service life and discharge degree of a lithium-ion battery have a great relationship with the number of times the battery is charged and discharged. The degree of discharge of the battery is the ratio of the amount of electricity released by the battery to the rated capacity, expressed by. Usually the condition is less than or equal to 80% to prolong the life of the battery. The state of charge represents the ratio between the battery capacity and the rated capacity of the battery in a steady state at a temperature of 25 °C, and is generally expressed. The state of charge of the lithium battery is constantly changing dynamically, and its state of charge will calculate the amount of electricity consumed or absorbed in the previous period and update it at each time point.

The state-of-charge formula for charging and discharging a lithium-ion battery is shown in. The relationship between the state of charge and the depth of discharge is shown below.

$$ SOC(t + 1) = SOC(t) - \frac{{P_{BAT} (t) \cdot \Delta t}}{{Q_{R} \cdot \eta_{dis} }}\quad P_{BAT} (t) \ge 0 $$
(7)
$$ SOC(t + 1) = SOC(t) - \frac{{P_{BAT} (t) \cdot \Delta t}}{{Q_{R} \cdot \eta_{ch} }}\quad P_{BAT} (t) \le 0 $$
(8)
$$ DOD = 1 - SOC $$
(9)

In the formula, \(SOC(t + 1)\), \(SOC(t)\) represents the state of charge of the lithium ion battery at \(t + 1,t\); \(P_{BAT} (t)\) represents the charge and discharge power of the lithium ion battery per unit time, the value during charging is less than 0, and the value during discharging is greater than 0; \(\eta_{dis}\) represents the discharge efficiency of the lithium ion battery; \(\eta_{ch}\) represents The charging efficiency of a lithium-ion battery; \(Q_{R}\) is the rated capacity of the battery.

2.2.4 Electrolyzer Model

The working process of the electrolytic cell is a redox reaction, which conforms to the law of conservation of matter. In the process of electrolysis of water, 96485.31 C of electricity will be consumed for every 1 mol of electron change. Therefore, the amount of gas produced by the electrolysis process is positively related to the current. The alkaline solution is only to improve the conductivity of the solution, and does not participate in the actual electrolysis process, so it will not produce consumption.

According to the formula, it can be concluded that 1 unit of hydrogen is generated by electrolysis and 2 units of electrons are transferred. The specific relationship between the rated power of the electrolyzer and the hydrogen content is expressed as follows:

$$ P_{{N{ - }ele}} = \frac{{Q_{N} \cdot 2 \cdot N_{A} }}{{V_{M} \cdot C_{O} \cdot 3600}}V_{N} \frac{1}{{\eta_{ele} }} $$
(10)
$$ Q = \frac{{P_{\tan k} }}{{P_{{N{ - }ele}} }}Q_{N} $$
(11)

In the formula: \(P_{{N{ - }ele}}\) is the rated power of the electrolysis process of the electrolytic cell; \(Q_{N}\) is the rated hydrogen production rate; \(P_{\tan k}\) is the equivalent power of volume hydrogen; \(N_{A}\) is the constant 6.021023; \(V_{M}\) is the molar volume, 24.5 L/mol; \(\eta\) is the electrolytic cell efficiency of 75%.

2.2.5 Hydrogen Storage Tank Model

The hydrogen storage tank is a device that stores the hydrogen produced by the electrolyzer and provides fuel for the fuel cell. The hydrogen storage tank is generally composed of a container, a valve, a hydrogen storage material, and a gas guiding structure. The hydrogen storage method of the hydrogen storage tank has the advantages of large capacity and high safety factor. By electrolyzing water to produce hydrogen from excess electrical energy, it not only reduces the charging and discharging pressure of batteries in the microgrid, but also can store hydrogen to meet the use of hydrogen. The specific energy conversion relationship:

$$ P_{{el{ - }\tan k}} (t) = P_{{gen{ - }el}} (t) \times \eta_{el} $$
(12)

In the formula, \(P_{{el{ - }\tan k}} (t)\) represents the energy of hydrogen charged in the time hydrogen storage tank, \(P_{{gen{ - }el}} (t)\) represents the excessive power generation in the microgrid and the energy flowing to the electrolyzer, \(\eta_{el}\) is the efficiency of the alkaline electrolyzer.

2.2.6 Converter Model

As a device that converts electrical energy, converters are generally divided into DC/AC inverters, DC/DC choppers, AC/DC rectifiers, AC/DC/AC voltage conversion and frequency conversion, etc. [20]. The use of current transformers can meet the input and output requirements of distributed power and energy storage equipment.

In the microgrid system, wind turbines and solar photovoltaics can generate alternating current and direct current, and the converter can convert the electric energy to alternating current and direct current. In the entire microgrid system, converters are required between the supply and demand of equipment to ensure the power exchange between AC and DC system components. The capacity expression of the converter is shown below.

$$ P_{inverter} = \frac{{E_{load,\max } }}{{\eta_{inverter} }} $$
(13)

In the formula: \(E_{load,\max }\) represents the maximum load in the microgrid; \(\eta_{inverter}\) represents the power conversion efficiency of the converter, and the calculation formula is as follows.

$$ \eta_{inverter} = \frac{{P_{out} }}{{P_{in} }} $$
(14)

When the converter is working, the input electrical power will be consumed as the energy inside the device, and no power will be generated. An electrical power proportional to the input is then output. When the rated power is reached, the output will be limited due to temperature and its own limitations. When the input is too large, the output power remains unchanged, and the efficiency is reduced by the formula. The converter selected in this paper has a conversion efficiency of 90%.

3 Optimization Objectives and Constraints

3.1 Optimization Goals

In this microgrid system, the optimization objective is selected as the total net present cost of the system (Net Present Cost, NPC).

Total System Cost

The total net cash cost of the system refers to the difference between the total cost and the benefit obtained in the whole life cycle of the microgrid. The cost of microgrid mainly includes initial equipment investment, operation cost, replacement consumption, fuel consumption cost, environmental pollution control cost and power grid purchase cost. The total benefit of the microgrid is the grid-connected benefit of the residual value of equipment and excess electricity. The microgrid system in this paper is an off-grid type and does not require an external power grid. Moreover, the distributed power sources in the microgrid system are all renewable and clean energy sources, and there is no environmental pollution problem. Therefore, the pollution emission penalty can be ignored in the net cash cost of this system. Compared with the power purchase cost of the power grid, only four parts are considered: the investment cost of the equipment in the system, the operation and maintenance cost, the replacement cost and the equipment residual [21].

The total net cash cost of the microgrid system is:

$$ C_{NPC} = C_{CNPC} + C_{RNPC} + C_{SNPC} + C_{OMNPC} $$
(15)

In the formula, \(C_{CNPC}\) represents the investment cost of related devices in the microgrid; \(C_{RNPC}\) represents the replacement cost of the device in the microgrid; \(C_{SNPC}\) represents the residual value of the device in the microgrid; \(C_{OMNPC}\) represents the operation and maintenance cost of the device in the microgrid.

3.2 Constraints

3.2.1 Equipment Operation Constraints

  1. (1)

    Power generation constraints of the fan system

    $$ 0 \le P_{WT} \le P_{WT.\max } $$
    (16)

In the formula, represents the maximum generating power of the fan system.

  1. (2)

    Power generation constraints of photovoltaic solar panels

    $$ 0 \le P_{PV} \le P_{PV.\max } $$
    (17)

In the formula, represents the maximum power generation of photovoltaic solar panels.

  1. (3)

    Li-ion battery output power and SOC constraints

    $$ SOC_{\min } \le SOC(t) \le SOC_{\max } $$
    (18)
    $$ - P_{bat.d\max } \le P_{bat} \le P_{bat.c\max } $$
    (19)
    $$ SOC(t + \Delta t) = SOC(t) - \frac{{\eta_{bat} P_{bat} (t)\Delta t}}{{E_{bat} }} $$
    (20)

In the formula: \(SOC_{\min }\), \(SOC_{\max }\) respectively represent the minimum and maximum state of charge of the lithium-ion battery; \(P_{bat.c\max }\), \(P_{bat.d\max }\) respectively, represent the maximum charge and discharge power of the lithium-ion battery; \(\eta_{bat}\) represent the conversion efficiency of the lithium-ion battery; \(E_{bat}\) represent the lithium-ion battery capacity; \(\Delta t\) represent the time step.

3.2.2 Capacity Constraints of Microgrid-Related Equipment

$$ S_{WT.\min } \le S_{WT} \le S_{WT.\max } $$
(21)
$$ S_{PV.\min } \le S_{PV} \le S_{PV.\max } $$
(22)
$$ S_{BAT.\min } \le S_{BAT} \le S_{BAT.\max } $$
(23)
$$ S_{HESS.\min } \le S_{HESS} \le S_{HESS.\max } $$
(24)
$$ S_{CON.\min } \le S_{CON} \le S_{CON.\max } $$
(25)

In the formula: \(S_{WT.\max }\), \(S_{WT.\min }\) respectively represent the maximum and minimum capacity of the fan system; \(S_{PV.\max }\), \(S_{PV.\min }\) respectively represent the maximum and minimum capacity of the photovoltaic solar panel; \(S_{BAT.\max }\), \(S_{BAT.\min }\) respectively represent the maximum and minimum capacity of the lithium-ion battery; \(S_{HESS.\max }\), \(S_{HESS.\min }\) respectively represent the hydrogen energy storage system capacity The maximum and minimum values; \(S_{CON.\max }\), \(S_{CON.\max }\) represent the maximum and minimum values of the converter capacity.

3.3 Comparison of Hydrogen Production Capacity and Gasoline Production Capacity

In this paper, the use of hydrogen generated by wind and solar resources can effectively reduce the demand for gasoline, thereby greatly reducing the production of carbon dioxide, carbon monoxide and other particulate matter. According to the lower heating value of hydrogen and gasoline fuel [22], the microgrid system is calculated. The consumption of gasoline (kg) that can be replaced by the hydrogen produced, the specific calculation relationship is as follows:

$$ M_{GFuel} = \frac{{M_{{H_{2} }} \times LHV_{{H_{2} }} }}{{LHV_{GFuel} }} $$
(26)

where: represents the annual hydrogen production of the microgrid system; represents the minimum heating value of hydrogen (119.9 MJ/kg) [23], and represents the minimum heating value of gasoline (43.4 MJ/kg) [24].

Therefore, the annual emissions of carbon dioxide and carbon monoxide that can be reduced by hydrogen production in the microgrid system are expressed as follows:

$$ A_{{CO_{2} }} = M_{GFuel} \times SE_{{CO_{2} }} $$
(27)
$$ A_{CO} = M_{GFuel} \times SE_{CO} $$
(28)

In the formula:, respectively represent the specific emission factors of carbon dioxide and carbon monoxide in the combustion process of gasoline, in which the emission coefficient of carbon dioxide is 2.3 kg per kilogram of gasoline, and the emission coefficient of carbon monoxide is 0.00766 kg per kilogram of gasoline [25].

4 Simulation Results and Analysis

4.1 Introduction of HOMER Simulation Software

The HOMER simulation software is developed by the US Department of Energy Renewable Energy Laboratory (NREL) based on C/C++. It has been widely used in microgrid systems and distributed power sources in renewable energy. HOMER contains a large number of ready-made models, mainly including wind turbine models, solar photovoltaic models, grid models and load models, and operators can build new models according to their own needs. The biggest advantage of this simulation software is that it can convert the microgrid system model built by the operator into a set of related schemes, and use the scheme sensitivity to analyze, and can conduct simulation on the investment situation, energy and capital flow conditions in the simulation on the premise of actual operation. Simulation: After building the microgrid system model, the operator can use the HOMER software to obtain the capacity configuration with the lowest net cash cost, and perform data analysis on the required results [22, 26]. HOMER simulation software has the following features.

  1. (1)

    System simulation

The characteristic of HOMER software is that it can simulate the system model. By simulating a system, the operator can obtain the model of the combination of various equipments. By setting different parameters, HOMER software can generate a large number of simulated systems. The operator can set the time step of the simulation according to the needs, which is generally between 1 min and 1 h. During the simulation process, the software takes into account the investment cost of the equipment. Operation and maintenance costs. Replacement costs and environmental treatment costs, etc.; finally obtain the corresponding system configuration results, the cost ratio of each equipment, the proportion of power generation, the operation of the equipment, etc.

  1. (2)

    Process optimization

The HOMER software considers all possible combinations during operation and ranks the system results according to the selected optimization variables. Due to the “no-derivative” algorithm, the design process of determining the minimum cost of the microgrid system can be greatly simplified, and the simulation optimization results of the system will be arranged in an increasing manner according to the total net cash cost.

  1. (3)

    Sensitivity analysis

Under normal circumstances, the built system is relatively complex, and the operator cannot master all aspects of the system. Therefore, a large number of simulations and comparisons are required to better understand the importance of some variables and parameters. HOMER software has a sensitivity analysis function, which can provide the operator with the functions of all variables, such as light intensity, wind speed, etc., and can also understand the changes of various variables and parameters in the microgrid system under the optimal state conditions. At present, HOMER software has become the software of choice when many foreign scholars study the economics of distributed energy and microgrid.

4.2 HOMER Software Principle and Evaluation Index

4.2.1 Software Principle

HOMER simulation software has now been widely used in the planning and construction of smaller-scale microgrid systems. In the construction of the model, the first step is to select the constituent equipment and models in the microgrid system, such as fan systems, photovoltaic solar panels, electrolyzers, hydrogen storage tanks, energy storage batteries, etc.; in the second step of the model system Input of relevant parameters, such as the local geographical location of the research object, natural resources such as wind and light, the relevant cost of the equipment in the system, and the service life, etc.; Finally, through simulation, various combination schemes and each equipment in the system can be obtained. Sensitivity analysis can also be used to obtain the influence of different parameter conditions on the capacity configuration results of the microgrid system. For the situation that cannot be run, the HOMER simulation software will give specific adjustment parameters [26]. The flow chart of the calculation principle of the simulation software is shown in Fig. 3.

Fig. 3.
figure 3

Flowchart of software calculation principle

4.3 Microgrid System Modeling Based on HOMER Software

4.3.1 Optimal Capacity of Microgrid System

Taking Chongli, Zhangjiakou as the research object, the capacity allocation optimization of the microgrid system is carried out through the timing load and local wind and solar resources. The installed capacity of the hydrogen storage tank and the installed capacity of the converter.

$$ S = [S_{WT} ,S_{PV} ,S_{BAT} ,S_{ELE} ,S_{HT} ,S_{CON} ] $$
(4.1)

where: \(S_{WT}\) represents the installed capacity of the fan system; \(S_{PV}\) represents the installed capacity of the solar photovoltaic system; \(S_{BAT}\) represents the installed capacity of the lithium-ion battery energy storage system; \(S_{ELE}\) represents the installed capacity of the electrolyzer; \(S_{HT}\) represents the installed capacity of the hydrogen storage tank; \(S_{CON}\) represents the installed capacity of the converter.

4.3.2 Microgrid System Structure

In this paper, Zhangjiakou Chongli (latitude: 40.5; longitude: 114.5; altitude: 1200 m; the test wind speed altitude is 10 m) is used as the research object. The specific local data are shown in Table 2. Build a simulation structure through the HOMER simulation software, and set relevant parameters: the power of the electrical load is 2400 kWh/d, of which the peak power is 183.32 kWh/h, and the demand of the hydrogen load is 730 kg/d, of which the peak demand is 72.11 kg/h; The initial capacity of the hydrogen storage tank is 80%, the initial capacity of the lithium-ion battery is 80%, the minimum capacity is 30%, and the working efficiency of the electrolyzer is 75%. The life of the simulated system is 35 years, the maximum allowable power shortage rate is 0.5%, the actual annual interest rate is 8%, and the expected expansion rate is 2%. The load following strategy (LC) and the cyclic charging strategy (CC) are adopted. Controls the run strategy.

Table 2. Local scenery and natural resources of the study subjects

According to Table 2, it can be concluded that the local wind energy and sunlight resources of the research object are sufficient, and a micro-grid system with wind turbine system and solar photovoltaic power generation based on renewable energy can be built. In this microgrid system, the installed capacity of the distributed power generation is restricted by its own volume and floor area, and the optimal variables of the microgrid system are in the range of (units), kW, kg, and kW. Other equipment variables in the microgrid system are not constrained, and the given equipment optimization variables are optimally configured and combined within the specified variation range. Figure 4 shows a typical local daily load curve. The cost parameters of related equipment in the microgrid system are shown in Table 3.

Fig. 4.
figure 4

Typical daily load curve

Table 3. Cost parameters of the equipment related to the microgrid

According to the data in Table 2, the HOMER simulation software is used to obtain the discrete data of local wind energy, light resources and load throughout the year. The discrete annual hourly wind speed data and light intensity data are shown in Figs. 5 and 6. The obtained discrete data is used as the input data of the system simulation, and the system simulation is carried out.

Fig. 5.
figure 5

Hourly wind speed data for the year after discrete

Fig. 6.
figure 6

Data on hourly light intensity for the year after discrete

In the HOMER simulation software, by referring to the inputted microgrid system parameters, load data and the local wind speed, light intensity and other data of the research object, the power generation of the distributed power generation in the microgrid system for 8760 h in a year can be obtained. The hourly power generation is compared with the load. The simulation step size of each hour not only proves the accuracy of the simulation optimization results, but also reduces the calculation time of the optimization process. The discrete hourly load data for the whole year are shown in Figs. 7 and 8.

Fig. 7.
figure 7

Electric load data for the full year after discrete

Fig. 8.
figure 8

Hydrogen load data for the full year after discrete

4.4 System Simulation Results and Analysis

4.4.1 Optimization Results and Analysis

Compared with other professional optimization software, HOMER simulation software simulates with the conditions set in advance, arranges the simulation results and the size of the net cash cost, and outputs the equipment configuration scheme required by the load, and the configuration scheme of the final equipment optimization results. As shown in Table 4.

Table 4. Capacity configuration results of the microgrid system

From Table 4, it can be concluded that after the HOMER simulation software sets specific conditions and performs system simulation, the optimal combination scheme of microgrid system equipment is 2 wind turbines, 2000 kW solar photovoltaic battery, and 2000 kW lithium-ion battery capacity. 86 pieces, electrolyzer capacity 2800 kW, hydrogen storage tank capacity 600 kg converter 2682kW, system control operation strategy is load following control strategy. In this scenario, the total net cash cost of the microgrid system is 138.75 million yuan. In all simulation schemes, the utilization rate of renewable energy is 100% because they are based on wind energy and solar energy, which ensures the non-polluting of the microgrid system, which is in line with the “carbon peak and carbon neutrality” advocated by the current society. Dual carbon policy.

In the optimal system configuration scheme, the electric energy in the microgrid is mainly supplied by wind energy and solar energy jointly, but in other combination schemes, the electric energy is only supplied by wind energy or solar energy alone. A microgrid system where energy sources are mixed for power supply has more economic advantages than a single system. In the microgrid system, the distributed power generation units are all renewable resources. With the continuous development of distributed renewable power technology, the corresponding microgrid costs will continue to decline, so the integrated microgrid system technology has a very broad development. Prospect: From the results of the scheme in Table 4, the total net cash cost of the optimal scheme and the capacity configuration of the related equipment in the microgrid system can be obtained. The summary chart of the cash flow of the microgrid system according to different investment cost types of the optimal scheme is shown in Fig. 9. As shown in the figure, it can be concluded that in the initial investment cost, wind turbines account for the largest proportion of 38.28%, the investment cost of solar photovoltaic cell systems accounts for 14.85%, and the investment cost of electrolyzers accounts for 23.82%. The investment cost of the hydrogen storage tank accounted for 9.92%, the investment cost of the converter accounted for 8.25%, and the investment cost of the lithium-ion battery energy storage system accounted for 4.88%. It is comprehensively explained that the wind turbine system occupies most of the investment cost in the microgrid system, so it is also the main power generation unit of the microgrid system.

Fig. 9.
figure 9

Summary of system cash flow distinguished by cost type

From Fig. 9, it can be clearly seen that, except for the lithium-ion battery energy storage system, the initial investment cost of related equipment in the microgrid system is far greater than the maintenance and replacement costs of the equipment. The maintenance cost and replacement cost of the lithium-ion battery energy storage system are far greater than the initial investment cost, which is completely different from the total cost distribution of other related equipment. The initial investment cost, replacement cost and operation and maintenance cost of the lithium-ion battery energy storage system account for the proportion of its own total investment cost is 23.69%, 42.28% and 34.03% respectively. The replacement cost of the fan system and the solar photovoltaic cell system is far greater than the operation and maintenance cost of the equipment.

Figure 10 shows the cash summary of the microgrid system according to the operating years. It can be concluded that the initial investment in the microgrid system is 13.96 million yuan, the equipment replacement cost is 3.777 million yuan, the operation and maintenance cost is 139,700 yuan, and the system recovery cost is 173.5 10,000 yuan, Fig. 10 shows the cash flow of the hybrid microgrid system over its useful life.

Fig. 10.
figure 10

Annual cash flow by component

4.4.2 Optimum Scheme Determination and Analysis

On the premise of the known wind energy, light energy resources and the specific cost of related equipment, the simulation software has made the best equipment configuration plan: 2 wind turbines, 2000 kW solar photovoltaic battery capacity, 86 lithium-ion battery capacity, Electrolyzer capacity 2800 kW, hydrogen storage tank capacity 600 kg and converter 2682 kW. In the optimal combined configuration system, the power generation amount and the power generation proportion of the relevant power generation units in the system operation for one year are shown in Table 5. From the data in the table, it can be concluded that the power generation proportion of the wind turbine system is 80.6%, and the solar photovoltaic power generation proportion is 80.6%. The power generation of the battery accounts for 19.4%, which is far less than the power generation of the wind turbine system. Therefore, the wind turbine plays the main role of power generation in the microgrid system.

Table 5. Power generation and proportion of power generation units of the microgrid system

The output of the power generation unit in each month of the year is shown in Fig. 11. From the figure, the output of the power generation unit in each month can be obtained. The output of the wind turbine system is much larger than that of the photovoltaic cell. However, the output of photovoltaic cells is greatly affected by the environment. From June to September, the power generation of photovoltaic cells accounts for a larger proportion than other times of the year. The power generation ratio of wind turbines is relatively small from June to September compared with other times. Therefore, the wind-solar complementary power generation method can make up for the volatility and intermittent shortcomings of natural resources to a certain extent, and ensure sufficient power generation. Ensure the stable operation of the microgrid system. Figures 12 and 13 show the heat maps of wind turbines and solar photovoltaic cells in the microgrid system at different times of the year. From Fig. 12, it can be concluded that in spring and winter, the power generation output of wind turbines is relatively sufficient, which is more in line with the local wind energy situation of the research object. From Fig. 13, it can be concluded that the power generation of solar photovoltaic cells in a day varies greatly, generally concentrated between 11:00 and 14:00. In the horizontal time span, solar photovoltaic cells generate more electricity during summer than at other times.

Fig. 11.
figure 11

Monthly power generation of the system components in the optimal configuration

Fig. 12.
figure 12

Heat map of wind turbine

Fig. 13.
figure 13

Heat map of power generation of solar photovoltaic cells

When the simulation software is used to configure the capacity of the microgrid, the hydrogen storage level of the hydrogen storage tank and the SOC state change of the lithium-ion battery in the system for 8760 h in a year are obtained, which are shown in Figs. 14 and 15, respectively. From the pictures, it can be seen that the hydrogen storage capacity of the hydrogen storage tank in summer and autumn is less than that in spring and winter, but the hydrogen storage capacity of the system can well meet the hydrogen demand of the hydrogen filling station, which proves that the relevant capacity selection of the system is correct. The overall level of the SOC state of lithium-ion batteries in summer and autumn is lower than that in spring and winter. Therefore, compared with the two seasons of summer and autumn, the power supply in spring and winter is more abundant, and the reliability of power supply of the system is more stable.

Fig. 14.
figure 14

Hydrogen storage capacity of hydrogen storage tank

Fig. 15.
figure 15

Annual SOC change of lithium battery

4.5 Hydrogen’s Ability to Replace Gasoline and Reduce Carbon Emissions

From the hydrogen produced by the microgrid system, the amount of gasoline that can be replaced with hydrogen as a transport fuel can be calculated. From this, it is possible to calculate the amount of carbon dioxide and carbon monoxide emissions that can be reduced by using hydrogen as a fuel. The specific results are shown in the following table. According to the data in the table, the use of hydrogen as fuel can replace 495.21 tons of gasoline every year, which can lead to a reduction of 1138.98 tons and 3.80 tons of carbon dioxide and carbon monoxide emissions respectively. It can greatly reduce carbon emissions, which is more in line with the “dual carbon” policy advocated by the government (Table 6).

Table 6. Annual gasoline replacement and carbon emission reduction

5 Conclusion

In this study, the simulation results show that the optimized hybrid microgrid system consists of 2000 kW photovoltaic modules, 2 wind turbines, 86 batteries, 2682 kW inverter, 2800 kW electrolyzer and 600 kg hydrogen tank. The total net cash cost and renewable energy utilization rate of the optimized microgrid system are 138.75 million yuan and 100%, respectively. In this way, the supply of hydrogen bus fuel during the Winter Olympics is guaranteed, and it is also in line with the dual-carbon policy of “carbon peaking and carbon neutrality” advocated by the current society. At the same time, the annual hydrogen production of the micro-grid system can replace the use of 495.21 tons of gasoline, and it is expected to reduce carbon dioxide and carbon monoxide emissions by 1,138.98 tons and 3.80 tons, respectively.