## 2 Materials and Methods
### Implementation of PID, MPC, and AMPC
#### 2.3.2 Implementation of MPC and AMPC  
Model-based Predictive Control (MPC) is an advanced approach that employs the processing model to predict the future outputs of the model according to system behavior. At each time step, MPC determines the optimal control action by solving a constrained optimization problem, which takes into account predictions of future costs, disturbances, and constraints over a moving time horizon. This approach is often referred to as \"receding horizon\" control because the optimization process continually updates as new data becomes available. The fundamental concept is that short-term predictive optimization can lead to  
Figure 3: Controller and plant architecture. optimal long-term performance, as the prediction error remains smaller over short intervals compared to long-term predictions. The key distinction between MPC and traditional control methods lies in its use of real-time prediction and optimization, rather than relying on precomputed control laws. However, a major challenge with MPC is the need to solve the optimization problem at every time step, which has historically limited its use to systems with slow sampling rates, typically below 1 Hz. Recent advancements, such as explicit MPC, address this limitation by solving the optimization problem analytically and storing the results in a lookup table, allowing for the rapid evaluation of the control policy. The MPC is mathematically represented by Equations (2) and (3). \[x(k+1)=Ax(\mathrm{k})+B_{u}u(\mathrm{k})+B_{v}v(\mathrm{k})+B_{d}d(\mathrm{k}) \tag{2}\]  
\[y(k)=Cx(\mathrm{k})+D_{v}v(\mathrm{k})+D_{d}d(\mathrm{k}) \tag{3}\]  
The matrices \(A\), \(B_{u}\), \(B_{v}\), \(B_{d}\), \(C\), \(D_{v}\), and \(D_{d}\) are parameters that can change over time. \(u\) is the control input or manipulated variable (MV), \(y\) is the plant output, \(x\) denotes the plant model states, \(v\) represents the measured disturbance, \(d\) is the unmeasured disturbance, and \(k\) represents the time index. A conventional MPC controller typically operates around a linearized and fixed nominal operating point (\(x\)), where the plant model determines the optimal control action (\(u\)). For the MPC applied in this study, the specific properties are outlined below:  
\[A= \begin{bmatrix}0.999&0.295\\ -7.2\times 10^{-4}&0.970\end{bmatrix} ,\ B_{u}= \begin{bmatrix}8.27\times 10^{-5} \\ 5.48\times 10^{-4}\end{bmatrix} ,\ B_{v}=0,\ B_{d}=0,C= \begin{bmatrix}1\;0 \end{bmatrix}  \tag{4}\]  
\[D_{v}=0,\ D_{d}=3.3\times 10^{-4}.\]  
Sample time (\(\mathrm{t_{s}}\)) = 0.3 s;  
Rate of change of manipulated variable (\(\Delta u\)) = 2.78 \(\times\) 10\({}^{-4}\);  
Output variable weight = 0.0011;  
Prediction horizon = 30;  
Control horizon = 3. The control and prediction horizons were configured based on the residence time of the food product within the heating chamber. The prediction horizon was selected to account for the time required for the product to flow from the inlet to the outlet, as well as to accommodate the temperature build-up in the CFOH chamber. In contrast, the control horizon was defined to ensure that the controller could take corrective actions within the necessary time frame to maintain optimal heating conditions. Additionally, matrix coefficients and the weights for the manipulated and the output variables were selected based on the constraints and cost functions observed during real-time operation. These assessments build upon the controller design methodologies detailed in [26]. However, for an Adaptive Model Predictive Control (AMPC), the nominal operating point is continuously updated over time to align with the evolving plant model. This allows the operating point to vary as necessary to remain consistent with the updated system dynamics. The AMPC can be represented by the equations expressed in Equations (5) and (6).