The article discusses a modification of Bergman's minimal mathematical model of the "insulin-glucose" system, which allows simulating controlled exogenous sources of glucose and insulin into the patient's blood on the model and investigating the dynamics of changes in their concentrations in normal conditions, in type I DM and type II DM. A modeling scheme is presented in graphic notations of the MatLab / Simulink computer mathematics system and a number of computational experiments on it are described to determine the type of glycemic profiles of glucose and insulin concentration in the patient's blood in the noted situations. The fundamental possibility of using model mappings in the MatLab/Simulink environment for the study and tuning of the loop for automatic regulation of the "insulin-glucose" balance in the patient's blood using a controlled insulin pump is demonstrated. It was also found that the modified minimal model can be customized for a specific patient with diabetes, which makes it possible to use it to solve the problems of individual prediction of the development of a diabetic disease in a specific patient. In addition, the described model makes it possible to recreate and virtually investigate various conditions and cases on it that affect the dynamics of insulin and glucose concentrations in the patient's blood, for example, when he performs physically stressed activities, in the presence of the effects of “aging” of insulin-producing cells in the pancreas. iron, etc.