2.2.1. Mathematical Modeling of Electrolytic Cell

Electrolyzed water is a widely used primary hydrogen production method in industrial hydrogen production [21]. The electrolyzer electrolyzes water into hydrogen and oxygen. There are alkaline electrolyzers, proton exchange membrane electrolyzers, and solid oxide electrolyzers. Compared with other electrolyzers, alkaline electrolyzers have higher efficiency and the best hydrogen production capacity. The system life is twice as long as that of proton exchange membrane electrolyzers, and the cold start-up time is shorter than that of solid oxide electrolyzers. An alkaline electrolyzer is the safest, most mature, and most widely used. The hydrogen production rate of an alkaline electrolyzer is [22]

$$\begin{cases} \begin{array}{c} V\_{\text{F}\_2} = \eta\_F \frac{N\_C}{2F} I \\ \eta\_F = 96.5e^{\left(\frac{0.09}{l} - \frac{75.5}{l^2}\right)} \end{array} \tag{4} $$

where: *V*H2 is the hydrogen production rate; *η<sup>F</sup>* is Faraday efficiency; *NC* is the number of electrolyzers; *F* is Faraday constant (C/mol); *I* is the current in the electrolytic cell.

In practice, the electrolytic cell cannot be electrolyzed entirely, and its conversion efficiency is represented by

$$P\_{\rm H\_2}(t) = \eta\_{\rm EL} P\_\mathbf{c}(t) \tag{5}$$

where: *P*H2(*t*) is the power generated by hydrogen production in the electrolytic cell; *P*e(*t*) is the electricity consumption of the electrolytic cell; and *η*EL is the conversion efficiency of electricity and hydrogen in the electrolyzer.

#### 2.2.2. Mathematical Modeling of Fuel Cell

A mathematical example is provided for the fuel cell:

$$Q\_{\rm H\_2fc} = \frac{N\_{\rm S} P\_{\rm fc}}{\mathcal{U}\_{\rm fc} (2F)} \tag{6}$$

where: *Q*H2fc is the hydrogen consumption of the fuel cell; *N*<sup>S</sup> is the number of batteries connected in series; *P*fc is the output power of the fuel cell; *U*fc is the battery voltage; and *F* is the Faraday constant (C/mol).

#### 2.2.3. Mathematical Modeling of Hydrogen Storage Device

Most hydrogen storage devices use hydrogen storage tanks, which can store the hydrogen produced by electrolytic cells and provide hydrogen for fuel cells. The hydrogen storage tank device has the characteristics of low cost, high safety, and fast charging and discharging speed. A hydrogen storage tank is characterized by a mathematical model:

$$Pa\_{\rm H\_2} = \frac{RT\_a}{V} \int\_{t\_1}^{t\_2} \left(V\_{\rm H\_2} - Q\_{\rm H\_2\rm fc}\right) dt\tag{7}$$

where: *Pa*H2 is the pressure of the hydrogen storage tank; *R* is a gas constant; *T*<sup>a</sup> is the thermodynamic temperature of the gas; *V* is the total capacity of the hydrogen storage tank; *t*<sup>1</sup> and *t*<sup>2</sup> are the start time for starting hydrogen production and the end time for stopping hydrogen production, respectively.

#### *2.3. Battery Modeling*

A storage battery is a kind of galvanic energy storage, while chemical energy storage is a relatively stable and high-grade energy storage method. This article selected a lithium battery as a storage battery, and the running state of the storage system is marked by the state of charge (*SOC*) of the lithium battery. When *SOC* = 1, the battery capacity reaches a maximum value [23]. The battery output model is

Charging status:

$$\text{SOC}(t) = \text{SOC}(t-1)(1-\sigma) + P\_c(t)\eta\_c \frac{\Delta t}{E\_{\text{max}}} \tag{8}$$

Discharge state:

$$\text{SOC}(t) = \text{SOC}(t-1)(1-\sigma) - P\_f(t)\frac{\Delta t}{\eta\_f E\_{\text{max}}} \tag{9}$$

where: *σ* is the charge and discharge rate of the storage battery; *P*<sup>c</sup> and *P*<sup>f</sup> are the charging and discharging power of the battery in *t* time; *η*<sup>c</sup> and *η<sup>f</sup>* are charge and discharge efficiency; and *E*max is the maximum capacity of the battery.

#### **3. Capacity Optimal Allocation Model**

Based on the microgrid system of wind–solar hydrogen storage, this paper not only considers the economy of the independent microgrid of wind–solar hydrogen storage; but also to consider the power fluctuations on the wind generated by the wind and light abandonment, so as to make the wind utilization rate to reach the highest, and put forward the corresponding optimization scheme.
