Identification and Low-complexity Regime-switching Insulin Control of Type I Diabetic Patients

This paper studies benefits of using simplified regime switching adaptive control strategies in improving performance of insulin control for Type I diabetic patients. Typical dynamic models of glucose levels in diabetic patients are nonlinear. Using a linear time invariant controller based on an operating condition is a common method to simplify control design. On the other hand, adaptive control can potentially improve system performance, but it increases control complexity and may create further stability issues. This paper investigates patient models and presents a simplified switching control scheme using PID controllers. By comparing different switching schemes, it shows that switched PID controllers can improve performance, but frequent switching of controllers is unnecessary. These findings lead to a control strategy that utilizes only a small number of PID controllers in this scheduled adaptation strategy.


INTRODUCTION
Insulin is a hormone that is necessary for converting the blood sugar, or glucose, into usable energy.The human body maintains an appropriate level of insulin.Diabetes are caused by lack of insulin in the body.There are two major types of diabetes, called type 'I' and type 'II' diabetes.Type 'I' diabetes are called Insulin Dependent Diabetes Mellitus (IDDM), or juvenile onset diabetes mellitus.Type 'II' diabetes are known as Non-Insulin Dependent Diabetes Mellitus (NIDDM) or Adult-Onset Diabetes (AOD) [1][2][3][4][5][6][7].This paper is focused on type 'I' diabetes.Type 'I' diabetes develop when the pancreas stop producing insulin.Consequently, insulin must be provided through injection or continuous infusion to control glucose levels.
The insulin infusion rate to a diabetic patient can be administrated based on the glucose (sugar) level inside the body.Over the years many mathematical models have been developed to describe the dynamic behavior of human glucose/insulin systems.The most commonly used model is the minimal model introduced by Bergman, et al. [6,[8][9][10][11][12][13]. The minimal model consists of a set of three differential equations with unknown parameters.Since diabetic patients differ dramatically due to variations of their physiology and pathology characteristics, the parameters of the minimal model are significantly different among patients.Based on such models, a variety of control technologies have been applied to glucose/ insulin control problems [14][15][16][17].
This paper studies benefits of using simplified adaptation control strategies in improving performance of insulin control for Type I diabetic patients.Typical dynamic models of glucose levels in diabetic patients are nonlinear.Using a linear time-invariant controller based on an operating condition is a common method to simplify control design.On the other hand, adaptive control can potentially improve system performance, but it increases control complexity and may create further stability issues.This paper investigates patient model identification and presents a simplified switching control scheme using PID controllers.By comparing different switching schemes, it shows that switched PID controllers can improve performance, but frequent switching is unnecessary.These findings lead to a control strategy that utilizes only a small number of PID controllers in this scheduled adaptation strategy.
Many methods and techniques have been investigated, tested, and studied for controlling the glucose level in type 'I' diabetes patients.Lynch and Bequette [14] tested the glucose minimal model of Bergman [10] to design a Model Predictive Control (MPC) to control the glucose level in diabetes patients.Also in that study the nonlinear mathematical model was linearized about the steadystate values of time variant variables.Fisher [15] used the glucose insulin minimal model to design a semi closed-loop insulin infusion algorithm based on three hourly plasma glucose samplings.The study concentrated on the glucose level, and did not take in consideration of some important factors such as the free plasma insulin concentration and the rate at which insulin is produced as the level of glucose rises.Furler [16,18] modified the glucose insulin minimal model by removing the insulin secretion and adding insulin antibodies to the model.The algorithm calculates the insulin infusion rate as a function of the measured plasma glucose concentration.The linear interpolation was used to find the insulin rate.The algorithm neglected some important variations in insulin concentration and other model variables.Ibbini, Masadeh and Amer [17] tested the glucose minimal model to design a semi closed-loop optimal control system to control the glucose level in diabetes patients.
The rest of this paper is organized as follows.Section 2 discusses basic model structures, experimental data, and model simulations.Section 3 is focused on model parameter identification.The Levenberg-Marquardt algorithm is employed to obtain model parameters iteratively.Control design and switching strategies are presented in Section 4. By comparing fixed PID controllers with switching strategies, we first show that adaptation can be beneficial.Further studies show that using a small set of PID controllers in switching control is a feasible and desirable approach, which simplifies switching scheme without performance degeneration.

MODELS
Since the level of the glucose inside the human being body changes significantly in response to food intake and other physiological and environment conditions, for control design it is necessary to derive mathematics models to capture such dynamics [8][9][10][19][20][21].Many mathematical models have been developed to describe the human glucose/insulin system.Such models are highly nonlinear and usually very complex.The most commonly used and simplified model is the Minimal Model introduced by Bergman, et al. [8][9][10], which is still nonlinear.To further simplify the model for control design, a common practice is to locally linearize the Minimal Model under a given operating condition.

Model Structures
The minimal model of the glucose and insulin is perhaps the simplest model that is physiologically based and represents well for the observed glucose/insulin dynamics of a diabetic patient.The insulin enters or exits the interstitial insulin compartment at a rate that is proportional to the difference  

I t Ib
 of plasma insulin

 
I t and the basal insulin level Ib [22,23].If the level of insulin in the plasma is below the insulin basal level, insulin exits the interstitial insulin compartment; and if the level of insulin in the plasma is above the insulin basal level, insulin enters the interstitial insulin compartment.Insulin also can flee the interstitial insulin compartment through another route at a rate that is proportional to the insulin amount inside the interstitial insulin compartment.On the other hand, glucose enters or exits the plasma compartment at a rate that is proportional to the difference

 
G t and the basal glucose level b G .If the level of glucose in the plasma is below the glucose basal level, the glucose exits the plasma compartment; and if the level of glucose in the plasma is above the glucose basal level, glucose enters the glucose compartment.Glucose also can flee the plasma compartment through another route at a rate that is proportional to the glucose amount inside the interstitial insulin compartment.
Currently, the most widely used model in physiological research on the metabolism of glucose is the Minimal Model.This model structure describes experimental data well with the smallest set of identifiable and meaningful parameters.The Minimal Model consists of two parts: the minimal model of glucose disappearance and the minimal model of insulin kinetics.
where   G t (mg/dL) is the blood glucose level in plasma;   I t (µU/mL) is the insulin concentration level in plasma;   x t (min −1 ) is the variable which is proportional to insulin in the remote compartment, G b (mg/dL) is the basal blood glucose level in plasma; I b (µU/mL) is the basal insulin level in plasma; t (min) is the time interval from the glucose injection.Eqs.1 and 2 represent the glucose disappearance and Eq.3 represents the insulin kinetics.The initial conditions of the above three differential equations are as the following: The model parameters carry some physiological meanings that can be summarized as follows.P 1 (min −1 ) describes the "glucose effectiveness" which represents the ability of blood glucose to enhance its own disposal at the basal insulin level.P 2 (min −1 ) describes the decreasing level of insulin action with time.
) describes the rate in which insulin action is increased as the level on insulin deviates from the corresponding baseline. ((µU/mL)  (mg/dL) −1  min −1 ) denotes the rate at which insulin is produced as the level of glucose rises above a "target glycemia" level.n (min −1 ) represents fractional insulin clearance.h (mg/dL) is the pancreatic "target glycemia" level.G 0 (mg/dL) is the theoretical glucose concentration in plasma extrapolated to the time of glucose injection t = 0 [8][9][10]24].I 0 (µU/mL) is the theoretical plasma insulin concentration at t = 0. µU/mL is the conventional unit to measure the insulin level and has the following conversion formula: 1 micro-unit/ milliliter = 6 picomole/liter (1µU/mL = 6 pmol/L) [25,26].P 1 , P 2 , P 3 , n, , h, G 0 and I 0 are the parameters to be estimated.
A fourth differential equation will be added to the set of the Minimal Model equations to represent a first-order pump dynamics: where   1 U t is the infusion rate,   u t is the input command, and a is the time constant of the pump.

Experimental Data
A new approach was developed by Bergman, et al. [8][9][10] to compute the pancreatic responsiveness and insulin sensitivity in the intact organism.This approach uses computer modeling to investigate the plasma glucose and insulin dynamics during a Frequently Sampled Intravenous Glucose Tolerance (FSIGT).An amount of glucose was injected at t = 0 over a period of time equal to 60 seconds [8][9][10]27].The blood samples were taken from a fasting subject at regular intervals of time, and then analyzed for glucose and insulin content.Glucose was measured in triplicate by the glucose oxidize technique on an automated analyzer.The coefficient of variation of a single glucose determination was about ± 1.5%.Insulin was measured in duplicate by radioimmunoassay, with dextrin-charcoal separation using a human insulin standard.Table 1 shows the FSIGT test data for a normal individual.

Model Simulation
Implementation of the minimal model can be achieved by using computer simulation tools.The two differential Eqs.1 and 2 of the minimal model that correspond to the glucose kinetics are modeled here by using the MAT-LAB/Simulink software.In this model, the insulin   shown in Figure 2 for a normal individual with the following parameters:

Parameter Estimation
Parameter estimation is to determine the values of model parameters that provide the best fit to measured data, based on some error criteria such as least-squares.The method of least squares assumes that the best-fit curve of a given set of data is the curve that has the minimal sum of the deviations squared from a given set of data [28][29][30][31].Given a set of data (x 1 , y 1 ), (x 2 , y 2 ), (x 3 , y 3 ),  , (x N , y N ), where the independent variable is x and the dependent variable is y, under a selected model function form   f x the least squares (LS) estimation seeks to minimize When the function is an m-th degree polynomial we have The unknown coefficients 0 1 2 , , , , m a a a a  , can be estimated to yield a least squares error., , , n p p p  . The functions and the parameters can be represented as follows: The least square method is to find the values of the unknown parameters 1 2 , , , n p p p  for which the cost function is minimum, i.e.

   
T 2 The Levenberg-Marquardt algorithm is an iterative technique that seeks the minimum of a multivariate function that is expressed as the sum of squares of nonlinear real-valued functions [28].It has become a standard technique for nonlinear least-squares problems.Levenberg-Marquardt can be thought of as a combination of steepest descent and the Gauss-Newton method.When the current solution is far from the correct one, the algorithm behaves like a steepest descent method which is guaranteed to converge.When the current solution is close to the correct solution, it becomes a Gauss-Newton method.
The Levenberg-Marquardt algorithm is an iterative procedure.Let   ˆf  x p be the parametrized model function.The minimization starts after an initial guess for the parameter vector p is provided.The algorithm is locally convergent, namely it converges when the initial guess is close to the true values.In each iteration step, the parameter vector p is updated by a new estimate   p , where  is a small correction term that can be determined by a Taylor Series expansion which leads to the following approximation: where, J is the Jacobian of Levenberg-Marquardt iterative initiates at the starting point 0 p , and produces a series of vectors 1 2 3 , , p p p etc, that converge towards a local minimizer p  of f .At each step, it is required to find the  which minimizes the value of That gives the following: where p  is the solution to a linear least squares problem.The minimum is achieved when the term p e   J is orthogonal to column space J. Based on that, the following can be concluded Eq.13 can be rearranged as the following The Levenberg-Marquardt algorithm solves a slight variation of Eq.14, which is known as the augmented normal equation T p e   N J (15) where the diagonal elements of N are computed as , where p  is computed from Eq.15, yields a reduction in the residual value or error e, then the update is valid and the process repeats with a decreased damping parameter  .Otherwise, the damping parameter is increased and the augmented normal Eq.15 is solved again.Then the process iterates until a value of p  that reduces error is found.The MATLAB Software has the Optimization Toolbox which has a command called Lsqnonlin for this algorithm.This algorithm is applied to our problem here.The FSIGT data sample in Table 1 consists of 24 samples.The FSIGT samples were taken over a period of 182 minutes.The unknown parameters of the minimal model Eq.1, Eq.2, Eq.3 were estimated by utilizing the Levenberg-Marquadrt Algorithm.The parameters to be estimated were given an initial guess, then the algorithm was used to update the parameters using the sequential data in Table 1.A MATLAB program was written to estimate the unknown parameters.The estimated values of those parameters are shown in Table 2.The values of the parameters shown in Table 2 were implemented in the simulation diagram of the minimal model shown on Figure 1.The values of the glucose levels of both individuals are shown in Table 3.
The graphs of both experimental and simulated data for normal individual #1 and #2 are shown in Figure 3 and Figure 4 respectively.These plots show that the two graphs (experimental and simulated) are close to each other, leading to the conclusion that the estimated values of parameters are close to the actual values.In general, the relative errors indicate how good an estimate is, relative to the true values.Although absolute errors are useful, they do no necessarily give an indication of the importance of an error.If the experimental value is denoted by G , and the estimated (or simulated) value is denoted by G , then the relative error is defined as   And the Square Relative Error can be expressed as When the data is sampled over a certain period of time, the mean squared relative error (MSRE) can be used.The MSRE is defined as , for 1, 2, , where i G is the experimental value at sample i. ˆi G is the estimated value at sample i. n is the number of samples of a data set.
The Square Relative Error between the experimental data and the simulated data of the glucose level for individual #1 and # 2 are calculated and shown in Table 4 and Table 5 respectively.Normally the Mean Square Relative Error is expressed in percentage format.Below is the percentage error for both individuals: the percent-

Model Linearization
Now let us recall the four differential Eqs.1-4 that define the proposed mathematical model and denote them as The above equations can be written and arranged as follows.
The above equations can be further simplified as The above system is a nonlinear system due to the presence of the nonlinear term that appears in Eq.23.
The nonlinear term is     x t G t .Now let us make the following definitions Then Eqs. 23 The Jacobian matrices ( x J and u J ) of the model can be derived as where the point (x 0 , u 0 ) is the equilibrium point.The equilibrium point can be calculated by setting the state equations to zero and solving The above equation is a 2 nd order equation and can be solved by using the quadratic formula

      
There are 2 possible values of x 10 .Since x 20 and x 30 are expressed in term of x 10 , there will be 2 possible values for each.Based on that, the controllability test will be studied to check which value of x 10 is accepted.
The output of the simulated system is shown in Figure 5.By examining Figure 5, it can be clearly seen that the glucose level does not come down to the basal level after injecting an amount of 337 mg/dL of glucose inside a diabetic patient.Figure 5 shows that the level of the glucose inside a diabetic patient decreases for the first 100 minutes, starts increasing afterward, and reaches the value of around 310 mg/dL after 3 hours from the time the glucose was injected.The goal is to bring down the value of the glucose inside a diabetic patient to the normal level or at least into a small neighborhood of the basal level.The above goal can be achieved by designing a PID feedback controller.The controller is to regulate the infusion rate and inject the required amount of the insulin inside the diabetic patient, and in turn the insulin will work inside the patient to bring down the level of glucose to the normal level or at least to the neighborhood of the normal level.

CONTOL DESIGN
We start with a linearized state space model for our systems.The general form of the state space is defined in the following equation: The proposed mathematical model at the equilibrium point (x 0 , u 0 ) can be written in the state space form as shown below: where u is the input and y is the output of the system.The data of a diabetic person shown in Section 3.3 was used and the equilibrium point (x 0 , u 0 ) was calculated as time varies from t = 1 min to t = 182 min.The two values for x 10 that were calculated before were substituted in Eq.42 and the controllability test was performed.It was found that only one value (the one obtained from the sign) makes the system to be controllable, hence only this value is used in the subsequent development.

Design of PID Controllers for Diabetic Patient
When designing a controller, the designer must define the specifications that need to be achieved by the controller.Normally the maximum overshoot (Mp) of the system step response should be small.Commonly a range between 10% and 20% is acceptable.Also the settling time (ts), is an important factor.The objective here is to design a PID controller, so that the closed-loop system has the following specifications: small steady-state error for a step input; less than 10% overshoot; settling time less than 60 minutes.The patient dynamic system was expressed in the state space representation in (42).For an overshoot less than 10%, a damping ratio must be greater than 0.59, and a settling time less than 60 minutes implies that   The control design is done by applying the root locus method and then evaluated by using the step response.For example, if the model at t = 1 min is used, after substituting the above numerical values ( 42 The open loop poles are shown in Figure 6.These poles are located at -0.0040 + 0.0045j, -0.0040 -0.0045j, -0.2302, -0.5.The four poles are stable, but the first two poles are very close to the imaginary axis and hence represent the slowest dynamics.The controller takes the form where K is the value of the gain where the root locus intersects with the line of the damping ratio.The z 1 and z 2 represent the value of the zeros to be added and may be selected to cancel the slowest poles of the dynamic system.Hence, select z 1 = -0.004+ 0.0045j, z 2 = -0.004-0.0045j. The controller is * (please see the equation below) resulting in the system matrix A and the PID controller as The PID Parameters are: 4 0.0444, 2.0094 10 , 5.59 The design specifications of the system require the maximum overshoot to be less than 10% and the settling time to be less than 60 minutes.After inserting the PID controller in series with the patient system and connecting them in a unity feedback, we get the maximum overshoot 5.71% and the settling time 47.5 minutes (see Figure 7).t = 20 minutes: The PID Parameters are: = 0.2160, 0.0031, = 28.4 The PID Parameters are: = 0.2374, 0.0061, = 32.7 The PID Parameters are: 4 0.0444, 2.0094 10 , 5.59 The PID Parameters are: = 0.2331, 0.0138, = 36.4 The PID Parameters are: = 0.2234, 0.0187, = 37.9 The PID Parameters are: = 0.2032, 0.0229, = 37.7 The PID Parameters are: = 0.1870, 0.0281, = 38.5

Individual PID Controllers
Non-adaptive PID controllers use a fixed PID controller for the entire control period and rely on its robustness to maintain control performance.For each individual PID controller (with its transfer function found in the previous subsection for t = 1, 20, 40, 60, 90, 120, 150 and 182 min) the simulation results on   G t and   u t are shown below in Figures 8-15.
Under the individual PID controllers, the output

 
G t , the glucose level, did not really meet the design specification, and the glucose level is not near or at least in a small neighborhood of the glucose basal level.The overshoot of the system was too high and beyond the acceptable level.Also the settling time was not even close to where it should be as per the design requirement.And the steady state error was not satisfactory.A new method should be developed and implemented to meet all the design specifications.This method is explained in detail in the following section.

Switched PID Controllers
The individual PID controllers could not lower the glucose level

 
G t of the patient to the neighborhood of the glucose basal level.Consequently, we introduce a new control-switching scheme that adapts controllers to meet design specifications.The switching control consists of the following items: One "time clock," one "switch case" block, one "if action case" block, one "merge" block, and eight "off-on switches."All these blocks are connected together to form the wiring diagram of the Control-Switching Scheme.
The functions of the control switching scheme is detailed in Figure 16.The "Time Clock" is to provide the "Switch Case" block with time as a signal input to activate it.
The "Switch Case" block receives a single input from the clock, which it uses to form case conditions that determine which subsystem to execute.Each output port case condition is attached to a Switch Case Action sub-         system.The cases are evaluated top-down, starting with the top case.If a case value corresponds to the actual value of the input, its Switch Case Action subsystem is executed.The "Switch Case" model is divided into eight time interval zones as shown in Table 6.
The "If Action Case" block consists of eight "If-Action Subsystem."The "If-Action Case" implements Action Subsystems used in if-statement and switch control flow statements.Action Subsystems execute their programming in response to the conditional outputs of an If-statement or Switch Case block.A schematic diagram of the "If Action Case" block is shown in Figure 17.The "Merge" block combines its inputs into a single output line whose value at any time is equal to the most recently computed output of its driving blocks.The number of inputs can be specified by setting the block's inputs parameter.The "Off-On Switches" are used to turn the PID controllers OFF or ON.
In general when the time clock is running, it feeds the "Switch Case" block with an input signal which in turn switches on the "If-Action Case" block as per the time interval that was specified in Table 6.Based on the status of the "If-Action Case", a specific PID controller will be turned on and executed to control the output of the system.
For zone 1, the time interval is between 0 -1 minute, during this period of time the "Switch Case" is enabling input "In9" of the "If-Action Case".When input "In9" is enabled, it will only execute the input "In1" to the output "Out1".The input "In1" is connected to the first PID Controller.That means only the first PID Controller, (PID Controller 1), is working.At the end of the first minute, the "Switch Case" will switch to zone 2 which runs from the beginning of the minute number 2 and will last until the end of the minute number 20.During this period of time, the "Switch Case" is enabling input "In10" of the "If-Action Case".When input "In10" is enabled, it will only execute the input "In2" to the output "Out2".The input "In2" is connected to the second PID Controller.That means only the second PID Controller, (PID Controller 20), is working.The same procedure will be followed until the "Switch Case" switches between the eight time zones that were specified in Table 6.In turn the PID Controllers will be executed based on the status of the "If-Action Case".
The Control-Switching Scheme Diagram shown in Figure 16 was simulated with all the PID controllers executed (connected to the circuit).The output   G t of the system is shown in Figure 18.It can be clearly seen that the PID controllers are able to bring the glucose level from 337 mg/dL to the basal level (99 mg/dL) within 40 minutes.But in about 70 minutes the value of the glucose starts going below the basal level, and it  For verification, the same control strategy is evaluated on patient #2.Following the same modeling procedure that was performed for the diabetic patient #1, the model parameters are identified as P 1 = 0, P 2 = 0.42/100, P 3 = 2.56/1000000, I 0 = 209, G 0 = 297,  = 3.72/1000, h = 154, n = 0.22, a = 2, G b = 100, I b = 8, [10].
Without control, the above data was implemented in model simulation.The output of the simulation diagram is shown in Figure 24, which shows that without proper control the glucose level does not come down to the basal level after injecting an amount of 297 mg/dL of glucose inside a diabetic patient.The level of the glucose inside a diabetic patient decreases for the first 120 minutes and starts increasing afterward and reaches the value of about 270 mg/dL after 3 hours from the time the glucose was injected.
The same control-switching scheme that was performed for diabetic patient #1 is repeated for diabetic patient #2.The values of the parameters for the first four PID controllers (at t =1, 20, 40 and 60 minutes) are summarized in Table 7.
The control-switching scheme was simulated for diabetic patient #2 by using only the first four PID controllers.The output   G t of the system is shown in Based on the simulation results, although adaptive control can potentially improve control performance, it is          sometimes unnecessary, or even harmful when switching overly frequently.Our results show that when the switching scheme is limited to the first four PID controllers, the performance is in fact enhanced.This may be related to the fact that some PID controllers are more robust with respect to the model variations.On the other hand, in comparison to individual controllers, the control-switching scheme achieves design specification while all individual controllers fail to deliver the required performance.

CONCLUSIONS
This study reveals that typical PID controllers may not be sufficient to deliver satisfactory control performance in glucose level control problems.This is mainly due to the nonlinear nature of patient dynamic models and limited robustness of the PID controllers.An adaptive control that switches controllers based on operating conditions can potential enhance control performance.However, the switching control scheme must be carefully designed to ensure that control specifications be met.Our results show that overly frequent switching of controllers may have detrimental effects on control performance.We show that by reducing the number of PID controllers in the switching scheme, not only control complexity is reduced, but performance is actually enhanced.

Figure 1 .
Figure 1.Simulation diagram of the glucose kinetic model.

Figure 2 .
Figure 2. The output of the minimal model for the glucose kinetics Model parameters can be obtained iteratively to reduce computational complexity.It starts with an initial guess of the unknown parameters.Each iteration updates the current estimate based on new observations.Suppose there are m base functions 1 2 , , , m f f f  of n parameters 1 2 while the rests of the matrix N are identical to those of the matrix T     J J . is called the damping parameter.If the updated parameter vector, p   p

Figure 3 .
Figure 3. Plot of glucose level G(t) for normal individual #1.

Figure 4 .
Figure 4. Plot of glucose level G(t) for normal individual #2.

Figure 5 .
Figure 5. Output of the simulated system for diabetic.
n  must be greater than 0.067.The PID Controllers can be designed based on the models at different operating points.The following list contains the models at t = 1, 20, 40, 60, 90, 120, 150 and 182 minutes, and the corresponding PID controllers.Since B and C do not change with time, they are fixed in all cases as: ), the root locus plot can be generated by the Matlab functions MATLAB Program Plotting the open loop system Root locus using MATLAB [num, den] = ss2tf(A,B,C,D]; rlocus(num, den) axis([-0.60.1 -0.5 0.5]) sgrid(0.59,0)sigrid(0.067)

Figure 6 .
Figure 6.Output of the simulated system for Root Locus.

Figure 7 .
Figure 7. Output of the unit step response, using the model at t= 1 minute with K = 5.5.
Figure 8.   G t and   u t using 1 C G .
Figure 9.   G t and   u t using 20 C G .

Figure 10 .
Figure 10.  G t and   u t using 40 C G .
Figure 11.  G t and   u t using 60 C G .

Figure 12
Figure 12.   G t and   u t using 90 C G .

Figure 13 .
Figure 13.  G t and   u t using 120 C G .

Figure 14
Figure 14.  G t and   u t using 150 C G .

Figure 15
Figure 15.  G t and   u t using 182 C G .

Figure 21 .
Again in both cases the person will be classified as a patient with the hypothe system, shown in Figure22,.reaches the glucose basal level (99 mg/d/L) within 40 minutes, and it stays in that neighborhood.The input of the PID Controller system is shown in Figure23.

Figure 17 .
Figure 17."If Action Case" system and PID controller switching function module.

Figure 25 .
The output   G t reaches the glucose basal level (100 mg/d/L) within 60 minutes and it stays in that neighborhood.The graph of the input of the PID Controller system is shown inFigure 26.

Figure 18 .
Figure 18.Plot of G(t) when all PID Controllers are executed.

Figure 19 .
Figure 19.Plot of G(t) when all PID Controllers except controller 182 C G

Figure 20 .
Figure 20.Plot of G(t) when all PID Controllers except controller 150 C G and 182 C G are executed.

Figure 21 .
Figure 21.Plot of G(t) when all PID Controllers except controller 120 C G , 150 C G and 182 C G are executed.

Figure 22 .
Figure 22.Plot of G(t) when all PID Controllers except controller 90 C G , 120 C G , 150 C G and 182 C G are executed.

Figure 23 .C
Figure 23.Plot of u(t) when all PID Controllers except controller 90 C G , 120 C G , 150 C G and 182 C G are executed.

Figure 24 .
Figure 24.Output of the Simulation Diagram for diabetic patient #2.

Table 1 .
The simulation diagram of the minimal model for the glucose kinetic is shown in

Table 1 .
FSIGT test data for a normal individual.

Table 4 .
Error data for normal individuals #1.

Table 5 .
Error data for normal individuals #2.
10 , x 20 , x 30 , x 40 and u 0 are the values of the state variables and the input at the operating point (i.e. the equilibrium point).At the equilibrium point, u 0 = 0,

Table 6 .
Swithing Time Interval.G t of the system is shown in Figure19.It can be seen the same problem still exists.Again in this case the person will be classified as a patient with the hypoglycemia.The same procedure was repeated but with all the PID controllers executed except the PID Controllers 150