Code Monkey home page Code Monkey logo

Comments (7)

jxx123 avatar jxx123 commented on May 29, 2024

The basal I use (basal = u2ss * BW / 6000) is under unit "U/min", where 1 U/min = 6000 pmol/L. "u2ss" is the steady state insulin rate per kilogram, and its unit is pmol/(L * kg).

Documentation is really an issue. I need to find time to address that. Thanks!

from simglucose.

EemeIi avatar EemeIi commented on May 29, 2024

Hey @jxx123!

Further, in controller/basal_bolus_ctrller.py, line 56:

bolus = bolus / env_sample_time

scales the bolus from "U/env_sample" to "U/min", right? Then, in simulation/env.py, there is

insulin += tmp_insulin / self.sample_time

again, so the stored output is divided by env_sample_time. The division from this line should be omitted, right?

from simglucose.

jxx123 avatar jxx123 commented on May 29, 2024

Hey @jxx123!

Further, in controller/basal_bolus_ctrller.py, line 56:

bolus = bolus / env_sample_time

scales the bolus from "U/env_sample" to "U/min", right? Then, in simulation/env.py, there is

insulin += tmp_insulin / self.sample_time

again, so the stored output is divided by env_sample_time. The division from this line should be omitted, right?

Hi @EemeIi , the reason to divide bolus by env_sample_time is that the original bolus is the total amount (U), and the division is to convert it to rate (U/min).

For the line insulin += tmp_insulin / self.sample_time, the purpose is just to compute the average insulin rate in the sample time (see this comment). The reason for this is that the patient simulation sample time is 1 minute (see the mini_step function), but I would like to support arbitrary sample time in the simulator, hence I record the average values for all the variables including insulin.

from simglucose.

OneBirding avatar OneBirding commented on May 29, 2024

Hello, can you write down and upload the detailed documentation of the algorithm in your spare time?

from simglucose.

jxx123 avatar jxx123 commented on May 29, 2024

Hi I have added the documentation for the controller. I closed this issue for now, please feel free to reopen it if there is anything unclear. Thanks.

from simglucose.

KeAWang avatar KeAWang commented on May 29, 2024

1 U/min = 6000 pmol/L

@jxx123 How can this be? The right hand side has no units of time. Should u2ss be instead pmol/L/min since it's a rate?

from simglucose.

zjp-zjp-zjp avatar zjp-zjp-zjp commented on May 29, 2024

Hi, I'm wondering how u2ss is calculated? Or it's an independent parameter that needs to be input instead of calculated?

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.