Closed manueich closed 2 years ago
You might be right. Let me look into this unit issue and get back to you. Thanks for reporting this!
Thanks for getting back to me.
I checked out the papers on the simulator model and none of them really specify how multiple consecutive meals are handled, so there is no last_Qsto
or last_foodtaken
. However, all variables related to the food intake are typically in mg.
The obvious fix would just be to change line 130 to:
Dbar = last_Qsto + last_foodtaken * 1000
From the small tests I did, I think it might have quite a significant impact on the simulated glucose dynamics, especially for larger meals. Perhaps you have access to the code of the commercial simulation to check how it is done there.
Thanks for getting back to me. I checked out the papers on the simulator model and none of them really specify how multiple consecutive meals are handled, so there is no
last_Qsto
orlast_foodtaken
. However, all variables related to the food intake are typically in mg.The obvious fix would just be to change line 130 to:
Dbar = last_Qsto + last_foodtaken * 1000
From the small tests I did, I think it might have quite a significant impact on the simulated glucose dynamics, especially for larger meals. Perhaps you have access to the code of the commercial simulation to check how it is done there.
Hi, the BG after eating behaves strangely after making this change, and the BG curve differs significantly to those reported in the papers written by UVA/Padova team, do you have the same problem?
hi, can you be more specific on what BG curves from the literature you used as comparison and how you know the parameters that went into the specific simulations?
I hava made some further investigations into this and found the following:
I have extracted the parameters for a normal subject from the article "Meal Simulation Model of the Glucose-Insulin System", Dalla Man, IEEE TBME, 2007. I had to assume a BW of 78 kg as it is not provided. The paper gives the following time course of the rate of glucose appearance (Ra) from three meals:
I then adapted the code to give me Ra using it as a second observation:
Ra = self.state[2] * self._params.f * self._params.kabs / self._params.BW
The fact that the model of the toolbox describes a T1DM subject is irrelevant as the meal absoption model is identical. Using the current code, i.e. NOT multiplying by 1000, I get the following result which does not match with the shape given in the paper
However, if I multiply by 1000, as I suggested before, I get a result that matches much better regarding shape. The amplitude is dependent on the BW which I had to assume, so it cannot be compared
For me this makes it quite clear that my suggestion is correct and the current version (without multiplying 1000) is a bug. Here is the csv file with the parameters I extracted from the paper. The subject is called "normal": vpatient_params.csv
Wow that was really detailed investigation. You are right. I checked the equation. Dbar should be in mg. Let me submit a fix for this. Thank you so much for your bug report. Please do submit issues to this repo when you find any other bugs in the future. Thank you so much!
Hi,
I just looked through the meal absoption model in detail and I noticed the following in the script t1dpatient.py:
When you calculate the variable
Dbar
in line 130, which is in turn used to calculate the nonlinear gastric emptying ratekgut
, you add the variableslast_Qsto
andlast_foodtaken
. However, the variablelast_Qsto
is in mg as all the digestion states, whereas the variablelast_foodtaken
is in g (line 100).Shouldn't these variables both be in mg, as
Dbar
is in mg?Cheers, Manuel