# Mathematics-Driven Analysis of Offshore Green Hydrogen Stations
## 2 Materials and Methods
### PHASE II: Modeling of Solar Electricity Generation
\begin{array}{c}\
abla t=229.18\times(0.000075+0.001868\times cos(x)-0.0320 77\times sin(x)\\ -0.014615\times cos(2x)-0.040849\times sin(2x))\end{array}  \tag{5}\]  
where x is an expression calculated as follows:  
\[x=\frac{2\pi}{N_{days}}\times\bigg{(}\ N-1+\frac{(h_{local}-12)}{24}\bigg{)} \tag{6}\]  
By combining equations (Equations (4)-(6)), the corrected solar angle equation (\(\alpha_{solar\_corrected}\)) was obtained:  
\[\alpha_{solar\_corrected}=\frac{360^{\circ}}{24}\times\bigg{(}(h_{local}-12)+ \ \frac{\
abla t}{60}\bigg{)} \tag{7}\]  
where the value of \(\
abla t\) is divided by 60 to convert it to hours (Equation (7)). The solar elevation angle (\(\alpha_{solar\_elevation}\)) is the angle formed by the solar rays with the horizon line as seen from the location of the green hydrogen station. This angle is modeled using a trigonometric relationship that depends on _lat_ (Equation (1)), \(\alpha_{declination}\) (Equations (2) and (3)), and \(\alpha_{solar\_corrected}\) (Equation (7)):  
\[ \begin{array}{c}\alpha_{solar\_elevation}=\frac{360}{2\pi}\times arcin(cos( lat)\times cos(\alpha_{solar\_corrected})\times cos(\alpha_{declination})\\ +sin(lat)\times sin(\alpha_{declination}))\end{array}  \tag{8}\]The solar azimuth angle (\(\alpha_{solar\_zismuth}\)) is the angle formed by the sun's rays relative to the Earth's south, or north, depending on the hemisphere where the station is located. Similar to \(\alpha_{solar\_elevation}\) (Equation (8)), the model for \(\alpha_{solar\_zismuth}\) (Equation (9)) is a trigonometric relationship that depends on _lat_ (Equation (1)), \(\alpha_{declination}\) (Equations (2) and (3)), \(\alpha_{solar\_corrected}\) (Equation (6)), and, additionally, \(\alpha_{solar\_elevation}\) (Equation (8)). \[\alpha_{solar\_azimuth}=\frac{360}{2\pi}\times arccos\bigg{(}\frac{cos(lat) \times sin(\alpha_{declination})-sin(lat)\times cos(\alpha_{solar\_corrected}) \times cos(\alpha_{declination})}{cos(\alpha_{solar\_elevation})}\bigg{)} \tag{9}\]  
To ensure the correct visualization of \(\alpha_{solar\_azimuth}\) values, the result of equation (Equation (9)) was corrected (Equation (10)) based on the sign of \(\alpha_{solar\_corrected}\) (Equation (7)) and adjusted within the interval [\(-180^{\circ}\), \(180^{\circ}\)] (Equation (11)):  
\[\alpha_{solar\_azimuth}= \begin{bmatrix}\alpha_{solar\_zimuth}&if\ \alpha_{solar\_ corrected}<=0\\ 360-\alpha_{solar\_azimuth}&if\ \alpha_{solar\_corrected}>0\end{bmatrix}  \tag{10}\]  
\[\alpha_{solar\_zimuth}=180-\alpha_{solar\_azimuth} \tag{11}\]  
The generation of photovoltaic energy is only possible within the time range where \(\alpha_{solar\_elevation}\) is greater than 0, as observed from the location of the photovoltaic panels, in other words, within the time range in which solar radiation is available to impact the surface of the photovoltaic panels. This time range (\(d_{length}\)) was modeled based on _lat_ (Equation (1)), \(\alpha_{declination}\) (Equations (2) and (3)), and, subsequently, by calculating the difference between _sunset_ and _sunrise_ times (Equation (12)):  
\[ \begin{array}{l}surtise=-\frac{1}{15}\times\frac{360}{2\pi}\times arccos(- tan(lat)\times tan(\alpha_{declination}))\\ sunset=\frac{1}{15}\times\frac{360}{2\pi}\times arccos(-tan(lat)\times tan( \alpha_{declination}))\\ d_{length}=sunset-sunrise\end{array}  \tag{12}\]  
where \(d_{length}\) is expressed in hours (\(h\)). The calculation of sunrise and sunset is referenced to 12 p.m. local time. The calculations of \(\alpha_{solar\_elevation}\) (Equation (8)) and \(\alpha_{solar\_azimuth}\) (Equation (9)) allow for determining the unit coordinates \(X\), \(Y\), and \(Z\), which are used to plot the solar trajectory relative to the station's position (Equation (13)). \[ \begin{array}{l}X=cos(\alpha_{solar\_elevation})\times sin(\alpha_{solar\_ azimuth})\\ Y=cos(\alpha_{solar\_elevation})\times cos(\alpha_{solar\_ azimuth})\\ Z=sin(\alpha_{solar\_elevation})\end{array}  \tag{13}\]