## 2 Materials and Methods
### Exergy and Exergoenvironmental Analysis  
The condition when the maximum useful work of a system is obtained when a system reversibly reaches equilibrium with its environment is termed exergy. Exergy is widely preferred in the analysis of the performance of thermodynamic systems because it deals with the quality rather than the quantity of energy, which enables losses and inefficiencies to be evaluated realistically [30]. The chemical exergy of the methane fuel can be determined using the exergy ratio relation,  
\[\Phi_{CH4}=\frac{ex_{f}}{LHV_{CH4}}, \tag{18}\]  
where \(\Phi_{CH4}\) = 1.06 [31], and \(LHV_{CH4}\) = 50,023 kJ/kg. The exergy balance of the combustion chamber is given as  
\[\dot{\dot{Q}}_{CC}\bigg{(}1-\frac{T_{0}}{T_{3}}\bigg{)}+\dot{m}_{1}ex_{1}+\dot{m}_ {f}ex_{f}=\bigg{(}\dot{m}_{f}+\dot{m}_{1}\bigg{)}ex_{3}+\dot{E}x_{D,CC}, \tag{19}\]  
where \(\dot{Q}_{cc}\) is the heat output of the combustion chamber, \(\dot{m}_{f}\) is the mass flow rate of the fuel, and \(Ex_{D,CC}\) is the exergy destruction in the combustion chamber. The exergy efficiency of the combustion chamber is calculated using  
\[\psi_{CC}=\frac{\dot{E}x_{4}}{\dot{E}x_{2}+\dot{E}x_{3}}. \tag{20}\]  
The exergy destruction rate of the other components in the multigeneration system can be obtained using the energy balance equations presented in Table 1.  
An exergoenvironmental analysis of a system is used to measure the impact of the system on the environment. The six parameters used are described below. Exergoenvironmental impact factor (\(f_{el}\)): This shows how a system's environmental impact can be reduced by decreasing its irreversibility. It is determined using  
\[f_{ei}=\frac{\dot{E}x_{dest,tot}}{\dot{E}x_{in}}, \tag{21}\]  
where \(\dot{E}x_{dest,tot}\) and \(\dot{E}x_{in}\) represent total exegetic destruction in the system and the overall exegetic destruction supplied to the system. Exergoenvironmental impact coefficient (\(C_{ei}\)): The value of \(C_{ei}\) for an ideal case of a system is one to show that there is no exergy destruction. This is defined as  
\[C_{ei}=\frac{1}{\eta_{ex}/100}, \tag{22}\]  
where \(\eta_{ex}\) is the exergetic efficiency of the system. Exergoenvironmental impact index (\(\theta_{ei}\)): This is used to indicate how much damage a system exerts on the environment as a result of its exergy losses and exergy destruction. It is calculated as  
\[\theta_{ei}=f_{ei}\times C_{ei}. \tag{23}\]  
Exergoenvironmental impact improvement (\(\theta_{eii}\)): Reducing the exergoenvironmental impact index of a system will increase how appropriate the system is to the environ \begin{table}
\begin{tabular}{c c} \hline \hline
**Component** & **Exergy Balance** \\ \hline Air compressor & \(\dot{E}x_{1}+\dot{W}_{gas,comp}=\dot{E}x_{2}+\dot{E}x_{D,gas,comp}\) \\ Gas turbine & \(\dot{E}x_{5}=\dot{E}x_{6}+\dot{W}_{gas,turb}+\dot{E}x_{D,gas,turb}\) \\ Heat recovery steam generator & \(\dot{E}x_{6}+\dot{E}x_{12}=\dot{E}x_{7}+\dot{E}x_{8}+\dot{E}x_{D,hreg}\) \\ Steam turbine & \(\dot{E}x_{8}=\dot{E}x_{9}+\dot{W}_{steam,turb}+\dot{E}x_{D,steam,turb}\) \\ Condenser 1 & \(\dot{E}x_{10}+\dot{E}x_{18}=\dot{E}x_{11}+\dot{E}x_{19}+\dot{E}x_{D,cond1}\) \\ Pump & \(\dot{E}x_{11}+\dot{W}_{pump}=\dot{E}x_{12}+\dot{E}x_{D,pump}\) \\ Evaporator & \(\dot{E}x_{7}+\dot{E}x_{16}=\dot{E}x_{13}+\dot{E}x_{17}+\dot{E}x_{D,env}\) \\ Ammonia compressor & \(\dot{E}x_{13}+\dot{W}_{NH3,comp}=\dot{E}x_{14}+\dot{E}x_{D,NH3,comp}\) \\ Condenser 2 & \(\dot{E}x_{14}+\dot{E}x_{20}=\dot{E}x_{15}+\dot{E}x_{21}+\dot{E}x_{D,cond2}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Exergy relations for the exergy analysis of the system’s components. ment. Therefore, the exergoenvironmental improvement of a system is derived from its exergoenvironment impact index using  
\[\theta_{eii}=\frac{1}{\theta_{ei}}. \tag{24}\]  
Exergy stability factor (\(f_{es}\)): A system is considered a stable one if its exergy stability factor is close to one.