Comments (5)
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.
I think, @jxx123 you may want to fix #18.
from simglucose.
@aacelik Thanks! I will take a look. If you want to go head and fix it, please send me a pull request :)
from simglucose.
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.
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)
- The reward function encourages short episodes HOT 2
- Units in the Meal Absoption Model HOT 6
- Report function does not work HOT 2
- Controller is not reset during simulation of patients HOT 5
- Scenario with no meal in gym env HOT 2
- How to correctly implement the use of OpenAI Gym - reset() and step() methods are not implemented (NotImplementedError on google Colab)
- Dbar Modification HOT 3
- whether there is paper related to this project or not?
- Input meal size given in (g/min) instead of expected (g)
- Import Error
- Risk index calculation error in report generation
- Risk Index probably incorrect HOT 3
- Does this simulator has the property of time-delay? HOT 1
- Insulin unit error and scenario setting error HOT 3
- pip 0.2.8 broken HOT 2
- Patient interface missing observation, state and t HOT 2
- Clarity on calculation of parameters apha and beta HOT 2
- Patient Parameter Documentation
- Sensor sample_time affects reported CHO and Insulin
- Deprecated distutils in Python v3.12 causes "no module..." exception
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simglucose.