Magikcraft / insulin-engine

Naive implementation of insulin and blood glucose interaction, for educational purposes.
https://www.magikcraft.io/minecraft-for-type-1-diabetes
1 stars 2 forks source link

Insulin vs Glucose as vectors #8

Open Nelyx opened 7 years ago

Nelyx commented 7 years ago

The simplest way to model the Insulin vs Foods graph is with a pair of vectors.

  1. Foods bring the BSL up at a particular rate. This rate is determined by the GI of the food, and the duration is determined by the quantity.
  2. Insulin brings the BSL down at a particular rate. This is a much more deterministic rate. An example pseudocode implementation may look like this. BSL(t) = BSL(t-1) + ((GI / 100) * t) - (InsulinOnBoard * t) -