^{1}

^{*}

^{2}

^{*}

In recent decades, due to the increasing risk of diabetes, the measurement and control of the blood sugar is of great importance. In typeI diabetes, because of the lack of insulin secretion, the cells cannot absorb glucose, and thus have a low level of glucose. To control blood glucose, the insulin must be injected to the body. In fact, the injection must be in a completely controlled environment. If the level of the insulin exceeds the physiological limits, it may cause death. This paper presents an online approach to control the blood glucose level using a nonlinear model predictive control. This method, maintains the level of blood glucose concentration within a normal range. Thus, the blood glucose level is measured in each minute and predicted for the next time interval. If that is not in the normal range, amount of the insulin which must be injected will be determined. The proposed control approach includes important features such as model uncertainties and prevents acute decrease in the blood glucose level, and instability. In order to assess performance of the proposed controller, computer simulations have been carried out in Matlab/Simulink. Simulation results will reveal the effectiveness of the proposed nonlinear model predictive controller in adjusting the blood glucose level by injecting required insulin. So if the nutrition of the person decreases instantly, the hypoglycemia does not happen.

Diabetes is a group of metabolic diseases, which is known as hyperglycemia. It arises from defects in the insulin secretion, insulin action or both. Diabetes increases the blood glucose level in the fasting blood sugar test to an amount over the normal range (70 - 110 mg/dl). The insulin is produced by beta cells. In diabetics, beta cells are destroyed and the body can’t control the blood glucose level [

Several methods have been proposed to control the blood glucose level. One method obtains a control rule from the input/output values such as insulin/glucose level [

In another method, the relationship between the insulin and glucose estimated with a sigmoid curve. In this method controlling rules acquired from the relationship between control variables then applies curve fitting and extracts practically the relationship between them [

Furler et al. proposed another method using look up table to find the relationship between inputs and outputs [

In this paper, a nonlinear model predictive controller has been employed. This controller provides real-time control which used nonlinear model with delays and stability. It presents a control system, which can continuously predict the blood glucose level and inject the insulin in a way that the blood glucose level remains in the normal range, permanently.

Several mathematical models have been proposed for the insulin-glucose regulatory system, additionally. Early models were simply structured and linear, which considered only the insulin and blood glucose. After that, Bergman et al. proposed the first class of minimal models [

In this article, nonlinear model predictive controller (NMPC) is introduced in Section 2. Nonlinear model predictive control is composed of two models. One model is called plant, which is diabetic model. The other one is called system model, which shows insulin-glucose regulatory system in a normal body. In Section 3 the model proposed by Li, Kaung [

Predictive controllers were first developed by engineers working in industries, in 1970s. Clerke introduced this method to control unstable, non minimum phase, and slow systems [

NMPC is formulated to solve on-line a finite horizon optimal control problem according to system dynamics, constraints involving states and controls.

Dynamic manner of the system over a prediction horizon Tp and determines the input such that a predetermined performance objective functional is optimized. If there were no model-plant mismatch, and if the optimization problem could be solved for infinite horizons, then one could apply the input function at time t = 0 to the system for all times t ≥ 0. The manipulated input function obtained and it will be implemented only until the next measurement turns into available. The time difference between the recalculation/measurements can vary, however it is presumed to be fixed, the measurement will take place every δ sampling time-units. Using the new measurement at time t + δ, the entire process-prediction and optimization will be repeated to find a new input function with the control and prediction horizons moving forward. As it is shown in

subject to input and state constraints of the form [

x(t) and u(t) represent the vector of states and inputs, respectively. U and X constraints are given in Eq.3 which u_{min}, u_{max} and x_{min}, x_{max} are constant vectors [

In order to make a distinction between the real system and the system model used to predict the future within

the controller, the internal variables in the controller are shown by a bar (for example). Usually, the finite horizon optimal control problem described above is mathematically formulated as follows [

The function F, in the following called cost function, specifies the preferred control performance that can arise. The standard quadratic form is the simplest and most often used one:

u_{d} and x_{d} are the desired input and output, respectively. Q and R are symmetric, definite positive and weighting matrices. T_{p} is the horizon of the predicted output and T_{c} is the control horizon. In Eq.6 the error between the desired output and model predicted output is obtained. In this method, to obtain the output values in the next time interval, the optimal input values in time period T_{c} are used, then the value of the control variable, is held constant in the last calculated value [

The block diagram of nonlinear model predictive control is shown in

Since Li, Kaung et al. model describes the insulin-glucose regulatory system in more details and is closer to physiological data [

Applying the mass conservation law, Li and Kaung modeled the insulin-glucose regulatory system in Eq.7 [

Li and Kaung defined some functions for the process of (consumption) producing insulin and glucose. f_{1}(G) used to stand for the insulin production which is stimulated by glucose concentration. f_{1}(G) has sigmoid shape as follows [

The insulin-independent glucose consumers are mainly the brain and nerve cells which is denoted by f_{2}(G) indicating its dependency on the glucose concentration alone. f_{2}(G) > 0 is in sigmoidal shape with f_{2}(0) = 0, and (x) > 0 is bounded for x > 0 [

Insulin-dependent glucose uptake is denoted by f_{3}(G) f_{4}(I) [

Glucose is denoted as f_{5}(I) controlled by insulin concentration [

Insulin degradation is proportional to insulin concentration which is denoted by positive constant d_{i}, glucose infusion rate is a constant, denoted by G_{in}, τ_{1} is used to denote the time delay from the time that the glucose concentration level is elevated to the moment the insulin has been secreted and τ_{2} is measured from the time that insulin becomes remote insulin to the time that a signifycant change of hepatic glucose production take place [

The first time delay is of greater importance in the blood glucose level growth and insulin secretion reducetion (which are the diabetes symptoms). To enhance performance of the NMPC controller, the system model and plant should include the features of the insulin-glucose regulatory system and diabetic, in appropriate conformity with physiological data. For this purpose, in this research, the model proposed by Li and Kuang is modified to Eq.15 to achieve diabetes model. Because of that in typeI diabetes, insulin isn’t secreted or produces very slight and τ_{1} intensely will increase, so Eqs.11 and 12 will change to Eqs.13, 14.

Eq.15 is obtained for typeI diabetes. The blood glucose level of a diabetic model (Eq.15) is shown in

The Li, Kaung model is also used to design fuzzy predictive model which represents the system model that will be discussed in Section 4.

The fuzzy predictive model is used as the system model in the NMPC controller. The fuzzy system which applies the predictive model is employed for time series includeing a time delay. If this time delay increases, the glucose-insulin regulatory system behavior will be chaotic, which is illustrated in Figures 4, 5. This method (fuzzy predictive model) is used for constructing the fuzzy system. The fuzzy predictive model, f(x), is designed based on lookup table. So, inputs/output pairs must be defined. The inputs of f(x) are for and the output is. n defines the number of inputs. This inputs/output pairs are used to design f(x) with lookup table and then f(x) will be applied to predict All the samples of the glucose are divided into 2 parts. The first is assigned to training and the second to prediction.

In this step, the order of the predictive model (n) and the number of membership functions for any input must be determined [

The introduced models, however, have uncertainties in the parameter definition, and lacks sufficient knowledge about the insulin-glucose regulatory system. Since each model must show the features of a system in its best style, these uncertainties must be considered. The insulin-glucose system model proposed by Li and Kaung is appropriate, because it describes the insulin-glucose regulatory system more accurately and in a more robust manner, but in this model, uncertainties were not considered. In this paper based on the Li and Kaung model, the fuzzy predictive model of the insulin-glucose regulatory system is designed as well as modeling the characteristics of the system and considers the uncertainties which exist in the model.

The glucose is considered as input-output pairs in each time, by choosing n as 4. Therefore, input-output pairs are four input-one output packages. The singleton fuzzifier and center of averages defuzzifier are used. 1500 samples in the glucose profile exist, so the first 750 samples are used as training input-output pairs, and the remainder for predicting. The fuzzy predictive model is implemented in Matlab.9, 15 fuzzy sets are attributed to each input including 13 triangular membership functions and two trapezoidal as the first and last membership functions. Some of the rules conflict with each other, so they must be pruned. After pruning 113 rules remain.

The prediction accuracy is very important and can be reached by defining more fuzzy sets for each variable. In this section, by using four successive dynamics of glucose, the next dynamic is predicted. So, this model predictive is called as four-point model predictive.

To use the NMPC as a blood glucose level controller, the steps which describe the structure of NMPC must be implemented. The input and output of the controller are the amount of the insulin injection and glucose level, respectively. In the insulin-glucose regulatory system, there are two state space; I(t) and G(t). I(t) represents insulin and G(t) indicates blood glucose level concentration. Hence, the state space matrix is a 2 by 1 matrix.

model) is needed. In Section 3, typeI diabetes is modelled and in Section 4, design of the system model is studied.

By considering the description in Section 2, the NMPC controller was designed to regulate the blood glucose level in typeI diabetes. As mentioned, the NMPC is composed of the plant and system model. Plant (diabetic model) and fuzzy predictive model (system model) are designed on the basis of the model proposed by Li and Kaung et al. First, the results of the Li and Kaung et al. model are studied. Model simulation which is shown in Figures 4, 5 are the profiles of the blood glucose level and insulin concentration versus variation of the first and second time delays. The results of fuzzy predictive model and diabetic model are shown in Figures 6, 7 respectively. In

As it is shown in

In the next step, a diabetic person who has consumed three meals is regarded as a case to study. Since a diabetic person can just consume 250 - 300 mg/dl carbohydrates per day, each meal is considered to be a pulse with an amplitude of 100 (mg/dl) and a time interval of 45 minutes (

The blood glucose level of the diabetic person under NMPC is shown in

level leads to hypoglycaemia, but it does not happen in real life.

In this paper, based on the model proposed by Li and Kaung et al., the diabetic model and fuzzy predictive model were developed. First, the simulation results of the Li, Kaung et al. model were studied which were shown in Figures 4, 5 also the results of the fuzzy predictive model and diabetic model were depicted in Figures 6, 7 respectively.

As it is seen in

If the first and second time delays are 6 and 6.75 minutes, respectively, oscillation of glucose and insulin concentration will be in the normal range. In this system, if these time delays increase over 2.25 and 6.75, bifurcation will occur (Figures 4, 5). Insulin and glucose concentration do not have constant values and they oscillate after mentioned times. After bifurcation, the oscillations of the

insulin and glucose will begin.

To design the fuzzy predictive model, half the samples were used as training data and 15 membership functions were allocated to 4 inputs. After pruning, the rules that conflicted with each other were eliminated, so 113 rules remained.

The similarity between the fuzzy predictive model and main model (Li and Kaung et al.), was shown in

In the NMPC controller, using the proposed fuzzy predictive model (natural insulin-glucose regulatory system) and the diabetic model, the difference between the concentrations of the blood glucose level in these models, has been obtained in each time. According to this dissimilarity, the rate of the insulin injection is defined in a way that the blood glucose level of the diabetic person reaches the normal range. The profile of the continuous insulin injection which could regulate the blood glucose level of the subject in last experiment like (

In the next stage, a study carried out on a diabetic person who consumed three meals. Since a typical diabetic person is medically restricted to consume 250 - 300 mg/dl carbohydrates per day, each meal was considered as a pulse with amplitude of 100 (mg/dl) which was applied to the diabetic model during 45 minutes (

The blood glucose level of the diabetic person after applying the proposed NMPC controller was demonstrated in

The glucose-insulin regulatory system considers important characteristics such as oscillatory manner and time delays. For this reasons, in this paper, it was used as the main model to obtain fuzzy predictive model and typeI diabetic model. Fuzzy predictive model is used to take into account the uncertainties.

The proposed NMPC controller is able to measure blood glucose level in an online method. In each time, regarding to the difference between blood glucose level in plant and system model, insulin injection is adjusted to keep the blood glucose level in the normal range. By injecting high amount of insulin, the blood glucose level decreases explicitly, and the person undergoes the hypoglycemic shock. In the consequence of insufficient insulin injection, the blood glucose cannot reach its normal range. So, by using the NMPC controller, the blood glucose level can be controlled in the normal range. The simulation result indicates that the proposed controller is more stable and can control the blood glucose level in an online method. Unlike offline controllers, online types can check the blood glucose level each time and prevent hypoglycemic shock due to the insulin hyper-injection. NMPC controller checks the blood glucose level continuously.