## 3 Modeling of Backup Systems
### Hydrogen Storage System
#### 3.1.2 Hydrogen Storage Tank  
Once \(H_{2}\) is generated, it must be stored safely and efficiently. The \(H_{2}\) tank is designed to store hydrogen gas at high pressure, ensuring it is readily available for use when needed. The storage capacity of the tank is a critical parameter as it calculates the amount of energy that can be stored for later use. Advanced storage technologies, including composite materials and cryogenic methods, are employed to maximize storage efficiency and ensure safety. Proper storage management is crucial to maintaining the integrity of the hydrogen and preventing leaks or other safety hazards. By storing energy in the form of hydrogen, the HSS provides a long-term energy storage solution that can balance seasonal variations in renewable energy production, thus guaranteeing a consistent energy supply even when renewable generation is low. It is kept under high pressure, and the tank's capacity can be calculated through the following formula [51]:  
\[V_{H_{2}}=\frac{m_{H_{2},EL}\times M_{HT}}{P_{H_{2}}\times\rho_{H_{2}}} \tag{3}\]  
when the PV and WTs produce more power than what is required by the load at time t, the electrolyzer will store hydrogen in the tanks. The quantity of hydrogen stored in the tank can be determined with the following formula [52]:\[E_{stor}(t)=E_{stor}(t-1)+\left[E_{gen}(t)-\frac{E_{Load}(t)}{\eta_{inv}}\right] \times\eta_{ele} \tag{4}\]  
The equation for the hydrogen storage tank describes how the amount of hydrogen stored at any time t is calculated based on the energy dynamics within the system. Specifically, the stored energy (\(E_{stor}(t)\)) is determined by adding the energy stored at the previous time step t \(-\) 1 to the net surplus energy generated at time t. This surplus energy is the difference between the energy generated by renewable sources (\(E_{gen}(t)\)) and the energy consumed by the load (\(E_{Load}(t)\)), adjusted for the efficiency of the inverter (\(\eta_{inv}\)). The resulting net energy is then multiplied by the electrolyzer's efficiency (\(\eta_{ele}\)), which dictates how effectively this energy is converted into storable hydrogen. This equation is essential for managing the conversion of excess renewable energy into hydrogen, allowing for effective energy storage that can be used during periods of lower generation or higher demand.  
Conversely, when there is insufficient power obtained from RESs, the stored hydrogen is converted into electricity using FCs. In this situation, the quantity of hydrogen in the tank can be calculated using the following formula:  
\[E_{stor}(t)=E_{stor}(t-1)-\frac{\left[\frac{E_{Load}(t)}{\eta_{inv}}-E_{gen}(t )\right]}{\eta_{FCs}\times\eta_{inv}} \tag{5}\]  
The equation describes the process of utilizing stored hydrogen to generate electricity when RESs are insufficient to meet the load demand. Specifically, it calculates the remaining energy in the hydrogen storage tank at time t by subtracting the amount of hydrogen used to cover the energy shortfall. This shortfall is determined by the difference between the load demand and the energy generated by RESs, adjusted for the efficiency of the inverter and the fuel cells. The equation ensures that the stored hydrogen is only depleted by the necessary amount to make up for the energy deficit, effectively balancing the system's energy needs when renewable generation is low. This approach helps maintain a reliable power supply while optimizing the use of stored hydrogen as a backup energy source.