One of the new updates that came to both sides (OpenAPS and Loop) quite recently are Exponential Insulin Curves. I’ll spare you all the detailed history of development and discussion, but there’s several threads of discussion on GitHub regarding the new curve developments like the PR here in OpenAPS, the issue here in OpenAPS, and the issue here in Loop if you want to read up. What you’ll notice is that there was a lot more cross-communication between the different DIY groups than usually happens…so this particular feature happens to be where OpenAPS and Loop have the greatest degree of similarity right now. And something must have spurred this sudden cross-system work, right? Yes…and that something is Fiasp. The new “faster” insulin.
What’s so special about Fiasp?
Fiasp is like Novolog, except it has an additive that “speeds up” the insulin effect. To quote from the official paperwork:
Fiasp is a mealtime insulin aspart formulation in which the addition of nicotinamide (vitamin B3) results in a faster initial absorption of insulin compared to NovoRapid.
The onset of action was 5 minutes earlier and time to maximum glucose infusion rate was 11 minutes earlier with Fiasp than with NovoRapid. The maximum glucose-lowering effect of Fiasp occurred between 1 and 3 hours after injection. The glucose–lowering effect during the first 30 minutes (AUCGIR, 0–30 min ) was 51 mg/kg with Fiasp and 29 mg/kg with NovoRapid (Fiasp/NovoRapid ratio: 1.74 [1.47;2.10]95% CI). The total glucose–lowering effect and maximum (GIRmax) glucose–lowering effect were comparable between Fiasp and NovoRapid. Total and maximum glucose–lowering effect of Fiasp increase linearly with increasing dose within the therapeutic dose range.
What is the most important take away for most of us? Less need for prebolusing in order to control post-prandial spikes in BG. Translation for Anna…she doesn’t have to wait nearly as long to eat that donut. So you can see the appeal of the product if it works as they advertise…a 2-minute prebolus or even post-meal bolus?!
Why can’t Fiasp work with the old curves?
As a gross simplification, the insulin curves are made by “drawing” a smooth line through a bunch of individual, discrete data points collected from all the users in insulin study groups. Mathematician’s version of art could be envisioned as HOW they connect all those data points, because there are many different methods (such as straight-line, bilinear or exponential) they can use, each with pros and cons. Typically, mathematicians try to pick the method that provides the “best fit” to the data points. In picking that method they may need to ask themselves…what are the important areas of the dataset? Do they want those areas to match up best? This wiki page offers a great overview of the concept of curve fitting.
The old insulin curves (bilinear curve for OpenAPS, Walsh curve for Loop) didn’t fit Fiasp data well. Our looping community needed a new piece of art (aka curve)…and ideally the new curves could also be slightly individualized for YDMV (your diabetes may vary) and still work for the rapid insulins such as novolog and homolog.
What are the Exponential Insulin Curves?
The new way that the looping systems model insulin impacts in their system is through exponential insulin curves. The exponential insulin curves have two user-adjustable inputs; peak time (PT) and insulin action duration (DIA).
For Loop, there is one legacy insulin curve (Walsh) and three new exponential curves to choose from when you configure your Loop app. The first 3 listed below are for rapid-acting insulins (novolog/humalog) and the last one is for Fiasp. (Note: the Loop docs contain the instructions for individualizing the exponential curves’ DIA and PT settings.)
- Walsh – default DIA =360 min, PT not user-configurable
- Rapid-acting adult – default DIA = 360 min, PT = 75 min
- Rapid-acting child – default DIA = 360 min, PT = 65 min
- Fiasp – default DIA = 360 min, PT = 55 min
For OpenAPS (currently in dev branch, as of this blog date), there are three curves; the legacy curve, and two new exponential curves (one for novolog/humalog and one for fiasp). The peak times for rapid-acting and ultra-rapid can be set in the preferences, DIA is set in the pump (and must be at least 5 hours for the exponential curves).
- Bilinear – old OpenAPS curve
- Rapid-acting – default DIA = 300 min, PT = 75 min
- Ultra-rapid -default DIA = 300 min, PT = 55 min
For fun, here’s what the math looks like inside the Loop code:
td = duration,
tp = peak activity time, both expressed in minutes.
Time constant of exp decay:
tau = tp*(1-tp/td)/(1-2*tp/td)
Rise time factor:
a = 2*tau/td
Auxiliary scale factor:
S = 1/(1-a+(1+a)*exp(-td/tau))
Insulin activity curve:
Ia(t) = (S/tau^2)*t*(1-t/td)*exp(-t/tau)
IOB(t) = 1-S*(1-a)*((t^2/(tau*td*(1-a)) - t/tau - 1)*exp(-t/tau)+1)
And the math inside the OpenAPS code is pretty similar, too.
IF you take that math and boil it down into pictures (because don’t most of us like pictures better?), you get curves kind of like these based on what DIA and what PT you select (thanks Sulka Haro):
Looking at the chart above, you can see the grey and blue lines would roughly represent Fiasp, while the orange and yellow lines would represent slower Novolog.
So this default curve will work for me, right?
Most of us are so excited when something new is released for our loop, and we think it will be as simple as just turning on the new feature and looping gets even easier. The developers do a great job of reminding us YDMV, test these features for yourself…but somehow we all get so darned excited we forget that warning soon after we enable the new feature.
The new insulin curves are no different. There are a lot of assumptions that go into these curves, not the least of which is that they represent a consolidation of data from THOUSANDS of insulin users in study groups. They are not derived from data gathered from YOU in a study group.
My personal understanding of insulin curves has grown a lot since beginning to loop, and it still has a long ways to go. When I started, I’d swear on a stack of bibles that our insulin duration was 3 hours. Then, after looping for a bit, I’d sheepishly admitted that 5 hours was indeed actually a smoother ride once my settings adjusted. Finally, I even moved it out to 5.5 and 6 hours and still had a smooth ride (the difference between the two durations was not enough for me to readily notice in my data). I would say that if there’s one bit of consensus in the looping community development group, it is that your DIA should not be less than 5 hours. If you aren’t at 5 hours DIA yet, you should take the time to fine-tune your settings. If you are using less than 5 hours DIA, you are probably relying on a loop-induced insulin stacking to make up for basals that are too low. (Ahem, looking at you 670G users who are using 2 hour DIA in order to trick those loops into providing more aggressive BG control…but alas, that’s the only variable they have to control their loop. Lucky us, Loop and OpenAPS give us options.)
But, since Anna started on Fiasp October 11th, my whole head exploded and I had to rethink my insulin curves all over again. In fact, if you read those discussion threads linked at the beginning of this post…people have been having success at lots of different settings while trying fiasp (2 hours, 5 hours, 7 hours DIA and various peak times as well). How could the same person be having “success” at such varied settings? The answer is multi-faceted.
What are the impacts of DIA and PT?
This is a great set of graphics (thanks Dragan Maksimovic) illustrating the effects on the curves at varying settings. This first set is the insulin activity where you are only varying the PT, and keeping the same DIA. Notice, as the peak time increases, more of the insulin’s strength to bring down insulin is used up earlier. You’d expect to see BGs drop sooner with a quicker PT and slow up more as the insulin wears off.
This next set of curves shows what happens when you keep the same PT, but vary the DIA. If the peak time is the same, the shorter the DIA then the stronger the insulin will impact the user at the same time post-prandial.
Keep these curves in mind, as they may provide good reference in later discussions about fine-tuning your insulin settings.
Actually, this is probably a good place to end this post. We can carry over the discussion about Fiasp and insulin curves to the next post, where I’ll share how the first 6 days of Fiasp led me to actually stop looping, go full manual mode for 2 days to recalibrate all my settings and search deeper about where my problems with Fiasp and looping were coming from. Don’t worry…so far it has a happy ending.