# Real-Time Model Predictive Control of Human Bodyweight Based on Energy Intake
## 3 Results and Discussion
### Simulation Model Predictive Control
The _NRMSE_, _RMSE_ and \(r\) describing the differences between the reference bodyweight curve and the bodyweight curves achieved with the control simulation are summarized in Table 8. Table 9 shows the _RMSE_ between the final bodyweight value from the controllers and the one from the theoretical reference curve. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & \multicolumn{2}{c}{_Reference Curve 1_} & \multicolumn{2}{c}{_Reference Curve 2_} & \multicolumn{2}{c}{_Reference Curve 3_} \\ \hline  & **TI** & **TIC** & **TI** & **TIC** & **TI** & **TIC** \\ \hline _NRMSE_ & 0.968 \(\pm\) 0.004 & 0.969 \(\pm\) 0.003 & 0.941 \(\pm\) 0.002 & 0.941 \(\pm\) 0.003 & 0.943 \(\pm\) 0.002 & 0.951 \(\pm\) 0.010 \\ \hline RMSE & 0.10 \(\pm\) 0.05 & 0.10 \(\pm\) 0.04 & 0.19 \(\pm\) 0.05 & 0.19 \(\pm\) 0.05 & 0.15 \(\pm\) 0.04 & 0.13 \(\pm\) 0.08 \\ \hline \(r\) & 0.999 \(\pm\) 0.001 & 0.998 \(\pm\) 0.002 & 0.999 \(\pm\) 0.001 & 0.999 \(\pm\) 0.001 & 0.998 \(\pm\) 0.002 & 0.999 \(\pm\) 0.001 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Normalized root mean square error (_NRMSE_), root mean square error (_RMSE_), in kg, and Pearson correlation coefficient (_r_) for the comparison between the bodyweight curve obtain following the suggestions from the MPC systems using the time-invariant parameters transfer function model, without (TI) and with constraints (TIC) and the three theoretical bodyweight reference curves generated. Figure 5: Energy intake curves suggested by the MPC controller using the time-invariant averaged TF model in order to follow the theoretical bodyweight curves 1, 2 and 3, (**a**), (**c**) and (**e**), respectively. The reference bodyweight curves 1, 2 and 3 (solid lines) and bodyweight curves obtained with the MPC simulation (dashed lines) are display in (**b**), (**d**) and (**f**), respectively. It can be seen that the _RMSE_ errors, when comparing the complete curves or just the final values, are small, less than 200 g on average, in all cases. Thus, the MPC controller is able to follow closely a predefined theoretical bodyweight curve. Therefore, the MPC developed in this study may be used to set a theoretical bodyweight reference curve and evaluate the energy intake curve suggested to follow the given bodyweight curve in order to achieve the desired final weight. Finally, as the last part of the analysis, the robustness of the controller is tested. A random contribution, at the level of the standard error in the parameters estimations (10%), is added as uncertainty to the \(a\)- and \(b\)-parameters of the time-invariant model. Using Monte Carlo simulations, the robustness of the model is tested, generating 100 realizations varying \(a\)- or \(b\)-parameter estimations. In Figure 6, examples of the suggested energy intake and bodyweight curves obtained from these 100 Monte Carlo simulations, adding uncertainty in the \(a\)- and \(b\)-parameters, respectively, are shown. The results have shown how the controller's suggestions for energy intake are much less sensitive to the uncertainty in the \(a\)-parameter than in the \(b\)-parameter. This is expected as the \(b\)-parameter \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & _Reference Curve 1_ & \multicolumn{3}{c}{_Reference Curve 2_} & \multicolumn{3}{c}{_Reference Curve 3_} \\ \hline  & **TI** & **TIC** & **TI** & **TIC** & **TI** & **TIC** \\ \hline _RMSE_ & \(0.010\pm 0.003\) & \(0.010\pm 0.003\) & \(0.034\pm 0.012\) & \(0.006\pm 0.003\) & \(0.065\pm 0.38\) & \(0.065\pm 0.036\) \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Root mean square error (_RMSE_), in kg, for the comparison between the end bodyweight from the curves obtain following the suggestions from the MPC systems using the time-invariant parameters transfer function model, without (TI) and with constraints (TIC) and the three theoretical bodyweight reference curves generated.