First, exponential functions are not a part of NS, as the math.js
library is not included, although you can fork a copy of Nightscout and
include the math.js function and program the exponential function rather
easily. You can
approximate the exponential function without adding the math.js library, similar to what I did with the
curvilinear percent IOB left curves
provided with all modern "smart" insulin pumps that stay constant
regardless of initial insulin dose/bolus amount. The problem with
approximating the exponential function, is you would have to create a
matrix for
each DIA with IOB remaining, based on
each respective insulin dose, ranging from 0-20 units, likely in 0.25 unit increments.
So, the matrix would look something like:
0.25 0.50 1.00 1.25 1.5 .... 10 ... 20
_____________________________________________________________________________________
DIA_5h = 0 min | 0.25 0.50 1.00 1.25 1.5 .... 10 ... 20
....
150 min | 0.125 0.25 0.50 0.625 0.75 0.50 10
...
300 min| 0 0 0 0 0 0 0
And yes, while this is more dynamic than the curvilinear IOB percentage calculator that is provided with modern insulin pumps, IOB in itself is only an approximation, and it cannot be reliably taken from euglycemic insulin clamp studies, even with the respective fast-acting insulins:
1. Because there are limited studies, with different set parameters, making it impossible to get a reliable approximation in between insulins.
2. IOB is a very strange function that can only be approximated (see this:
http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3045234/figure/fig1/ ) (Original article here:
http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3045234/ )
3. No IOB equation will have a true basis in chemical kinetics because IOB is a systematic concept of human metabolism and pharmacokinetics and pharmacokinetics and is accounted for and approximated by dosing "healthy" subjects with high doses of insulin, because of the inability to extrapolate the endogenous glucose production when a "basal insulin rate" is set to 0 in healthy subjects. Also, IOB is based in terms of two variables: time and initial insulin dose. It does not account for variability in absorption or diurnal variations, or accumulated IOB, and most importantly, it is a system of several variables that IOB is dependent on.
Either way, using curvilinear percent IOB representation based as a function of time, or exponential decay, as a function of both time and initial bolus dose(s), is merely a rudimentary approximation that does not account for things as a dynamic system. That is why I am programming Hovorka's models (again), which are based on metabolic modeling of at least 5 separate systems working in tandem, in compartments. I am designing my controller based off of Hovorka's models too. I have pretty much passed the part of being overwhelmed by the information for the mathematical models, and I hope to be done with the mathematical modeling in a couple of weeks. It's gotten to a point where it is common sense to me now conceptually. I start school in a couple of weeks, and during those 8 weeks that I will be taking a course, I hope to get my controller finished. A month after I finish the controller, I hope to be done with the interfacing and "go live".
As for the paper, I knew that the results were skewed, and that was a poor example for me to use.