## 2 Moving Window Decision-Making Algorithm  
Our moving window decision-making algorithm is indeed a modified version of the multi-period OCP approach proposed by [PERSON] et al. [18]. So, herein, we first describe the multi-period OCP framework for the HEN cleaning schedule optimization as simply as possible since its details can be found in [18]. The heat transfer rate (\(Q\)) in each heat exchanger unit can be calculated by using the overall heat transfer coefficient (\(U\)) with the heat transfer area (\(A\)) and the logarithmic mean temperature difference (\(\Delta T_{lm}\)). \(Q\) is also related with the inlet and outlet temperatures of hot and cold streams (\(T_{h}^{in}\), \(T_{h}^{out}\), \(T_{C}^{in}\), and \(T_{C}^{out}\)) through the simple mass balances as shown in Equation (1), where \(F\) and \(C_{p}\) represents the mass flow rate and the specific heat, respectively, together with relevant subscripts for the cold and hot streams. \[Q=UA\Delta T_{lm}=F_{h}C_{ph}\left(T_{h}^{in}-T_{h}^{out}\right)=F_{c}C_{pc} \left(T_{C}^{out}-T_{C}^{in}\right) \tag{1}\]  
Along with the fouling proceeding, \(Q\) is decreased by the increase of the fouling resistance (\(R_{f}\)) because \(U\) is inversely corelated with \(R_{f}\) in a sense of overall heat transfer resistance as given by Equation (2), where subscript \(c\) denotes the clean condition. The fouling kinetics can be described by several models [10,18,19], but here we just considered a simple linear model with the fouling constant \(a\) as shown in Equation (3). \[\frac{1}{U}=\frac{1}{U_{c}}+R_{f} \tag{2}\]  
\[\frac{dR_{f}}{dt}=a \tag{3}\]  
The fouling proceeding is simulated for a fixed time horizon (from 0 to \(t_{F}\)), which is discretized into time periods of equal length (one month in usual). Each period can be further divided into a cleaning and operating sub-period, of which length is represented by \(\Delta t^{CL}\) and \(\Delta t^{OP}\), respectively. With this discretization, the cleaning actions can be incorporated into the model by using binary control (decision) variable \(y_{np}\) shown in Equation (4). It should be noted that at this moment the problem becomes a mixed integer optimal control problem (MIOCP), which is more difficult to solve in general. However, [PERSON] et al. [18] treated \(y_{np}\) as a continuous variable that is bounded for the range of 0 to 1, so that the problem could still remain in the OCP framework. They also proved that the cleaning actions are indeed the controls which occur linearly in the system (model) equations, and in this case a bang-bang solution (0 or 1) could be obtained for the control variable. \[y_{np}=\left\{ \begin{matrix}0&\text{if the $n$-th heat exchanger is cleaned in period $p$}\\ 1&\text{other wise}\end{matrix} \right\}\quad\forall n,p \tag{4}\]By incorporating the control variable \(y_{np}\), Equations (1) and (3) can be rewritten into Equations (5)-(9). The actual system equations incorporating the control variable are Equations (2) and (5)-(9), which is an index-1 differential-algebraic system of equations (DAEs). \[\alpha=\frac{UA}{F_{h}C_{ph}} \tag{5}\]  
\[P=\frac{F_{h}\ C_{ph}}{F_{c}\ C_{pc}} \tag{6}\]  
\[T_{\mathrm{C}}^{out}=T_{\mathrm{C}}^{in}+P\Big{(}T_{\mathrm{C}}^{in}-T_{h}^{ out}\Big{)} \tag{7}\]  
\[T_{h}^{out}=y_{n,p}\Bigg{[}\frac{(1-P)T_{h}^{in}e^{-\alpha(1-P)}+T_{\mathrm{C} }^{in}\Big{(}1-e^{-\alpha(1-P)}\Big{)}}{1-P\ e^{-\alpha(1-P)}}\Bigg{]}+\big{(}1 -y_{n,p}\big{)}T_{h}^{in}\ \ \ \ \ \forall n,p \tag{8}\]  
\[\frac{dR_{f}}{dt}=y_{np}a\ \ \ \ \ \ \ \forall n,p \tag{9}\]  
The objective function to be minimized for the cleaning schedule optimization is given by Equation (10), which is the additional operating cost to resolve the fouling problem. This additional operating cost can be represented as the sum of the fuel and cleaning costs. The fuel cost is the extra energy cost in the furnace of preheat train which is needed to compensate the temperature drop of the crude oil due to the fouling.