This page provides technical details and references.

Physiological model

The following models are currently available for the mathematical description of the physiological processes in the body:

  • UVA/Padova according to Dalla Man et al. Very similar equations also underlie the commercial UVA/PADOVA Type 1 Diabetes Simulator (T1DMS).
  • Cambridge according to Hovorka et al.

Detailed information can be found under the respective link. It must be expressly pointed out that these are always only mathematical models which can at most describe the real processes in the human body approximately and in parts. Therefore, although the simulation results qualitatively resemble clinical curves, they must be interpreted with caution and are not suitable for deriving individual treatment strategies from them (see disclaimer).

AID algorithms

Currently, these algorithms are included in the simulator; the selection will be expanded in the future.

CSII (Basal + Bolus)

This setting realizes a standard pump therapy, i.e. continuous subcutaneous insulin infusion at constant basal rate plus meal boluses. When changes are made to the virtual patient, the basal rate is automatically set to a physiological value, but can be manually overwritten. The meal bolus is delivered for announced meals with an adjustable timespan between injection and meal; the carb factor (in units of insulin per unit of carbohydrate, i.e. 10g) is also configurable.

OpenAPS (oref0)

OpenAPS (oref0) is the open source algorithm developed and maintained by the Do-It-Yourself (DIY) community. It is included unchanged and in its original form because it is also programmed in JavaScript.

Manual delivery of a meal bolus by the virtual patient is configured exactly as above; basal rate adjustment, however, is done automatically by the algorithm. Various parameters can be adapted, including insulin sensitivity (ISF), target range of glucose concentration, duration of insulin activity (DIA) and others. For more details on their meaning and effect in the algorithm, please refer to the OpenAPS documentation.


PID refers to a classical proportional+integral+derivative controller as it is also most commonly used in countless industrial applications. It reacts to the difference between a desired blood glucose concentration and the actual value. This control error is processed in three ways: The proportional path multiplies the error by a constant (momentary reaction). The integral path gathers the area under the error curve and thus accounts for continuing deviations. The derivative path reacts to changes. All three components are eventually summed up.


For the simulation, any number of meals can be defined, which are taken at a specific time and consist of an adjustable amount of carbohydrates. Meals can be announced or unannounced.

In the expert mode, especially the announcement can be parameterized even more filigree: On the one hand, the announced time of the meal can deviate from the actual time as desired; the same applies to the amount of carbohydrates. In addition, the exact time at which the announcement is made can be set; for example, it is possible to specify how much advance notice the AID algorithm has of an upcoming meal.

Technical realization

The simulator was implemented entirely in JavaScript, which is interpreted by all modern browsers. This means that all calculations can be performed directly on the user’s device. Data or parameters entered can be downloaded if desired, but are never automatically saved outside the browser.

Numerical simulation

For the numerical solution of the differential equation system, a classical Runge-Kutta method with a fixed step size of 1min is used. This ensures a good compromise between short simulation time and high accuracy. Furthermore, the fixed step size facilitates the consideration of impulsive signals such as the sudden increase of the insulin concentration due to a bolus.

Used tools and libraries

The graphical visualization of the simulation results is carried out with Chart.js. Webpack is used to bundle the JavaScript packages and as a local server, and Vue.js as the framework.