Determining the optimal timing for insulin injection to minimize glucose level variability after a meal in ideal conditions

Determining the optimal timing for insulin injection to minimize glucose level variability after a meal in ideal conditions was a research project for the IB Standard Level Mathematics Analysis and Approaches course inspired by my type 1 diabetes. With type 1 diabetes, there are broadly two major problems that must be solved daily by the diabetic individual: when to eat or inject insulin and how much? Because of the IB’s policy on human and animal experimentation, the first question was significantly easier to approach as it could be done by simply modeling the behavior of my glucose levels after said events without modifying anything about my daily routine, a point I had to stress over and over again to get the project approved.

The overall method was to isolate the events where I naturally either injected 1 unit of insulin or consumed 10 grams of carbohydrates far enough from eating and exercise from the over 10 000 data points that my dexcom G6 glucose sensor collected over the data collection period. I used statistical methods to model the average behavior of my glucose levels in those events to produce curves (functions) for both types of events with python. Adding together the curves and taking the integral of that graph with different x-offsets of the insulin injection curve then produced the optimal timing with the simplified assumptions that were made. Due to these simplified assumptions and the one person test group, the results are not to be trusted in making medical decisions but the process may be used as inspiration for a better algorithm one day.

As a mathematics IA for the International Baccalaureate Diploma Programme, it got 18/20 points, which translates into an overall grade of 7.

See it on ib-done.com.