- Messages
- 3,176
- Type of diabetes
- I reversed my Type 2
- Treatment type
- I do not have diabetes
Following on from this thread http://www.diabetes.co.uk/forum/threads/diabetes-management-apps.62199/page-2#post-924862
I have created the code model for IOB calculations to go into my BG Management App. Here are the details and output from the test client which is testing out the model.
Please all have a look and comment. @Spiker
IOB Profile Cofiguration
The Bolus insulin estimation model allows you to set complex profiles of bolus usage against
time and for different injected quantities.
The default profile is linear with 100% at zero hours down to zero effective units at 5 hours (300
minutes)
You can change the profile period to any value you wish and also add additional profiles that come
into effect at different injected quantities
You do not need to restrict yourself to linear profiles either and you could set the profile up as a
curve so that for the first hour it absorbs slowly then accelerates before slowing down for the last
hour.
Test Output
Default IOB Profile
---calculate Effective Bolus---
Date=Sun Sep 20 08:00:00 BST 2015, units=20.0, IOB=20.0
Date=Sun Sep 20 12:00:00 BST 2015, units=20.0, IOB=24.0 (4 hours after first)
---Projected Insulin---
Date=Sun Sep 20 13:00:00 BST 2015, IOB=19.200000000000003
Date=Sun Sep 20 14:00:00 BST 2015, IOB=14.399999999999999
Date=Sun Sep 20 15:00:00 BST 2015, IOB=9.599999999999998
Date=Sun Sep 20 16:00:00 BST 2015, IOB=4.799999999999999
Date=Sun Sep 20 17:00:00 BST 2015, IOB=0.0
Add Bolus adjustment at 10AM
---calculate Effective Bolus---
Date=Sun Sep 20 08:00:00 BST 2015, units=20.0, IOB=20.0
Date=Sun Sep 20 10:00:00 BST 2015, units=10.0, IOB=22.0
Date=Sun Sep 20 12:00:00 BST 2015, units=20.0, IOB=33.2
Date=Sun Sep 20 13:00:00 BST 2015, IOB=26.560000000000002
Date=Sun Sep 20 14:00:00 BST 2015, IOB=19.92
Date=Sun Sep 20 15:00:00 BST 2015, IOB=13.279999999999998
Date=Sun Sep 20 16:00:00 BST 2015, IOB=6.639999999999999
Date=Sun Sep 20 17:00:00 BST 2015, IOB=0.0
I have created the code model for IOB calculations to go into my BG Management App. Here are the details and output from the test client which is testing out the model.
Please all have a look and comment. @Spiker
IOB Profile Cofiguration
The Bolus insulin estimation model allows you to set complex profiles of bolus usage against
time and for different injected quantities.
The default profile is linear with 100% at zero hours down to zero effective units at 5 hours (300
minutes)
You can change the profile period to any value you wish and also add additional profiles that come
into effect at different injected quantities
You do not need to restrict yourself to linear profiles either and you could set the profile up as a
curve so that for the first hour it absorbs slowly then accelerates before slowing down for the last
hour.
Test Output
Default IOB Profile
---calculate Effective Bolus---
Date=Sun Sep 20 08:00:00 BST 2015, units=20.0, IOB=20.0
Date=Sun Sep 20 12:00:00 BST 2015, units=20.0, IOB=24.0 (4 hours after first)
---Projected Insulin---
Date=Sun Sep 20 13:00:00 BST 2015, IOB=19.200000000000003
Date=Sun Sep 20 14:00:00 BST 2015, IOB=14.399999999999999
Date=Sun Sep 20 15:00:00 BST 2015, IOB=9.599999999999998
Date=Sun Sep 20 16:00:00 BST 2015, IOB=4.799999999999999
Date=Sun Sep 20 17:00:00 BST 2015, IOB=0.0
Add Bolus adjustment at 10AM
---calculate Effective Bolus---
Date=Sun Sep 20 08:00:00 BST 2015, units=20.0, IOB=20.0
Date=Sun Sep 20 10:00:00 BST 2015, units=10.0, IOB=22.0
Date=Sun Sep 20 12:00:00 BST 2015, units=20.0, IOB=33.2
Date=Sun Sep 20 13:00:00 BST 2015, IOB=26.560000000000002
Date=Sun Sep 20 14:00:00 BST 2015, IOB=19.92
Date=Sun Sep 20 15:00:00 BST 2015, IOB=13.279999999999998
Date=Sun Sep 20 16:00:00 BST 2015, IOB=6.639999999999999
Date=Sun Sep 20 17:00:00 BST 2015, IOB=0.0