# Real-Time Model Predictive Control of Human Bodyweight Based on Energy Intake
## 2 Materials and Methods
### Model Predictive Control (MPC)
Afterwards, the robustness is tested by performing 100 Monte Carlo simulations. In each simulation, the average values of the \(a\)- and \(b\)-parameters are disturbed with random noise and the impact on the performance is evaluated. Finally, the MPC is applied using theoretical curves as bodyweight reference curves. Since no ideal target trajectory is suggested in literature, three different target body weight trajectories are proposed. In [49], it is recommended to decrease bodyweight by 5-10% within 6 months. The study, performed on obese women, concludes that a weight loss of 5-10% of the total body weight results in improvements in blood glucose levels and hypertension [49]. The initial and final body weight for the three targeted body weight trajectories are set to the same values. The initial body weight is defined as the average maximum body weight over all participants prior to the start of the starvation phase, which is 69.36 kg. The final body weight is set to 59.36 kg and has to be reached after one year or 52 weeks. This means that the initial body weight is decreased with 14.4%. The first and second trajectories gradually decrease the body weight in even steps, holding these steps constant for 3 or 8 weeks, respectively. The third body weight trajectory follows an exponential trend with equation \(BW_{t}=BW_{0}\cdot 0.95^{\mathrm{t}}\) (\(t=1\),..., 52 weeks) where the desired bodyweight at the start of the simulation is reduced more rapidly than near the end of the simulation. The MPC algorithm used to test the three trajectories has different constraints. The maximum value of the output is defined as the average maximum body weight over all participants prior to the start of the starvation phase, which is 69.36 kg. The minimum output value is the target body weight at the end of the trajectory of 59.36 kg. The maximum input or energy intake is the average maximum energy intake of 3538.72 kcal day\({}^{-1}\) prior to the starvation phase. The minimum energy intake is calculated using the Henry equations based on the average height, age, target bodyweight and gender [50]. These equations estimate the basal metabolic rate (BMR) and defines the minimum energy intake to account for daily energy expenditure in rest. As the age of the male participants from the Minnesota starvation experiment varies between 20 and 33 years, the following equation is used for the estimation of the minimum energy:  
\[BMR\ (\mathrm{kcal\ day^{-1}})=14.4\cdot BW(\mathrm{kg})+313\cdot H(\mathrm{m})+113 \tag{18}\]where \(BW\) is the target body weight of 59.36 kg and \(H\) is the average height of 1.79 m of all participants. This equation results in a minimum energy intake of 1672.05 kcal day\({}^{-1}\). Both, the \(NMRSE\), given by Equation (11), and the root mean square error (\(RMSE\)) are used to quantify the deviation between the desire targeted (reference) and simulated, using the MPC, energy intake or bodyweight curves. The \(RMSE\) is given by the expression:  
\[RMSE=\sqrt{\frac{\left\|y_{ref}-y_{sim}\right\|^{2}}{N_{s}}} \tag{19}\]  
where \(N_{s}\) is the number of samples, \(y_{ref}\) is the reference energy (or bodyweight) curve and \(y_{sim}\) is the simulated energy intake (or bodyweight) curve by the MPC.