## 4 NMPC Formulation
### Control Objectives and Constraints  
The primary objective of the NMPC controller is to maximize crop profitability while ensuring precision environmental control. This profit is defined as the revenue from the accumulated shoot biomass minus the operational costs associated with CO\({}_{2}\) injection and heating power usage. To formulate this control objective, an NMPC problem is defined as follows. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Symbol** & **Value** & **Unit** & **Explanation** \\ \hline P1 & 0.544 & – & Yield Factor \\ P2 & \(2.65\times 10^{-7}\) & s\({}^{-1}\) & Maintenance Respiration \\ P3 & 53 & m\({}^{2}\)\(\cdot\)kg\({}^{-1}\) & Effective Canopy Area \\ P4 & \(3.55\times 10^{-9}\) & kg\(\cdot\)J\({}^{-1}\) & PAR to total radiation conversion \\ P5 & \(5.11\times 10^{-6}\) & m\(\cdot\)s\({}^{-1}\)\({}^{\circ}\)C\({}^{-2}\) & Temp effect CO\({}_{2}\), 2 nd order \\ P6 & \(2.3\times 10^{-4}\) & m\(\cdot\)s\({}^{-1}\)\({}^{\circ}\)C\({}^{-1}\) & Temp effect CO\({}_{2}\), 1 st order \\ P7 & \(6.29\times 10^{-4}\) & m\(\cdot\)s\({}^{-1}\) & Temp effect CO\({}_{2}\), 0 th order \\ P8 & \(5.2\times 10^{-5}\) & kg\(\cdot\)m\({}^{-3}\) & CO\({}_{2}\) compensation point \\ P9 & 4.1 & m & Volumetric Capacity (CO\({}_{2}\)) \\ P10 & \(4.87\times 10^{-7}\) & s\({}^{-1}\) & Maintenance Respiration Weighted \\ P11 & \(7.45\times 10^{-6}\) & m\(\cdot\)s\({}^{-1}\) & Leakage Greenhouse Cover \\ P12 & 8.314 & J\(\cdot\)K\({}^{-1}\).mol\({}^{-1}\) & Gas Constant \\ P13 & 27.315 & K & Absolute Temperature \\ P14 & 10,1325 & Pa & Standard Atmospheric Pressure \\ P15 & 0.044 & kg\(\cdot\)mol\({}^{-1}\) & Molar Mass of CO\({}_{2}\) \\ P16 & \(3\times 10^{4}\) & J\(\cdot\)m\({}^{-3}\)\({}^{\circ}\)C\({}^{-1}\) & Heat Capacity Greenhouse Air \\ P17 & 1290 & J\(\cdot\)m\({}^{-3}\)\({}^{\circ}\)C\({}^{-1}\) & Heat Capacity Volume \\ P18 & 6.1 & W\(\cdot\)m\({}^{-2}\)\({}^{\circ}\)C\({}^{-1}\) & Heat Transfer Coefficient \\ P19 & 0.2 & – & Sun Heat Load Coefficient \\ P20 & 4.1 & m & Volumetric Capacity (Humidity) \\ P21 & 0.0036 & m\(\cdot\)s\({}^{-1}\) & Canopy Transpiration Coefficient \\ P22 & 9348 & J\(\cdot\)kg\({}^{-1}\)\(\cdot\)m\({}^{-3}\).K\({}^{-1}\) & Water Molar Value (for transpiration) \\ P23 & 8314 & J\(\cdot\)K\({}^{-1}\).mol\({}^{-1}\) & Gas Constant (water vapor) \\ P24 & 273.15 & K & Absolute Temperature (humidity) \\ P25 & 17.4 & – & Saturation Vapor Pressure (Canopy Transpiration) \\ P26 & 239 & \({}^{\circ}\)C & Saturation Vapor Temp \\ P27 & 17.269 & – & Saturation Vapor Pressure (Humidity) \\ P28 & 238.3 & \({}^{\circ}\)C & Saturation Vapor Temp (humidity) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Model parameters and their values [7]. At each time instant \(t\), the NMPC controller solves the following finite-horizon optimization problem:  
\[ \begin{split}\min_{\{u(t+k|t),\,\varepsilon(t+k|t)\}_{k=0}^{N_{p}-1} }J\\ \text{subject to:}\\ x(t+k+1|t)=f(x(t+k|t),\,u(t+k|t),\,d(t+k|t)),\\ y(t+k|t)=g(x(t+k|t)),\\ u_{\text{min}}\leq u(t+k|t)\leq u_{\text{max}},\\ |u(t+k|t)-u(t+k-1|t)|\leq\Delta u_{\text{max}},\\ y_{\text{min}}(t+k)-\varepsilon(t+k|t)\leq y(t+k|t)\leq y_{\text{ max}}(t+k)+\varepsilon(t+k|t)\\ \varepsilon(t+k|t)\geq 0,\\ \text{for }k=0,\ldots,N_{p}-1.\end{split}  \tag{5}\]  
Here, \(x(t+k|t)\) denotes the predicted state at time \(t+k\) based on information available at time \(t\), \(u(t+k|t)\) is the control input, \(d(t+k|t)\) is the disturbance prediction, \(y(t+k|t)\) is the predicted output, and \(\varepsilon_{j}(t+k|t)\) are slack variables associated with the soft output constraints.