-
Notifications
You must be signed in to change notification settings - Fork 354
Add more manual-style description for the DIA configuration #2607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,39 +126,54 @@ More information to understand the Insulin Profile as shown in **AAPS** [here](# | |
| * This effect profile is recommended if an unbacked insulin or a mixture of different insulins is used. | ||
|
|
||
| (Config-Builder-insulin-dia)= | ||
| ### Duration of insulin action (DIA) | ||
| ### Duration of insulin action (DIA) and peak | ||
|
|
||
| #### Description | ||
|
|
||
| The length of time that insulin takes to decay to zero. | ||
| ```{warning} | ||
| Decreasing DIA or peak will always increase administered insulin. DIA has different logic to it in AAPS compared to commercial AID systems. Uninformed changes to these settings can change insulin dosing in a way which is much larger or smaller than expected. | ||
| ``` | ||
|
|
||
| The duration of insulin action is set to a single value per insulin type in **AAPS**, because your pump will continually infuse the same type of insulin. | ||
| AAPS models insulin action with a mathematical function, configured using **DIA** and the closely related **peak** settings. DIA represents a theoretical duration until IOB reaches zero and peak represents timepoint after insulin activity is strongest. Insulin activity and rate of IOB decay is one and the same. | ||
|
|
||
|  | ||
|
|
||
| This, together with the insulin type's peak time, results in the [insulin profile](#AapsScreens-insulin-profile), as shown in the image above. The important thing to note is that the decay has a **long tail**. If you have been used to manual pumping, you have probably been used to assuming that insulin decays over a much shorter period i.e. about 3.5 hours. However, when you are looping, the long tail matters as the calculations are far more precise and these small amounts add up when they are subjected to the recursive calculations in the **AAPS** algorithm. Therefore, **AAPS** uses a minimum of 5h as **DIA**. | ||
| In the above chart, in theory, half the IOB is decayed after ~110 minutes. The blue activity curve shows that at 120 minutes, IOB is decaying at a rate of 0.5 percentage points per minute. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see the exact activity values in v4, in the new Insulin Manager... I hope developers could add them, I already pointed out this small flaw. |
||
|
|
||
| Additional reading on the topic of duration of insulin action, and why it matters : | ||
| * [Understanding the New IOB Curves Based on Exponential Activity Curves](https://openaps.readthedocs.io/en/latest/docs/While%20You%20Wait%20For%20Gear/understanding-insulin-on-board-calculations.html#understanding-the-new-iob-curves-based-on-exponential-activity-curves) on OpenAPS documentation. | ||
| * [Why we are regularly wrong in the duration of insulin action (DIA) times we use, and why it matters…](https://www.diabettech.com/insulin/why-we-are-regularly-wrong-in-the-duration-of-insulin-action-dia-times-we-use-and-why-it-matters/) on Diabettech. | ||
| * [Exponential Insulin Curves + Fiasp](https://web.archive.org/web/20220630154425/http://seemycgm.com/2017/10/21/exponential-insulin-curves-fiasp/) on See My CGM (archive). | ||
| * [Revised Humalog model in a closed loop](https://bionicwookiee.com/2022/04/13/revised-humalog-model-in-a-closed-loop/) and other articles on Bionic Wookie, recommending a DIA of 9h for Lyumjev, Fiasp, NovoRapid, Humalog. | ||
| Recall that as AAPS applies TBR below profile basal rate, IOB is subtracted. Therefore, in the typical hybrid closed-loop AAPS use, positive IOB from meal bolus will in practice reach zero many hours earlier than the configured DIA. For the same reason, positive IOB from a small SMB will decay to zero very quickly after zero-temping. | ||
|
|
||
| To configure DIA and peak, tap **Manage** in the main screen, and then tap **Insulin**. Due to the influence of TBR explained above and the mathematical formula used for IOB decay in AAPS, most users set a clearly higher DIA than in commercial systems. In general, many people find that a **DIA** of 9h works well for them. After you have more experience with AAPS and have a well-tuned profile, you can try to determine a personalized DIA and peak configuration with the information presented in the next section. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Giving a single, 9h suggestion for DIA. The old version had 6-7h, and then "growing number using 8-9h". I think this can add some confusion because people often recommend raising the DIA value from e.g. 6h to 9h, without realizing that this has quite different impact with Novorapid preset than Lyumjev preset. So I think we can prevent confusion by giving one, consistent "beginner default" here. |
||
|
|
||
| #### Additional details on the impact of DIA and peak configuration | ||
|
|
||
| Since the basal rate has an indirect influence to IOB decay in AAPS, it follows that too high basal rates can mask too high DIA, and vice versa. It makes sense to first carefully tune basal rates before adjusting DIA and peak. Additionally, consider that the DIA and peak settings interact in sense that the effect of DIA depends on peak, and vice versa. | ||
|
|
||
| #### Impact | ||
| The following charts show the exact impact of DIA and peak to the IOB curves. | ||
|
|
||
| Too short **DIA** can lead to low BGs. And vice versa. | ||
| Adjusting DIA: | ||
|
|
||
| If **DIA** is too short, **AAPS** will calculate too early that your previous bolus is all consumed, and if your **BG** is still high, it will over-deliver in insulin. (Actually, it does not wait that long, but predicts what would happen, and keeps adding insulin). This essentially creates ‘insulin stacking’ that **AAPS** is unaware of. This is especially noticeable at night, if you see negative IOB with no other explanation than the queue of the last bolus. | ||
| ```{image} ../images/iob_remaining_static_peak.png | ||
| :width: 400px | ||
| ``` | ||
|
|
||
| Adjusting peak: | ||
|
|
||
| ```{image} ../images/iob_remaining_static_dia.png | ||
| :width: 400px | ||
| ``` | ||
|
|
||
| Example of a too-short **DIA** is a **high BG** followed by **AAPS** over-correcting and giving a **low BG**. | ||
| Finally, a comparison adjusting DIA and peak in parallel. The logic here is that both values are adjusted in same relative amounts, so that `49/35 ~ 7/5`. Or similarly, `120/93 ~ 9/7`. The intervals will be consistent regardless of the baseline DIA or peak, as long as the relative change is same for both. | ||
|
|
||
| #### How to set it | ||
| ```{image} ../images/iob_remaining_uniform.png | ||
| :width: 400px | ||
| ``` | ||
|
|
||
| The **figure below** shows an example of a DIA setting. | ||
| Note that when DIA and peak are adjusted in this fashion, every point in the curve will shift by the same relative amount. | ||
|
|
||
|  | ||
| #### Further reading on DIA and peak configuration | ||
|
|
||
| The **DIA** setting is often set too short by new users. A **DIA** of 6 or 7 is probably a good place to start. A growing number of people find that a **DIA** of 8 to 9 hours works well for them. See the additional reading mentioned above. | ||
| * [Technical details and historical background from the AAPS predecessor, OpenAPS](https://openaps.readthedocs.io/en/latest/docs/While%20You%20Wait%20For%20Gear/understanding-insulin-on-board-calculations.html#understanding-the-new-iob-curves-based-on-exponential-activity-curves). | ||
| * [Why we are regularly wrong in the duration of insulin action (DIA) times we use, and why it matters…](https://www.diabettech.com/insulin/why-we-are-regularly-wrong-in-the-duration-of-insulin-action-dia-times-we-use-and-why-it-matters/) on Diabettech. | ||
| * [Exponential Insulin Curves + Fiasp](https://web.archive.org/web/20220630154425/http://seemycgm.com/2017/10/21/exponential-insulin-curves-fiasp/) on See My CGM (archive). | ||
| * [Revised Humalog model in a closed loop](https://bionicwookiee.com/2022/04/13/revised-humalog-model-in-a-closed-loop/) and other articles on Bionic Wookie, recommending a DIA of 9h for Lyumjev, Fiasp, NovoRapid, Humalog. | ||
|
|
||
| (Config-Builder-bg-source)= | ||
| ## BG Source | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -259,15 +259,17 @@ In the editor you can give the insulin a **nickname** and set its **Peak** (in m | |
|
|
||
|  | ||
|
|
||
| ```{admonition} Don't change the peak unless you know what you are doing | ||
| :class: danger | ||
| For advanced users or medical studies it is possible to define a customized insulin activity profile. Please don't change the peak unless you are an expert — usually the preset values work well for each branded insulin. | ||
| ``` | ||
|
|
||
| Pick the preset that matches your insulin, for example **Fiasp**: | ||
|
|
||
|  | ||
|
|
||
| ```{admonition} Tap your insulin brand and use the given preset for peak. | ||
| :class: danger | ||
| Please don't change the peak unless you are an expert — usually the preset values work well for each branded insulin. | ||
| ``` | ||
|
|
||
| If you are a new AAPS user, set DIA to 9 hours. More details at [the DIA section of the docs](#Config-Builder-insulin-dia). | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently many users might pick 5h DIA without understanding how DIA works, then they later read that generally higher values are recommended and raise the value. I think it makes sense to give consistent advice here and directly recommend the high 9h. |
||
|
|
||
| ```{admonition} "Insulin configuration changed" dialog | ||
| :class: note | ||
| If a paired client (_e.g._ another phone) has changed the insulin configuration, a dialog appears. Press **OK** to load their changes, or **Cancel** to keep editing (your next save will overwrite theirs). | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Insulin activity and rate of IOB decay is one and the same."
I'm 99% sure this is how it works, but highlighting this change just in case...