Git Product home page Git Product logo

Comments (5)

celikalp avatar celikalp commented on July 20, 2024

Gb is the initial fasting bg. I re-computed values of Gs, Gpb, Gtb, EGPb, Vm0 and it did the job. I used the paper to interpret the equations. Here is the code:

@classmethod
def withName(cls, name, **kwargs):
    '''
    Construct patient by name.
    Names can be
        adolescent#001 - adolescent#010
        adult#001 - adult#001
        child#001 - child#010
    '''
    patient_params = pd.read_csv(PATIENT_PARA_FILE)
    params = patient_params.loc[patient_params.Name == name].squeeze()
    # set fasting blood glucose if given in kwargs
    if 'fasting_bg' in kwargs and kwargs['fasting_bg'] is not None:
        params.Gb = kwargs['fasting_bg']
        params.Gpb = params.Gb * params.Vg
        params.EGPb = params.kp1 - params.kp2 * params.Gpb - params.kp3 * params.Ib
        Gtb = (params.Fsnc - params.EGPb + params.k1 * params.Gpb) / params.k2
        params.Vm0 = (params.EGPb - params.Fsnc) * (params.Km0 + Gtb) / Gtb
        params.iloc[5] = params.Gpb
        params.iloc[6] = Gtb
        params.iloc[14] = params.Gpb
    kwargs.pop('fasting_bg', None)
    return cls(params, **kwargs)

from simglucose.

celikalp avatar celikalp commented on July 20, 2024

I think, @jxx123 you may want to fix #18.

from simglucose.

jxx123 avatar jxx123 commented on July 20, 2024

@aacelik Thanks! I will take a look. If you want to go head and fix it, please send me a pull request :)

from simglucose.

junzhuang-code avatar junzhuang-code commented on July 20, 2024

Hi @aacelik and @jxx123,

I'm interested in following up on this question. After this new feature added, is it possible for the user to select a new initial blood glucose level for the patient?

For example,
Patient adolescent#002 has an initial glucose level 152.41. I want to change this level to another number (let's say 120) at the beginning.
I read the repo and the article that you used to implement this repo. I attempted to change some parameters in "vpatient_params.csv" as follows: 1. Changed Vg and u2ss; 2. Changed from x0_1 to x0_13 and u2ss.
However, both attempts fail to fulfill this goal as the new BG keeps on increasing without any meal or insulin input.
I'm wondering whether or not I can change the initial glucose level of Patient adolescent#002 from 152.41 to 120 by using this new feature (or other features)?
If not, any parameters in "vpatient_params.csv" that I can change to achieve the same goal?
Please correct me if my understanding is imprecise.

Thanks for your reply in advance,


I think I've solved this issue. Forget my question.
Thanks,

from simglucose.

edger-asiimwe avatar edger-asiimwe commented on July 20, 2024

Hi @aacelik and @jxx123,

I'm interested in following up on this question. After this new feature added, is it possible for the user to select a new initial blood glucose level for the patient?

For example, Patient adolescent#002 has an initial glucose level 152.41. I want to change this level to another number (let's say 120) at the beginning. I read the repo and the article that you used to implement this repo. I attempted to change some parameters in "vpatient_params.csv" as follows: 1. Changed Vg and u2ss; 2. Changed from x0_1 to x0_13 and u2ss. However, both attempts fail to fulfill this goal as the new BG keeps on increasing without any meal or insulin input. I'm wondering whether or not I can change the initial glucose level of Patient adolescent#002 from 152.41 to 120 by using this new feature (or other features)? If not, any parameters in "vpatient_params.csv" that I can change to achieve the same goal? Please correct me if my understanding is imprecise.

Thanks for your reply in advance,

I think I've solved this issue. Forget my question. Thanks,

@junzhuang-code where you able to achieve this. Wanted to work with a similar situation where I set my initial BG, lets say at 7am.

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.