## 4 Modeling a Solar-Hydrogen System in the University
### Simulation Result  
In order to simulate the dynamic behavior of a solar-hydrogen system using Simulink MATLAB, a number of components, including SOC, PSolar, Pstorage, PElectryzer, and mH2, must be integrated. The representation of solar power generation (PSolar), which is based on solar irradiance levels and panel properties, is at the center of the simulation. Next, this electrical power is put to use in a variety of ways, such as powering the electrolyzer (PElectryzer) to create hydrogen and charging energy storage devices (PStorage) like batteries. As energy is stored or released, the energy storage system's State of Charge (SOC), which dynamically adjusts, indicates the quantity of energy that is accessible for usage. The mass of hydrogen created throughout the hydrogen generation process is represented by mH2, which further influences the dynamics of the system as a whole. Through the use of Simulink simulations, engineers are able to examine the functionality, effectiveness, and interplay of the solar-hydrogen system in a variety of scenarios. The development of control algorithms for energy management, the optimization of system design parameters, and the assessment of the overall sustainability and reliability of the system are all made easier by this simulation. Engineers can improve solar-hydrogen  
Figure 4: Energy storage. system designs for maximum performance and to forward the development of clean energy technologies by using extensive simulation (Figure 5). When simulating an energy storage system using Simulink Matlab, setting the initial State of Charge (SOC) to 100% is more commonly a modeling convention than an accurate depiction of the system. For simplicity's sake and to show that the battery is completely charged at the start of the simulation, many simulations begin with a SOC of 100%. As a result, the starting circumstances are made simpler, and the simulation can start with the battery fully charged and prepared to provide energy when needed. However, in real-world scenarios, a battery's initial State of Charge (SOC) could change based on its usage pattern, level of charging, and external factors. In real-world situations, batteries might not always start completely charged since they might have self-depleted over time or been partially discharged during prior usage cycles. As a result, even while simulations frequently employ the starting SOC value of 100% for simplicity, it is crucial to understand that actual battery systems may have varied initial SOC values depending on their unique operating conditions and past. More realistic simulations of battery behavior and system performance can be achieved by changing the starting SOC value to reflect actual conditions. A dynamic relationship between solar power intake and energy storage levels is indicated by the analytical findings of PSolar and SOC (State of Charge) (Figure 6). Beginning with a SOC of 100, the SOC progressively drops to 75, while PSolar fluctuates between 230 and 250. This drop in SOC illustrates how the system may adjust to shifting energy generating conditions by using stored energy in response to fluctuating solar power inputs. There is a correlation between solar power generation and energy storage, according to the analysis of PSolar and PStorage, where PSolar ranges from 230 to 250 and PStorage from \(-10\) to \(-2\) (Figure 7). Higher energy storage rates at times of excess solar power generation are indicated by PStorage becoming more negative as PSolar increases. In contrast, PStorage tends to be less negative or even positive when PSolar drops, indicating the release of stored energy to satisfy demand. Figure 5: Performance results of SOC, PSolar, PStorage, PElectrolyzer, and mH2. The analysis of PSolar (solar power generation) and Pstorage (energy storage) demonstrates the relationship between solar power generation and energy storage. The band of 230 to 250 is where PSolar swings, showing changes in solar power output over time.