Skip to content
GlucoTwin

About

How GlucoTwin works, written for someone curious rather than expert.

What the twin is

A digital twin is a small model that behaves like a part of you. GlucoTwin's model covers how glucose, insulin and your tissues interact over a day. You describe yourself, add meals, walks and medication, and the model works out a glucose curve. Everything runs in your browser. No data leaves your device.

The model

The core is the Bergman minimal model, published in 1979 and still used in diabetes research. Three equations describe how three quantities change from minute to minute.

dG/dt = −(p1 + X) · G + p1 · Gb + Ra(t) / Vg
dX/dt = −p2 · X + p3 · (I − Ib)
dI/dt = −n · (I − Ib) + γ · max(G − h, 0)

In words: glucose drifts back to its resting level and is pulled down by insulin's action, while food pushes it up. Insulin's action builds when insulin is above its resting level. The pancreas releases insulin when glucose rises above a threshold, and the body clears it again.

G
Glucose in your blood, in mg/dL.
X
How strongly insulin is working on your tissues right now. It rises after insulin does and fades slowly.
I
Insulin in your blood, in µU/mL.
Gb
Basal glucose: where you settle when fasting.
Ib
Basal insulin: your fasting insulin level.
p1
Glucose effectiveness: how fast glucose returns to basal on its own, with no extra insulin.
p2
How quickly insulin's effect on your tissues fades.
p3
Insulin sensitivity: how much effect each unit of extra insulin builds. Lower means more insulin resistance.
n
How fast your body clears insulin from the blood.
γ
Beta-cell response: how much insulin the pancreas releases for each mg/dL of glucose above the threshold.
h
The glucose level above which the pancreas starts releasing extra insulin.
Vg
The volume glucose spreads through, set from your body weight (1.7 dL per kg).
Ra(t)
Rate at which glucose from food enters the blood at time t.

The equations are solved on a computer one minute at a time over a full day, using a standard method called fourth-order Runge-Kutta. Glucose is never allowed below 40 mg/dL.

Making it personal

Your HbA1c reflects your average glucose over about three months. The twin converts it with the formula from the American Diabetes Association:

eAG (mg/dL) = 28.7 × HbA1c − 46.7

Fasting glucose is set to 85 % of that average, because meals pull the average above the fasting level. A higher HbA1c lowers the twin's insulin sensitivity and beta-cell response. Low activity and older age reduce sensitivity a little further. Your weight sets the volume glucose spreads through.

Meals, walks and metformin

Meals release glucose along a curve that rises, peaks and tails off. The peak comes about 35 minutes after eating for fast, high-glycaemic-index foods and about 70 minutes for slow ones. About 90 % of the carbohydrate reaches the blood.

Walking makes muscles take up glucose directly, and raises insulin sensitivity by up to 1.6 times while you walk, fading over the next 90 minutes.

Metformin lowers how much glucose the liver releases, by up to 12 %. The effect builds over about 2 hours and lasts around 10.

Calibration

Two numbers describe how your body differs from the average person with the same HbA1c: insulin sensitivity and beta-cell response. When you enter glucometer readings, GlucoTwin tries many combinations of the two, simulates your day for each, and keeps the combination whose curve passes closest to your readings. It searches a coarse grid first and then finer grids around the best point.

Glucose readings alone cannot fully tell the two apart, so the search prefers explanations that change insulin sensitivity.

Insights

The insights are fixed rules, such as "find the meal with the largest carbohydrate load before the peak". Where a suggestion has a number, such as a lower peak after swapping rice for rotis, GlucoTwin gets it by running the simulation again with that change. There is no AI service behind them.

Limitations

Please read these. DemoThe sample patient and sample readings are made up.

  • GlucoTwin has not been clinically validated. It has not been tested against measured glucose from a group of patients.
  • The physiology is simplified: one pool of glucose and one of insulin. It leaves out glucagon, fat and protein in meals, stress, illness, sleep, alcohol and hormones.
  • Food values are approximate reference figures. Real glycaemic index and carbohydrate content vary with the recipe, cooking and portion.
  • Several starting constants were chosen by us to give plausible curves, not fitted to patient data.
  • A few readings from one day cannot separate insulin sensitivity from pancreas response, so calibration mostly adjusts sensitivity.
  • Simulated numbers should never be used to decide a dose or to change treatment.

Educational tool. Not a medical device. Always follow your doctor's advice.

References

  • Bergman RN, Ider YZ, Bowden CR, Cobelli C. Quantitative estimation of insulin sensitivity. American Journal of Physiology 236(6): E667-E677, 1979.
  • Bergman RN, Phillips LS, Cobelli C. Physiologic evaluation of factors controlling glucose tolerance in man. Journal of Clinical Investigation 68(6): 1456-1467, 1981.
  • Nathan DM, Kuenen J, Borg R, Zheng H, Schoenfeld D, Heine RJ. Translating the A1C assay into estimated average glucose values. Diabetes Care 31(8): 1473-1478, 2008.
  • Atkinson FS, Foster-Powell K, Brand-Miller JC. International tables of glycemic index and glycemic load values: 2008. Diabetes Care 31(12): 2281-2283, 2008.
  • Atkinson FS, Brand-Miller JC, Foster-Powell K, Buyken AE, Goletzko J. International tables of glycaemic index and glycaemic load values 2021. American Journal of Clinical Nutrition 114(5): 1625-1632, 2021.
  • Longvah T, Ananthan R, Bhaskarachary K, Venkaiah K. Indian Food Composition Tables 2017. National Institute of Nutrition, Hyderabad.