Code Monkey home page Code Monkey logo

Comments (6)

manueich avatar manueich commented on May 29, 2024 1

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:
Ra_DallaMan

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
Ra_old

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
Ra_new

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

from simglucose.

jxx123 avatar jxx123 commented on May 29, 2024

You might be right. Let me look into this unit issue and get back to you. Thanks for reporting this!

from simglucose.

manueich avatar manueich commented on May 29, 2024

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.

from simglucose.

hyx07 avatar hyx07 commented on May 29, 2024

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.

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?

from simglucose.

manueich avatar manueich commented on May 29, 2024

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?

from simglucose.

jxx123 avatar jxx123 commented on May 29, 2024

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!
image
image
image

from simglucose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.