# Real-Time Model Predictive Control of Human Bodyweight Based on Energy Intake
## 3 Results and Discussion
### Simulation Model Predictive Control
In this regard, these capabilities can be exploited by dietitians to determine which is the healthier alternative for an individual patient to achieve the desire bodyweight change according to its response to the initial treatment through time. Thus, in order to test the MPC system capabilities to follow theoretical reference curves, three different theoretical bodyweight curves are defined according to the procedure described in Section 2.3 of the Material and Methods section. In Figure 5, the different energy intake curves suggested by the controller are displayed. In addition, the resulting estimated weight curves obtained when following these suggestions, compared with the defined theoretical ones, are displayed as well. In order to perform these simulations, the average time-invariant model obtained in Section 3.1 of this section is used as model for the controller. This approach cannot be tested with the time-variant \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline  & \multicolumn{4}{c}{_Bodyweight_ [kg]} & \multicolumn{4}{c}{_Energy Intake_ [kcal day\({}^{-1}\)]} \\ \hline  & **TI** & **TIC** & **TV** & **TVC** & **TI** & **TIC** & **TV** & **TVC** \\ \hline
**NRMSE** & 0.92 \(\pm\) 0.01 & 0.92 \(\pm\) 0.01 & 0.90 \(\pm\) 0.03 & 0.91 \(\pm\) 0.02 & 0 & 0 & 0 & 0.92 \(\pm\) 0.04 \\ \hline
**RMSE** & 0.46 \(\pm\) 0.19 & 0.46 \(\pm\) 0.19 & 0.33 \(\pm\) 0.08 & 0.32 \(\pm\) 0.08 & 1278 \(\pm\) 875 & 726 \(\pm\) 324 & 232 \(\pm\) 121 & 13 \(\pm\) 10 \\ \hline
**r** & 0.99 \(\pm\) 0.01 & 0.99 \(\pm\) 0.01 & 0.99 \(\pm\) 0.01 & 0.99 \(\pm\) 0.01 & 0.43 \(\pm\) 0.12 & 0.95 \(\pm\) 0.03 & 0.41 \(\pm\) 0.27 & 0.99 \(\pm\) 0.01 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Normalized root mean square error (_NRMSE_), root mean square error (_RMSE_) and Pearson correlation coefficient (_r_) when comparing the MPC suggestions for energy intake and bodyweight outcome, with the energy intake and body weight from the Minnesota starvation experiment. The MPC systems tested are the one using the time-invariant parameters model without constraints (TI), the same one but with constraints (TIC), the MPC system using the time-variant parameter DARX model without constraints (TV) and this one with constraints (TVC). The RMSE for bodyweight has kg as units and the RMSE for energy intake has kcal day\({}^{-1}\) units. The NRMSE value is set to 0 when the energy intake suggested by the MPC and the measured energy intake curves follow diverging dynamics. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & \multicolumn{4}{c}{_Bodyweight_ [kg]} & \multicolumn{4}{c}{_Energy Intake_ [kcal day\({}^{-1}\)]} \\ \hline  & **TI** & **TIC** & **TV** & **TVC** & **TVC** \\ \hline
**RMSE** & 0.38 \(\pm\) 0.06 & 0.38 \(\pm\) 0.06 & 0.26 \(\pm\) 0.06 & 0.26 \(\pm\) 0.03 & 9 \(\pm\) 3 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Root mean square error (_RMSE_) when comparing the MPC end value of bodyweight outcome for all MPCs tested and final energy intake suggestion for the MPC using the time-variant parameter DARX model with constraints (TVC) with the final bodyweight and energy intake values from the Minnesota starvation experiment. The MPC systems tested are the one using the time-invariant parameters model (TI), the same one but adding constraints (TIC), and the MPC system using the time-variant parameter DARX model (TV) and this one with constraints (TVC). The _RMSE_ for bodyweight has kg as units and the _RMSE_ for energy intake has kcal day\({}^{-1}\) units. parameters DARX models, as there is no actual data collection from the participants following these theoretical curves. It can be seen that the energy intake curves suggested by the controller are similar. The main difference is the energy intake change rate over consecutive weeks. Depending on the theoretical bodyweight curve used as reference, the energy intake suggested for an average individual decreases faster or slower in consecutive weeks.