Abstract
Background:
Blood glucose (BG) regulation is a long-term task for people with diabetes. In recent years, more and more researchers have attempted to achieve automated regulation of BG using automatic control algorithms, called the artificial pancreas (AP) system. In clinical practice, it is equally important to guarantee the treatment effect and reduce the treatment costs. The main motivation of this study is to reduce the cure burden.
Methods:
The dynamic R-parameter economic model predictive control (R-EMPC) is chosen to regulate the delivery rates of exogenous hormones (insulin and glucagon). It uses particle swarm optimization (PSO) to optimize the economic cost function and the switching logic between insulin delivery and glucagon delivery is designed based on switching control theory.
Results:
The proposed method is first tested on the standard subject; the result is compared with the switching PID and the switching MPC. The effect of the dynamic R-parameter on improving the control performance is illustrated by comparing the results of the EMPC and the R-EMPC. Finally, the robustness tests on meal change (size and timing), hormone sensitivity (insulin and glucagon), and subject variability are performed. All results show that the proposed method can improve the control performance and reduce the economic costs.
Conclusions:
The simulation results verify the effectiveness of the proposed algorithm on improving the tracking performance, enhancing robustness, and reducing economic costs. The method proposed in this study owns great worth in practical application.
Keywords
Type 1 diabetes (T1D) is one of many incurable metabolic diseases with the symptom that the body only secretes a negligible amount of insulin because of the destruction of the pancreatic beta-cells. The blood glucose (BG), for people with diabetes, always lies at abnormal levels, which causes a lot of complications, such as nephropathy, peripheral neuropathy, blindness, and so on. In 2015, the International Diabetes Federation (IDF) published the newest Diabetes Atlas, that is, the IDF Diabetes Atlas (7th ed.), which showed that a total of 5 million people died of diabetes by the end of 2015, and the world’s diabetes treatment costs exceeded $673 billion. 1 The rapid increase of people with diabetes and the serious results that causes in health care and economic costs all promote the development of diabetes therapies.
The most common therapy should be multiple daily injections of insulin to regulate the glucose level. In recent decades, more and more researchers, not in medical field, engage in diabetes treatment. For example, automatic control scholars attempt to combine continuous glucose monitoring, continuous subcutaneous insulin infusion and an automatic control algorithm to achieve closed-loop control of BG, that is, artificial pancreas (AP). The AP can be divided into two types: unihormonal AP and bihormonal AP. Several algorithms have been used in unihormonal AP, such as PID in Marchetti et al, 2 model predictive control (MPC) in Wang and Doyle 3 and Wang et al, 4 and fuzzy logic control in Grant. 5 The previous studies showed that hypoglycemia can cause more direct damage than hyperglycemia and can even cause death. 6 To avoid this risk, researchers add the glucagon infusion into the system to transfer unihormonal AP into bihormonal AP. There are also many algorithms using in this type AP, such as the switching PID control in Gao and Wang 7 and the switching MPC in Ning and Wang. 8
In clinical practice, the primary task is to achieve an effective treatment that guarantees the safety of the patients; however, the decrease of treatment costs is also important. This article fills the gap of previous studies that pay no attention to decreasing the treatment costs. In this article, to reduce the treatment costs, the EMPC is chosen to be the core algorithm. The EMPC originated from traditional two-layered real-time optimization with a similar framework to conventional MPC, 9 which focused more on the economic consideration using a general cost function which differs from the quadratic cost function of MPC. 10 Hence, the EMPC inherits the merits of the MPC, which can manage time delays, constraints, and multivariate effectively. These advantages all prove that the EMPC is a good choice to regulate the glucose in the AP because the subject model system is a nonlinear time-varying model with great time delays and strong disturbances. The design of switching rules also refers to the core idea of the EMPC, which can reduce the economic cost further.
The dynamic R-parameter 11 is utilized to improve the control performance, make zero-error tracking possible, which is designed based on the tracking error of the last sampling moment. For the insulin subsystem and the glucagon subsystem, the design of (the R-parameter) is different because they have opposite effect on glucose regulation. Several penalty parameters are used to adjust the value of r.
Simulation results are shown in figures and the statistical data are recorded in tables. After the simulation on the standard subject, the comparison for tracking performance and the tests for robustness, we can draw the conclusion that the proposed method can improve tracking performance and reduce treatment costs at the same time. For the standard subject, BG can be maintained within the normal range (70-180 mg/dl), the average tracking error (ATE) and BG risk index (BGRI) are 14.04 and 1.01, respectively, which is sufficient. In addition, the economic costs of insulin and glucagon are reduced by 41.74% and 70.40% compared with the switching PID, 7 28.47% and 53.92% compared with the switching MPC. 8
Simulation Model
A meal model, an insulin model, a glucagon model and a glucose model form the whole simulation model. In this study, the meal model and the glucose model are selected from Hovorka et al, 12 the insulin model can be seen in Wilinska et al, 13 and the glucagon model is proposed in Gao and Wang. 7 All these models are authoritative and have been used widely in AP study.
We name the virtual subject with the same parameters of Gao and Wang, 7 Hovorka et al, 12 and Wilinska et al 13 as the standard subject. Another nine virtual subjects (numbered 1-9) with different parameters obtained by the same method in Ning and Wang 8 will be used to make the robustness tests on subject variability.
The Switching Dynamic R-parameter Economic Model Predictive Control
The framework of the switching R-EMPC is shown in Figure 1.

The structure chart of the switching R-EMPC.
Dynamic R-parameter Economic Model Predictive Control
The detailed overview of the EMPC can be found in Ellis et al. 14 The key procedures include the identification of the prediction model, the design of the cost function, and the receding horizon optimization of inputs.
The prediction models are used to approximate the relationship between insulin and glucose and glucagon and glucose, respectively. In this study, the autoregressive exogenous (ARX) model is used, which is described as:
where
For the design of the cost function, we add the idea of the dynamic R-parameter 15 into the general EMPC to improve the tracking performance; hence, the cost function of each subsystem can be designed as follows:
where the second term aims to reduce the usage of hormone directly; N and M (N>M) are the prediction horizon and the control horizon, chosen as 30 and 3 respectively;
where
In this study, particle swarm optimization (PSO) is chosen to solve the receding horizon optimization problem, the predictive inputs signal can be obtained by solving the optimization problem (5).
Then, only the first input
The Switching Rules
In this article, the whole system is divided into three modes: the insulin infusion mode, the glucagon infusion mode, and the zero-input mode. The switching rules are used to simulate the switching logic between them.
The switching cost function is designed like (6) considering the tracking error and the economic cost comprehensively:
where the same notations has the same meanings as equation (2), and M1 and N1 represent the control horizon and prediction horizon, which are chosen as 3 and 10, respectively, of the switching rules (M1 ≤ M, N1 ≤ N).
At every sample t, the appropriate mode can be obtained by optimizing (7).
The Simulation Results
Performance Assessment Indices
In this study, the safe range of BG concentration is defined as 70-180 mg/dl, BG greater than 180 mg/dl is called hyperglycemia, and BG lower than 70 mg/dl is called hypoglycemia.
The ATE is used to show the tracking performance of the controller, which is introduced as follows:
where k represents the k-th day,
The BGRI 16 are chosen to reflect the risk of BG.
Regarding the economic costs, the amount of insulin and glucagon used in simulations are recorded and compared.
The control variability grid analysis (CVGA) 17 is used to visualize the quality of the control algorithm on different subjects.
Simulation on the Standard Subject
The duration of simulation is set to 2 days, the basal and bolus open-loop therapy is used in the first day, while the closed-loop control is implemented in the second day. During the simulation, patients eat 40 g, 60 g, and 85 g carbohydrates at 7:00, 12:00, and 18:00, respectively, which correspond to the patients’ three meals every day. These parameter settings accord with the real cases. Simulation does its best to imitate clinical test. In this simulation, the superiority of the switching R-EMPC is compared with the other two closed-loop control methods, that is, the switching PID 7 and the switching MPC. 8 The simulation results are shown in Figures 2 to 4 and the statistical data are recorded in Tables 1 and 2.

Simulation results for the switching R-EMPC.

Simulation results for the switching PID. 7

Simulation results for the switching MPC. 8
Control Performance Statistics.
Economic Cost Comparisons.
The simulation results in Figures 2 to 4 and the statistical data in Table 1 show that the control performance of the switching R-EMPC is the best among these three methods. In addition, from the data in Table 2, compared with the switching PID, 7 the switching R-EMPC decreases the economic costs of insulin and glucagon by 41.74% and 70.40%, respectively; compared with the switching MPC, 8 it decreases the economic costs of insulin and glucagon 28.47% and 53.92%, respectively. These results prove that the proposed switching R-EMPC can improve control performance and decrease economic costs simultaneously.
Tracking Performance Improvement of Dynamic R-parameter
The simulation results of the switching R-EMPC are compared with the switching EMPC to illustrate the effectiveness on improving the tracking performance of the dynamic R-parameter, shown in Figure 5.

Comparison of simulation results between the switching EMPC and the switching R-EMPC.
From Figure 5, the glucose control curve of the switching R-EMPC is smoother than that of the switching EMPC. Besides, the ATE and the BGRI of the switching R-EMPC are smaller than these of the switching EMPC (14.04 and 1.01 vs 18.25 and 1.09). Thus, the comparison results show that the dynamic R-parameter can improve the tracking performance.
Robustness Tests
In this section, simulation is designed to test the robustness of the proposed method with respect to inevitable variations in the real cases. First, the change on meal size and meal time occur frequently, in real life. It is necessary to test the robustness on meal change, we add a uniform distributed random variable to meal size, meal time, or both to realize meal changes in this case. Second, the hormone sensitivity of the same subject could be time-varying due to exercise, stress, and other factors. It is significant to test the robustness on hormone sensitivity; we multiply a uniform distributed sensitivity gain on the input of the insulin subsystem, the glucagon subsystem, or both to realize hormone sensitivity changes in this case. Finally, superior performance must be shown across a range of subjects for the results to be generally applied. So, the robustness tests on subject variability are performed.
The robustness tests on the meal change consists of three parts: the robustness tests on meal size change only, with the results shown in Figure 6; the robustness tests on meal time change only, with the results shown in Figure 7; and the robustness tests on combined changes, with the results shown in Figure 8. In addition, the statistical data about control performance and economic costs are recorded in Tables 3 and 4.

Simulation results for the standard subject with ±50% meal size change.

Simulation results for the standard subject with ±40 minutes meal time change.

Simulation results on the standard subject with ±50% and ±40 minutes meal change.
Statistical Results for Control Performance With Meal Changes.
Statistical Results for Economic Costs With Meal Changes.
According to Figures 6 to 8 and Tables 3 and 4, we can conclude that the robustness of the switching R-EMPC on meal change is better than the other two methods, and this method can significantly reduce the economic cost.
Similar to the robustness tests on meal change, the robustness of the R-EMPC on insulin sensitivity and glucagon sensitivity are considered separately at first, then in combination. The results are shown in Figures 9 to 11, with the statistical data on control performance and economic costs recorded in Tables 5 and 6.

Simulation results for the standard subject with ±20% insulin sensitivity.

Simulation results for the standard subject with ±20% glucagon sensitivity.

Simulation results for the standard subject with ±20% insulin and glucagon sensitivity.
Statistical Results for Control Performance With Hormone Sensitivity Change.
Statistical Results for the Economic Costs With Hormone Sensitivity Change.
From Figures 9 to 11 and Tables 5 and 6, the robustness of the switching R-EMPC on hormone sensitivity is superior to the other two methods and consumes less insulin and glucagon.
Regarding the robustness test on subject variability, the switching R-EMPC proposed in this study is tested on 10 different subjects, previously mentioned in the Section of Simulation Model. The glucose control curves of the 10 subjects are shown in Figure 12, where the subfigure (a) corresponds to the standard subject and the subfigures (b)-(j) correspond to subjects 1 to 9, respectively. Figure 13 is the CVGA of them.

Simulation results for the 10 subjects.

The control variability grid analysis (CVGA) for the 10 subjects.
In Figure 13, as all points fall in zone B; combined with the results shown in Figure 12, we have reason to believe that the method proposed in this study has excellent robustness on subject variability.
Conclusion
The economic model predictive control, dynamic R-parameter, and switching theory, are combined to design the bihormonal AP system in this study. Simulation results and statistical data show that the proposed method has excellent control performance and robustness. The dynamic R-parameter can improve the tracking performance effectively. In addition, the switching R-EMPC performs well in reducing economic costs. Simulation scenarios in the Simulation Results are designed to imitate the clinical trials. Simulation results demonstrate that the proposed method owns the potential of clinical insight. The proposed method will be clinically tested in the near future.
Footnotes
Abbreviations
AP, artificial pancreas; ARX, autoregressive exogenous; ATE, average tracking error; BG, blood glucose; BGRI, blood glucose risk index; CVGA, control variability grid analysis; EMPC, economic model predictive control; IDF, International Diabetes Federation; MPC, model predictive control; PID, proportional integral derivative control; PSO, particle swarm optimization; R-EMPC, dynamic R-parameter economic model predictive control; T1D, type 1 diabetes.
Declaration of Conflicting Interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: National Natural Science Foundation of China (61374099) and Research Fund for the Taishan Scholar Project of Shandong Province of China.
