# Optimal Energy Integration and Off-Design Analysis of an Amine-Based Natural Gas Sweetening Unit
## 3 Heat Integration Model
### Optimization Methodology of the Second Loop  
The optimization problem was formulated in a way that takes into account the importance of synergy between ORC and the heat recovery network as a unified integrated functioning system. Performing a global optimization on both systems leads to the simultaneous identification of the optimal recovery temperature of each heat exchanger as well as the ORC working pressure corresponding to the highest energy output. Due to the simplicity of its implementation and reported efficiency in solving global optimization problems [21], a particle swarm algorithm (PSO) was used in this study. PSO is a nature-inspired evolutionary algorithm [22]. It has been successfully applied to solve many engineering problems including the optimization of ORC working parameters [23; 24; 25]. In PSO, the possible solutions are represented by a swarm of particles that have their own positions in the search space and which converge to the optimal solution with an individual velocity vector. After each iteration, each particle harnesses its own experience as well as the collective experience of the swam in order to update its velocity and position as shown in Equations (1) and (2). \[v_{j}^{i+1}=w_{j}v_{j}^{i}+c_{1}*r_{1}\Big{(}p_{best}^{i}-x_{j}^{i}\Big{)}+c_{2 }*r_{2}\Big{(}g_{best}^{i}-x_{j}^{i}\Big{)} \tag{1}\]  
\[x_{j}^{i+1}=x_{j}^{i}+v_{j}^{i+1} \tag{2}\]  
\(x_{j}^{i},\ v_{j}^{i}\) in Equations (1) and (2) denote the position and velocity vectors of the particle \(j\) at the \(i\)th iteration. \(W_{j}\) is the inertia weight that maintains the particle \(j\) in its previous direction. \(c_{1}\) and \(c_{2}\) are self-adjustment and social adjustment weights that accelerate the particles toward individual best (\(p_{best}\)) and global best (\(g_{best}\)) positions. \(r_{1}\) and \(r_{2}\) are randomly distributed factors in the range of [0, 1][25]. In this study, a swarm size of 30 particles and self- and social adjustment factors of 0.99 and 1.99, respectively, were used [25]. Moreover, a maximum iteration count of 50 was selected in order to ensure the convergence of the model in an acceptable time, although it was found, as presented in Figure 5, that the PSO algorithm was able to reach the optimum in 20-30 iterations. Using all the available low-temperature waste heat hinders the performance of the ORC by limiting the application range to low evaporation temperatures only; thus, in addition to the ORC working pressure, the decision variables of the particle swarm algorithm were extended to include the amount of heat absorbed from each of the waste heat sources \begin{table}
\begin{tabular}{c c} \hline
**Property Package** & Peng-Robinson \\
**Evaporator/Condenser calculation mode** & Weighted \\
**Evaporator pressure drop (Hot/Cold)** & 0.1 bar/0.2 bar \\
**Air condenser pressure drop** & 0.2 bar \\
**Ambient air temperature** & 30 \({}^{\circ}\)C \\
**Minimum temperature approach** & 5 \({}^{\circ}\)C \\
**Pump efficiency** & 80\% \\
**Expander isentropic efficiency** & 75\% \\
**Total \(\Delta\)P in the heating oil system** & 3 bar \\ \hline \end{tabular}
\end{table} 
Table 3: Main assumptions of ORC model. listed in Table 2. This was performed by manipulating the outlet temperature of waste heat streams from the heat recovery exchangers. Initial air coolers were maintained to ensure trim cooling so that all streams reach the target process temperature. In this study, the net energy output of the ORC was chosen as the objective function to be maximized. It is the gross power produced by the ORC substituting the pumping energy required to circulate the ORC fluid and the heat transfer fluid for direct heat integration. The decision variables associated with the objective function are the evaporator pressure, noted P6 in Figure 2, and the outlet temperature of the hot streams of the four exchangers, noted T1 to T4 in Figure 2. Evaporator pressure (P6) was set to vary from the pressure upstream of the pump and the critical pressure of the ORC working fluid.