Three Parameter Control Algorithm for Obtaining Ideal Postprandial Blood Glucose in Type 1 Diabetes Mellitus

The three main parameters used by patients in diabetes management are initial blood glucose, carbohydrate amount, and mealtime difference. In this study, a novel open-loop control algorithm was proposed, which aims to determine the correct value of mealtime difference duration. Unlike current blood glucose estimation methods, this algorithm was focused on determining extreme points that only concern patients such as hyperglycemia and hypoglycemia, instead of predicting all blood glucose trace in the postprandial period. This new approach has made it possible to determine extreme blood glucose values with simple linear equations without using complex models. This algorithm has only three parameters and has been validated in the UVA Padova type 1 diabetes mellitus simulator, which has thirty in-silico patients. The regressions between real and predicted values for hypoglycemia, hyperglycemia, and mean blood glucose were 0.95, 0.99, and 0.98, respectively. Using the proposed algorithm, the severity of hyperglycemia, mean blood glucose, and standard deviation values were reduced, and hypoglycemia events were prevented. Postprandial blood glucose curves have occurred as desired and within normal limits. Furthermore, it was concluded that intersection points of blood glucose curves contain information about the metabolic parameters of the patients, in this study.


I. INTRODUCTION
Open-loop control is the most prevalent form of treatment for patients with type 1 diabetes mellitus (T1DM). The regulation of blood glucose (BG) comprises an assortment of metabolic dynamics. There are only three notable parameters that T1DM patients regularly engage in daily to manage their BG. These parameters are composed of initial blood glucose (IBG) value, carbohydrate (CHO) amount, and mealtime difference (DIF) which refers to the waiting time after insulin injection. The effectiveness of open-loop control relies on the precise overlap of insulin and carbohydrate mechanisms. T1DM models that require extensive usage of mathematics are not structured in a way that patients and physicians can easily comprehend and apply. In order to develop artificial pancreases that will carry out all the stages of BG The associate editor coordinating the review of this manuscript and approving it for publication was Geng-Ming Jiang . management independently, studies have been concentrated on insulin pumps, measurement sensors, and control algorithms [1]- [3].
It is desirable that children with T1DM have a BG value in the range of 100-180 mg/dL. Hypoglycemia refers to BG value declining below 70 mg/dL, whereas hyperglycemia refers to it rising above 180 mg/dL in children with T1DM. The past value of BG is obtained by examining levels of hemoglobin A1C, which reflects the estimated average BG measure in the previous three months. Hemoglobin A1C is briefly referred to as A1C in the literature [4], [5]. Blood Glucose Risk Index (BGRI) value is used to reveal the risk of chronic damage caused by uncontrolled BG [6], [7]. The fact that T1DM is recognized as an autoimmune disease reduces precise treatment expectations in the short term. For this justification, practical solutions that will facilitate the lives of patients such as artificial pancreas are increasingly being emphasized [8]- [10]. In open-loop control algorithms, the amount of bolus insulin to be given for a meal is calculated as follows: where, B represents the bolus insulin amount. This equation contains three components. The first is the amount of insulin calculated using carbohydrate-insulin ratio (CR) for foods taken and provides the basis for bolus insulin. The second is defined as correction insulin. It determines how much insulin is to be added or reduced to bring the current IBG to the targeted BG. It is calculated using insulin correction factor (CF). The third is the amount of insulin called insulin on board (IOB), which is still metabolically active in the body and deducted from the account [11], [12]. Current insulin pumps are not yet at a level that can detect the food that has been eaten. Hence, both IBG value and CHO amount in the meal taken are entered manually into the insulin pump. BG values can be consistently supervised with continuous glucose monitoring systems (CGM) developed using subcutaneous BG measurement sensors [13]. Several advanced categories of insulin pumps have the capacity to interpret IBG value directly from the CGM system. After these procedures, the amount of bolus insulin is calculated with the aid of an insulin pump and injected into the body with the patient's approval. The current goal of interest is to develop an insulin pump, also known as an artificial pancreas that can execute all of these processes on its own. Nowadays, the use of automation in healthcare and all other industry is becoming more prominent, including biomedical systems [14], [15]. Artificial pancreatic studies have also focused on the ability to detect CHO quantity and deliver insulin in the appropriate dose and within the recommended time interval [16], [17].
There are various algorithms developed for BG management systems. The approaches of these algorithms differ depending on whether the control system is an open or closed loop. Closed-loop BG control systems have an insulin pump, a controller, and a CGM sensor. This structure forms the basis of the artificial pancreas. The control structure here is based on the processing of CGM data provided periodically. As soon as BG value tends to go beyond normal limits, the system can be intervened. Thanks to CGM, which provides a feedback signal, dependence on insulin glucose models has been reduced. However, for closed-loop BG control algorithms to be successful, BG data obtained from CGM must be accurate and reliable. Today, many closed-loop control algorithms have been developed using all the algorithms in the control theory literature, such as predictive, fuzzy logic, proportional -integral -derivative (PID), and different combinations created using them together. Model predictive control algorithms have been more successful and have been widely used. These algorithms were also enhanced by new approaches such as deep learning [18]- [20].
Although current studies have shifted onto closed-loop control systems and many control algorithms have been developed in this regard, the most valid method in today's BG management is still open-loop control. In open-loop control, it is not possible to continuously measure and correct BG value. In general, these algorithms should have a fairly successful insulin-glucose model. Bergman (minimal), Hovorka, Stolwijk-Hardy, Wang-Li-Kuang, and UVA/Padova T1DMS models can be listed as the most widely used models in the literature. Non-model based open loop algorithms such as Pankowska and Food Insulin Index are also available and are not widely used because they cause too many hypoglycemia events. Model-based algorithms could not be presented to the practical use of all patients and physicians, due to their complex mathematical structures and person-based parameters [21], [22].
In this study, it was aimed to develop an open-loop control method that patients and physicians can be used easily. The presented method has been developed to improve BG values of the postprandial period and to prevent hypoglycemia and was based on determining the correct value of DIF duration. Unlike the current BG estimation methods, it was focused on determining extreme points that only concern patients such as hyperglycemia and hypoglycemia, instead of predicting all BG values in the postprandial period. This new approach has made it possible to determine extreme BG values with simple linear equations without using complex models.

II. THEORY
The purpose of BG regulation is to ensure that BG value remains within normal limits by giving the insulin that the body needs. The success of this process depends on the exact overlapping of insulin and CHO mechanisms. The delay caused by the nature of the insulin and CHO mechanism of action makes this overlap difficult. The effect of insulin and CHO continues for a period of about 3 hours after the meal, which is called the postprandial period. Although the steadystate goal is generally achieved at the end of the process, dangerous hypoglycemia and hyperglycemia values reached during this period cannot be prevented in today's open-loop control methods [23], [24].
In fact, DIF duration is one of the most important parameters that will ensure that BG value remains within the desired range during the postprandial period. DIF duration is defined as the time between the administration of insulin injection and the time at which the patient starts eating. In addition, DIF duration is one of the three most frequently used parameters by T1DM patients in their daily lives. The other two accompanying parameters are IBG and CHO. IBG is an existing value at the time of insulin injection and there is no prospect of intervention to this value. In contrast, the amount of CHO is flexible and can be adjusted for the benefit of T1DM patients, that is, it can be reduced. DIF duration can be used as an effective argument to better overlapping of action mechanism of insulin and CHO if it determined correctly.
Today, DIF duration is roughly adjusted by the patient, and BG values are ignored in the postprandial period. It was not understood what happened in the postprandial period until the  CGM systems, which now appeared to be used in patients with T1DM were discovered, and this period could not be managed [25]. Çankaya and Aydoğdu [26] claimed in their theoretical studies that if CHO and IBG values could be defined, BG curve would be as in Fig. 1, depending on the different DIF durations.
In their theoretical study, BG and insulin mechanisms were expressed with the ''pimf'' function in MATLAB. They stated that if insulin and CHO mechanisms are suitably matched, patients will experience a lesser extent of hyperglycemia. For the overlap of these mechanisms, it is a prerequisite for DIF duration to be established accurately. It was shown that by precisely determining DIF duration, the level of hyperglycemia could be decreased, and if this setting alone was not sufficient, the amount of CHO could be further minimized to reduce the high BG levels to lie within the reasonable range [27], [28].
A more appropriate amount of CHO could be selected using Fig. 2. Here, DIF duration that obtains the lowest hyperglycemia values but does not cause hypoglycemia is called as ideal DIF. Hyperglycemia may not have fallen to an acceptable level although the most conducive DIF duration was selected. In such a case, the amount of CHO in the diet should be reduced instead. Hypoglycemia and hyperglycemia values for different amounts of CHO could be seen from the curves in Fig. 2 [26]. Ideal postprandial BG curve for T1DM patients should be as shown in Fig. 2.
BG curve starts from IBG value. If DIF duration is determined correctly, the insulin mechanism becomes active a little earlier. Based on this situation, there is a reduction in BG value observed in the first stage which is described as the ''First Fall''. After a while, the values of CHO and insulin mechanisms gradually become equal due to the rapidly increasing CHO mechanism. The minimum BG value obtained at this time is called the ''First Low BG'' and is denoted by BG 1LOW . As CHO mechanism usually has higher amplitude and a shorter period, this explains the prompt elevation of BG level. At the end of the elapsed time, the effectiveness of the insulin mechanism becomes evident again, while the activity of CHO progressively decreases. Eventually, both mechanism curves are bound to meet at the same value. The highest BG value measured in this curve is called as BG MAX . BG MAX demonstrates the peak hyperglycemia value of the postprandial period. Consequently, BG value will proceed to diminish over time until it arrives at the target BG value. After this point, the insulin mechanism is superior; BG value successively drops until it reaches a target value during the period called ''Last Falling'' [26,27].
Extremum points on BG curves correspond to the maximum and minimum extreme values, indicating the level of hyperglycemia and hypoglycemia. BG curves obtained for different amounts of CHO always intersect at the inflection point. For BG curves, the times of occurrence of the intersection, minimum, and maximum points are always constant, it does not vary with the amount of CHO. This was due to the dominant linear effect of CHO amount on BG. Nonetheless, when DIF duration changes, it makes the mentioned times changed [27], [28].
In Fig. 3, the effect of the involved mechanisms was presented collectively. Insulin and CHO mechanisms have been drawn with 5 times magnification for a better understanding. Since IBG value was 150 mg/dL and the target BG value was 100 mg/dL, correction insulin was added to the bolus insulin amount in addition to CHO requirement. The theoretical study was based on mathematical functions and was devised with the assumption that insulin and CHO mechanisms interacted with BG in a linear fashion. Other non-linear factors affecting BG were neglected. Whether the model is competent in providing information with sufficient reliability is dependent on the non-linear dynamics of T1DM patients [27], [28].
In this study, it was aimed to validate that the theoretical BG curve which is given in Fig. 2 could also be created in subjects with T1DM. Thus, by developing a practical method, especially extreme BG values could be calculated in advance and ideal DIF duration could be determined. In this way,  hypoglycemia could be prevented and hyperglycemia could be reduced to more reasonable levels.

III. EXPERIMENTAL METHOD
The UVA/Padova T1DM simulator [Copyright (''2008, 2013 The University of Virginia'') T1DMS (Version 3.2) [Software] (2008, 2014)] was used for this study. T1DMS has been accepted by the United States Food and Drug Administration in lieu of animal trials. The principle diagram of a T1DM simulator was given in Fig. 47, in the supplementary material file [29]. The pharmacokinetic model for the insulin in the T1DMS was designed to represent a rapid-acting insulin analog, comparable to insulin aspart, lispro or glulisine. In T1DMS, BG measurements were computed via built-in intravenous sensors. As for the insulin application method, this system has involved a generic standard insulin pump as the prime tool. Subject-based metabolic parameters were used in all trials [30].
The research study was performed on 30 in-silico subjects totally those 10 children, 10 adolescents, and 10 adults. Targeted BG value has been determined as 100 mg/dL for all patients. IBG values have been selected as 80 mg/dL, 130 mg/dL and 180 mg/dL, respectively. At the same time, total amounts of CHO have been determined as 40 g, 80 g, and 120 g while DIF durations have been fixed at 0 minutes, 15 minutes, and 30 minutes, respectively. Trial patterns and protocols have been created using all combinations of CHO, IBG, and DIF.
The measurement period was determined as a total of six hours that starting one hour before eating and ending five hours later eating. In all protocols, subjects were required to eat their meals one hour after the start of the measurement period whereby each meal was taken within 15 minutes. The study has been performed according to the daily single meal intake. The statistical analysis of the data has been conducted using the SPSS 17 statistical package.

IV. RESULTS
All results obtained from the experiments were given in the supplementary material file. The protocols trialed and the values of some BG parameters obtained were given in Table 1. The terms of BG MEAN , SD BG , BG 1LOW , and BG MAX refer to mean, standard deviation, hypoglycemia, and hyperglycemia parameters of BG, respectively. Table 1 shows that increasing DIF duration causes a decrease in all BG parameters. While the most impactful decrease was observed in hyperglycemia values, the smallest range of decrease was seen in BG MEAN value. However, as DIF duration has been continued to increase, after a certain value, hypoglycemic conditions have been begun to occur. For this reason, the decrease in SD BG value stopped and this value started to increase again. Based on the results, it was found that DIF duration should be set to an exact value called ideal DIF.
According to the statistical analysis of the data obtained, the interaction among the three basic parameters mentioned was explained below. This interaction was referenced in the process of developing the best method in determining ideal DIF duration.

A. DIF EFFECT ON POSTPRANDIAL BG CURVE
Postprandial BG curves formed by different DIF duration were given in Fig. 4. Here, CHO and IBG were kept constant.
As evidently seen from Table 1, Fig. 4 and the statistical analysis, BG MAX , BG 1LOW , and BG MEAN values decreased due to the increase in DIF duration. Hyperglycemia values decreased, but the risk of hypoglycemia also showed an ascending pattern. Especially in cases where normal and low IBG values were present, hypoglycemic events were distinguishably more common. As DIF increased in its duration, SD BG value initially declined. Then, it started to increase after a certain point. This increase began with the formation of hypoglycemia. When DIF duration designated was longer than the correct one, it caused hypoglycemia, and SD BG began to increase again simultaneously. It was clear that ideal DIF duration should be determined as the longest time that will not cause any hypoglycemia.
BG curves intersect at diverse points for different DIF durations. The curve with a higher BG value at the beginning appears to have a lower BG value at the end of the postprandial period. However, the curve with a low BG value has a higher BG value at the end of the same period. Routinely, it was evaluated that the situation that occurred approximately 150 minutes after mealtime was predominantly due to the IOB effect. The IOB effect is the effect of the insulin which had previously entered the body either in bolus or basal form but is still effectively surviving in the circulation without deterioration to its course. Therefore, a high dose of effective insulin causes a larger than expected decrease in BG value. According to the results of the statistical analysis, the changes that would occur in BG value if DIF duration was modi-fied were given in the supplementary material file covering Fig. 35 -38 Fig. 5 and the statistical analysis, the increase in the amount of CHO increased BG MEAN , BG MAX , and SD BG while decreased BG 1LOW value. In other terms, both hyperglycemia and hypoglycemia events were increased. The study has shown that an increased amount of CHO worsened all BG management parameters of patients with T1DM.
To emphasize, perhaps one of the most important points inferred was that the increased amount of CHO causes a rise in the incidence of hypoglycemia after a meal. This situation revealed that a behavior existing in T1DM patients is actually wrong. These patients instinctively elongate DIF duration when they increase CHO intake in their meals. But, hypoglycemia occurs much earlier in response to the high CHO amount. It seems that if the amount of CHO is high, DIF duration should be reduced. As a result, hyperglycemia values will of course worsen. This indicates that the amount of CHO should always be limited in T1DM patients. It was observed that BG curves intersect as in the theoretical study and the model was also validated. According to the results of the statistical analysis, the changes that would occur in BG value if the amount of CHO was modified were given in the supplementary material file covering Fig. 39 -42.

C. IBG EFFECT ON POSTPRANDIAL BG CURVE
The effect of different IBG values on postprandial BG curve was given in Fig. 6. CHO and DIF were kept constant. Based on what was determined from Table 1, Fig. 6, and the statistical analysis, the rise in IBG value has been caused a similar increase in BG MEAN , BG 1LOW , and BG MAX values, but decreased SD BG value. Ideally, it is desired that IBG of T1DM patients be less than 140 mg/dL. As in the theoretical study, there was no intersection point in BG curves for different IBG values. According to the results of the statistical analysis, the changes that would occur in BG value if IBG was modified were given in the supplementary material file covering Fig. 43 -46.
It has been confirmed on subjects with T1DM that BG parameters could be improved by setting DIF duration correctly. Thus, the theory proposed Çankaya and Aydoğdu [26] has been validated in this study. In addition, it has been demonstrated once again that patients with the same A1C and BG MEAN values were actually exposed to very different levels of hyperglycemia and hypoglycemia. Then, referenced to this theory, the development of a practical method to be used by patients and physicians has been begun.

V. PROPOSED METHOD
From the data obtained, it was observed that the correct determination of DIF duration would decrease the hyperglycemia VOLUME 8, 2020 values of T1DM patients and inhibit hypoglycemia in the same process. Thereupon, a method has been developed to calculate the best duration of DIF. Adhering to this method, BG parameters are acquired by multiplying the coefficient matrix and another matrix consisting of CHO, IBG and DIF values.

A. LINEAR EQUATIONS AND COEFFICIENT MATRIX FOR BG PARAMETERS
The first step was the establishment of the coefficient matrix. Following that, ideal DIF duration was determined by means of iteration using the coefficient matrix. The algorithm of the method was created as follows. To start with, the different BG parameters and CHO, IBG, and DIF values of the patient were recorded at different times. With these data in hand, matrices expressing linear equations were formulated while the coefficient matrix was easily calculated by MATLAB. Then, using this matrix and iteration method, BG parameters for different CHO, IBG and DIF values were calculated. Ideal DIF duration was established as the longest waiting time that will not cause hypoglycemia for the algorithm of the developed method. The lower limit of BG 1LOW , which is the hypoglycemia value that will occur after the meal, is fixed at a level of 80 mg/dL. All T1DM patients need to determine their CHO and IBG values for each meal, regardless of whether or not they used an insulin pump. And patients also need to decide their DIF duration. As can be seen, patients must already have knowledge of all three parameters. On the basis of this information, the formation of equation matrices can be executed with greater ease. The expansion in the amount of data used provides a more accurate calculation of the coefficient matrix. The implementation steps of the method are described below. In this study, it was experimentally deduced that ideal DIF duration can be resolved by applying as follows: In [x] matrix, the coefficients associated with IBG, DIF, and CHO parameters were expressed as x IBG , x DIF , x CHO , respectively. If n different BG parameters were to be calculated, a three-element row was added to the [x] matrix for each additional BG parameter. In this case, the formula to be used for n different BG parameters was constructed in the form as follows: In order to achieve the same purpose, different linear equations were developed and tried in this study. Another alternative that could be used in the calculation was as follows: (5) where, [I ] was the unit matrix. So, it has also been demonstrated that it was also possible to express the system with different formulas. Equation (4) has been chosen to explain the methodology as it yields more successful results than (5). The values obtained from these two approaches were given in Table 3 and Table 4.
In this study, BG MEAN , SD BG , BG 1LOW , BG MAX , and other extreme BG parameters were calculated as follows:  To determine ideal DIF duration of T1DM patients, only BG 1LOW and BG MAX values are sufficient. Other parameters have been analyzed only to find out the scope and competence of the method. The system of linear equation employed in this study was given as follows: In order to calculate the coefficient matrix correctly as many values as possible for each BG parameter should be implemented. In this study, the results of all 27 protocols in the trial design were included and 27 independent equations were entered for each BG parameter. MATLAB solution of [x] coefficient matrix, consisting of the terms x, was efficiently accomplished as follows:  The coefficient matrix obtained according to the mean BG values of all patients was given in Table 2.
In the statistical analysis, it was revealed that x coefficients in the range of −0.1 <x< +0.1 may not be significant and could be regarded as zero. The coefficient matrix exhibits the effects of IBG, DIF, and CHO on BG parameters.

B. PREDICTING OF BG PARAMETERS
In order to control the effectiveness of the method used, BG predictions made with the coefficient matrix were compared with the actual results obtained from T1DMS. These calculations have been made for all patients. The data belonging to the patient known as Child8 was given in Table 3 to be referred to as an example. The regression between the predicted and realized data was determined as follows: where, y i is predicted value, y i is realized value,ȳ is average value of realized values. The R 2 parameter, which indicates the regression value, was found to be 0.95, 0.99, and 0.98 for BG 1LOW , BG MAX , and BG MEAN values of Child8, respectively. In the remaining patients, the results were obtained in the same regression and the results were examined. Equation (5) has been tried as another alternative; the results obtained were given in Table 4. The R 2 parameter, which indicates the regression value, was found to be 0.93, 0.99, and 0.98 for BG 1LOW , BG MAX , and BG MEAN values of Child8, respectively. The regressions were similar for the other patients. Equation (4) has been much more successful in predicting BG 1LOW and other parameters such as SD BG not given here. It was recognized that the focal cause of hyperglycemia was owing to the high CHO amount and high IBG value. But in the situation where hypoglycemia occurred immediately after a meal, the reasoning for these phenomena was due to the role of low IBG. If the amount of CHO taken in the presence of low IBG is high, the risk and severity of hypoglycemia increase.

C. DETERMINATION OF IDEAL DIF DURATION
So far, BG parameters have been predicted with sufficient accuracy thanks to the linear equations. After that, the stage of determining the most suitable value of DIF duration was started in order to realize postprandial BG in the more suitable range. An algorithm was developed with reference to the effects of DIF duration on the postprandial BG curve. The aim was to determine the duration of ideal DIF. VOLUME 8, 2020 Ideal DIF duration in the algorithm was determined as the highest DIF duration that would not cause hypoglycemia in the patient. However, DIF duration was limited to a maximum of 30 minutes, with reference to valid treatment practices. The hypoglycemia value was normally below 70 mg/dL, but a +10 mg/dL safety tolerance was added to this value and the hypoglycemia limit value was set at 80 mg/dL. As noted by various sources, in the case of hypoglycemia, the linear structure of the system is disrupted and the predictions are far from reality [31]- [33]. Hence, in the algorithm, DIF duration was set in such a way that no hypoglycemia occurred in the patient. If IBG value was lower than 80 mg/dL, DIF was chosen as zero to prevent the risk of hypoglycemia.
Current optimization methods could be used to determine ideal DIF duration. In this study, it was preferred to use iteration method instead of optimization methods due to the low number of parameters to be calculated.
The developed algorithm was tested on subjects by creating a scenario. A high amount of CHO and low IBG values mean extreme conditions that make BG management difficult. Patients and their parents need professional help in such conditions. IBG and CHO values in the scenario that will test the algorithm have been determined to meet these extreme conditions and the algorithm has been tried according to the most difficult conditions. Ideal DIF duration, BG 1LOW , and BG MAX values were calculated by the algorithm for the specified CHO and IBG values. In Table 5, the calculations for Adolescent8 were given as an example. The same calculations were made for all T1DM subjects and similar results were obtained.
The postprandial BG curves of all subjects were obtained according to the scenario given in Table 5, and one of them was given as an example in Fig. 7.
As seen in Fig. 7, the postprandial BG curve realized exactly as it was targeted and predicted. For the current values, it was seen that the lowest possible value of hyperglycemia was 252 mg/dL without hypoglycemia. This value was slightly outside the acceptable limit. And this high hyperglycemia could be prevented only by reducing the amount of CHO.
Normally, one minimum and one maximum extremum points are expected for BG curve. However, due to non-linear constituents, two local minimum and two local maximum points may also appear. The second extremum points are dependent on subjects and this does not affect the success rate of the method. The developed method can be used in all T1DM patients treated with the open-loop control method, whether or not they use an insulin pump.
In this study, it has been revealed that the waiting duration between insulin injection time and mealtime, called DIF duration, was one of the most important parameters in the formation of postprandial BG values of patients with diabetes. For different DIF durations, although the mean BG value was approximately the same, the values of hyperglycemia and hypoglycemia occurred at very different levels. With an increase of DIF duration, hyperglycemia values decreased significantly in all subjects, and it was also validated by the decrease in BGRI value, which was an indicator of chronic damage. However, if DIF duration was determined too long, hypoglycemia occurred and BGRI value started to increase again.
To complete the performance of this study, a mobile application has been developed that works according to the proposed algorithm and suitable for the use of all patients and physicians. By handling this application, data collection, coefficient matrix calculation, and ideal DIF determination were performed with a user-friendly interface. This application also calculates both ideal DIF duration and the upper limit of the amount of CHO that will ensure that hyperglycemia remains below a certain value. This application works on Android and IOS devices and was developed using React-Native which is a JavaScript-based platform. This application guides the input of patients' information and makes calculations using the models mentioned in the study. Patients and physicians never need to understand the mathematical model. Further studies on this application will be continued with a team that includes physicians, under another project.

VI. RELATED STUDIES
Equation (1) is the standard formula used to calculate bolus insulin in open-loop control algorithms. Cappon et al. [34] have added glucose rate of change (ROC) parameter obtained using CGM sensor information to this formula to prevent hypoglycemia and provide better BG management. Due to the new parameter added, the bolus insulin amount has been reduced for the patient whose BG was decreasing. And it has been increased while BG was rising. This method personalized the calculation of bolus and glucose control, outperforming the standard approach of current clinical practice. But, it led to worse performance in several scenarios. In future studies, if the ROC approach is proven to be reliable, and added to the simulator, it can also be tried for our method. In particular, the selection of the optimum BG curve has a parallel approach in both study and BGRI value was taken as a reference. Rosales et al. [35] developed an IOB-based open-loop control method called super bolus for high glycemic index meals that the current standard basal-bolus treatment could not provide well BG management. They provided an advanced postprandial control that could prevent late postprandial hypoglycemic events. Some aims of the study were in line with ours.
Equation (1) determines the amount of bolus based on CHO content only. Bell et al. [21] aimed to determine the amount of bolus for high-fat, high-protein meals and they developed an open-loop algorithm. It was demonstrated that the amount of bolus should be increased by around 65% in these meals and insulin should be given in two stages for 2.4 hours. Since only CHO content is simulated in T1DMS, this algorithm could not be tried in our study.
In another open-loop control study, Zaharieva et al. [36] investigated how long before basal insulin would be reduced from exercise. Typically, to reduce exercise-induced hypoglycemia, the basal rate is lowered and carbohydrate is taken. However, it is uncertain when to reduce basal to prevent hypoglycemia. As a result of the study, it was revealed that the basal should be reduced 90 minutes before exercise and more than half. Some targets of the study were similar to ours.
The algorithms described above focused on accurately determining the amount of bolus and dosing of insulin. Our study has been focused on the accurate determination of DIF duration using BG parameters obtained by any method.

VII. DISCUSSION
Since there is no literature information about the following study findings, further studies are recommended. In this study, as a novel finding, it was observed that vital information could be obtained from the intersection points of BG curves for different parameters. As is already known, a similar intersection methodology has been used to define the thermodynamic temperature unit, Kelvin.
As seen in Fig. 5, BG curves always intersect at the same point for different amounts of CHO. This phenomenon occurs  Fig. 4. This intersection, which should not be witnessed in completely linear systems, is due to the IOB effect. IOB dynamics, in which the mechanism of action is very difficult to understand in T1DM patients, can be determined by evaluating these intersections. As seen in Fig. 6, the curves for different IBG values do not intersect in the postprandial process. Intersection points of BG curves refer to patient-specific metabolic constants. Intersection points, which were not included in the literature yet, could be used to determine the metabolic parameters of T1DM patients.

VIII. CONCLUSION
In this study, it was validated using T1DMS that the extreme values of the postprandial BG curve, such as hypoglycemia and hyperglycemia, were affected by the change of DIF duration, and results were given in Table 1.
As a new approach, a practical BG estimation method has been developed based on the dominant linear effect of the three main parameters used in BG management. Firstly, the coefficient matrices that shape BG were determined and were given in Table 2. BG parameters such as hypoglycemia and hyperglycemia were estimated using only CHO, IBG, and DIF. The proposed method has been validated in patients with T1DM and results were given in Table 3 and Table 4. The regression rate of this method in determining hypoglycemia, hyperglycemia, and mean values of BG were 0.95, 0.99, and 0.98, respectively. The corrective effects of DIF durations on BG were also confirmed from BGRI value in Table 1.
Then, an algorithm has been developed that calculates BG parameters using iteration for different DIF durations and determines ideal DIF duration that defined as the longest amount of time that would not put the patient into a state of hypoglycemia. Results and an exemplary application were given in Table 5 and Fig. 7.
By using the proposed open-loop method, hypoglycemia was prevented, hyperglycemia values were reduced to normal limits, and inappropriate CHO amounts were predicted and reduced. In addition, a mobile application has been developed for patients and physicians to use the method easily without having the mathematical model knowledge.
NIHAT ÇANKAYA was born in Konya, Turkey, in 1974. He received the B.S. degree in electrical electronics engineering from Selçuk University, Konya, in 1997, and the M.S. degree in electrical electronics engineering from Necmettin Erbakan University, Konya, in 2017. He is currently pursuing the Ph.D. degree in electrical electronics engineering with Konya Technical University, Konya.
From 1998 to 2015, he worked as an Electrical and Electronic Engineer and a Manager in heavy industrial plants of different companies. Since 2015, he has been a Lecturer with the Food Processing Department, Meram Vocational School, Necmettin Erbakan University. He specializes in heavy industrial plant designing, process control, and PLC automation. He is the author of several articles and two inventions. His research interests include control theory, automation, PLC, process control, and T1DM.
Mr. Cankaya has been a member of the Chamber of Electrical Engineers, since 1997.
ÖMER AYDOĞDU was born in Konya, Turkey, in 1973. He received the B.S., M.S., and Ph.D. degrees in electrical and electronics engineering from Selçuk University, Konya, in 1995Konya, in , 1999Konya, in , and 2006 From 1996 to 2007, he was a Research Assistant with the Department of Electrical and Electronics Engineering, Selçuk University. From 2007 to 2018, he worked as an Assistant Professor and an Associate Professor with the Department of Electrical and Electronics Engineering, Selçuk University. From 2018 to 2020, he worked as an Associate Professor with the Department of Electrical and Electronics Engineering, Konya Technical University, Konya, where he has been a Professor, since 2020. He is the author of a book chapter and more than 70 scientific publications. His research interests include control theory, adaptive control systems, fractional order control, fuzzy logic control and applications, and brushless dc motors and drives. VOLUME 8, 2020