Abstract:
An augmented, adaptive algorithm utilizing model predictive control (MPC) is developed for closed-loop glucose control in type 1 diabetes. A linear empirical input-output subject model is used with an MPC algorithm to regulate blood glucose online, where the subject model is recursively adapted, and the control signal for delivery of insulin and a counter-regulatory agent such as glucagon is based solely on online glucose concentration measurements. The MPC signal is synthesized by optimizing an augmented objective function that minimizes local insulin accumulation in the subcutaneous depot and control signal aggressiveness, while simultaneously regulating glucose concentration to a preset reference set point. The mathematical formulation governing the subcutaneous accumulation of administered insulin is derived based on nominal temporal values pertaining to the pharmacokinetics (time-course of activity) of insulin in human, in terms of its absorption rate, peak absorption time, and overall time of action. The MPC algorithm is also formulated to provide control action with an integral effect, and in essence minimizes overall drug consumption. When employed as a modulator in an automated integrated glucose-control system for type 1 diabetes, the control algorithm provides the system with self-learning capability that enables it to operate under unrestricted activity of the subject.

Description:
BACKGROUND 
       [0001]    Type 1 diabetes is a chronic, life-threatening disease that is caused by failure of the pancreas to deliver the hormone insulin, which is otherwise made and secreted by the beta cells of the pancreatic islets of Langerhans. Insulin opens receptors on the cell surfaces, thereby regulating inflow of blood glucose, an essential cell nutrient. With the resulting absence of endogenous insulin, people with type 1 diabetes cannot regulate their blood glucose to euglycemic range without exogenous insulin administration. However, it is critical to provide accurate insulin dosing, so as to minimize and whenever possible eliminate low or high blood glucose levels. Both high glucose levels, known as hyperglycemia, and low glucose levels, known as hypoglycemia, can have debilitating and deleterious consequences. Hypoglycemia may result in a coma and can cause acute complications, including brain damage and paralysis. While severe hyperglycemia can also result in a coma, mild chronic hyperglycemia potentially results in long-term, deleterious, and even life-threatening complications, such as vascular disease, renal complications, vision problems, nerve degeneration, and skin disorders. 
         [0002]    In practice, it has been necessary for people with type 1 diabetes to monitor their blood glucose and administer exogenous insulin several times a day in a relentless effort to maintain their blood glucose near euglycemic range. This is a demanding, painstaking regimen. Even those who successfully adhere to the regimen are burdened by it to varying degrees and often still struggle with maintaining good glycemic control. Those who do not follow a regimen are at risk for severe complications. 
       SUMMARY 
       [0003]    It would be desirable to reduce the burdens associated with monitoring blood glucose levels and administering exogenous insulin, as well as to better regulate blood glucose levels of those with type 1 diabetes and avoid the complications of hyper- and hypoglycemic conditions. A disclosed closed-loop control system automatically commands delivery of insulin based on glucose measurements. Since slight overdosing of insulin is possible during online operation of such a system, an agent having a counter-regulatory effect to insulin action, such as a hormone known as glucagon, is also made available for delivery by the system. 
         [0004]    In a disclosed automated control system for type 1 diabetes, an adaptive algorithm utilizing model predictive control (MPC) is employed. An input-output subject model is used in conjunction with the MPC algorithm to regulate blood glucose online, where the subject model is recursively adapted, and the delivery of insulin is based solely on online glucose concentration measurements. An MPC signal is synthesized by optimizing an objective function that regulates glucose concentration to a preset reference set point while simultaneously minimizing both the control signal aggressiveness and local insulin accumulation in the subcutaneous space or “depot” that receives the infused insulin. A mathematical formulation describing the subcutaneous accumulation of administered insulin is derived based on nominal temporal values pertaining to the pharmacokinetics (time-course of activity) of insulin in human, in terms of its absorption rate, peak absorption time, and overall time of action. The MPC algorithm also provides control action with an integral effect, and in essence minimizes overall drug consumption. The control algorithm provides the automated glucose-control system with self-learning capability that enables it to operate under unrestricted activity of the subject. 
         [0005]    The subject model may be an empirical subject model, which may initially be constructed based on a system identification process performed on input-output data obtained from open-loop glycemic control of the subject. The controller may be further operative to generate the insulin control signal to provide a basal rate of delivery of insulin when the model-predictive control algorithm reveals no need for a corrective dose of insulin. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0006]    The foregoing and other objects, features and advantages of the invention will be apparent from the following description of particular embodiments of the invention, as illustrated in the accompanying drawings in which like reference characters refer to the same parts throughout the different views. The drawings are not necessarily to scale, emphasis instead being placed upon illustrating the principles of the invention. 
           [0007]      FIG. 1  is a block diagram of a fully automated control system for type 1 diabetes in accordance with the present invention; 
           [0008]      FIG. 2  is a functional block diagram of a controller in the system of  FIG. 1 ; 
           [0009]      FIG. 3  is a flow diagram depicting the operation of the system of  FIG. 1 , including details of the operation of the controller of  FIG. 2 ; and 
           [0010]      FIG. 4  is a flow diagram depicting a particular implementation of a control step of  FIG. 3 . 
       
    
    
     DETAILED DESCRIPTION 
       [0011]      FIG. 1  illustrates an automated control system  10  for regulating the blood glucose level of an animal subject (subject)  12 , which may be a human. The subject  12  receives doses of insulin from a delivery device  14 , which may be an infusion pump coupled by a catheter to a subcutaneous space of the subject  12  for example. As described below, the delivery device  14  may also deliver a counter-regulatory agent such as glucagon for more effective control of blood glucose level under certain circumstances. In the present description, reference is made to glucagon specifically, but it is to be understood that this is for convenience only and that other counter-regulatory agents may be used. For the delivery of both insulin and glucagon, the delivery device  14  is preferably a mechanically driven infusion mechanism having dual cartridges for insulin and glucagon respectively 
         [0012]    A glucose sensor  16  is operatively coupled to the subject  12  to continually sample a glucose level of the subject  12 . Sensing may be accomplished in a variety of ways. A controller  18  controls operation of the delivery device  14  as a function of a glucose level signal from the glucose sensor  16  and subject to user-provided parameters. One feature of the disclosed technique is its ability to perform without receiving explicit information regarding either meals that the subject  12  has ingested or any other “feedforward” information. One necessary user-provided initialization parameter is the weight of the subject  12 . Another user-provided parameter is a “setpoint” which, as described below, establishes a target blood glucose level that the system  10  strives to maintain. 
         [0013]      FIG. 2  shows a functional block diagram of the controller  18 , specifically a high-level depiction of a control algorithm that is executed by software/firmware within the controller  18 . As shown, a dose control signal u(t) is generated by an objective function optimizer  20  which receives as one input a setpoint signal r(t+k), which may be constant (independent of time). The dose control signal u(t) controls the operation of the insulin-glucagon delivery device (delivery device)  14  of  FIG. 1 . The input dose control signal u(t) is also provided to a subject model  22  which, as described in more detail below, explicitly models the response of the subject  12  to delivery of insulin and/or glucagon. The subject model  22  also receives an actual glucose level signal y(t) from sensor  16 , and generates a predicted future glucose level signal ŷ(t+k|t) that is used in the operation of the objective function optimizer  18 . 
         [0014]    During operation, the dose control signal u(t) and actual glucose level signal y(t) are continually fed into the subject model  22 , thereby internally updating the subject model  22  and generating updated output predictions ŷ(t+k|t). By comparison with desired future reference setpoint values r(t+k), the objective function optimizer  20  computes future error signals which are used to synthesize the dose control signal u(t) in an optimizing fashion based on a model predictive control (MPC) algorithm. An amount of insulin or glucagon corresponding to the input signal u(t) is physically administered to the subject  12  via the delivery device  14  and is also passed to the subject model  22 . The glucose sensor  16  provides the latest measurement y(t) to complete the cycle, which is then executed anew. 
         [0015]    The function of the subject model  22  is to predict future blood glucose levels based on current and past values of the signals u(t) and y(t). There are a variety of models that can be employed. The following describes one particular embodiment for the subject model. 
         [0016]    An option for the subject model is one of an empirical form, which may be obtained by system identification performed on input-output data generated from open-loop glycemic control of the subject. The subject model could be of a single-Input single-output, auto-regressive moving average with exogenous input (ARMAX) structure, with the representation 
         [0000]        A ( z   −1 ) y   t   =z   −d   B ( z   −1 ) u   t   +C ( z   −1 ) w   t   (1)
 
         [0000]    where u t  denotes the (input) insulin-glucagon doses, y t  denotes the (output) glucose concentration deviation from the reference set point, w t  is a white Gaussian noise sequence, d is the inherent system time-delay (dead-time), z −1  plays the role of the unit delay shift operator, and the scalar polynomials A, B, C are given by 
         [0000]        A ( z   −1 )=1+ a   1   z   −1   +a   2   z   −2   + . . . +a   n   z   −n , 
         [0000]        B ( z   −1 )= b   0   +b   1   z   −1   +b   2   z   −2   + . . . +b   m   z   −m , 
         [0000]        C ( z   1 )=1 +c   1   z   −1   +c   2   z   −2   + . . . +c   p   z   −p . 
         [0017]    The model&#39;s orders and delay may be determined beforehand from the offline system identification analysis. The identified model is then employed in the online integrated control system, except that the model parameters are not statically stipulated, but are dynamic (free), in the sense that they are recursively updated. Recursive (online) parameter estimation of a model such as (1) may be facilitated by re-writing the model in regressor form, namely as 
         [0000]        y   t =θ T ψ t   +w   t ,  (2)
 
         [0000]    where the regressor ψ t  and θ are respectively given by 
         [0000]      ψ t   :=[−y   t−1    . . . −y   t−n   u   t−d    . . . u   t−d−m   w   t−1    . . . w   t−p ] T  
 
         [0000]      θ:=[a 1  . . . a n b 0  . . . b m c 1  . . . c p ] T   (3)
 
         [0018]    With online parameter estimates packed in a time-varying version of vector θ, namely θ t , and the estimate w t :=y t −ψ t   T θ t  used in ψ t , one popular recursive estimation scheme is the Extended Least Squares [13, 14], which follows the scheme 
         [0000]    
       
         
           
             
               
                 
                   
                     θ 
                     t 
                   
                   = 
                   
                     
                       θ 
                       
                         t 
                         - 
                         1 
                       
                     
                     + 
                     
                       
                         
                           
                             P 
                             
                               t 
                               - 
                               1 
                             
                           
                            
                           
                             ψ 
                             t 
                           
                         
                         
                           1 
                           + 
                           
                             
                               ψ 
                               t 
                               T 
                             
                              
                             
                               P 
                               
                                 t 
                                 - 
                                 1 
                               
                             
                              
                             
                               ψ 
                               t 
                             
                           
                         
                       
                        
                       
                         e 
                         t 
                       
                     
                   
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
             
               
                 
                   
                     P 
                     t 
                   
                   = 
                   
                     
                       P 
                       
                         t 
                         - 
                         1 
                       
                     
                     - 
                     
                       
                         
                           P 
                           
                             t 
                             - 
                             1 
                           
                         
                          
                         
                           ψ 
                           t 
                         
                          
                         
                           ψ 
                           t 
                           T 
                         
                          
                         
                           P 
                           
                             t 
                             - 
                             1 
                           
                         
                       
                       
                         1 
                         + 
                         
                           
                             ψ 
                             t 
                             T 
                           
                            
                           
                             P 
                             
                               t 
                               - 
                               1 
                             
                           
                            
                           
                             ψ 
                             t 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   5 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where e t :=y t −ψ t   T θ t−1 , and P 0  is taken to be a positive definite matrix. Another option for recursive parameter estimation is the Recursive Maximum Likelihood estimation method, which is similar to the Extended Least Squares, except that φ t :=ψ t /C(z −1 ) is used in lieu of ψ t [14]. Other recursive (online) parameter-estimation schemes may also be used, such as the Instrumental Variable method, the Gradient estimation method, or alternate versions of these estimators that use a forgetting factor, to mention but a few options known to those skilled in the art [14]. Regardless of the scheme used, the adaptive subject model can be used to make online predictions of glucose concentrations and can be inherently employed by the controller block in generating the control signal. 
         [0019]    The function of the objective function optimizer  20  is to generate the insulin and glucagon control signals u(t) in an optimized fashion based in part on the predicted blood glucose levels ŷ(t+k|t) from the subject model  22 . There are a variety of optimization techniques that can be used. The following describes one particular embodiment of the objective function optimizer  20 , which is also referred to as the “controller block” in the following description. The embodiment described below uses a model-predictive control (MPC) strategy. 
         [0020]    The controller block may use one or more of the many MPC strategies, which all (1) make use of a mathematical model to {\it predict} the output at future time instants (horizon), (2) compute the control signal that optimizes an objective function at each step, and (3) employ a receding horizon strategy [5, 8]. The latter aspect refers to repeatedly displacing the prediction horizon towards the future, while only applying the first control signal in the calculated sequence at each step. 
         [0021]    One popular MPC algorithm, compatible with an ARMAX subject model, is the Generalized Predictive Control (GPC) algorithm, which optimizes the multi-stage quadratic cost function given by 
         [0000]    
       
         
           
             
               
                 
                   
                     J 
                     GPC 
                   
                   = 
                   
                     
                       
                         ∑ 
                         
                           k 
                           = 
                           
                             N 
                             d 
                           
                         
                         
                           N 
                           m 
                         
                       
                        
                       
                           
                       
                        
                       
                         
                           δ 
                           k 
                         
                          
                         
                           
                              
                             
                               C 
                                
                               
                                 ( 
                                 
                                   
                                     r 
                                     
                                       t 
                                       + 
                                       k 
                                     
                                   
                                   - 
                                   
                                     y 
                                     
                                       t 
                                       + 
                                       k 
                                     
                                   
                                 
                                 ) 
                               
                             
                              
                           
                           2 
                         
                       
                     
                     + 
                     
                       
                         ∑ 
                         
                           k 
                           = 
                           0 
                         
                         
                           N 
                           u 
                         
                       
                        
                       
                         
                           
                             λ 
                             k 
                           
                            
                           
                             ( 
                             
                               Δ 
                                
                               
                                   
                               
                                
                               
                                 u 
                                 
                                   t 
                                   + 
                                   k 
                                 
                               
                             
                             ) 
                           
                         
                         2 
                       
                     
                   
                 
               
               
                 
                   ( 
                   6 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where N d  and N m  are respectively the minimum and maximum (output) prediction costing horizon limits, N u  the control horizon bound, δ m  the weighting on prediction error, and λ n  the weighting on control signals. Some general guidelines in GPC implementation include (1) N d ≧d, since earlier outputs are not influenced by the current input signal, (2) the output horizon, N y :=N m −N d , covering a substantial portion of the response rise time due to u(t|t), and (3) N y ≧N u , with N u =0 or square horizons, i.e. N y =N u , popularly enforced. 
         [0022]    For control action with integral effect, predictor and control design are based on 
         [0000]        A ( z   −1 ) y   t   =z   −k   B ( z   −1 ) u   t   +C ( z   −1 ) w   t /Δ  (7)
 
         [0000]    with the corresponding Diophantine separation identity given by 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       C 
                       
                         A 
                          
                         
                             
                         
                          
                         Δ 
                       
                     
                     = 
                     
                       
                         E 
                         k 
                       
                       + 
                       
                         
                           z 
                           
                             - 
                             k 
                           
                         
                          
                         
                           
                             F 
                             k 
                           
                           
                             A 
                              
                             
                                 
                             
                              
                             Δ 
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   8 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where F k  is the remainder polynomial corresponding to the monic quotient polynomial E k , the former and latter of respective orders n and k−1 in z −1 , or specifically, F k =f 0 +f 1 z −1 + . . . +f n z −n  and E k =1+e 1 z −1 + . . . +e k−1 z −(k−1) . The best predictor ŷ t|t-k  is then defined to satisfy 
         [0000]        y   t   =ŷ   t|t−k   +E   k   w   t ,  (9)
 
         [0000]    which yields 
         [0000]        Cŷ   t+k|t   =G   k   Δu   t+k−d   +F   k   y   t ,  (10)
 
         [0000]    where G k :=E k B. Note that G k  is order (m+k−1) in z −1 , and can be written as G k =g 0 +g 1 z −1 + . . . +g m+k−1 z −(m+k−1) , with g 0 =b 0 , since E k  is monic ∀k. To implement the GPC algorithm, we re-write (10) as 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       C 
                        
                       
                         
                           y 
                           ^ 
                         
                         
                           
                             t 
                             + 
                             k 
                           
                            
                           t 
                         
                       
                     
                     = 
                     
                       
                         
                           ∑ 
                           
                             i 
                             = 
                             0 
                           
                           
                             k 
                             - 
                             d 
                           
                         
                          
                         
                             
                         
                          
                         
                           
                             g 
                             i 
                           
                            
                           
                             z 
                             
                               - 
                               i 
                             
                           
                            
                           Δ 
                            
                           
                               
                           
                            
                           
                             u 
                             
                               t 
                               + 
                               k 
                               - 
                               d 
                             
                           
                         
                       
                       + 
                       
                         
                           ( 
                           
                             
                               G 
                               k 
                             
                             - 
                             
                               
                                 ∑ 
                                 
                                   i 
                                   = 
                                   0 
                                 
                                 
                                   k 
                                   - 
                                   d 
                                 
                               
                                
                               
                                 
                                   g 
                                   i 
                                 
                                  
                                 
                                   z 
                                   
                                     - 
                                     i 
                                   
                                 
                               
                             
                           
                           ) 
                         
                          
                         Δ 
                          
                         
                             
                         
                          
                         
                           u 
                           
                             t 
                             + 
                             k 
                             - 
                             d 
                           
                         
                       
                       + 
                       
                         
                           F 
                           k 
                         
                          
                         
                           y 
                           t 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   11 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where the first term on the right-hand side contains the only k−d future-terms (containing the sought control signal) for any k. Taking N d =d and N y +1=N u +1=: N, i.e. square prediction and control horizons of N steps, we apply (11) over k=d→(N y +d), and pack term contributions in the matrix-form equation given by 
         [0000]    
       
         
           
             
               
                 
                   
                     y 
                     = 
                     
                       Gu 
                       + 
                       
                         
                           G 
                           ′ 
                         
                          
                         u 
                       
                       + 
                       
                         Fy 
                         t 
                       
                     
                   
                    
                   
                     
 
                   
                    
                   where 
                    
                   
                     
 
                   
                    
                   
                     y 
                     = 
                     
                       
                         
                           
                             [ 
                             
                               
                                 
                                   
                                     C 
                                      
                                     
                                       
                                         y 
                                         ^ 
                                       
                                       
                                         
                                           t 
                                           + 
                                           d 
                                         
                                          
                                         t 
                                       
                                     
                                   
                                 
                               
                               
                                 
                                   
                                     C 
                                      
                                     
                                       
                                         y 
                                         ^ 
                                       
                                       
                                         
                                           t 
                                           + 
                                           d 
                                           + 
                                           1 
                                         
                                          
                                         t 
                                       
                                     
                                   
                                 
                               
                               
                                 
                                   ⋮ 
                                 
                               
                               
                                 
                                   
                                     C 
                                      
                                     
                                       
                                         y 
                                         ^ 
                                       
                                       
                                         
                                           t 
                                           + 
                                           N 
                                           + 
                                           d 
                                           - 
                                           1 
                                         
                                          
                                         t 
                                       
                                     
                                   
                                 
                               
                             
                             ] 
                           
                           
                             N 
                             × 
                             1 
                           
                         
                          
                         G 
                       
                       = 
                       
                         
                           [ 
                           
                             
                               
                                 
                                   g 
                                   0 
                                 
                               
                               
                                 0 
                               
                               
                                 0 
                               
                               
                                 ⋯ 
                               
                             
                             
                               
                                 
                                   g 
                                   1 
                                 
                               
                               
                                 
                                   g 
                                   0 
                                 
                               
                               
                                 0 
                               
                               
                                 ⋯ 
                               
                             
                             
                               
                                 ⋮ 
                               
                               
                                 ⋮ 
                               
                               
                                 ⋮ 
                               
                               
                                 0 
                               
                             
                             
                               
                                 
                                   g 
                                   
                                     N 
                                     - 
                                     1 
                                   
                                 
                               
                               
                                 
                                   g 
                                   
                                     N 
                                     - 
                                     2 
                                   
                                 
                               
                               
                                 ⋯ 
                               
                               
                                 
                                   g 
                                   0 
                                 
                               
                             
                           
                           ] 
                         
                         
                           N 
                           × 
                           N 
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     u 
                     = 
                     
                       
                         
                           
                             [ 
                             
                               
                                 
                                   
                                     Δ 
                                      
                                     
                                         
                                     
                                      
                                     
                                       u 
                                       t 
                                     
                                   
                                 
                               
                               
                                 
                                   
                                     Δ 
                                      
                                     
                                         
                                     
                                      
                                     
                                       u 
                                       
                                         t 
                                         + 
                                         1 
                                       
                                     
                                   
                                 
                               
                               
                                 
                                   ⋮ 
                                 
                               
                               
                                 
                                   
                                     Δ 
                                      
                                     
                                         
                                     
                                      
                                     
                                       u 
                                       
                                         t 
                                         + 
                                         N 
                                         - 
                                         1 
                                       
                                     
                                   
                                 
                               
                             
                             ] 
                           
                           
                             N 
                             × 
                             1 
                           
                         
                          
                         
                           G 
                           ′ 
                         
                          
                         u 
                       
                       = 
                       
                         
                           [ 
                           
                             
                               
                                 
                                   
                                     ( 
                                     
                                       
                                         G 
                                         d 
                                       
                                       - 
                                       
                                         
                                           ∑ 
                                           
                                             i 
                                             = 
                                             0 
                                           
                                           0 
                                         
                                          
                                         
                                             
                                         
                                          
                                         
                                           
                                             g 
                                             i 
                                           
                                            
                                           
                                             z 
                                             
                                               - 
                                               i 
                                             
                                           
                                         
                                       
                                     
                                     ) 
                                   
                                    
                                   Δ 
                                    
                                   
                                       
                                   
                                    
                                   
                                     u 
                                     t 
                                   
                                 
                               
                             
                             
                               
                                 
                                   
                                     ( 
                                     
                                       
                                         G 
                                         
                                           d 
                                           + 
                                           1 
                                         
                                       
                                       - 
                                       
                                         
                                           ∑ 
                                           
                                             i 
                                             = 
                                             0 
                                           
                                           1 
                                         
                                          
                                         
                                             
                                         
                                          
                                         
                                           
                                             g 
                                             i 
                                           
                                            
                                           
                                             z 
                                             
                                               - 
                                               i 
                                             
                                           
                                         
                                       
                                     
                                     ) 
                                   
                                    
                                   Δ 
                                    
                                   
                                       
                                   
                                    
                                   
                                     u 
                                     
                                       t 
                                       + 
                                       1 
                                     
                                   
                                 
                               
                             
                             
                               
                                 ⋮ 
                               
                             
                             
                               
                                 
                                   
                                     ( 
                                     
                                       
                                         G 
                                         
                                           N 
                                           + 
                                           d 
                                           - 
                                           1 
                                         
                                       
                                       - 
                                       
                                         
                                           ∑ 
                                           
                                             i 
                                             = 
                                             0 
                                           
                                           
                                             N 
                                             - 
                                             1 
                                           
                                         
                                          
                                         
                                             
                                         
                                          
                                         
                                           
                                             g 
                                             i 
                                           
                                            
                                           
                                             z 
                                             
                                               - 
                                               i 
                                             
                                           
                                         
                                       
                                     
                                     ) 
                                   
                                    
                                   Δ 
                                    
                                   
                                       
                                   
                                    
                                   
                                     u 
                                     
                                       t 
                                       + 
                                       n 
                                       - 
                                       1 
                                     
                                   
                                 
                               
                             
                           
                           ] 
                         
                         
                           N 
                           × 
                           1 
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     F 
                     = 
                     
                       
                         [ 
                         
                           
                             
                               
                                 F 
                                 d 
                               
                             
                           
                           
                             
                               
                                 F 
                                 
                                   d 
                                   + 
                                   1 
                                 
                               
                             
                           
                           
                             
                               ⋮ 
                             
                           
                           
                             
                               
                                 F 
                                 
                                   N 
                                   + 
                                   d 
                                   - 
                                   1 
                                 
                               
                             
                           
                         
                         ] 
                       
                       
                         N 
                         × 
                         1 
                       
                     
                   
                 
               
               
                 
                   ( 
                   12 
                   ) 
                 
               
             
           
         
       
     
         [0023]    The last two quantities in (12) are available at time t, as they are either directly measurable or depend only on past measurements, and can be grouped into a vector f, leading to: 
         [0000]        y=Gu+f   (13)
 
         [0024]    With δ m =1 and λ n =λ, (6) can be re-written as 
         [0000]        J   GPC =( G+f−r ) T ( G+f−r )+λ u   T   u,   (14)
 
         [0000]    where r is the vector holding future set points as r=[Cr t+d Cr t+d+1  . . . Cr t+N+d−1 ] T . Further manipulation of (14) leads to 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         J 
                         GPC 
                       
                       = 
                       
                         
                           
                             1 
                             2 
                           
                            
                           
                             u 
                             T 
                           
                            
                           Hu 
                         
                         + 
                         
                           
                             b 
                             T 
                           
                            
                           u 
                         
                         + 
                         
                           f 
                           0 
                         
                       
                     
                     , 
                     
                       
 
                     
                      
                     where 
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         H 
                         = 
                         
                           2 
                            
                           
                             ( 
                             
                               
                                 
                                   G 
                                   T 
                                 
                                  
                                 G 
                               
                               + 
                               
                                 λ 
                                  
                                 
                                     
                                 
                                  
                                 I 
                               
                             
                             ) 
                           
                         
                       
                       ; 
                       
                         
                           b 
                           T 
                         
                         = 
                         
                           2 
                            
                           
                             
                               ( 
                               
                                 f 
                                 - 
                                 r 
                               
                               ) 
                             
                             T 
                           
                            
                           G 
                         
                       
                       ; 
                       
                         
                           f 
                           0 
                         
                         = 
                         
                           
                             
                               ( 
                               
                                 f 
                                 - 
                                 r 
                               
                               ) 
                             
                             T 
                           
                            
                           
                             ( 
                             
                               f 
                               - 
                               r 
                             
                             ) 
                           
                         
                       
                     
                     , 
                   
                 
               
               
                 
                   ( 
                   15 
                   ) 
                 
               
             
           
         
       
     
         [0025]    The unconstrained vector u minimizing J GPC  can be found by inspection of (15), and is given by 
         [0000]        u   GPC   =−H   −1   b =( G   T   G+λI ) −1   G   T ( r−f ),  (16)
 
         [0026]    Since G T G≧0, (16) gives a unique solution, provided λ&gt;0. Only the first control move is of interest at t, namely 
         [0000]      Δ u   t =[1 0 0 . . . 0]( G   T   G+λI ) −1   G   T ( r−f ),  (17)
 
         [0027]    The control increment or move in (17) is thus zero if the current situation and desired outcome coincide, that is if r−f=0, as it should. Finally, to deal with non-square horizons, which would only be permissible for N u &lt;N y , G is replaced G Nu , where G Nu  is composed of the first N u +1 columns of G, and u is replaced by u Nu , which contains the first N u +1 elements of u, with everything else kept the same. Note that the Generalized Minimum Variance (GMV) control, with N y =N u =N−1=0, is a special instance of GPC with square horizons. 
         [0028]    In the case of subcutaneous drug administration, drug accumulation in the subcutaneous depot (typically that of insulin) can be augmented to the raw control cost function of (6), and viewed as an additional control objective in the optimization process. The resultant online control signal simultaneously (1) optimizes the controller&#39;s aggressiveness, (2) minimizes insulin accumulation in the subcutaneous depot, and (3) regulates glucose concentration to a preset set point target value. The mathematical formulation governing the subcutaneous accumulation of administered insulin can be derived based on nominal temporal values pertaining to its pharmacokinetics (time-course of activity), in terms of its absorption rate, peak absorption time, and overall time of action (perfusion into plasma). If p(t) is the concentration, in mU/dl, of the drug in plasma as it is absorbed from the subcutaneous depot, its evolution can be taken to be governed by 
         [0000]        p ( t )= KU   0 ( e   −α     1     t   −e   −α     2     t ),  (18)
 
         [0000]    where U 0  is the subcutaneous-drug impulse dose in units (U), and K, α 1 , and α 2  are positive constants. A measure of the pending effect of the accumulated amount of insulin in the SC depot can be taken to be the difference between the total area (∫ 0   ∞  p(t)dt, i.e. a measure of the total action over time due to dose U 0 ) and ∫ 0   t  p(t)dt, i.e. a measure of the expended portion of U 0 . With the measure of the lingering effect of the outstanding quantity of insulin in the SC depot denoted by q(t), we arrive at 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       q 
                        
                       
                         ( 
                         t 
                         ) 
                       
                     
                     := 
                     
                       
                         
                           
                             ∫ 
                             0 
                             ∞ 
                           
                            
                           
                             
                               p 
                                
                               
                                 ( 
                                 t 
                                 ) 
                               
                             
                              
                             
                                 
                             
                              
                             
                                
                               t 
                             
                           
                         
                         - 
                         
                           
                             ∫ 
                             0 
                             t 
                           
                            
                           
                             
                               p 
                                
                               
                                 ( 
                                 t 
                                 ) 
                               
                             
                              
                             
                                 
                             
                              
                             
                                
                               t 
                             
                           
                         
                       
                       = 
                       
                         
                           
                             KU 
                             0 
                           
                           
                             
                               α 
                               1 
                             
                              
                             
                               α 
                               2 
                             
                           
                         
                          
                         
                           ( 
                           
                             
                               
                                 α 
                                 2 
                               
                                
                               
                                  
                                 
                                   
                                     - 
                                     
                                       α 
                                       1 
                                     
                                   
                                    
                                   t 
                                 
                               
                             
                             - 
                             
                               
                                 α 
                                 1 
                               
                                
                               
                                  
                                 
                                   
                                     - 
                                     
                                       α 
                                       2 
                                     
                                   
                                    
                                   t 
                                 
                               
                             
                           
                           ) 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   19 
                   ) 
                 
               
             
           
         
       
     
         [0029]    As a discrete-time model, this can be written as 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       q 
                       k 
                     
                     = 
                     
                       
                         
                           
                             ( 
                             
                               
                                  
                                 
                                   
                                     - 
                                     
                                       α 
                                       1 
                                     
                                   
                                    
                                   
                                     T 
                                     s 
                                   
                                 
                               
                               + 
                               
                                  
                                 
                                   
                                     - 
                                     
                                       α 
                                       2 
                                     
                                   
                                    
                                   
                                     T 
                                     s 
                                   
                                 
                               
                             
                             ) 
                           
                            
                           
                             q 
                             
                               k 
                               - 
                               1 
                             
                           
                         
                         - 
                         
                           
                              
                             
                               
                                 - 
                                 
                                   ( 
                                   
                                     
                                       α 
                                       1 
                                     
                                     + 
                                     
                                       α 
                                       2 
                                     
                                   
                                   ) 
                                 
                               
                                
                               
                                 T 
                                 s 
                               
                             
                           
                            
                           
                             q 
                             
                               k 
                               - 
                               2 
                             
                           
                         
                         + 
                         
                           
                             K 
                             
                               
                                 α 
                                 1 
                               
                                
                               
                                 α 
                                 2 
                               
                             
                           
                            
                           
                             ( 
                             
                               
                                 α 
                                 2 
                               
                               - 
                               
                                 α 
                                 1 
                               
                             
                             ) 
                           
                            
                           
                             u 
                             
                               k 
                               - 
                               
                                 d 
                                 q 
                               
                             
                           
                         
                         + 
                         
                           
                             K 
                             
                               
                                 α 
                                 1 
                               
                                
                               
                                 α 
                                 2 
                               
                             
                           
                            
                           
                             ( 
                             
                               
                                 
                                   α 
                                   1 
                                 
                                  
                                 
                                    
                                   
                                     
                                       - 
                                       
                                         α 
                                         1 
                                       
                                     
                                      
                                     
                                       T 
                                       s 
                                     
                                   
                                 
                               
                               - 
                               
                                 
                                   α 
                                   2 
                                 
                                  
                                 
                                    
                                   
                                     
                                       - 
                                       
                                         α 
                                         2 
                                       
                                     
                                      
                                     
                                       T 
                                       s 
                                     
                                   
                                 
                               
                             
                             ) 
                           
                            
                           
                             u 
                             
                               k 
                               - 
                               
                                 d 
                                 q 
                               
                               - 
                               1 
                             
                           
                         
                       
                       = 
                       
                         : 
                         
                           
                             
                               - 
                               
                                 a 
                                 
                                   1 
                                    
                                   
                                       
                                   
                                    
                                   q 
                                 
                               
                             
                              
                             
                               q 
                               
                                 k 
                                 - 
                                 1 
                               
                             
                           
                           - 
                           
                             
                               a 
                               
                                 2 
                                  
                                 
                                     
                                 
                                  
                                 q 
                               
                             
                              
                             
                               q 
                               
                                 k 
                                 - 
                                 2 
                               
                             
                           
                           + 
                           
                             
                               b 
                               
                                 1 
                                  
                                 
                                     
                                 
                                  
                                 q 
                               
                             
                              
                             
                               u 
                               
                                 k 
                                 - 
                                 
                                   d 
                                   q 
                                 
                               
                             
                           
                           + 
                           
                             
                               b 
                               
                                 2 
                                  
                                 
                                     
                                 
                                  
                                 q 
                               
                             
                              
                             
                               u 
                               
                                 k 
                                 - 
                                 
                                   d 
                                   q 
                                 
                                 - 
                                 1 
                               
                             
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   20 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where T s  is the sampling period. Incidentally, IV dosing may be perceived as bypassing the SC depot, i.e., for an IV drug dose, q(t)=0 in (19) and q k =0 in (20), as if there were zero peak (α 2 →∞) and zero depletion or consumption times (α 1 →∞) from the SC depot into plasma, with coinciding values for α 1  and α 2 . Before augmenting (20) to the original discrete-time model of (1), whose inherent units are mg/dl, we non-dimensionalize (20) and re-scale it to switch its inherent units from mU\,min/dl to mg/dl, so that control signal computation (optimization) is performed on an overall homogenous (augmented) system. An overall scaling factor to operate on (20) can be obtained from the steady-state effect of an impulse dose on blood glucose, taken to vary as per a scaled integration of (18). As such, the scaling factor, 
         [0000]    
       
         
           
             
               
                 s 
                 f 
               
               = 
               
                 
                   
                     y 
                     ∞ 
                   
                    
                   
                     α 
                     1 
                   
                    
                   
                     α 
                     2 
                   
                 
                 
                   
                     U 
                     0 
                   
                    
                   
                     K 
                      
                     
                       ( 
                       
                         
                           α 
                           2 
                         
                         - 
                         
                           α 
                           1 
                         
                       
                       ) 
                     
                   
                 
               
             
             , 
           
         
       
     
         [0000]    in mg/(mU min), where y ∞  is the steady-state excursion (offset from reference) in blood glucose per unit impulse dose U 0 , can be used. Note that the scaling factor s f  provides the proper unit conversion, but can be scaled further by a unitless factor. The steady-state blood-glucose value, y ∞ , can be approximated from the pharmacodynamics of insulin, which is available in the literature. Augmenting the scaled q k -system of (20) to the original y k -system of (1), we obtain the single-input multiple-output model given by 
         [0000]        A ( z   −1 ) y   k   =z   −d   B ( z   −1 ) u   k   +C ( z   −1 ) w   k ,  (21)
 
         [0000]    where y k =[y k  s f q k ] T , w k  is a vector of two white-noise sequences, and 
         [0000]        A ( z   −1 )= I   2×2   +A   1   z   −1   +A   2   z   −2   + . . . +A   n   z   −n , 
         [0000]        B ( z   −1 )= B   0   +B   1   z   −1   +B   2   z   −2   + . . . +B   m   z   −m , 
         [0000]        C ( z   1 )= I   2×2   +C   1   z   −1   +C   2   z   −2   + . . . +C   p   z   −p . 
         [0000]    with 
         [0000]    
       
         
           
             
               
                 A 
                 1 
               
               = 
               
                 [ 
                 
                   
                     
                       
                         a 
                         1 
                       
                     
                     
                       0 
                     
                   
                   
                     
                       0 
                     
                     
                       
                         a 
                         
                           1 
                            
                           
                               
                           
                            
                           q 
                         
                       
                     
                   
                 
                 ] 
               
             
             , 
             
               
                 A 
                 2 
               
               = 
               
                 [ 
                 
                   
                     
                       
                         a 
                         i 
                       
                     
                     
                       0 
                     
                   
                   
                     
                       0 
                     
                     
                       
                         a 
                         
                           2 
                            
                           
                               
                           
                            
                           q 
                         
                       
                     
                   
                 
                 ] 
               
             
             , 
             
               
                 A 
                 i 
               
               = 
               
                 
                   [ 
                   
                     
                       
                         
                           a 
                           i 
                         
                       
                       
                         0 
                       
                     
                     
                       
                         0 
                       
                       
                         0 
                       
                     
                   
                   ] 
                 
                  
                 
                   ∀ 
                   
                     i 
                     &gt; 
                     2 
                   
                 
               
             
             , 
             
               
 
             
              
             
               
                 B 
                 0 
               
               = 
               
                 [ 
                 
                   
                     
                       
                         b 
                         0 
                       
                     
                   
                   
                     
                       
                         
                           s 
                           f 
                         
                          
                         
                           b 
                           
                             1 
                              
                             
                                 
                             
                              
                             q 
                           
                         
                       
                     
                   
                 
                 ] 
               
             
             , 
             
               
                 B 
                 1 
               
               = 
               
                 [ 
                 
                   
                     
                       
                         b 
                         0 
                       
                     
                   
                   
                     
                       
                         
                           s 
                           f 
                         
                          
                         
                           b 
                           
                             2 
                              
                             
                                 
                             
                              
                             q 
                           
                         
                       
                     
                   
                 
                 ] 
               
             
             , 
             
               
                 B 
                 i 
               
               = 
               
                 
                   [ 
                   
                     
                       
                         
                           b 
                           i 
                         
                       
                     
                     
                       
                         0 
                       
                     
                   
                   ] 
                 
                  
                 
                   ∀ 
                   
                     i 
                     &gt; 
                     1 
                   
                 
               
             
             , 
             
               
 
             
              
             
               
                 C 
                 i 
               
               = 
               
                 
                   [ 
                   
                     
                       
                         
                           c 
                           i 
                         
                       
                       
                         0 
                       
                     
                     
                       
                         0 
                       
                       
                         0 
                       
                     
                   
                   ] 
                 
                  
                 
                   ∀ 
                   
                     i 
                     &gt; 
                     0 
                   
                 
               
             
             , 
           
         
       
     
         [0000]    where, for simplicity, the same system delay d of (1) can be assumed between q k  and u k . Coupling between the two systems, via the same input signal, is relevant when solving for the optimal control signal [5], whereby matrix G is merely extended to give an analogous matrix, G e , for the new system, the latter constructed as: 
         [0000]    
       
         
           
             
               G 
               e 
             
             = 
             
               
                 [ 
                 
                   
                     
                       
                         g 
                         0 
                       
                     
                     
                       0 
                     
                     
                       0 
                     
                     
                       ⋯ 
                     
                   
                   
                     
                       
                         g 
                         
                           0 
                            
                           
                               
                           
                            
                           q 
                         
                       
                     
                     
                       0 
                     
                     
                       0 
                     
                     
                       ⋯ 
                     
                   
                   
                     
                       
                         g 
                         1 
                       
                     
                     
                       
                         g 
                         0 
                       
                     
                     
                       0 
                     
                     
                       ⋯ 
                     
                   
                   
                     
                       
                         g 
                         
                           1 
                            
                           
                               
                           
                            
                           q 
                         
                       
                     
                     
                       
                         g 
                         
                           0 
                            
                           
                               
                           
                            
                           q 
                         
                       
                     
                     
                       0 
                     
                     
                       ⋯ 
                     
                   
                   
                     
                       ⋮ 
                     
                     
                       ⋮ 
                     
                     
                       ⋮ 
                     
                     
                       0 
                     
                   
                   
                     
                       
                         g 
                         
                           N 
                           - 
                           1 
                         
                       
                     
                     
                       
                         g 
                         
                           N 
                           - 
                           2 
                         
                       
                     
                     
                       ⋯ 
                     
                     
                       
                         g 
                         0 
                       
                     
                   
                   
                     
                       
                         g 
                         
                           
                             ( 
                             
                               N 
                               - 
                               1 
                             
                             ) 
                           
                           q 
                         
                       
                     
                     
                       
                         g 
                         
                           
                             ( 
                             
                               N 
                               - 
                               2 
                             
                             ) 
                           
                           q 
                         
                       
                     
                     
                       ⋯ 
                     
                     
                       
                         g 
                         
                           0 
                            
                           
                               
                           
                            
                           q 
                         
                       
                     
                   
                 
                 ] 
               
               
                 2 
                  
                 
                     
                 
                  
                 N 
                 × 
                 N 
               
             
           
         
       
     
         [0000]    where the g iq -entries pertain to the q k -system and are the analogues of the g i -entries in the y k -system. Vector f is also adjusted accordingly to yield an extended version, f e , which is twice in length. A relative scaling (penalty) between outputs y k  and q k  can be accommodated in the construction of f. The GPC signal is again given by (17), except that G e  (or its first N u +1 columns for non-square horizons) and f are used in lieu of G and f respectively, in addition to using a trivially extended version, r e , for r. The GMV control is recovered by setting N y =N u =N−1=0. 
         [0030]    The following describes the use of constraints on the control signals u(t): 
         [0031]    Constraints on input-output signals may be enforced to limit them to allowable, possibly subjective, fields of action. The output constraints are not usually explicitly contemplated, but rather implicitly enforced via optimizing the cost function [5]. In general, the input constraints can be described by 
         [0000]      u min ≦u t ≦u max  
 
         [0000]      Δu min ≦Δu t &lt;Δu max ,
 
         [0032]    Input constraints, such as minimum (basal) and maximum (bolus) doses, or their respective rate of change, may be explicitly enforced, possibly by saturation or clipping. The input constraints may be left for the user to initialize, but may at the same time be stipulated to be less than (and occasionally clipped or overridden by) a maximum allowable value, possibly based on the subject&#39;s weight. 
         [0033]      FIG. 3  illustrates the overall process by which the system  10  of  FIG. 1  operates. In step  24 , the glucose level of the subject  12  is continually sensed by the glucose sensor  16 , which generates a corresponding actual glucose level signal y(t). In step  26 , the delivery device  14  operates in response to the insulin/glucagon dose control signal u(t) to deliver corresponding doses of insulin and glucagon to a subcutaneous space of the subject  12 . 
         [0034]    In step  28 , the controller  18  generates the insulin/glucagon dose control signal u(t) as a function of the weight of the subject  12 , the setpoint r(t+k), and time-varying glucose levels of the subject  12  as represented by the actual glucose level signal y(t) over time. Specifically, the controller  18  employs a control algorithm including steps  30  and  32  as shown. 
         [0035]    In step  30 , a subject model  16  is utilized to explicitly model response of the subject  12  to delivered doses of insulin and glucagon and thereby generate, based on time-varying values of the actual glucose level signal y(t) and the insulin/glucagon dose control signal u(t), a predicted glucose level signal ŷ(t+k|t) representing a predicted glucose level of the subject. 
         [0036]    In step  32 , the insulin and glucagon dose control signals u(t) are generated based on (a) a difference between the predicted glucose level signal ŷ(t+k|t) and the setpoint signal r(t+k) representing desired future levels of the glucose level of the subject  12 , and (b) local accumulation of insulin in the subcutaneous space of the subject  12 . This latter value is tracked according to the pharmacokinetics of insulin as described above. 
         [0037]      FIG. 4  illustrates a particular implementation of the general step  32  of  FIG. 3 . In particular, the illustrated embodiment utilizes an MPC control strategy as described above. In step  34 , the insulin/glucagon control signal u(t) is generated as optimizing an objective function with objectives of (a) a weighted integration of a difference between the actual glucose level signal y(t) and a predetermined setpoint value over a time horizon, and (b) a weighted integration of the insulin/glucagon control signal u(t) over the time horizon. 
         [0038]    In step  36 , the model parameters of the subject model  22  are recursively and continually updated to dynamically adapt the subject model  22  to variations in the response of the subject  12  to the delivered doses of insulin and glucagon. 
         [0039]    It will be appreciated that the present invention may be embodied as an overall system such as shown in  FIG. 1 , as an overall method, as a controller such as shown in  FIG. 2 , and as a method performed by a controller such as shown in  FIG. 4 . With respect to the method performed by a controller, the method may be performed by computer program instructions executed by generic controller hardware including memory, a processing or execution unit, and input/output circuitry. The instructions may be provided to the controller from a computer-readable medium such as semiconductor memory, magnetic memory (e.g. magnetic disk), optical memory (e.g. optical disk such as CD, DVD), etc. 
         [0040]    While this invention has been particularly shown and described with references to preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.