## 2 Materials and Methods
### Methodology
Similarly to Table 7, the contents of Table 8, which concern the year 2020, are assumed to remain relatively the same in 2023. Figure 13 computes the combined hourly contribution of the diesel and Mazut power plants for each hour of the simulation. To estimate the annual carbon emissions generated during the simulation, the emission factors of diesel and Mazut were used ([40,41]) to calculate the annual CO\({}_{2}\) production, as \begin{table}
\begin{tabular}{c c} \hline
**Energy Source** & **Technology** \\ \hline RES & 24.1\% \\ Interconnection & 11.0\% \\ Diesel & 17.3\% \\ Mazut & 47.6\% \\ \hline \end{tabular}
\end{table} 
Table 7: Mixed energy sources of Crete in 2021. Figure 11: Calculation of hourly fuel cell system’s contribution. \begin{table}
\begin{tabular}{c c c} \hline
**Fuel Type** & **Production (MWh)** & **Consumption** \\ \hline Diesel & 622,574.2 & 193,545.6 (klt) \\ Mazut & 1,503,131.8 & 390,405.8 (m. ton.) \\ \hline \end{tabular}
\end{table} 
Table 8: Electricity generation and consumption for the two fuels for the Cretan system in 2020. Figure 12: Hourly green hydrogen production through successfully stored electrolysis. By referring to Figure 13 and Tables 7 and 9, the annual emissions can be calculated as the percentage of each fuel's contribution to the total power plant production multiplied by their respective emission factor under the assumption of identical fuel participation in 2023. Equation (2) represents this relationship. \[\text{Emissions}=\sum_{i=1}^{8760}\left(0.08157+0.37988\right)\times\text{TOTAL CONV}[i] \tag{2}\]  
The system's emissions are linearly correlated to the annual energy produced by the conventional system, which can be decreased down to the total sum of the hourly lower limit, a crucial aspect to be commented on in the appropriate section. The calculation of the energy import needed to fulfill the remaining demand is depicted in Figure 14. To ensure the simulation's hourly power balance, the imported energy is equal to the amount needed if all other measures do not suffice. The imports are attributed with the least priority, opting for their removal after the optimization process. In contrast to imports, exported energy is constrained by the capacity of the interconnection, which imposes an upper limit. The constraint is especially useful in case of extended renewable energy production, particularly from PV and WT systems, that could substantially increase during periods of intense sunlight and wind. Such limitation would turn out to be crucial, as surplus energy can be directed towards hydrogen production or rejected energy, which cannot be utilized by the system. From a financial perspective, this may also be advantageous, especially if revenue from selling green hydrogen exceeds that from exporting electricity via the interconnection, which often fluctuates in price according to the country's energy exchange. The calculation of surplus energy sold to the main grid is illustrated in both Figures 15 and 16. The algorithm has been divided into two images to improve readability. \begin{table}
\begin{tabular}{c c} \hline \hline
**Fuel Type** & **Emission Factor (tCO2/MWh)** \\ \hline Diesel & 0.306 \\ Mazut & 0.279 \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Emission factors for the two fuels. Figure 13: Power plant system’s total hourly contribution. If the electrolyzed energy has not reached its nominal value, the remaining energy is utilized for hydrogen production intended for industrial purposes, a crucial part of the business scheme, as it is the main contributor to the system's financial gain. The quantity is determined as illustrated in Figure 17.  
The calculation of the mass of hydrogen produced (in kilograms) requires the use of the lower heating value of hydrogen (LHV H\({}_{2}\)) set at 33.33 kWh/kg.