Modern Control System for Artificial Pancreatic A Cell by CH KEVIN PAUL B.S., Massachusetts Institute (1976) of Technology SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE IN MECHANICAL ENGINEERING at the MASSACHUSETTS INSTITUTE OF June, TECHNOLOGY 1981 Kevin Paul Koch The author hereby grants to the Massachusetts Institute of Technology permission to reproduce and distribute copies of this thesis document in whole, or in part. Signature of Author Department of Mechanical ./ 4 A Engineering June 1, 1981 Certified by J. Karl Hedrick Thesis Supervisor Accepted by Chairman, Departmental Archives MASSACHUSETTS INSTITUTE OF TECHNOLOGY JUL 31 1981 UIBRARIES ~ Warren M. Rohsenow Graduate Committee ABSTRACT Modern Control System for 8 Cell Pancreatic Artificial by KEVIX PAUL KOCH Submitted to the Department of Mechanical Engineering on 1 June 1981 in partial fulfillment of the requirements for the Degree of Master of Science in Mechanical Engineering ABSTRACT of diabetes has been Progress toward closed-loop control years. In spite of the increasing accelerating in recent attention being devoted to this problem, apparently all work has been based solely on empirical observations. an engineering thesis is to take goal* of this The A simple linear approach to the glucose regulation problem. be derived from and insulin dynamics will model of glucose using straightforward an existing complex, nonlinear model, The simplified model will serve linear analysis techniques. as the basis for a modern control system. is 'good enough' Whether the simplified characterization of the control law derived is determined by the performance Simulations indicate that the control law works therefrom. including In simulations as a normal pancreas. as well insulin pump hardware constraints, (glucose sensing delays, the modern control system provides regulation quantization) artificial than existing as or better which is as good glucose controllers. Thesis Supervisor: Title: Dr. J. Karl Hedrick Associate Professor - ii - ACKNOWLEDGEMENTS My deepest thanks to Albert Hopkins and Basil were Smith, able to let me devote my time to this project, who and who provided encouragement and valuable editorial comments. To Steve Hall, for his graphics package and many hours of fruitful conversations. To Mario computer Santarelli and Dave Haugar for unlimited time and resources. To Professor Clark Colton and their support, encouragement, To those who helped Dr. iii little ways: Allison Brown, and Jeanne Bueche. - Stuart Soeldner for and enthusiasm. in countless Youcef-Toumi, Allan O'Connor, J. - Kamal John Sorensen, - iv - TABLE OF CONTENTS . . . . . . . . . ACKNOWLEDGEMENTS . . . . . . . . . . . . . TABLE OF CONTENTS . . . . . . . . . . . . . . - - . . . . - - . . . . - . ABSTRACT - . . . . . . .. .. - - . . . viii . .. LIST OF TABLES . . . . . . . . . . . . .. LIST OF FIGURES . . . . . . . . . . . . . . .. . . . ix . . page Chapter . . . . . . 1. INTRODUCTION 2. APPLICABLE CONTROL THEORY .... . . . . . . . . . . . THE PROBLEM OF DIABETES 1 . . . . . . . . . . . . . . . . . . . . . . Results of Modern Control Theory . Modern Control System Formulation . . . . . . .. .. . . Controllability . . . . . . . .. . 2uadratic Performance Index . . . . . . . . .. . . . . . . . . . . . . .. . State Estimation . .. . . Kalman Filter . . . . . . . *. .... Error Coordinate Transformation . . . . . . . Integral Control/Intelligent Integrator . . . An Example of the Modern Control Formulation Classical Control as a Subset of the Modern . . . . . . . . . . . . Formulation 3. V . . . . . . . . .. . .. . . . . . 5 6 6 8 9 10 12 12 13 14 . 16 17 17 .. . Glucose - Insulin Physiology . . . . . .. . 18 . . . . . . . . . . . . . . . . Diabetes Mellitus 20 . . . . . . . . . . . . . . . . . . . . Treatment 4. GLUCOSE/INSULIN MODELLING . . . . . . . . . . . . . . 22 Existing Gluocse and Insulin Dynamics Models . . . . . . . . . . . . . . . . . The FLOWMOD Model .. . Physical Derivation . . . . . . . . . . . . . . . . . . . . . . . . . Glucose Space . . . . . . . . . . . . . . Insulin Space . . . . . . . . . . The Pancreatic 4 Cell ........ . Value Validation/Predictive .... . Cell B FLOWMOD the of Irrelevance . . . . . . . . FLOWMOD Using Sample Results - v - . 23 . 24 24 . 26 . 29 . 30 30 31 . 31 5. LINEAR CHARACTERIZATION Insulin Dynamics . . . . . . . . . . . Controllability . . . . . . . . Transfer Functions . . . . . . Error Coordinate Transformation Glucose Dynamics . . . . . . . . . Frequency Response Analysis . Impulse Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 OBSERVER DESIGN . . . . . . . . . . . . . 52 RESULTS . . . . . CONCLUSIONS . . . .48 Observer 52 53 54 55 58 . Controller Design . . . . . . . . . . Comparison to Empirical Algorithms Intelligent Integrator Design . Hardware Limitations Simulation Insulin Pump quantization..... Glucose Measurement Delays . Peripheral versus Portal Delivery Comparison with Other Results 8. . . . . . . . . . . Summary . . . . . . . . . . . . . Future Work . . . . . . . . . . . . . Discrete-Time Kalman Filter Model Enhancement/Verification Experimentation with Controller Partial 3 Cell Function . . . . Fault Tolerance . . . . . . . . Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . . . . . . . . . . . . 58 61 61 65 65 6 . 71 . 74 76 76 . . 78 78 78 . . 79, 79 80 p.80 . . . page Appendix A. 38 39 40 43 44 44 . Parameter Readjustment Using Open Loop Insulin States . . . . . . . . . . Glucose States . . . . . . . . . . Observer Implementation . . . . . . . 7. . 36 . . Summary 6. . MODEL OF THE COMPUTER PROGRAMS . . . . . . . . . . . . . . . . Simulation Data Definitions /PCOM/ Database Generator Named Common Definition Observer Program . . . Simulation Program . . DYSYS Common Block Modified FLOWMOD . - . . . . . . . . . vi - . . . . . . . . . . 82 83 86 87 89 89 89 REFERENCES . . . . . . . . . . . - vii - . . . . . . . . . . . 102 LIST OF TABLES Table page . . . . . . . . . 41 1. Insulin Subsystem Poles and Zeroes 2. Insulin 3. Insulin Dynamics Transfer Functions 4. Simplified Glucose 5. Insulin Subsystem Final Parameter Settings 6. Glucose Subsystem Final Parameter 7. Observer 8. Controller Gains Subsystem Gains Fraction Numerators Partial Dynamics . . . . . . . . . . . . . . Values . . . . . 41 . . . . 42 . . . . 49 . . . . 53 . . . . . . 55 . . . . . . . . . . . . . . . . . . . 56 . . . . . . . . . . . . . . . . . . 59 - viii - LIST OF FIGURES page Figure Windup 14 . . . . . . . . . . . . . .. . . 1. Integrator 2. Intelligent Integrator 3. Glucose Compartments and Blood Circulation 4. Glucose Uptake by Liver as a Function of Insulin Concentration . . . . . . . . . . . . . . . . . . 28 5. Glucose Uptake by Liver as Concentration . . . . . . . . . . . . . . . . . . . . 15 . . . . . 26 a Function of Glucose . .. . . . . . . .. . . 28 . . . 29 and Blood Circulation . . 6. Insulin Compartments 7. FLOWNOD Gut Absorption Assumption During OGTT . . . 33 8. FLOWMOD Pancreatic Insulin Secretion During OGTT . . 33 9. FLOWMOD Peripheral Plasma Insulin Concentration .. . .. During OGTT . . . . . . . . . . . .. . 34 10. FLOWMOD Peripheral Blood Glucose Concentration During OGTT . . . . . . . . . . . . . . . . . . . 34 11. Simplified System Block Diagram 12. Phase 13. Error Coordinate Transformation of Canonical Second . . . . . . . 43 . . . . . . . .. . . order System 14. Bode Plot of Peripheral Blood Glucose Concentration Response When Driven By Liver Tissue Insulin . . . . . . . . . . . . . . . . . . . . Sinusoid 45 Bode Plot of Peripheral Blood Glucose Concentration Response When Driven By Peripheral Tissue Insulin . . . . .. . . . . . . . . . . . .. . Sinusoid 46 15. . . . . . . . . . . 39 Variable Form for Second Order System . . . . 43 . . . . . . . . . . . . . 51 16. Complete Linearized System 17. Peripheral Plasma Insulin Concentration - Modern . . . . . . . . . 60 Controller Compared to FLOWMOD - ix - 18. Peripheral Blood Glucose Concentration - Modern Controller Compared to FLOWMOD . . . . . . . . . 60 19. Proposed Intelligent Integrator . . . . . . . . . . 63 20. Peripheral Plasma Insulin Concentration Intelligent Integrator . . . . . . . . . . . . . 64 21. Peripheral Blood Glucose Concentration - Intelligent . . . . . . . . . . . . . . . . . . . 65 Integrator 22. Peripheral Plasma Insulin Concentration - Pump Constraints and Intelligent Integrator . . . . . 66 Peripheral Blood Glucose Concentration - Pump Constraints and Intelligent Integrator . . . . . 67 23. 24. Pump Rate with Pump Constraints and Intelligent . . . . . . . . . . . . . . . . . . . 67 Integrator 25. Synthetic Measurement for Discrete-Time 26. Peripheral Plasma Insulin Concentration Measurement Delays of .5, 3, and 5 Minutes Case . . . . . 69 . 70 27. Peripheral Blood Glucose Concentration - Measurement . . . . . . . . . 70 Delays of .5, 3, and 5 Minutes 28. Pump Rate with 3 Minute Measurement Delay 29. Peripheral Plasma Insulin Concentration - Peripheral Infusion . . . . . . . . . . . . . . . . . . . . 72 30. Peripheral Blood Glucose Concentration - Peripheral Infusion . . . . . . . . . . . . . . . . . . . . 73 31. Peripheral Plasma Insulin Concentration - Peripheral Infusion with 3 Minute Measurement Delay . . . . 73 32. Peripheral Infusion . . . . . 71 Blood Glucose Concentration - Peripheral with 3 Minute Measurement Delay . . . . 74 I Chapter 1 INTRODUCTION Steady improvements in the price, size, of digital electronics bring as more and capabilities applications within reach time goes on. Controlling the blood sugar time has in the come. Diabetes is United States associated with of a diabetic is the third leading [281. as atherosclerosis, failure, and gangrene believe that precise significantly improve cause of death The abnormal metabolic processes diabetes heighten the risk complications such a task whose [16,28,37]. degenerative blindness, kidney Hence there is reason to regulation of the of quality blood of glucose life many would diabetics could expect. Conventional treatment injections state of of function of units, blood insulin once the art programmed to the concentration, is a infuse time used for from for severe or twice unit worn varying [36). diabetes consists daily. externally which amounts of to determine use this information [33,35,45). - 1 - current can be as a nonportable continuously withdraw patient insulin infusion rate insulin Substantially larger short term research, and The of the to blood sugar compute an Analytic techniques and control to biological systems as to biological modelling any others. practices have theoretical considerations In the glucose-insulin extensive review theory are as applicable been reconciled of modern realm, of current 'algorithm' for literature incorporates other [111. [241 provides approaches to blood with the control theory Hillman algorithms. Numerous references are No Idiosyncracies of glucose also contained glucose an control herein. control in the than empirical observations of glucose or insulin dynamics, or any consideration of control theory. It is body appears and its determined to be a by trial the differentiating Coefficients and error. the goal of this work will law derived will unit [381 [12,273, each term knowledge be of the obtained A cubic function and are by of the reported as a [7]. glucose regulator. sensor only empirically found blood implantable can measurement. has been of Without any derivative superior algorithm The insulin secretion in a normal function of both glucose concentration derivative. dynamics, derivative observed that to methodically It is envisioned that the ultimately which be be incorporated design a control into an includes a miniaturized 'glucose an insulin reservoir, power supply. -2- pump, controller, and The point starting investigation of of glucose this design and insulin established physiological model [241. is similar consists to others described in particular model may be be used can be it may Insulin dynamics are, ignore possible to be predictive value. of portions nonlinearities glucose - essence of shown to the insulin model is the same these It is assumed realistic enough The A to severities captures which Some of the form as of the highly simplified linear derived the actual dynamics. be of (some of) characterization is made of model. are elucidated. for engineering here. used are A linear in which does not yet appear been addressed, is investigated that the portions of the model those of a acknowledge that glucose However, This possibility, nonlinearities. have the merits While dynamics probability, also nonlinear. purposes connected applied to other models with equal ease. dynamics have many nonlinearities. to have in that it the analytic techniques to argued, All studies of glucose all an The model to be used the literature (2,3,21,42,43,441. an using dynamics of lumped parameter organ representations by circulation be will those the results are obtained by other investigators using experimental methods. After deriving a insulin dynamics, linear model simplified principles of -3 - glucose and control theory are applied One of to design a glucose controller. of the many results of control theory which is exploited is are never differentiated. to be radically that the measurements The derived control law different is shown from empirical been evaluated in computer it into the model in place of A standard oral glucose tolerance algorithms currently in use. The derived controller simulations by the pancreatic substituting beta cell. test was then simulated. as the model's experimental has The pancreas, data. controller performed and Corruption implementational restrictions was in the glucose measurement and finite bandwidth of the compared of the favorably control discrete output that either superior or parts of the hardware suggested is by Delays levels and insulin pump were simulated. the controller controllers designed herein the mathematical model must be Substituting with law then considered. Comparisons with existing closed loop glucose indicate as well modern control as a question. - 4- algorithm method of into is refined. existing answering this Chapter 2 APPLICABLE CONTROL THEORY The function of a control system can be modification of the dynamics of the controlled. have The most productive been in the analysis system is one in which, if a multiplicative factor, factor. be described virtually anything analytically. linear the output of this in plant to be systems. an is A linear changed by the same quality linear about is or results in control theory of linear are vast. differential the The cumulative systems system, the the input is scaled up or down by The implications system can thought of as system byproduct impressively If a equations, can of be found the work large and on mature collection of analytic tools. Non-linear systems, intractable. on the Analyses of those of one applicable to another. The the solution are generally nonlinear systems for which are highly individual -- an analytic solution exists of other hand, nonlinear analysis system are of nonlinear results seldom systems is typically accomplished by application of the first principle to one already solved. of engineering: Nonlinear suitable systems reduce the problem are often dealt linear representation of the - 5 - with by same system. finding a This is the method system, of choice when confronted since the wealth of with a nonlinear experience with linear systems can then be exploited. Control theory and 'modern.' single is divided into two multiple representing Because 'classical' Classical control deals only with single output systems. input camps: and of Modern output control deals systems, and these characteristics, applicable to a much wider with multiple is states controlling internal input capable of modern of a system. control is range of problems. RESULTS OF MODERN CONTROL THEORY 2.1 This section summarizes the results to the of modern theory which are applicable controller. The capabilities of modern control provide a strong to incentive design of represent control the glucose theory will the glucose - insulin dynamics linearly. 2.1.1 Modern Control System Formulation Modern control theory is based on a representation system as a set of equations. the states ordinary linear Each equation defines the of the system. It classical transfer function directly expressed in this represented first-order differential derivative can easily of be shown description of a system form. by - 6 - of the one of that the can be The modern formulation is k2 = a 1 1 X1 = az 1 X 1 + a1 2 X2 + + a 22 X 2 + n = ai1X1 + R1 at) 2 X 2 + . + + ajnX a2 nX + b11 u1 + b21u1 + + birur bzrur + annX + bn 1 ui + b notation as which is compactly expressed in matrix = X AX + BU coefficients , ai vector U, and the control inputs the matrix B contains of A and The coefficients B are contains the the system are the to the determined The characteristic equation is coefficients bii. by the plant. the determinant of (sI-A). where the characteristic equation is an equation in s, Thus the dimension of s is inverse equation can be written either transfer factors function (i.e. time. as are the the roots are system. can be interpreted physically as are the complex plant. characteristic 'poles' rather they For equation than time represent of The roots of - behavior real and negative, damped referred 7 of s). a product natural the to frequencies roots as they When the time constants. constants. - a (i.e. poles of the system, and generality, are characteristic in determining the most significant factor of the roots or as factored into the roots When the The a polynomial in s representation), the characteristic equation are of matrix A the vector X, are a The states of . the 'roots' or 2.1.2 Controllability The control combinations signals of the U states x2 = -clix - c1 U2 =-C21X1 - CZZX. - - cr2X2 - cr1x1 Ur= defined to be linear X via U1 2 are ... - - C1jrX C2 X x - ... which is expressed in matrix form as U = -CX Since U system is as function a of the states X, the description may be rewritten as X = The (A-BC)X characteristic equation (s_-(A-BC)). as defined the The ability controllability of the control characteristic equation of the determined by controllable, positioned the it is A and can arbitrarily then, if all the states used to form control control of the plant. B be now of the determinant the system gains system. C to If shown that the by the choice of the alter system poles C. the may is be Theoretically are known at all times, which defined Controllability is matrices. signals is of will allow they can be arbitrary Quadratic Performance Index 2.1.3 applied and how precisely the states can C can to define successful approach is the the X and states The goal is and Qo. index A well developed technique or optimized. minimized, index which performance the that such C gains Xo A very inputs? a performance controls U from their nominal values find all satisfy of the the variation of a measure to How on the values of the states and constraints is be controlled. simultaneously to chosen be can be much control on how practical limits There are is is to define the quadratic performance index t2 T T J = LX [ + 12][X] [U ]RHUI dt ti 2 and nominal 2 Lo. state Ko, with deviations associated penalties R are and from the be symmetric R must and positive definite. This the multiplies integrates the products. performance squares 2 Thus, in a simple case where there the weights (.0 and R identical to minimi-.ing performing formulation, it can be shown that -09- and diagonal), fit. Using this states, and terms index is of the products R, by products are no cross-product this forms performance index a least T = U(t) -R-1B where It S is Typically yields by T S + A S + SA that the work the steady for solving equation SBR-"B S + .0 = 0 - is a function state value gains o-F A, of C. S Many control 2, B, is and desired, have equation. utility program R. which techniques the matrix-Ricatti optimal been In this OPTSYS [231 used. A and the designer's must B are choice be stressed matter of 2 that the by State The the penalty choice of 2 and Typically the control is U=-CX unmeasurable estimated by a state = It strictly a choice is based trial and error performance. (A-BC)X , 10 - on To solve reconstructed, for the is now The plant, U the It is rarely observer. the control - X. measured. are states form postulated predicated vector state estimator or the X their by Estimation of the complete precisely matrices. R is and adjusted by case that all the states can be problem S is determined desired characteristics and optimal availability the plant, and R, and experience, to achieve the 2.1.4 fixed of engineering art. on intuition has the matrix-Ricatti feedback linear Since the --- T S constant developed is defined seen is S(t)X(t) t) '---C = or observer viz. -CX this If A and the initial conditions are known exactly, B and the is never actually This perfectly. error observer errors, the predict will observer of measurements Z which can be made as of combinations linear matrix measurement the correct The are devised. plant are described according states the To possible. signals feedback states unmeasureable a to M: Z = MX The identical measurements and is measurements X = The error is fed back - observability) is chosen to and estimated observer X - and X = (A-KM)X parallel to the controllability to and the the error zero dynamics the error dependent on A and M, force the estimated states ^ L X controllability of the actual dynamics A In a development states and to the between the actual states error X = be the (A-BC)X + K(Z-Z) shown to have the plant, between difference the states: of the observer MX = Z are made observer states the plant states converge to form U=-CX. - 1 1 - (termed gains K can plant rapidly. Thus to the plant are available the between the the observer states arbitrarily the of the states, and all optimal control A successful sufficiently A is too observer accurate. large the It depends on can be shown - plant A and B being that if the error in observer system can become unstable. 2.1.5 Kalman Filter When the plant states with noise, it the observer feedback or measurements because it contains noise, Kalman filter The gains to minimize (noisy) chosen plant states. characteristics Estimating matter 2.1.6 of the on the was to states i.e. A and the drive and of whose determined by measurement the part of the the of the problem was states and are to be regulated states which plant noise the the noise. is often a designer. C via the quadratic on deviations To solve observer Coordinate Transformation The derivation of values; an which -is the expected variance of characteristics judgement was based is The choice of K is of the Error contaminated is no longer possible to arbitrarily amplify also amplified. K are are this problem, nominal values and new states from their formulated such that controls to zero. nominal the goal Often the about nonzero values. the states are are nominally zero. B change, performance index During transformed to new the transformation terms which reflect are added. - 12 - the original 2.1.7 Integral Control/Intelligent Integrator A number of factors converge to zero. plant or measurements, One solution to the states. cause the error states never These include unknown disturbances estimated setpoints are can and in the incompatible of in the incorrectly error coordinate transformation. this problem is to integrals or to the define important It can easily be demonstrated of interest will be driven to nero new (error states which transformed) that the error with the use states of integral control. A pitfall of error can get digestion integral. long integral control 'wound up.' of glucose) The error enough for A large produces is that the disturbance a large must swing in the its integral to go to integrated (such as the error - time opposite direction zero. When the integral reaches zero the system may have enough momentum to carry it through another cycle. Figure 1 illustrates this phenomenon. To prevent integrator windup, limits the buildup of the technique which integral. 'throws away' when the integral exceeds some scheme is Figure - 13 2 illustrates a additional error a threshold value. - chosen which state input At t=a, Y(t) has returned to zero, but in order for the integral to also return to zero, Y(t) must go negative long enough for the integral to reach zero. / Y (t) B2 i If the B B trajectoiy is taken, when the I integral reaches zero, Y(t) may have enough momentum to carry it through another cycle. s. \ Y (t) a MW t=a Figure 2.1.8 The An Example equation considered. be Its denoted as X, of of 1: Integrator Windup the Modern Control motion of a single position, velocity, V, and A, Formulation 14 - be and acceleration will respectively. - particle will The equation of + error integral error state Intelligent Integrator Figure 2: and external forces as a function of the position, velocity, general In the F. case, A = kX + bV formulation) motion equation of is +F/m a set as (the equations differential linear the be expressed equation can This of the particle the acceleration an expression for motion is of first modern order control as X =V A = kX + bV V + F/m which, in matrix notation is X 0 1 It I 0 X +F L k LV Note that are differentiations is structured and the are such is positio successive by obtained V derivative the second the equation of motion b When performed. that highest the - 15 - 1/m obtained directly from n and first derivative integrations. No the set of equations order derivative is solved for directly obtained by variable and integration, the Classical Control Formulation Positional control All the expressed of the formulation is with the the as a Subset of modern classical control control input is are called ohase of the Modern control control input can formulation. a linear be From combination states. only the position X is included in F. proportional control. proportional plus a new state I is defined such integral of X), to order derivatives is achieved via the variations section 2.1.2, If lower form. 2.1.8.1 F. all derivative order other physical control I can be form proportional Higher X and If both that I=X included plus is integrals or derivatives, states of the system included. - '16 - V are result is included, implemented. (i.e. in the integral, the I If is the control signal or PID or control. functions of could also be Chapter 3 THE PROBLEM OF DIABETES 3.1 GLUCOSE - INSULIN PHYSIOLOGY Virtually all are powered physiological mechanisms by the triphosphate (ATP) energy part by exothermic breakdown into adenosine required to reconstitute requiring energy of diphosphate ATP adenosine (ADP). The from ADP is provided in oxidizing the monosaccharides glucose, fructose, and galactose. These sugars are the principal product digestion. Usually most of the Further, the liver rapidly converts that glucose sugar is essentially the of carbohydrate absorbed is glucose. galactose to glucose, so only monosacharide in the blood stream [20). The to molecular weight of the monosacharides is permit diffusion across actively transported. transport. rate the cell membrane; In the absence of insulin transport rate can be increased to across the they must be The hormone insulin facilitates is approximately one quarter of at elevated too great the glucose transport its normal value. cell membrane is bidirectional 17 - The four or five times normal concentrations of insulin. - this Glucose transport [20]. When a cell has assimilated converts the excess to When the cell has converts excess glycogen and tissue, glucose into for example, tissue types their liver plays between a major of glucose and also elevated levels the the normal it amount of Nervous glycogen or store no glycogen. fat very Many to meet regulation of blood presence of elevated levels liver takes up large amounts glycogen and fat. glucose to fatty the blood. The liver acids, In which released into the mechanism for raising are the presence of the hormone glucagon, glycogen is converted back to glucose and is glucose. storage capability In the transported to fat tissue by it meals. converts it to converts excess can, tissue. tissue can role in the and insulin maximum no but virtually glucose concentration. of both glucose The In contrast, fat needs it as possible, the type of have insufficient metabolic The fat. has virtually of fat, as a stored form of as much glycogen fat depends on amounts much glucose glycogen, stored storage capability. large as the rapidly blood. blood of This glucose concentration when it falls too low. 3.2 DIABETES MELLITUS The glucose the organ which secretes concentration is islets of the hormones the pancreas. Langerhans respectively, as functions secrete of - The - a and glucagon blood glucose 18 which and regulate S cells in insulin, concentration. diabetes mellitus The insufficient insulin in the blood. The resulting in urine output dump some of (diabetes.) the excess and of osmotic differential a corresponding increase Simultaneously, into glucose an levels. is an excessive concentration dehydration of the cells causes elevated glucose response to The primary result of this glucose characterized by syndrome is the kidneys the urine (mellitus.) 1201. The dehydration effect. The body's Because Depleted protein oxidation the it makes effectively, tissues is the first ill inability to utilize glucose results in alterations in glucose processes. on the stress body and intermediate metabolic is unable to utilize increased use of lipids stores results in a general sugar and proteins. weakness and susceptibility to other problems. Increased acids lipid and acidosis. can result in coma complications processes. including and renal are Their metabolism leads (Acidosis and death caused formation stresses the entire [281.) In by primary to these forms tissue keto- body tnd the long abnormal are of term, metabolic changes, atherosclerosis, an increased risk of heart attack peripheral vascular disease, retinopathy, failure. - 19 - blindness, and 3.3 TREATMENT Some diabetics with partial B cell function subnormal insulin response to glucose) are their however diabetes with diet and require injections of insulin once the injections contain an acting insulin, exercise, (i.e. a able to control many others or twice a day. Although optimized mix of fast- and the resultant glucose control is slow- still very poor. Because so many people control is a big, DNA Many They insulin range from delivery have insulin delivery also used in Existing closed-loop of pellets based The clinical settings 20 - on most BIOSTATOR, controllers are large - are insulin pump, systems been designed. a variety systems being 113] to [3,37] to 1361. mentioned in the literature is the been Human insulin would subcutaneous sophisticated programmable pumps sensors the insulin currently used for simple systems based 'on an external Closed-loop have made [40]. open-loop developed. being pursued. technology presumably be better than porcine its Several different human insulin possible. daily injections diabetes, control are currently in recombinant manufacture of by competitive business. approaches to diabetes Advances are affected glucose frequently [30] which has (33,35,451. external units. A significant advance would that they could explored The be to miniaturize be implanted. This area the devices is also so being [29,381. most exotic culture diabetics and potentially human 4 cells [401. Many in vitro obstacles before this idea reaches fruition. - 21 - effective and idea is transplant them must still be to into overcome Chapter 4 GLUCOSE/INSULIN MODELLING a vehicle for understanding the goes Usually the bloodstream if all the phenomena being Modelling dispersed. uniformly it will model is good, behavior of the system under of the considerations perform experiments on expensive, or be able to is that the model which would do to impossible in simulations might cast doubt on the model knowledge will about the it is physiology) or real in 22 - time for [9,19). predict the One possible to be dangerous, Such life. (i.e. the state of suggest experiments provide insights which might not otherwise be - the injection to a variety of conditions. a good model values of in studied have biological systems have been considered in detail If the injection homogenized than the time required for the constants longer be instantaneously being as restrictions, an intravenous example, For judgement. of relevant to the purpose the and approximations can be modelled a matter reasonable embodies model to serve. is model system. is model into the assumptions, knowledge the the greater the value of the model as incorporated into it, What better The system. about that knowledge to describe system is of modelling a the goals One of which gained. 4.1 EXISTING GLUCOSE AND INSULIN Much of insulin what has dynamics' observations confirm or of value A much to been more a hypothesis the system. those who of models because the is models of are of parts designed knowledge investigators and to and however, has a body proposed insulin are not of design the vivo. design models. composed of in data so obtained, [5,211 to than on and experimental in vitro or rather glucose pancreatic goal The glucose than based actually group models approximations no and pancreas Proposed circulation 'modelling of are investigative smaller mathematical called liver refute understanding of are has of the Such experiments been DYNAMICS MODELS dynamics. interest here pancreas. of Insulin lumped connected parameter by circulation [21,24,431. Models lowest so the glucose dynamics exist are descriptions little models models of understanding of the there equations are [21,24,42,431 which dynamics this Next are There level is that organ-level models into describing organs [8]. and connect the organs system. 23 at At the molecular-level organs - levels. interactions. ability. the entire (usually nonlinear) Finally of molecular have no predictive which lump at three - the circulation with the models circulatory 4.2 THE FLOWMOD MODEL The study glucose - model of was written formulated by in the Systems Dynamics where Foster Group at MIT. [21). Hillman [241 as In more conventional Simulation) [15). at Since simulated a set of with it form the the DYSYS at the differential to the point recapitulated by equations. behavior of facility by West the model has (DYnamic Computer equation the by differential Joint at reasonably well has been (nonlinear) originally DYNAMO refined this SYstem Facility [461 at MIT and Sorensen form. Physical Derivation the model independent the which is body 'spaces'; spaces are divided is imagined to insulin space and into a number of with rules creates glucose Each compartment the body. is compartments transfer for how the compartment The 3 the glucose and compartment - 2L4 - The in the same the consumes or to define the describe the and insulin spaces. an idealination Each 6 two each of between first task is Figures compartmentalization of glucose space. affecting or insulin. compartmentalization. consist of compartments, interconnected with other compartments and rules part of was It has been further refined 4.2.1 space, then developed the JCF in In language It used in It was experimental data Guyton been [181. system dynamics it reproduced this insulin dynamics of a real is assumed organ or to be a continuously stirred tank reactor, i.e. is not reasonable approximation. strictly true, For example, as being but is instantly dispersed through the In fact, required for this to occur. in the model are phenomena being affect the rules, each a definite amouat of time As long as shorter investigated, the than time constants of the of compartments in or bodily dynamics. constituitive should not the model is relationships subsystem Parts affects of the relationships are describing glucose body lumped determined by on of results experiments The the flow between them. glucose Thus the tissue, compartments In the heart, diffuses between liver, glucose concentrations and the venous as BLOOD compartment flow-rate are in units body of the are based investigative mentioned previously. various BLOOD kidneys, large similar together into The constituitive relationships how and/or with same compartment. the is time constants such assumptions or constituitive organ insulin compartment into accuracy of the model. The number the This an intravenous injection of insulin is modelled which it is injected. assumed a homogeneous. mixing connected by periphery, the blood liver, and and kidney compartments of their respective blood mixes, changes. The equations and of inverse are time. - 25 - the and tissues. change the blood supplies, glucose in coefficients of tissue blood transport the HEART both the equations A <<-2 BLOOD HEADiT B HEAD TISSUE 2-> H VENOUS CIRCULATION HEART BLOOD HEART TISSUE C F IARTERIAL I LIVER CIRCULATION <--2 L KIDNEY I > PERIPHERAL <--9 P" BLOOD <-2 P TISSUE Figure 4.2.1.1 those Compartments compartment represents most part of the its tissue brain. concentration. The HEART cells (RBCs). Though the TISSUE also consume constitui'iVe - 26 - For correspond glucose of glucose BLOOD compartment HEART RBCs supply tissue absorbs independent cardiovascular system. rate. Circulation the nervous system. and blood Nerve constant rate, essentially blood and Blood Glucose Space The HEAD the Glucose 3: or at glucose relations at to a insulin represents corresponds to the the red a constant ±or these of the compartments are constants are different. transmembrane equilibration time glucose Peripheral PERIPHERY. (the derivative peripheral uptake in the functions of level derivative of partial a is the of means the Further, the to function with respect the That product system the the peripheral glucose of the is nonlinear. relationship constituitive in states two and insulin. equation) differential on depends uptake of glucose relative concentrations together under lumped body tissues are The remainder of masses and the tissue form, same insulin concentration is also nonlinear. The constituitive kidneys' until the At this point dump glucose the kidneys the to amount by also negligible excretion is glucose concentration exceeds proportional rate glucose kidneys' The nonlinear. is relationship threshold value. a urine into the which the at a glucose concentration exceeds the threshold. The liver's chapter, introduced when the and fat stores. uptake off A saturation liver has glucose uptake. The concentration on insulin concentrations, insulin concentration zero. shown in-figures full glycogen in the saturates for high level to the preceding in The most significant nonlinearity is of insulin when the elucidated have several nonlinearities. also nonlinearity is effect as 'functions, The uptake 4 and 5 from its functions used in (from Guyton - drops 27 - (211). and cuts basal FLOWMOD are x2. - e 05 4,, 0 c1 LUc NL x2 x4 x3 x5 x6 x7 A G. < 40 mg % X 8 X 9 X 10 Insulin in liver space Figure 4: by Liver Glucose Uptake Concentration as a Function of Insulin x2 C') 4 -- ; Ln xl 0 U NL x2 x3 x4 Glucose in liver space Figure 5: Glucose Uptake Concentration by Liver - 28 - as x5 a Function of Glucose I p --- > LYtVEART DY TLASZ!A HEART TISSUE LIVER PLASMA H < <-2 L LIVER < TISSUE KIDNEY PLASMA KIDNEY TISSUE <-K -< PERIPHERAL PLASMA <-P TISSUE Figure 4.2.1.2 The 6: Insulin Compartments and Blood Insulin Space relations for constituitive diffuse between the blood tissue assumed to and interstitial fluid at a rate concentration. Thus the insulin of insulin in degraded in all proportional rate a at concentrations insulin is Further, compartments compartments in Insulin is dependent only on the relative compartments. the all insulin space are identical in form. the Circulation dynamics are to the its completely linear. As in insulin glucose space, between the the BLOOD various - tissue 29 - compartments transport compartments. The insulin concentration in the are those used compartments dynamics, tissue, to in determine glucose nerve tissue so the HEAD liver, kidneys, glucose space. In of periphery uptake terms is indistinguishable compartments and glucose in of those insulin from peripheral space are lumped into PERIPHERY in insulin space. 4.2.1.3 The Pancreatic .8 Cell The pancreatic R cell is to insulin space. and The secretes insulin 6). 0 FLOWMOD for nonexistent. postulated, A of the /3 pertinent mechanism and its senses glucose concentration (2(L) cell is the in Figure cell are The one experimental describing parameters closely approximated vein differential equations. workings which glucose space relationships for the /3 set of highly nonlinear internal cell into the portal The constituitive of the the coupling from the /3 'tuned' until its the performance of an a model part of data is cell was performance actual pancreas (21,221. 4.2.2 Most Validation/Predictive physiological Value models are difficult to validate. Often there is so little experimental data available is all used to help construct the cannot be used to then model verify correctly. - 30 - [9]. that the The that it same data model works constants The transmembrane blood time equilibration FLOWMOD model volumes, for glucose constants of these laboratory numerous were have sorts incorporated 4.2.2.1 into FLOWMOD of the derivation of insulin producing model are value of the the control system to be designed. intolerance is OGTT is procedure used to containing 100 the sugar stresses are taken glucose at 15 or pancreatic part of the (i.e. with for comparison with test twelve then subject grams the for tolerance test by an eight to The overnight. Therefore Using FLOWMOD the oral glucose preceded assumed to have no is will be used only Sample Results The most common weak point in The unmodified FLOWNOD FLOWMOD 4.2.3 cell) the this analysis. the , and FLOWMOD 13 Cell function in of no concern. in [24]. the pancreas validity and predictive obtained researchers, by other the 4 cell model is Fortunately, FLOWMOD. by the liver. experimentally experiments Irrelevance The been the effect and insulin concentration on glucose absorption Data with and tissue insulin degradation time constants, uptake, of concerned are thesis is which this of the the parts in drinks of glucose. minute a water This large intervals and insulin concentration. - 31 - (OGTT). hour fast, The usually solution ingestion of Blood samples glucoregulatory system. 30 carbohydrate and analyzed for control system by which the will be the basis The OGTT and clinical data, designed herein is compared to FLOWMOD, existing glucose regulators. an intravenous glucose FLOWMOD originally simulated only function of time is known because it is controlled a by the tolerance simulate an oral glucose To experimenter. input as glucose case, the intravenous In infusion. test with FLOWMOD required modifications in two areas. the digestive system. absorption of effect the gastric of This is due glucose The second was to model hormones on insulin secretion. larger than to an digested glucose is (Insulin response to intravenous the model to was modification first The injection of amount of an identical of hormones secreted by to the effect glucose. the gut These modifications were made by Hillman during digestion.) [24). OGTT, 9, 8, Figures 7, and 10 show a FLOWMOD simulation of compared with a pool of clinical data in the results of the simulation are and modelling of gastric glucagon and Embedded FLOWMOD's assumptions 4 cell dynamics, of alucose, about the gut absorption rate [391. an hormone effect on insulin secretion. Although FLOWMOD does not reproduce clinical OGTT results perfectly, this is thought - to be 32 - more a function of 0; -p. ) r" Z-D ) On 0. UCN ) .1 E-A -,D 50 100 150 200 T IME (MINUT ES) Figure 7: FLOWMOD Absorption Assumption Gut 250 3 00 During OGTT Cuj E-4 II - Ur> U) H .- z 9 qJ' 50 200 150 100 250 300 TIME (MINUTES) Figure 8: FLOWMOD Pancreatic - Insulin 33 Secretion During OGTT 120 MEAN t SEM 100 - z %%T 80 Ln MODEL EXPERIMENTAL (n=145) so0 z 0 U 0 40 2. (L 20r (L 0 -50 f 0 I 50 £00 150 200 250 300 TIME CMINUTES) Figure FLOWMOD Peripheral During OGTT 9: Plasma Insulin Concentration 130 MEAN: SEM L2 z 0 1.20 -MO-MODEL \ £10 ---- - EXPERIMENTAL LI 0 - (n=145) 100 L3 0 0 0 4j 4 wj IU 90 s0 70 w 0r s0 -50 0 50 00 £50 200 250 300 I TIME CMINUTES) Figure 10: FLOWMOD Peripheral Blood Glucose During OGTT - Concentration 34 I imperfect modelling effect of gut than a fundamental absorption and weakness model works well for intravenous response could be gastric gastric hormone of the model, glucose because infusion. altered by changing the the The OGTT gut absorption and hormone assumptions. The model is still of great value insulin dynamics. It can algorithm herein designed be used to BIOSTATOR algorithms). - 35 - for its to compare existing glucose the algorithms and control (e.g. Chapter 5 LINEAR CHARACTERIZATION OF THE MODEL Before launching into a controller design, to have some controlled. idea of In fact, the dynamics of the the system. be exploited. a simplified It dynamics. can never is model realized capture only capture the essence assumptions and ex'ample, the kidney dumping Any chapter glucose and of actual not necessary. It must of the actual dynamics. nonlinearity is insulin the used to be to can simply good enough reasonable simplify of the glucoregulatory control is to representation behavior is are of control this simplified approximations representation glucose this results describes what are believed dynamical the the the but of There representation of the both of that all physiological system, This chapter The goal be impossible plant. a linear With a linear model, all theory can derive for finding prudent plant to a modern control design is without a mathematical description of the strong motivations it is be so that the system. For discarded the if kidney threshold is never reached. glucose - insulin model sites at which glucose has many consumption - 36 - occurs. states and many Hotwever, in a represented as simplified model the dynamics can be - input single system. output concentration controls the site which dominates all others. One of This in FLOWMOD. one is the series Taylor's would be extremely tedious series are table because the nonlinearities necessary to evaluate more than and it might be functions, liver is-that site in ways to linearize a nonlinear common is the most The Taylor's expansion. The one system. There are several different system. insulin there is justified if can be gross simplification 'global' glucose concentration. 'global' This the glucoregulatory The a single operating point. the insulin used to simplify The method This partial fraction expansion. technique can be used when The transfer function can the transfer function is known. as be expressed number a sum the in denominator of fractions, and an numerator 1321. some If of each has a of which term (s-root) in are the numerators those terms can be smaller than others, is a subsystem the much discarded without sacrificing much accuracy. The The glucose goal subsystem of analyzing simplified transfer how much nonlinear it transfer function is not known. is to find a glucose subsystem the function describing it, varies with initial it is). - 37 - conditions and determine (i.e. how The method frequency used to response correspondence in s in the phase shift In in the estimate the a unique function as a polynomial and as an attenuation and time domain. system, The a is the steady a sinusoid of state Bode plot poles and is response to the same frequency a as the phase relative to an analytic tool used zeroes of a linear system by to from the domain transfer function [14,321. In a truly linear linear system, the transfer function is independent of Taking the the initial conditions and driving frequency response amplitudes will reveal A the transfer exists but with a different amplitude and input. time There frequency domain, sinusoidal input is the the glucose subsystem analysis. between a linear input, simplify Bode analysis with many will implicitly it will be poles and zeroes which are very close 5.1 INSULIN DYNAMICS secretion. insulin to insulin This is the space acts control input and the periphery, which are controlled. The first different driving how linear or nonlinear a system is. characterization because The only input amplitude. as space control a is yeild a simplified impossible to resolve to each other. the pancreatic input to the system. filter interposed insulin concentration in where task the is - glucose to characterize 38 insulin - between the the liver and concentration this The is filter. Insulin Insulin Liver Insulin Glucose Glucose Secretion Dynamics Concentration Dynamics Conc. Figure Since linear, the 11: Simplified System Block Diagram insulin dynamics are time invariant, linear analysis eight states, first techniques represented to The control PLASMA compartment, and the as order differential equations, are easily applied. corresponding concentrations. already There the four PLASMA input is applied outputs are are and TISSUE to the LIVER the LIVER TISSUE and PERIPHERAL TISSUE insulin concentrations. After determining equations from the coefficients of the constants in the model, the differential matrices of X = AX + BU have been specified. A matrix analysis utility program is used to examine the system described 5.1.1 by these matrices Controllability First, the examined. The indicating that controllability of the there are the states in the - 39 modes, insulin dynamics. (the state three uncontrollable - is a rank of 5, three uncontrollable system is transformed to canonical form uncoupled), output controllability matrix only has combinations of states, are [1]. modes or When the variables can -be identified, but their physical grasp. However, it is intuitive hence liver tissue the peripheral significance is impossible that the liver is not as be assumed that that state is 5.1.2 Transfer Next, to two outputs characteristic liver in not uncontrollable, it controllable. Functions the transfer functions the Because important as the glucose regulation, and by itself is will plasma and concentrations are controllable. tissue to are equation of relating the control found from the system input X=AX+BU. The has eight negative real roots. This is consiste-nt with intuition, as there are no storage modes. cannot be "energy" stored and parallel problem. dashpot later to a released; mass - system can poles cancellation of of half diffuse. This is a heat transfer A mass - spring - system or Neither system can oscillate. system function. (insulin) it can only dashpot store energy oscillations are possible The "Energy" one Four of a minute and of and later release in such a system. zeroes are given the poles the remaining or less. The in Table poles have time constants fastest time to two minutes, may so these faster poles remaining three 2. - 40 - A each transfer on the of the 1. occurs in physiological interest is assumed to be The residues it; poles constant order of of one be disregarded. are shown in Table TABLE 1 Insulin Subsystem Poles System Poles Location Time (s) The smaller Zeroes LIVER Constant of TISSUE -12.18 -11.67 -3.784 -2.533 -1.876 -. 4453 -. 07689 .08 min. .264 .395 .53 2.25 13.0 min. min. min. min. min. -. 03371 29.7 min. residues of the and Zeroes Zeroes of PERIPHERAL TISSUE -11.67 -3.469 -2.045 -11.67 -8.75 -2.469 -. 5609 -. 08117 -. 10 -. 04041 pole at s=-.07689 than those of the other partial fraction expansion are poles. are significantly These terms in the also discarded. TABLE 2 Insulin Subsystem Partial Pole Fraction Numerators Residue of Residue of LIVER -. 4453 -. 07689 -. 03371 The now simplified contains only PERIPHERY .004646 .00009395 .0003107 -. 3046 -. 08929 .3775 representation of two poles. measuring insulin disappearance show has the Laboratory that the the form of two decaying exponentials - 41 - insulin [17]. subsystem experiments disappearance To check the accuracy of impulse response of and compared approximations, the complete insulin model to the response predicted transfer functions. is shown in Table these The simplified 3 in factored the is measured by the simplified characteristic equation (values of the roots) form. TABLE 3 Insulin Dynamics Transfer Functions LIVER S + .0595 (s+.4453)(s+.03771) Predicted by Simplified Model: Estimated from Impulse Response of Complete Model: Both poles reflect the The values in the The influence obtained of all from the the s + 2.385 (s+.5)(s+.05) than predicted, poles impulse which may which were response ignored. will be used following chapter. system is in the further term liver. reduced system. The by amd assuming all Thus the discarding glucose the uptake the eighth order insulin system has been simplified to a second order, output, s + 2.165 (s+.4453)(s+.03771) s + .0866 (s+.5)(s+.05) are slightly faster peripheral uptake occurs PERIPHERY accuracy - 42 o± - single input, these assumptions single and the performance in section 5.2.1 5.1.3 and in the following chapter. Error Coordinate Transformation The insulin subsystem can be form directly from the below of the second order system are examined system the expressed in phase transfer function. can be expressed in and controllable. The Note this form it variable that when is observable states must then be transformed to error coordinates. = X1 -a X2 is the 0 1 -b X1 + 0 U ;Y canonical representation of Y = U = 2 a X1 X 2 X 2. the transfer function as + z s2 + bs + a Figure 12: Phase Variable Form for Second Order System 1- Xi aa2 S + -aa X, as + -a X2 I: U : Figure -b+aa X2 Io -a + U ZB Basal Insulin L iver Tissue Insulin Concentration Secretion Rate 13: Error Coordinate Transformation of Canonical Second Order System - 43 - GLUCOSE DYNAMICS 5.2 Many of the of FLOWNOD use nonlinear dynamics. Because table the a linear can still be the model functions glucose analytic determination of poles However, in the glucose equations differential dynamics and :eroes characterization of attempted. Advantage has predictive good to is the nonlinear, is not possible. glucose ability the describe are taken of section subsystem the fact to that the do physiologically impossible. 5.2.1 All Frequency Response Analysis parts of the disabled. In model except terms of figure examining the right hand box exist. The glucose as the this 11 if glucose space are to corresponds the left hand box didn't space is driven with Bode tissue insulin concentration inputs. sinusoidal plots liver are made of each time domain transfer function. The severity of variation in the amplitude and relating the nonlinearities will be Bode diagram as initial conditions. peripheral blood liver tissue shown in figures insulin, 14 and a and peripheral observed. 414 transfer - by driving functions the control inputs, tissue insulin Nonlinearities 15. - function of The glucose to indicated are are indeed 10 -~~- 114 -~z~ - --- - 7 -- - - - t Z - ---- .1 N,1 I; 1 11 ._- -a . .. - ..... 4. ..... -, 4 ' .--- -4 - + ---- -- -t--+ ----..-.---. .0/ ~I47~ (Ae 0 0I - - - -- ~ ____ - ~1 I - --6- - ---- tAVE -- -- ,--.--A -- - ~ * - - - -- r 41 -z8r - -30 -2e IZiZ7IZi7iZZ~~ P#9Sf/9A4LE - / ii 660606) .(nt Figure 14: a). (A)~.OI (4>): 1. Bode Plot of Peripheral Blood Glucose Concentration Response When Driven By Liver Tissue Insulin Sinusoid - 45 - Cuqo, L2 /i NI ------ IF IT -------------- -77 -:- -~ -I ! N ~\TL.2 2~\.~ r..u:\.:mY A- 1A - ~-- - A 7-7 \Wx /NJ = ID~7AbP~/ .. . . \ 0/ 7:t .... .... - ....- ... .-. ,- ...- ~ t..ff - -li .I:! /SD -94 FL-.-r- -3w ic. &7 ,I / Figure 15: Bode Plot of Peripheral Blood Glucose Concentration Respons.E When Priven By Sinusaid Tissue Insulin - 46 - Peripheral Valuable information may be obtained nonetheless. First, it is noted that for control the two shape. Further, function is function. the the ten have inputs Thus of the transfer functions substantially magnitude times that from the Bode plots of the the transfer peripheral transfer peripheral insulin characterization was justified. Bode plots three poles and no zeroes. of how complex the This contribution in indicate the presence of is a significant indication simplified glucose Because there are only three poles, subsystem must the important to 'more linear' One two. than of the system.) example liver can store This is given poles are than the other or "energy" complex. storage mode. later return The poles - The spring could be real it to - the dashpot or complex It is guessed that the complex. phase portion additional be real glucose and is function. significantly slower amount of damping. From the plot it is The transfer represents an It transfer function is parallel to the mass above. depending on the liver two poles could The other liver that the the peripheral poles is glycogen in the (The note be. simplified glucose subsystem can be represented with only three states. also same liver discarding the Most importantly, the the poles of with seen that these poles the indicates plot time - constants 47 - of are overdamped. that there are less one than minute. that these poles Note simulation. are fast enough that they they In any event, of the could be artifacts can be ignored. Whether the three poles are real and complex, or all real will be investigated in the next chapter. 5.2.2 Impulse Response The impulse response to check the control of the glucose subsystem theory that shows of the transformation from time domain to frequency domain) impulse a response of Thus by applying transfer'function. insulin, identically system is linear (i.e. transform Laplace the Linear plot. Bode predictions made from the taken was an impulse the of liver the transfer function of the glucose subsystem can be obtained. Identifying the than for the proved to be more difficult This was glucose subsystem impulse response of the because -the real pole insulin subsystem. is easily identified when plotted on semi-log paper, but the decaying sinewave is best plotted on linear the When paper. two signals are superimposed, neither plotting technique is suitable. The method used was to guess on estimates made from the Bode search on the coefficients of the an analytic function based plot and perform a gradient function to find the response. fit to the measured impulse - 48 - Higher best order terms, amplitudes an order of magnitude less have been discarded. compared in Table 4. one minute, less than time constants of which either had or than the dominant ones predicted The validity of are fitted roots and The these assumptions is investigated in the following chapter. 4 TABLE Simplified Glucose Dynamics Complex Poles Real Pole Predicted .002 .707 .707 Estimated from .00534 .953 .1692 Impulse Response 1 (s+.00534)((s+.1613)2+.051z) Transfer Function from Impulse Response magnitude The strength space. of the of The -coupling term to insulin space from coupling indicates response the impulse r is the glucose be .1 from the applied to both the estimated to impulse response. 5.3 SUMMARY Linear analysis glucose and techniques have The eighth insulin subsystems. a more tractable dynamics have been reduced to representation. The assumption - been 49 - that the order insulin second order peripheral contribution to glucose uptake was negligible in to the the liver was supported by analysis of comparison the glucose dynamics. Frequency response demonstrated However that analysis of the glucose the dynamics the nonlinearities are well an engineering Figure glucose are nonlinear. enough behaved 16 depicts left hand corner of A the insulin and glucose is The upper the insulin subsystem and the glucose subsystem. subsystems each are isolated r. term secretion rate. glucose respectively. I dynamics into one matrix equation. right hand corner contains the and that for approximation they can be ignored. descriptions assembled coupling subsystem from The control and Go are the concentrations in the Numerical values are - 50 - The for other except input is basal U, two the the insulin (nominal) insulin liver given lower and periphery, in Appendix A. I1 z 61 dz 3a X c II 012 c01 0 0 -r 0 0 0 = 0 0 0 0 -a 0 0 1 0 -b 0 0 0 I1 + G3 -c + X A b1 b oU 0 0 0 0 -1 + 0 I0 0 0 + 0 0 -a G0 B U + error coordinate terms States: Liver Tissue Insulin Mass I1 12 Linear combination of I1 and its first derivative G1 Peripheral Blood Glucose Concentration First Derivative of G 1 G2 G3 Second Derivative of G 1 Figure 16: Complete - 51 Linearized - System Chapter 6 OBSERVER DESIGN blood glucose concentration, In the body, only one state, the states The rest of is measurable. the simplified of model must be reconstructed, in order to be able to form the Because the noise characteristics for the feedback U = -Ct. be designed. free) observer will 6.1 PARAMETER READJUSTMENT USING chapter the In the previous OPEN LOOP OBSERVER parameters of the simplified The ultimate insulin and glucose subsystems were estimated. is how well these parameters test of the plant conditions of should observer Chapter from Recall observer. (noise a deterministic glucose sensor are unknown, pump and -track and observer the if initial the are identical, without perfectly plant the criterion will be used This feedback correction. that 2 in the they perform any to make final adjustments to the parameters. The observer must simplified reconstruct Two system. all those of insulin and peripheral blood glucose, The performance with respect of five states, states of liver two states. -'4 tissue also exist in FLOWMOD. the open-loop observer can to these the The control be evaluated input, the pancreatic also is insulin secretion. the accessible in model. Insulin States 6.1.1 control performance FLOWMOD and of the are index is of the square equal input phase to minimize then adjusted is discovered This response to given in been may have not because only z, a, detected the first 70 minutes in The 5. The from table previously the impulse of the were plotted. TABLE 5 Insulin Subsystem Final Parameter Settings a = b = z = a UO I .025 .8 .07 = = = 1.76 21.9 4.7 1,76(s+,04) (s+.768)(s+.0325) Transfer function - 53 - 12) index. table than in and /3 (figure (s=-.03771 more important be b. the performance subsystem insulin a, A the tissue insulin variable form the parameters are slowest pole of the thought. liver The parameters insulin subsystem in integral of the to be the error between the observer. final values of 1) defined output. pancreatic FLOWMOD's to and (in error coordinates) initial conditions equal to zero the setting the b.y insulin observer is tested The open loop response 6.1.2 Glucose States To test the glucose parameters, closed-loop until t=40. minutes. time during the peaked and its approximately insulin During c, zero. the and remaining the observer 260 minutes index is the r of and to minimize the nonlinearity subsystem. F was concentration to be the below concentration is basal concentration increases. instead of different --- it downward. The observer runs open- the square the parameters figure in on one fasting or the 16) the b, are glucose of two was level below is glucose two a, index. and r insulin glucose 'negative concentration of or glucagon effectively values values above basal, subsystem parameter slowest, accurately, zero. upward represent the of the two hormones. The final glucose 6. its The effectivities set to concentration Glucagon forces are absorption, Physiologically, when the falls insulin' are admitted insulin value. derivatives (see to take allowed depending on whether below its nominal performance had has the integral of subsystem the glucose run concentration glucose gains is approximately the second the glucose concentration estimate; One fairly and observer is glucose At t=40. The performance adjusted table This which first secretion, loop. of OGTT at the but values are most significant the other - 54 two poles - pole were shown in was estimated real instead of complex. One of them (s=-.2554) location of the complex poles a = b = c = Subsystem 6 Final 1.888 X 10-4 .03 .37 the estimated (s=-.1613). TABLE Glucose was near Parameter Values r(insulin) F(glucagon) = = .0302 .00695 1 (s+.00686)(s+.0108)(s+.2554) OBSERVER IMPLEMENTATION 6.2 When all the parameters determined, of the the observer gains can the observer error is described X = From figure system A matrix have been be chosen. Recall that by (A-KM)X 16 it is seen that if the measurement is the glucose concentration, the measurement matrix M is = 0 0 1 0 0 Because the system many zero is only fifth order and the determinant entries, evaluated analytically. The of + coefficients a 3 s 3 + azs 2 + a 1 s' - 55 - and M have (sI-(A-_K1)) of the equation assS + a 4s 4 A + ao is resulting are functions 13, 12, those of Ks, of the parameters and Ks. stability equations The Butterworth of the in five is a pole observer unknowns, observer gains for gains The coefficients a fifth order Butterworth pattern the insulin and the unknown There which may are shown in states are weak coupling glucose space via F. To check The the insulin gains are be table are solved 7. now Note insulin vary Further, five that this hypothesis, to The for the K's. Physically, this be maximizes the orders of magnitude between found verifying the hypothesis. with w=10. pattern which than those of the glucose states. represent are selected to pattern [34). gains KI, greater should space r is and varied. inversely the glucose the with F, gains are OGTT and be independent of r. -ound to TABLE 7 Observer Gains K1-= K2 The observer examining become and very the is -943011. 950273. tested reconstructed negative oscillate wildly as by for several 56G - 31.1907 486.763 4655.57 simulating states. soon as - = = = 13 K' Ks the an The insulin states gut absorption begins, minutes before dying away. The insulin glucose oscillations induce states. large The performance oscillations of the in the observer is totally unacceptable. The explanation may be Insulin causes negative makes glucose gut absorption begins, Because unknown to the insulin the it as through how are Therefore they should correction term. to insulin corresponding the insulin states The reconstructed those of independent of very conclude that obtained again by reasoning rapidly to the poles When the very negative. accurate without feedback. not respond rise. can only has become system works. observer concentration Therefore glucose concentration rises observer, solution is reasonably the to fall. the gut absorption is a state disturbance concentration The by physiological reasoning. glucose concentration insulin rapidly. found the the glucose states, Because the states are they can be adjusted. In the final observer are moved by scaling determined factor of five orders of implementation, K1 and 10". the ten times gut absorption than during the The observer the estimated now states down When the magnitude observation is still K2 are in during reduced by the insulin the onset of the OGTT simulation. the well enough to signal. 57 error empirically rest of used - insulin poles by an gains greater reconstructs can be the - states form the optimal that control Chapter 7 RESULTS 7.1 CONTROLLER Designing the design a DESIGN good observer process. If reconstruct the states be operating with Once the designed and by R. choosing Only concentration, the values insulin of the square of the method). The system is controller and controller figures trial and 17 concentration in the same as in the then matrices penalized. set value simulated with the and R adjusted 2 glucose are are is to (a the common artificial to actually desired values. are 18. so rate maximum desired values of 2 FLOWMOD and error to controller penalty R elements gains C are given and unable concentration, and * the the infusion inverse The control of insulin of those the maximum is controller will never been designed, values achieve observer has Initial the the part of information. the and the most critical accurately, the correct observer is in table 8. compared The penalties that the modern FLOWMOD in an OGTT simulation have been maximum controller simulation. - 58 - The modern adjusted by peripheral is The in insulin approximately the control gains and performance R. selection is a matter concentration-time insulin the modern the with hypoglycemic undershoot in the and there is no controller, lower is integral that in strongly and judgement. of the designer's differ results The .0 Their R. changes in 0 and results will vary with The of designer's choice are determined by the concentration. glucose 8 TABLE Controller Gains State (from figure Gain 16) -10.612 37 .091 15. 319 96.41 Insulin Conc. I1 Liver G1 Periph Glucose Conc. Gz First Derivative of G1 183.9 G 3 Second Derivative of G 1 below its basal control gains neither For this reason, (nominal) level. gains are are used; determined by r(insulin) only the calculated nor used for r(glucagon). three elements Only and R of . have There are 13 other elements which can obtain different results. investigating the C. has been made P efficiently - 1471. 59 time be varied to could - on be spent the five a methodology for 16 parameters on effect of all Progress choosing 2 and Much manipulated been here. gains hardly goes that the insulin concentration noted It is Light: Modern controller FLOWNOD Dark: 0 __ _ Or, __ _ zc____ I F. 5b 1'o 1'50 TIME Figure 17: 2bo 250 300 (MIN) Peripheral Plasma Insulin Concentration Controller Compared to FLOWIMOD Modern Light: Modern Cqntroller FLOWMOD Dark: C: z C (n Cj -4 -LD CIO 0.0 50 150 100 TIME Figure 18: (MIN) 200 250 Peripheral Blood Glucose Concentration Controller Compared to FLOWMOD - 60 - 3300 Modern 7.1.1 Comparison to Empirical Existing empirical Algorithms algorithms consider only concentration and its first derivative the power states 8 of the modern control are it is heavily weighted derivatives not the state Part of formulation is that all glucose in the signal. acceleration of the glucose concentration are From table is the control law. the most Although two used, they are obtained by differentiation. The insulin empirical which states, are This is probably absence of hypoglycemic the a significant factor in the undershoot in the modern controller. derivative were known because Insulin concentration and its insulin in unavailable heavily as the glucose algorithms, are weighted as concentration. the glucose (velocity). incorporated into the control seen that the infusion rate was known, and the dynamics of insulin diffusion and degradation were incorporated into the simplified model. INTELLIGENT INTEGRATOR 7.2 In some simulations not concentration insulin setpoint were setpoints which are DESIGN shown here, setpoint chosen incorrectly. depend on many factors, weight and individuals and as sex. Thus a particular - 61 and In liver the tissue insulin secretion the real 'world the the most significant of they will vary among subject's weight changes. - The result of the setpoint errors in glucose concentration. state, the integral of the defined to drive integral to As the is a steady explained in Chapter 2, glucose error state, steady state error to not grow, state error the glucose a new must be zero. For the error state must go to zero. The intelligent integrator described in usable here. Further, In the enough to offset them. in the it always integrated the entire glucoregulatory system, the large enough, are errors There if the setpoint intearal may never build up are glucose error state which During ignored. are normal for OGTT, an also large perturbations 40 mg./dl. For these figure much 19. and ought to the example, concentration rises from 80 mg./dl. zero to 2 is not In that design the integral could never exceed a certain value. error. Chapter to 120 mg./dl. be glucose (Or from in error coordinates). reasons, an alternate This -design allows the as necessary, but ignores design is integral large to proposed in build up as transients in the glucose error state. When the control system, the gains for glucose acceleration the gain gains are recalculated for on the smaller than the the glucose, double integral glucose from their state gain. - glucose 62 is The - an a six state velocity, previous order optimal of values and and magnitude control does not Error Signal Output to Controller Gain Integrator Signal Limiter Saturation Threshold Figure 'know' about integral by 19: the letting the what are two The the It parameters intelligent threshold, is integral existing controller. integrator it build up controller's integral control, provided by Intelligent controller desired state, of the integrated value of parameters: is the selected by 63 added to onto the adjust the There the saturation The never - undershoots that there will be magnitude of the related to the directly overshoot. - without integrated value. integrator. the good controller. recognized (hypoglycemia) is desirable but it is undershoot first place. is integrator the minimizes the 'correction term,' without the with can be a which independent undershoot hypoglycemia in the is would be integrator state, it performance and the gain on the glucose Integrator the intelligent integrator; never Because Proposed Thus saturation the degree threshold of of 4 the integrator. determined Based by trial on trial The the the and error and gain intelligent are both integrator is compared concentration anticipated, but is by set integrator to 1 and the The controller performance to the the integrator and with FLOWMOD in glucose state 4 control gains unchanged. with the integrated and error. saturation threshold other gain on controller without figures undershoots less than its 20 and 21. basal The level FLOWMOD's does 4 as 4 'normal' pancreas. 4 Light: Modern + Integrator di akW dd UIL ll- tA fC, 1 DL FILOWMOD ____hark: Cj F U z 0c-_ _ _ _ _ _ _ _ _ _ _ _ _ z Nz_ 53 a. 150 100 TIME Figure 20: 200 250 MIN) 300 4 Peripheral Plasma Insulin Concentration Intelligent Integrator 4 - 614 - 4 Light: Modern + Ihtegrator Medium:Modern Controller F:OWMOD !Dark: -j D. M 0._ _ _ _ _ __ _ _ _ _ M LJ U- _ _ U-) :D 5b e. 10o TIME Figure 7.3 21: the 300 Two redesigned. of the Simulations hardware constraints include will implementation the - LIMITATIONS SIMULATION hardware. whether 250 200 (MIN) Peripheral Blood Glucose Concentration Intelligent Integrator HARDWARE Any 150 control or of types hardware imposed can algorithm indicate need to limitations practical by be are considered here. 7.3.1 Insulin Pump Ruantization An actual nor insulin pump is neither The instantly adjustable. discrete output rates which small time be an intervals. may frequency of is pump only be of 2/min. - 65 - assumed changed to have at finitely were estimated to 20mu/min and an infusion Typical parameters infusion rate step size rate change continuously variable and pump quantization are Simulations with the integrator shown in figures 22, identical to plots indistinguishable that the (i.e. constrained pump are so nearly pump constraints that the The results 24. simulations without are indicates 23, and when be can less expensive) This superimposed. even more without severely compromising performance. 0) -J C 0 iuu .r' rigure 7.3.2 The 22: TIME (MIN) i2uu 250 Peripheral Plasma Insulin Concentration Constraints and Intelligent Integrator 30 Pump Glucose Measurement Delays other, the glucose hardware limitation is that more significant measurements are - not continuous 66 - and are delayed. - LO.I- t V __ C:) U) V U-) -i -j 0. Figure _______ _______ _______ 0. 0 5b 23: 100 T I ME 250 2b0 150 (MI.N) 300 Peripheral Blood Glucose Concentration Constraints and Intelligent Integrator Pump 0 Cu 0- U'L0 _ _ _ ICD __ _ _ _ _ _ _ __ Figure Ua 24: 1OU TIME 150 (MIN) 200 Pump Rate with Pump Constraints Integrator - 67 - _ _ i ____ U. U _ _ _ _____ 250 300 and Intelligent That is, every time period A 1 t a measurement is taken. measurement is not available until The results of control theory throughout this work are for measurement systems. powerful in theory the in its outside the have continuous-time, discrete-time domain as domain. is been used theory is as continuous-time control theory Discrete-time However, thesis. later. continuous- is a crude estimate indication of how well the can be made to get an controller stressed that the methods to be used It is not the correct which Discrete-time control scope of this might work. A2 t some time That approach to the problem, as are is apparent from the results they yield. The goal case 'look of this estimate like' problem to a The measurements. Figure measurement. It From is delayed must again correct. 25 this by figure it approximately Continuous-time is - that this introduced. 68 - the is a discrete-time the synthetic seen that the d,t-aet- controllers are from measurement two illustrates be stressed unstable when time delays last the reduce accomplished by measurement synthetic between the discrete-time (i.e This is 'continuous-time' interpolation the case the continuous-time discrete-time measurement. measurement to make one already solved). synthesizing linear is technique is typically not become * o Measurement taken Measurement available If the synthetic 0-~ measurement is the sample and 'A' hold signal 'A' the measurement is too choppy for ---- the continuous time 'B', a observer. linear interpolation of the previous two measurements, is much smoother. In 'B', the synthetic measurement is approx'B' imately the signal, delayed by Alt + A 2 t. --- Figure 25: The Synthetic pump rate reason Discrete-Time Case is observed to become gut absorption onset this Measurement for as the time the pump rate is t a unstable during the delay is increased. limited between For zero and 350mu./min. in the simulations. Simulations of seconds, and 3 minutes, and 5 minutes 27. It can concentration increases. will minutes. with time control of deteriorate as part suboptimal of The glucose the the controller the pump output when the - poorer 30 be better glucose delay control performance. output remained at 350mu/min instead of 69 the measurement measurements control would - delays of are compared in figures 26 be expected that However, attributable to 28 shows portal delivery is Figure are delayed 3 if the pump oscillating. 0 Light: Medium: O.\_Dar: ! Minute delay Minute delay .5 Minute delay -J N. U ote: A1 t = A2t = .5, 3, 5 mih. z 0 z LO z U) U. DL Figure 26: 0 1 U U I 300 Peripheral Plasma Insulin Concentration Measurement Delays of .5, 3, and 5 Minutes Minute Delay Light: Medium:!3 Minute delay DMk:1 Minu3te- Malay C) Note: A LO : = . 5, z 2 l 2)U (MIN) TIME 3, A2 t 5 min. W- U Li U CD0 ,0. Figure so 27: 1 30 150 TIME (MIN) 200 2Z,7 Peripheral Blood Glucose Concentr ation Measurement Delays of .5, 3, and 5 Minutes - 7vf - 3300 0 t-- C. Cr1 I~ 0~ -L(n CL Fi.gu C)1' Figure 28: 7.4 100 50 TIME DELIVERY controllers portal into the whereas be recognized the changes equilibrium. occurs insulin A in the that greater percentage peripheral tissue be an long not In the dynamics acceptable linear model, can change term delivery when the - infusion 71 - regulation of glucose when insulin is is of infused infusion may technique numerator site glucose hence and that peripheral only the was insulin infusion equilibrium It is believed pancreas comparison. peripheral peripherally. the Peripheral infusion vein. simulated with the modern controller for It must BIOSTATOR [301) (e.g. vein, insulin into a peripheral secretes 300 Measurement Delay Pump Rate with 3 Minute Existing closed-loop _ 250 (MIN) PERIPHERAL VERSUS PORTAL infuse t 200 150 [2,3]. the insulin changed. The two parameters adjusted in the numerator of for peripheral observer technique In Chapter 5 modes than when it is problems is infusion with was determined when the portal. insulin Thus the same (figures 29, 30) the glucose control was the controller becare unstable. the glucose are measurements nearly as When the glucose measurement insulin when peripheral was simulated with peripheral was delayed, results is fewer infusion. portal infusion. show the are of instability good as with 32 open-loop there possibility with peripheral greater that infusion the When the modern controller infusion transfer function are described previously. it controllable the is infused delazyed three Figures 31 and and peripherally minutes. C0 mr Light: Peripheral ';Infusion Portal Ifso 0IarLk: -J CD _ _ _ __ _ _ _ _ _ _ __ _ _ _ _ _ _ CD U) Z: I 50 100 Figure 29: 200 150 Peripheral Plasma Insulin Peripheral Infusion - 250 Soo (M N T I ME 7 '4 Concentration I - - I C bight: Peripheral Infusion -CZ Dark: I o _ Po tal Infusion __ _ _ _ -LJ 0. Figure 50 30: 100 TIME 150 250 - I300 (MIN) Peripheral Blood Glucose Peripheral Infusion Light: C) 200 tL r Concentration Peripheral 'Inf us ion 3 Minute dE lay rjhtrAL Infs-in no delay C) zhIn a. u Figure 53 31: 130 TIME 150 (MIN) 200 250 300 Peripheral Plasma Insulin Concentration Peripheral Infusion with 3 Minute Measurement Delay - 73 - C ru 1 ight: Peripheral Infusion 3 Minute d lay )ark: pe ripherallInfusion nc delay [0 n L. V7 C rl0Fg. n 32 TIME (MIN) 25 - 30 Peripheral Blood Glucose Concentration Peripheral Infusion with 3 Minute Measurement Delay Figure 32: 7.4.1 2u IOU .3L Comparison with Other Results Results of the reported in in these [10). tests BIOSTATOR controlled subjects are OGTT on concentration reached The maximum glucose is- 160mg/dl. With the modern controller, peripheral infusion, and measurements delayed three minutes, the maximum 30). is (see figure 135mg/dl This is the same maximum concentration as with portal and a three minute infusion It might the glucose concentration appear that BIOSTATOR's verified, simulated the modern (empirical) however, measurement until delay. controller algorithm. the on the same dynamic model. 74 - BIOSTATOR outperforms This cannot be algorithm is Hillman's results also (241 of simulated measurement indicate that sometimes the - 75 - delays controller is unstable. 8 Chapter CONCLUSIONS 8.1 SUMMARY Analytic techniques simplified derive a linear The insulin dynamics. intractable current sucessfully glucose all the a linear to not be made model tools of modern control algorithms, empirical to glucose and found dynamics were Having applied of characterization nonlinear. possible to exploit Unlike have been measurements it theory. were never differentiated. modern control The state estimator, solution controller, and The modern control formulation unavailable to empirical and its derivative simplified model, factor information, concentration not provided state Insulin obtained well as were in the including and its control exhibit hypoglycemic with empirical algorithms. concentration from glucose law. information time derivative, information directly Glucose acceleration was found acceleration. important as intelligent integrator. algorithms. were a of designing consisted velocity undershoot common and to be the most With about the the better insulin controller did in nature and Steady glucose state errors error-integral state. to not exhibit 'windup' and the law. control The to be Adding hypoglycemic undershoot, controllable by were eliminated integrator was adjustable the but the through the addition of undershoot of designed independent of integrator choice a introduced was the entirely integrator parameters. The in effect an of hardware of implementation investigated. much smaller constraints which would an artificial /3 be imposed cell were Insulin pump limitations were found effect on performance than glucose to have a measurement delays. When connected to the body at the controller provided glucose regulation Glucose control was unchanged portally glucose connected instability. This discrete-time system being is nature's. infusion site were remained controller peripherally hoc when the measurement delays connected as good as the was vein. changed to a peripheral When portal vein, controller suspected to be controller 77 exhibited the - the but the signs of stable result of the ad design rather inherently uncontrollable. - simulated, than of the FUTURE WORK 8.2 has This thesis theory of control complex nonlinear biological biological system. of design the then and a of the analysis in system demonstrated the application a regulator for that It is really only a proof of concept --- an even larger amount of analytic work is necessary before a is work further areas where the Some of the art artificial organ can be realized. state described are required of below. Discrete-Time Kalman Filter 8.2.1 A was filter Kalman charateristics of the sensor, because designed not actuator, the and plant noise were not known nor could they be guessed at. It by good was only observer worked at and delayed, properly, fortune that all when the measurements infusion may The disappear when to operate (observer) with instabilities associated a discrete-time time were sampled, For the controller manipulated. a discrete-time Kalman filter designed. the continuous must be peripheral controller is used. 8.2.2 Model Enhancement/Verification Simulations with the artifical peripheral portal vein were infusion. almost This itentical differee. - controller connected to a 78 - to simulations strongly from of clinical with results [10). PIOSTATOR closed-loop peripheral Either evaluate the first BIOSTATOR algorithm other needed to of FLOWMOD is experiments Two possibility. suggested to resolve the represent or a mistake was the field, in depth investigation An not are simulate the possibilities: and implement in FLOWMOD; the law derived here is control the superior to algorithms in use in made. does FLOWIMOD circulatory dynamics well, using control the modern control law in the BIOSTATOR. 8.2.3 Only Experimentation with Controller Parameters out five of parameters were modified in the parameters on the penalty eighteen this study. and still possible. Much experimentation with the parameters is demonstrated. and is required to determine how measurement delays were of both of More investigation effects of all The performance are unknown. controller's Modelling of pump limitations integrator pump much these variables discretization and measurement delay is tolerable. 8.2.4 This, Partial B Cell Function and other work no . cell function. B cell function control. but artificial B cells have on There are still many diabetics do not To properly address the amount of partial /3 cell function - 79 - have who have adequate possibility of is the assumed some glucose an unknown domain of adaptive field. still developing Fault Tolerance 8.2.5 - have will - organ artificial truly pancreas artificial implanted the meet to the life or well-being of the warn that service will reliability highest require requirements It must be able to patient. there is be required well before And it a catastrophic failure. seldom an It must not fail in any way which would endanger criteria. of itself a [26]), (for example, see taken in adaptive control A approaches which can be There are many different control. access surgical must be considered robust enough to must be These maintenance. for risk in the design of each aspect of the implantable unit. approach to reliability that Fault-tolerant design is an enables the system components have failed faults tolerate objective. to continue functioning There system is the and (failures), are many fault-tolerant system 8.3 -- after some of its designed still considerations carry so it can out its in designing a linear analytic [251. CONCLUSION This thesis techniques has and modern demonstrated control that theory can be applied to I nonlinear results which natural glucose contained herein will will further advance and dynamics. and insulin artifical glucose - provoke additional state the regulation. 81 - Hopefully the research of knowledge about Appendix A COMPUTER PROGRAMS This appendix used in this the All study. modified FLOWMOD For details DYSYS. A.1 contains the computer programs except is a one are subroutine which on this interface, see is were programs; called by 1 15]. SIMULATION DATA DEFINITIONS The first program is used to write all the the standalone which constants data file definition of a data which FLOWMOD uses. into the the /PCOM/ program which writes the named common common block file FLOWMOD block containing then reads /PCOM/. is given after The the data file. - 82 - 4 A.1.1 C C C C C C C C C C C C C C /PCOM/ Database Generator PURPOSE --THIS PROGRAM CREATES THE FIRST GENERATION OF PARAMETER FILES NOTES --THE BASELINE PARAMETER CONSTANTS ARE DECLARED IN DATA ALL THE PARAMETERS ARE STATEMENTS CONTAINED HEREIN. DECLARED TO BE IN THE NAMED COMMON /PCOM/. THE ARRAY PCOM IS E2UIVALENCED TO THE FIRST ELEMENT OF /PCOM/; THE ARRAY IS WHAT IS WRITTEN OUT TO THE FILE AND READ IN BY FLOWMOD. INCLUDE C C C C C C C C C C C C 'PCOM.FOR' LOCAL VARIABLE DECLARATIONS --LOGICAL*1 FILMAM(40) BASELINE PARAMETER VALUE DECLARATIONS --INPUT FOR SIMULATION CONSTANTS: DATA BFHDBVHD,BFL,TVLBFK,TVK/.72 5,.2,1.45,2.,1.16, 1 .6/ DATA BFP,BVP,GTETH,BFH,BVH,FVHT/2.465,2.4,1.,5.8,2.2, 13.5/ DATA TBVFVHD,GTETHD,BVK,BVL,FVP/6.,.2,. 2,.4,.8,7./ DATA GTETP,ITETH,PFK,PVK,PFL,PVL/5.,10., .696,.24,.87, 1 .'48/ DATA PFP,PVP,PVH,FVHI,ITETK,FVK/1.479,1. 44,1.44,3.7, 1.2,.2/ DATA FIKTKT,FVL,ITETL,FILTLT,ITETP,FIPTPT/2., .4, .2, 13.75,20.,.0125/ INPUT FOR IVGTT SIMULATION: DATA ISTARTISTOP,IRATE/-3.,0., 11666.67/ INPUT FOR OGTT SIMULATION DATA EOGISF/0.,1.,1.,7.273,5.714,3.636,2.677,2.,1.6, 11.333, 1.143,1., 1./ DATA EOGRHS/0.,0.,1..,1.,1.667,1.429,1.282,1.190,1.124, 11.087, *1.053,1.020,1./ INPUT FOR GLUCOSE DISTRIBUTION SECTOR DATA ILSNF,GLYBTN,GLYBNF,GLNF/4.702756,3.,100., 11846.437/ 545 0./ DATA GLYSN,GNEMTM,GNEOF,GPSNF/100.,3.,60., IPSNF,MAGMTI,MAGUF,pBCU/84.,3.,30.,10./ DATA DATA HUG,CNSU,GLYSTfl/20.,100.,3./ C - 83 C INPUT FOR BETA CELL SECTOR: DATA GMET,IRRF,ISPF,:FTSF/.465025,21 .86756,200000., 144.40491/ DATA DISTM,IRTM,GDC,FGTIrIM/.2,.4,.01,2./ DATA FiTGM,F IMPTl, MRNASNH, RTI N/.5,1.,.05,20./ DATA PISNF,PITIME,IGT!ME,RHSDTM/21.86756,20.,20.,45./ DATA DEGRTM,HSN,RSN/45.,2206.589,116. 1372/ C C NONLINEAR TABLE FUNCT I O - 1so.,0., DATA TB1 /0., 0., I 720.,690., 1 900. ,920./ 1 10. DATA TB2 /0., 0., .2, 50., 1./ 1 ., DATA TB3 /.5, V 6, 0 360.,230., 20.,.8, 3 0., 1., .8 ,.3 ,0., . 540.,460., ,.9, .8 40. ,1., , 1., 11./ DATA TB4 1 /0., 1 .5, 1. , 2., .64, 1., 3. .45, 4 5.,.35, 6., 32, DATA TB5 /20. 4.5, 12.4, 70. 1.2, 1 0 /0., TB6 DATA 5.,2.0/ 1 DATA TB7 /0., 2 .25, 11.4, .5, 1 .00, 1 DATA TBS /0.0 2.8, 10.8, 1 2.3 0.7, DATA TB9 /0.0 0.0, 12.0, 5.0 1 2.0/ DATA TB10/0.0 0.0, 16.0, 1 2.5 7.7, 110.4, 5., 10.8, 1 1 .,1 17 30 9 .,.23, 29, 8. .26, 10 ,4.3, 40., 3 .9, 50., 3.4, 80. ,1.0/ 1. 0, 2., 1.5, 3. 1.75 1 90 .2,2. 2 5, .3, .6, 0.60, 0.5 .7,0. 3 0, 1.0,1 0, .3, 0 3.0 ,0. 1 1.0 1.0, 3.5,0 2.0,1 5/ 4, 1. 0, 3.0 / ,2.0, 4 .1, 2.25, ,.2 60 , .4, 0/ 2.0, 0 .9 3.0,1 .7 5, 4.0, .0, 1.5 .0, 2 0, 3. 5, .5, 4.0 0., 4 5, 5.5 6. .5, 6.5 1.8, 7 0, 60. 40. 70 80 .0, .0, 80. 120 2., 240 28 0. 5.4, 320 5.7, 160., 1., 240. ,1.3, 80. 1 .0, 120. ,1. 280 4., 0.5 0.5, 112.0/ DATA TB11/50. 0.2, DATA TB12/00. 0.0, 1 160.,3., 200 ,4. 1 1 360.,5.9, 400 , 6.0/ 1 DATA TB13/.0.0 1.0, 1 320.,1.6, 400 ,1.8, 1 DATA TB14/O.0 0.0, 1 160.,1.4, 1 200 ,2.2, 1 360.,6.0, 400.,7., 1 DATA TB15/61.0345,0 80. 480 40. ,03.8, ,2 . ,0. 240 I / 440. ,8., 480. 7/ i.206 1,.9, . ,o P, 4 .0/ , 320. ,5., 1, I 9./ 31.3793,1./ I DATA TB16/0.0,0.0, 1 160.,.6, 1 200.,.7, 1 360.,.92, 2 400.,.95, C C C 40.,0.0, 80.,.05, 120.,.43, 240.,.78, 280.,.84, 320.,.89, 440.,.98, 480.,1.0/ START OF EXECUTABLE CODE --- 10 20 30 40 50 60 WRITE(5,10) FORMAT('[CREATE HOW MANY FILES>') READ(5,20) {F FORHAT(14) WRITE(5,30) FORMAT('IENTER FILENAME>') READ(5,40) LENF,FILNAM FORMAT(2,40Al) IF(LENF.E2.0) STOP FILNAM(LENF+1)=0 DO 60 I1=1,NF OPEN(UNIT=1,,HAME=FILEAr,TYPE='NEW',FORM='FORMATTED' CARRIAGECONTROL='LIST') 1 WRITE(1,50) PCOM FORMAT(8F10.3) CLOSE(UNIT=1) END - &5 - A.1.2 C C Named Common Definition PCOM.FOR --PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER /PCOM/ DECLARATIONS !NONLINEAR TABLE FUNCTIONS NT1=6 DIMENSION DECLARATIONS. NT2=6 NT3=6 NT4= 11 NT5=7 NT6=6 NT7=9 NT8=8 NT9=6 NT10=15 NT1 1=4 NT12=1 1 NT13=7 NT14=13 NT15=3 NT16= 13 PSIZE=358 C REAL REAL REAL REAL REAL REAL REAL REAL C C C MAGUFILSNF,IPSNF,MAGMTM,ITETH,ITETK,ITETLITETP MRNASN,MRTIME,IGTIME,IRTM,ILSN,IPSN,IRRF,ISPF EOGISF(NT1 4),EOGRHS(NT14), IFTSF TB5(2, NT5) TB1(2,NT1) ,TB2(2,NT2),TB3( 2 ,NT3 ) ,TB4(2,NT4) TB6(2,NT6) ,TB7(2,NT7),TB8( 2 ,NT8 ) ,TB9(2,NT9) TB11(2,NT1 1) ,TB 12(2,NT 12), TB 13 ( 2 ,NT13) TB10(2,NT1 0),TB14(2,NT14), TB15( 2 ,NT15) TB16(2,NT1 6),PCOM(PSIZE) /PCOM/ DECLARATIONS --COMMON /PCOM/ BFP,BVP,GTETH,BFH,BVH,FVHT,BFHD,BVHD,BFL COMMON /PCOM/ GTETP,ITETH,PF,PVIK,PFL,PVL,TBV,GTETHD COMMON /PCOM/ FIKTT,FVL,ITETL,FILTLT,ITETP,FIPTPT,PFP COMMON /PCOM/ ILSNF,GLYBTM,GLYBNF,GLNF,EOGISF,EOGRHS COMMON /PCOM/ IPSNF,MAGMTM,MAGUF,GLYSN,GNEMTM,GNEOF COMMON /PCOM/ GMET,IRRF,ISPF,IFTSF,HUG,CNSU,GLYSTM COMMON /PCOM/ FMTGM,FMMPM,MRIASN,MRTIME,DISTM,IRTM,GDC COMMON /PCOM/ DEGRTM,HSN.RS13,PISNF,PITIME,IGTIME,FV COMMON /PCOM/ FVP,TVfFV'I.TVL,BFK,FVHD,BV,BVL,PVP COMMON /PCOM/ PVH,RBCU,GPSNF,ITETK,FGTrPM,RHSDTM COMMON /PCOM/ TB1,TB2,TB3,TB4,TB5,TB6,TB7,TBS,TB9 COMMON /PCOM/ TB10,TB11,TB1 2,TB13,TB14,TB15,TB16 EQUIVALENCE (PCOM,BFP) - 86 - A.2 OBSERVER PROGRAM The will observer the program calculates produce a fifth observer poles. order This is observer gains Butterworth pattern done by which the for solving the determinant of A-KM directly. C C C OBSERVER.FOR WRITTEN: C C C C PURPOSE --CALCULATE C C C C C C 11APR81 STARK DRAPER LABORATORY OF COEFFICIENTS BUTTERWORTH POLYNOMIAL AND LOCAL VARIABLE DECLARATIONS --REAL*8 AK(5,5),AINV(5,5),DUMMY(5,5),V(5),DUM2(5,5) SYSTEM FORMULATION: C C E G 0 0 -D F H 0 0 0 0 0 C C C C C C C C C C C 0 0 0 0 0 0 C -D 0 C THE CHARLES THEN FIND K MATRIX TO YEILD BUTTERWORTH POLES IN A-KM C C C C C AT BY KEVIN KOCH REVISED:16APR81 KPK CORRECT A MATRIX! C M = DH 0 0 1 0 -B 0 0 0 1 -C 1 0 0 -A 1 C-P 0 1 C-P R-CP BR CR DATA A/1.888E-4/ DATA B/.03/ DATA C/.37/ DATA D/.0302/ DATA E/-.62857/ DATA F/-3.31020/ DATA G/-.025/ DATA H/-.17143/ NEXT DATA STATEMENTS MEASUREMENT OF + IS: ! K1 ! K2 1 ! ! K3 K4 R ! K5 BUTTERWORTH ARE - 87 - MATRIX (A-KM) IS SET EQUAL TO A2*SS + A1*S + A0 0 0 -P VARIABLES: R=(EH-FG) P=E+H EQUATION B+R-CP CR-BP IS INTERMEDIATE EQUATION + A3*SSS RESULTING MATRIX -DF A MATRIX 0 0 0 0 THE CHARACTERISTIC SSSSS + A4*SSSS THE THE = A4 A3 A2 Al A0 + P +CP +BP +AP -C - R -B -CR -A -BR -AR COEFFICIENTS BEFORE C C C MULTIPLYING BY POWERS OF W DATA AO/1/ DATA A1/3.236068/ DATA A2/5.236068/ DATA A3/5.236068/ DATA A4/3.236068/ START OF EXECUTABLE CODE --DO 10 11=1,5 DO 10 12=1,5 10 AK(I1,I2)=O C C C P=E+H R=E*H-F*G BUILD MATRIX OBTAINED BY TAKING DETERMINANT OF A-KM AND ISOLATING THE EXPRESSIONS FOR EACH POWER OF S. AK(1,3)=1 AK(2,3)=C-P AK(2,4)=1. AK( 3,3)=B+R-C*P AK( 3,4)=C-P AK(3,5)=1. AKC4,1)=-D AK(4,3)=C*R-B*P AK(4,4)=R-C*P AK(4,5)=-P AK(5, 1 )=D*H AK(5,2)=-D*F AK(5,3)=B*R AK(5,4)=C*R AK (5, 5)= R C WRITE(5,20) 20 FORMAT('IENTER READ(5,30) W 30 FORMATCF10.6) C C MAKE OMEGA>') VECTOR WHICH AK*K EQUALS + P -C 2)=A3*W*W R -B +C*P 3)=A2*W*DW*W +B*P -C* R -A 4)=A1*W*W*W* +A*P -B* R 5)=A0*W*W*W*W *W -A*. V( 1)=A4*W V( V( V( V( C CALL MPRINT(AK,5,5,5) CALL MPRINT(V,5,1,5) CALL MATINV1(AKAINV,5,DUMMY,DUMZ,IER) WRITE(5,40) IER 40 FORMAT(' MATINV1 IER=',I5) CALL DMATMUL(AK,AINV,DUMZ,5,5,5) CALL MPRINT(DUM2,5,5,5) CALL DMATMUL(AINV,V,DUMMY,5,5,1) CALL MPRINT(DUMMY,5,1,5) END - P, I A.3 SIMULATION PROGRAM The ±or all investigations described the simulation calculates variables. It is subroutine, A.3.1 C of details see DYSYS of FLOWMOD modified in this derivatives time The thesis. and subroutine by. as a called which integrates the For is a version simulation program auxiliary DYSYS 115], derivatives supplied by the subroutine. the interface between DYSYS and its [15]. Common Block EQSIMDECL.FOR PARAMETER MAX=98 REAL*4 Y(MAX),Y_IHITIAL(MAX),F(MAX),PRNTC(3),PLOTC(3) REAL*4 CONC(3) COMMON TIME,TIME_STEP,Y,F,STARTTIME,FIAL_TIE,NEWDT COMMON IREAD,NSYS,IDUMMY(3),TBREAK,IPLOT_FLAG,TBACK COMMON CONSTANT(30) EQUIVALENCE (DT,TIMESTEP),(STARTTIME,STIME) E2UIVALENCE (FTIME,FINALTIME) A.3.2 Modified FLOWMOD FLOWMOD IS A FLOW LIMITED MODEL OF GLUCOSE - INSULIN C METABOLISM ORIGINALLY DEVELOPED BY JOHN GUYTON AT HARVORD C THE PROGRAM WAS LATER MODIFIED BY ROBERT C MEDICAL SCHOOL. THE PROGRAM AS C HILLMAN AT MIT TO PERMIT OGTT SIMULATION. PROGRAM HILLMAN'S ADAPTATION OF HERE IS AN C IT APPEARS THE NEWEST VERSION TO ACCOMODATE WHICH HAS BEEN UPDATED C ALSO, FACILITY. COMPUTER JOINT AT THE MIT C OF DYSYS PROGRAM CONSTANTS FOR THE SIMULATION HAVE BEEN CHANGED TO C C REFLECT THEIR PHYSIOLOGICAL ORIGIN. C SEPT 1980 JOHN T. SORENSEN C C C ---------C ***** CONSTANT DEFINITIONS ***** C C DEFINIT101N C CONSTANT C BLOOD FLOW THROUGH HEART (LITERS/MINUTE) C BFH BLOOD FLOW THROUGH HEAD (LITERS/MIN) C BFHD - 89 - C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C BFK BFL BFP BVH BVHD BVK BVL BVP CNSU DEGRTM DISTM EOGISF EOGRHS FGTMTM FIKTKT FILTLT FIPTPT FMMPM FMTGM FVHD FVHI FVHT FVK FVL FVP GDC GLNF GLYBNF GLYBTM GLYSN GLYSTM GMET GNEMTM GNEOF GPSNF GTETH GTETHD GTETP- BLOOD FLOW THROUGH KIDNEY (LITERS/MINUTE) BLOOD FLOW THROUGH LIVER (LITERS/MIM) BLOOD FLOW THROUGH PERIPHERY (LITERS/MINUTE) BLOOD VOLUME OF HEART (LITERS) BLOOD VOLUME OF HEAD (LITERS) BLOOD VOLUME OF KIDNEY (LITERS) BLOOD VOLUME OF LIVER (LITERS) BLOOD VOLUME OF PERIPHERY (LITERS) RATE OF CENTRAL NERVOUS SYSTEM UPTAKE OF GLUCOSE (MG/MINUTE) DELAYED EFFECT OF GLUCOSE ON INSULIN RELEASE (MINUTES) RELEASING-HOLDING SITES DISTRIBUTION TIME (MINUTES) EFFECT OF OGTT ON INSULIN TRANSFER EFFECT OF OGTT ON DISTRIBUTION OF RELEASING-HOLDING SITES FRACTION OF GLUCOSE METABOLIZED (FRACTION/MINUTE) FRACTION OF INSULIN IN KIDNEY PLASMA TO KIDNEY TISSUE (FRACTION/MINUTE) FRACTION OF INSULIN I LIVER PLASMA TO LIVER TISSUE (FRACTION/MINUTE) FRACTION OF INSULIN IN PER TISSUE TO PER PLASMA (FRAC/MINUTE) FRACTION OF GLUCOSE METABOLITE METABOLIZED (FRACTION/MIN) FRACTION OF METABOLITE TO GLUCOSE (FRACTION/MINUTE) FLUID VOLUME OF HEAD TISSUE (LITERS) FLUID VOLUME OF HEART AND HEAD TISSUE(LITERS) FLUID VOLUME OF HEART TISSUE (LITERS) FLUID VOLUME OF KIDNEY TISSUE (LITERS) FLUID VOLUME OF LIVER TISSUE (LITERS) FLUID VOLUME OF PERIPHERAL TISSUE (LITERS) GLUCOSE DIFFUSION COEFFICIENT FOR BETA CELL (MG/MG%/MINUTE) FASTING LIVER GLYCOGEN STORE (GRAMS) FASTING RATE OF GLYCOGEN BREAKDOWN (MG/MINUTE) TRANSPORT DELAY IN ACTION OF GLYCOGEN BREAKDOWN (MINUTES) FASTING RATE OF GLYCOGEN SYNTHESIS(MG/MINUTE) TRANSPORT DELAY IN ACTION OF GLYCOGEN SYNTHESIS (MINUTES) FASTING GLUCOSE METABOLITE (MG) TRANSPORT DELAY IN ACTION OF GLUCONEOGENESIS (MINUTES) FASTING RATE OF GLUCONEOGENESIS (MG/MINUTE) FASTING PERIPHERAL GLUCOSE (MG) GLUCOSE TRANSCAPILLwtY EQUILIBRIUM TIME OF HEART (MINUTES) GLUCOSE TRANSCAPILLARY EQUILIBRIUM TIME OF HEAD (MINUTES) GLUCOSE TRANSCAPILLARY EQUILIBRIUM TIME OF - 90 - PERIPHERY (MINUTES) C C HUG RATE OF C HSN C IFTSF FASTING TOTAL HOLDING SITES (MU EQUIVALENTS) INSULIN TRANSFER FAST TO SLOW POOL FASTING ((MU/MINUT E) IGTIME INSULIN IN ILSHF (MINUTES) FASTING LIVER TISSUE INSULIN (MG) FASTING PERIPHERAL TISSUE INSULII c C C C C IPSNF HEART UPTAKE GOLGI OF GLUCOSE COMPLEX TIME (MG/MINUTE) CONSTANT (MU) C C C C IRATE IRRF IRTM IVGTT GLUCOSE INFUSION RATE (MG/MINUTE) FASTING RATE OF INSULIN RELEASE FROM BETA CELL (MU/MINUTE) INSULIN RELEASE TIME CONSTANT (MINUTES) C ISPF FASTING IN SLOW POOL (MU) C ISTART IVGTT STARTING TIME (MINUTES) C ISTOP IVGTT INFUSION STOPPING TIME (MINUTES) C C ITETH INSULIN TRANSCAPILLARY HEART (MINUTES) C C ITETK INSULIN TRANSCAPILLARY EQUILIBRIUM KIDNEY (MINUTES) TIME FOR C C C C ITETL INSULIN TRANSCAPILLARY LIVER (MINUTES) INSULIN TRANSCAPILLARY PERIPHERY (MINUTES) TIME FOR C MAGMTM ITETP C C C C C C C C C C C C C C C C C C INSULIN INFUSION TRANSPORT UPTAKE DELAY EQUILIBRIUM EQUILIBRIUM TIME OF EQUILILIBRIUM IN ACTION TIME FOR OF PERIPHERAL (MINUTES) PITIME PVH PVK PVP RA FASTING RATE OF PERIPHERAL GLUCOSE UPTAKE (MG/MINUTE) FASTING RATE OF MRNA SYNTHESIS (MOLECULES/MINUTE) MRNA TIME CONSTANT (MINUTES) PLASMA FLOW THROUGH KIDNEY (LITERS/MINUTE) PLASMA FLOW THROUGH LIVER (LITERS/MINUTE) PLASMA FLOW THROUGH PERIPHERY (LITERS/MINUTE) FASTING RATE OF PROINSULIN SYNTHESIS (MU/MINUTE) PROINSULIN TIME CONSTANT (MINUTES) PLASMA VOLUME OF HEART AND HEAD (LITERS) PLASMA VOLUME OF KIDNEY (LITERS) PLASMA VOLUME OF PERIPHERY (LITERS) MAXIMUM RATE OF GUT GLUCOSE ABSORPTION RBCU (MG/MINUTE) RATE OF RED BLOOD MAGUF MRNASN MRTIME PFK PFL PFP PISNF C CELL UPTAKE SITE DECAY OF GLUCOSE (MG/MINUTE) TIME C RHSDTM RELEASING-HOLDING C C RSN TBV FASTING TOTAL RELEASING SITES(MU TOTAL BLOOD VOLUME (LITERS) C TEND END C TVK TOTAL VOLUME OF GUT GLUCOSE ABSORPTION OF KIDNEY (MINUTES) EQUIVALENTS) (MINUTES) (LITERS) TOTAL VOLUME OF LIVER (LITERS) C TVL C C------------------------------------------------------------ C C - 91 - C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C INDEX DEFINITIONS: DEFINITION INDEX 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 HEART, LUNG, AND CENTRAL VASCULAR BLOOD GLUCOSE (MG) HEART, LUNG, AND CENTRAL VASCULAR TISSUE GLUCOSE (MG) HEAD BLOOD GLUCOSE (MG) HEAD TISSUE GLUCOSE (MG) KIDNEY BLOOD GLUCOSE (MG) LIVER BLOOD GLUCOSE (MG) PERIPHERAL TISSUE GLUCOSE (MG) PERIPHERAL BLOOD GLUCOSE (MG) LIVER GLYCOGEN (GRAMS) GLUCOSE IN BETA CELL (MG) GLUCOSE METABOLITE (MG) MRNA (MOLECULES) PROINSULIN (MU) INSULIN IN GOLGI COMPLEX (MU) INSULIN IN SLOW POOL (MU) HOLDING SITES EMPTY (MU EQUIVALENTS) HOLDING SITES OCCUPIED (MU) RELEASING SITES EMPTY (MU EQUIVALENTS) RELEASING SITES OCCUPIED (MU) DELAYED EFFECT OF GLUCOSE ON INSULIN RELEASE HEART, LUNG, CENTRAL VASCULAR, AND HEAD PLASMA INSULIN (MU) HEART, LUNG, CENTRAL VASCULAR, AND HEAD TISSUE INSULIN (MU) KIDNEY PLASMA INSULIN (MU) KIDNEY TISSUE INSULIN (MU) LIVER PLASMA INSULIN (MU) LIVER TISSUE INSULIN (MU) PERIPHERAL PLASMA INSULIN (MU) PERIPHERAL TISSUE INSULIN (MU) MEDIATOR OF GLYCOGEN BREAKDOWN MEDIATOR OF GLYCOGEM SYNTHESIS MEDIATOR OF GLUCONEOGENESIS MEDIATOR OF PERIPHERAL GLUCOSE UPTAKE NON-DERIVATIVE 90 89 88 87 86 85 84 83 82 80 VARIABLES OGTT GUT GLUCOSE ABSORPTION RATE (MG/MINUTE) IVGTT GLUCOSE INFUSION RATE (MG/MINUTE) RATE OF KIDNEY GLUCOSE EXCRETION (MG/MINUTE) EFFECT OF GLYCOGEN LEVELS ON GLYCOGEN BREAKDOWN EFFECT OF INSULIN ON MEDLGM EFFECT OF ARTERIAL GLUCOSE ON MEDLGM MEDIATOR OF LIVER GLUCOSE METABOLISM <MEDLGM> EFFECT OF MEDLGM CM GLYCOGEN BREAKDOWN MEDIATOR OF GLYCOGEN EREAV"DNWN-BEFORE TRANSPORT DELAY RATE OF GLYCOGEN ERAKDOWN (MG/MINUTE) - 92 - C C 79 C C 78 77 EFFECT OF LIVER GLUCOSE CONC. ON GLYCOGEN SYNTHESIS EFFECT OF MEDLGM ON RATE OF GLYCOGEN SYNTHESIS MEDIATOR OF GLYCOGEN SYNTHESIS-BEFORE TRANSPORT C DELAY C C C C 75 74 73 RATE OF GLYCOGEN SYNTHESIS (MG/MINUTE) EFFECT OF MEDLGM ON GLUCONEOGENESIS MEDIATOR OF GLUCONEOGENESIS-BEFORE TRANSPORT DELAY C 71 RATE C 70 EFFECT OF GLUCOSE ON PERIPHERAL GLUCOSE C C (MG/MINUTE) UPTAKE 69 EFFECT OF INSULIN ON PERIPHERAL GLUCOSE 68 EFFECT OF ARTERIAL GLUCOSE C C OF GLUCONEOGENESIS UPTAKE C GLUCOSE ON PERIPHERAL UPTAKE C 67 MEDIATOR OF PERIPHERAL GLUCOSE UPTAKE-BEFORE C C 65 TRANSPORT DELAY RATE OF PERIPHERAL GLUCOSE UPTAKE (MG/MINUTE) C C C C C C C C C C C 63 62 58 57 56 EFFECT OF GLUCOSE ON MRNA EFFECT OF GLUCOSE ON INSULIN SLOW TO FAST POOL EFFECT OF ARTERIAL GLUCOSE ON INSULIN TRANSFER SLOW TO FAST POOL EFFECT OF GLUCOSE ON INSULIN RELEASE RATE OF INSULIN TRANSFER SLOW TO FAST POOL (MU/MINUTE) SITES EMPTY TO SITES OCCUPIED (MU/MINUTE) SITES HOLDING TO SITES RELEASING (MU/MINUTE) ERROR FOR RELEASING SITES (MU) C 55 SITES HOLDING (MU/MINUTE) C 54 SITES HOLDING TO SITES RELEASING (MU/MINUTE) C C 53 TOTAL PANCREATIC INSULIN (MU/MINUTE) C C C C 50 49 48 HEART, LUNG, CENTRAL VASCULAR BLOOD GLUCOSE CONCENTRATION PERIPHERAL BLOOD GLUCOSE CONCENTRATION(MG/DL) PERIPHERAL TISSUE GLUCOSE CONCENTRATION C 47 KIDNEY C C 46 45 LIVER (BLOOD) GLUCOSE CONCENTRATION HEART, LUNG, CENTRAL VASCULAR, HEAD C C C 44 43 INSULIN CONC. PERIPHERAL PLASMA INSULIN CONCENTRATION(MU/L) KIDNEY PLASMA INSULIN CONCENTRATION (MU/L) 61 60 59 RELEASING TO SITES RELEASE RATE (MG/DL) C (BLOOD) GLUCOSE CONCENTRATION (MG/DL) (MG/DL) PLASMA C 42 LIVER PLASMA INSULIN CONCENTRATION (MU/L) C C----------------------------------------------------------C C GIPORTAL.FOR C EXCERPTED:08DEC80 C C MASSACHUSETTS INSTITUTE OF TECHNOLOGY FROM FLOWMOD.FOR AT THE - 93 - C C C C C C C C C C C C C C C C C C C C C C C C C REVISED:08DEC80 REVISED:15DEC80 REVISED:12APR81 REVISED:28APR81 .REVISED: BY KEVIN KOCH KPK REMOVE MOST COMMENTS (DESCRIPTIONS OF VARIABLES) FOR DEVELOPMENT EASE. KPK READ PARAMETERS FROM FILE RATHER THAN FROM DATA STATEMENTS KPK BASIC FLOWNMOD PLUS OBSERVER KPK ADD MEASUREMENT SAMPLE-AND-HOLD; INSULIN PUMP GRANULARITY KPK ADD INTEGRATOR; FIX PUMP INTERVAL METHOD PURPOSE --SIMULATE GLUCOSE-INSULIN METABOLISM/INTERACTION ADDITIONAL DERIVATIVE VARIABLES --INTEGRAL OF G3 WITH INTEGRATOR LIMITING 10 STATE I 33 12 STATE 34 G1 STATE 35 G2 STATE 36 G3 STATE' 37 CONTROL OUTPUT INTEGRAL FOR PUMP GRANULARITY 38 SYNTHETIC MEASUREMENT 39 START OF FORTRAN STATEMENTS * !DEFINE SUBROUTINE CALLED BY DYSYS SUBROUTINE E2SIM C !DYSYS COMMON INCLUDE 'E2SIMDECL.FOR' !SIMULATION CONSTANTS INCLUDE 'PCOM.FOR' REAL*8 GIAGIB,GIC,GIDP,GIDM,GIAE2,GICEM1,GIDME1 C C LOCAL DECLARATIONS --LOGICAL*l FILNAM(40) REAL IV89TB(2,4),K1,K2,K3,K4,K5 -3.,116 66.67, -. 001,11666.67, DATA IV89TB/-3.001,0., 1 0.0,0./ !INSU LIN VARIABLES IN /.025/ DATA CANIA !PHp.SE VARIABLE CANONICAL /.8/ DATA CANIB !FORM /.07/ DATA CANZ DATA CANALPHA /1.76/ !SETP OINTS FOR:LIV TIS INS /4.7/ DATA SETI26 PER BLO GLU /80./ DATA SET149 RATE SECRETION INS /21.9/ DATA SETI53 C !COEFFICIENTS OF GLUCOSE !SUBSYSTEM REPRESENTATION /1.888E-4/ / .03/ .37/ / / .0302/ / .00695/ DATA DATA DATA DATA DATA GIA GIB GIC GIDP GIDM DATA DATA DATA DATA K1/-9.43/ K2/ 9.502/ K3/31.1907/ C !OBSERVER !OBSERVER K4/486.763/ - 94 - GAINS FROM PROGRAM DATA K5/4655.57/ C DATA DATA DATA DATA DATA DATA C C C C G1 /-12.483/ G2 / 36.727/ G3 / 17.585/ G4 /100.98/ G5 /181.5/ /0/ IPASS !CONTROL GAINS FROM !OPTSYS START OF EXECUTABLE CODE --COMPUTE THE SIMULATION CONSTANTS IF(NEWDT.NE.-J) GO TO 90 !BEGINNING OF S IM IF(IPASS.NE.0) GO TO 20 !FIRST SIM OPEN(UNIT=1,NAME='PCOM.DAT',TYPE='OLD') READ(1,10) PCOM !READ CONSTANTS MADE BY PCOM PGM CLOSE(UNIT=1) 10 FORMAT(8F10.3) GET INITIAL CONDITIONS 20 OPEN(UNIT=1,AME='GISYSTEM.ICS',TYPE='OLD ') READ(1,10) (Y(I1),I1=1,39) CLOSE(UNIT=1) 21=BFHD/BVHD 22=BFL/TVL Q3=BFK/TVK 24=BFP/BVP 25=1./GTETH 26=-BFH/BVH-FVHT/(BVH*GTETH) 27=-BVH/TBV 28=FVHT/(BVH*GTETH) 29=-1./GTETH 210=BFHD/BVH 211=-BFHD/BVHD-FVHD/(BVHD*GTETHD) 212=1 ./GTETHD 913=-BVHD/TBV 214=FVHD/(BVHD*GTETHD) 215=-1. /GTETHD 216=BFK/BVH 217=-BFK/TVK 218=-BVK/TBV 919=BFL/BVH 220=-BFL/TVL 221=-BVL/TBV 222=FVP/(BVP*GTETP) 223=-i./GTETP 224=BFP/BVH 225=-BFP/BVP-FVP/(BVP*GTETP) 226=-BVP/TBV 227=1 ./GTETP 228=1 ./ITETH 229=PFK/PVK 230=PFL/PVL 231=PFP/PVP 232=(-1./PVH)*(PFP+PFL+PFK+FVHI/ITETH) 233=FVHI/(PVH*ITETH) - 95 C C C C C C C 234=-i./ITETH 235=PFK/PVH 236=-PFK/PVK-FVK/ ( PVK*ITET ) Q37=1./ITETK 238=FVK/( PVK*ITETK) 239=-i./ITETK-FIKTKT 240=PFL/PVH 241=-PFL/PVL-FVL/(PVL*ITETL) 242=1./ITETL 243=FVL/(PVL*ITETL) 244=-i./ITETL-FILTLT 245=PFP/PVH 246=-PFP/PVP-FVP/ ( PVP*ITETP) 247= 1 ./ITETP 248=FVP/(PVP*ITETP) 249=-i./ITETP-FIPTPT IVGTT=1 THIS SECTION ONLY EXECUTED FOR OGTT IF(IPASS.NE.0) GO TO 40 !FIRST SIM ADJUST SOME OF THE PANCREAS TABLE FUNCTIONS TO REFLECT THE EFFECT OF GUT ABSORPTION ON INSULIN SECRETION DO 30 I1=1,NT14 TB14(2,I1)=TB14(2,I1)*EOGISF(Ii) 30 TB16(2,I1)=TB16(2,I1)*EOGRHS(Ii) 40 IPASS=1 GET PARAMETERS FOR THIS PARTICULAR SIMULATION WRITE(5,50) 50 FORMATC'[ENTER MEASUREMENT DELAY TIME>') READ(5,60) DELAYTIME 60 FORMATC5F10.4) Y49HOLD=SET149 Y49DELAYED=SETI49 NDELAYINT=DELAYTIME/DT NDELAYCOUNT=0 Y53DELAYED=Y(35) Y(39)=SETI49 WRITE(5,70) 70 FORMAT('[ENTER DT, DH FOR PUMP GRANULARITY>') READ(5,60) PUMPDTPUMPDH NPUMPINT=PUrlTDT/DT+1 NPUMPCOUNT=0 WRITE(5,80) 80 FORMAT('IENTER INTEGRATOR GAIN AND SATURATION LIMIT>') READ(5,60) G6,Y35LIM Y(39)=Y(49) !SET INTEGRATOR BASE TRANSFORM INSULIN SUBSYSTEM COEFFICIENTS FROM CANONICAL FORM TO ERROR COORDINATE FORM CANBETA=SETI26*CANIA/ (CANZSETI53) C11= -CANIA*CANALPHA/CAEZ C12=1 -CAXIB*CAIALPHA/CANZ+CAIIA*(CANALPHA**2)/(CANZ**2) -CANIA Cz1= -CANIB -Cli C22= V. 1=K 1 - 96 - 90 C C K2=K2 CONTINUE FACTOR=1.0 IF(TIME.GT.40.) FACTOR=0.0 !ARTIFACT FROM OPEN-LOOP !OBSERVER TESTS IF (IVGTT.E2.1) GO TO 100 IF (NEWDT.E2.0) GO TO 100 Y(89)=R(TIME,Y(89),IV89TB,4) 100 !COMPUTE IVGTT INPUT CONTINUE c (IVGTT.E2.0) GO TO IF (NEWDT.E2.0) GO TO RA=800. TEND= 240. TO=30. 200 200 IF !COMPUTE OGTT INPUT IF IF IF (TIME.LT.3.) GO TO 110 GO TO 130 (TIME.GE.3..AND.TIME.LE.10.) (TIME.GT.10..AND.TIIME.LE.30.) GO TO 120 IF (TIME.GT.TEND) GO TO 150 Y(90)=RA*(1.-SIH(((TIME-TO)/(TEND-To))*1.5707963) 110 120 130 140 150 160 170 180 190 200 GO TO 140 Y(90)=0. GO TO 140 Y(90)=RA GO TO 140 Y(90)=RA*SIN(((TIME-3.)/(10.-3.))*1.570796) CONTINUE GO TO 200 TO=330. TEND=540. IF (TIME.LT 303.) GO TO 160 IF (TIME.GE 303..AND.TIME.LE.310.) GO TO 180 IF (TIME.GT 310..AND.TIME.LE.330.) GO TO 170 IF (TIME.GT TEND) GO TO 160 Y(90)=RA*(1 -SIN(((TIME-TO)/(TEND- TO))*1.570796)) GO TO 190 Y(90)=0. GO TO 190 Y(90)=RA GO TO 190 Y(90)=RA*SIN(((TIME-30 3.)/(310.-303.))*1.570796) CONTINUE CONTINUE C IF (NEWDT.E2.0) GO TO 210 GKC=Y(5)/6. Y(88)=R(GKC,Y(88),TB1,NT1) Y(87)=R(Y(9),Y(87),TB2,NT2) ILSN=Y(26)/ILSNF Y(86)=R(ILSN,Y(86),TB4,NT4) GLC=Y(1)/22. Y(85)=R(GLC,Y(85),TB5,NT5) Y(84)=Y(86)*Y(85) Y(83)=R(Y(84),Y(83),TB3,NT3) - 97 !COMPUTE GLUCOSE !DISTRIBUTION Y(82)=Y(84)*Y( 83) Y(80)=Y(87)*Y( 29)*GLYBNF GLN=Y( 6 )/GLNF Y(79)=R(GLN,Y( 79),TB6,INT6) Y(78)=R(Y(84), Y(78),TB7,lt'T7) 210 Y(77 )=Y(79)*Y( 78) Y(75)=GLYSN.*Y( 30) Y(74)=R(Y(84), Y(74),TB8,NT8) Y(73)=Y(84)*Y( 74) Y(71)=Y(31)*GN EOF GPSN=Y(7)/GPSN F Y(70)=R(GPSN,Y (70),TB9,NT9) IP SN=Y(28)/IPS NF Y(69)=R(IPSN,Y (69),TB10,NT10) GHC=Y( 1)/22. Y(68)=R(GHC,Y( 68),TB11,NT11) Y(67)=Y(69 )*Y( 68) 7(65)=MAGUF*Y( 70)*Y(32) CONTINUE C F( 1 )=26*Y( 1)+2 5*Y(2)+91*Y(3)+03*7 (5)+92*Y(6)+94*Y(8)+ 127*RBCU+Y(89) F(2)=28*Y(1)+29*Y(2) -HUG F(3)=0210*Y(1)+211*Y( 3)+O12*Y(4)4+013*RBC F(4)=214*7(3)+Q15*Y( 4) -CI{SU F(5)=216*7 (1)+217*Y( 5)+218*RBCU-Y(88) F(6)=219*Y(1)+220*Y( 6)+221*PBCU+Y (80)-Y (75)+Y(71)+Y(90) 1*FACTOR 7)=222*Y(8)+22 3*Y(7)-Y(65) 8)=224*Y(1)+22 5*Y(8)+226*RBCU+2Z7*Y(7) 9 )=0.001*(Y(75 )-Y(80) ) 29)=(Y(82)-Y(2 9))/GLYBTN 30)=(Y(77)-Y(3 0))/GLYSTM 31)=(Y(73)-Y(3 1))/GNENTM 32)=(Y(67)-Y(3 2 )) /rAGHTtl C C C C C C C C C C C C C C C cC BETA CELL SECTOR IF (NEDT.E2.0) GO TO 220 FLOWHOD BETA CELL IS NOT USED; VARIABLES 10-20 AND 53-63 ARE AVAILABLE. GMIETC=80.*Y(11)/GMET Y(63) GMETC, Y( 63) ,TB12 ,NT 12 ) =R( Y(62) GIMETC, Y( 62) ,TB 14 ,NT14 ) =R( Y(61) GHC,Y(61 ) ,TB 15, N T15) =R( GMETC, Y ( 60) ,TB13 ,NT 13) Y(60) y(59) ( 15)*Y(6 2) *Y( 20) *IRRF/ISPF+IFTSF)*Y(61) =R( Y(58) =1. /(Y( 16)+ Y(18) )*Y (59) GMETC, Y ( 57) ,TB 16 ,NT16) Y 57) Y(56) ( 18)+Y( 1 9))-(Y(1 8)+Y(19)+Y(16)+Y(17))*Y (57) Y(55) =( 1 ./(Y( 18) +Y( 19))) *ALIMIT(Y(56),0.,1.E37, IST 1, 1NED T )/DI ST M 'Y(54 )=-(1. / (Y (16 )+Y (17)) L M T Y 56), 1 .E37, 0.,IST2, 1NE11DT )/DIST1 7(53)=Y(19)/IRTM - I I I 98 - 4 C C C Y(53)=Y(53)*FACTOR SET OUTPUT PLUS THE (IN ERROR COORDINATES) TO CONTROL LAW RESULT BASAL SECRETION RATE Y(53)=Y(41)+SETI53 IF(Y(53).LT.0) Y(53)=0 IF(Y(53).GT.300.) Y(53)=300. CONTINUE 220 !CLAMP IT C C C F(10)=GDC*GHC-Y(10)*(GDC*100.+FGTMPM)+FMTGM*Y(11) C F(12)=MRNASN*Y(63)-Y(12)/MRTIME C C F(13)=Y(12)*PISNF-Y(13)/PITLIME C C C C C C C C C F(11)=Y(10)*FGTMlPM-Y(11)*(FrTGM+FMIPM) F(14)=Y(13)/PITIjrE-Y(14)/IGTIME F(15)=Y(14)/IGTIME-(Y(16)+Y(18))*Y(58)+(Y(17)+ 1Y(19))/RHSDTI F(20)=(Y(60)-Y(20))/DEGRTM F(17)=Y(16)*Y(58)+Y(19)*Y(55)-Y(17)*(Y(54)+1./RHSDTM) F(16)=Y(60)*HSI/RHSDTM+Y(18)*Y(55)-Y(16)*(Y(54)+Y(58)+ 11./RHSDTM) F(19)=Y(18)*Y(58)+Y(17)*Y(54)-Y(19)*(Y(55)+1./RHSDTM+ 11./IRTM) F(18)=Y(19)/IRTM+Y(60)*RSN/RHSDTri-Y(18)*(Y(58)+ 11./RHSDTM+Y(55)) +Y(16)3Y(54) C C C C C C C C COMPUTE INSULIN DISTRIBUTION PERIPHERAL .VS. PORTAL DELIVERY PERIPHERAL DETERMINED BY THE INFUSION (THE PERIPHERAL VEIN LEADS DIRECTLY TO THE HEART COMPARTMENT) F (2 1) 22 8*Y(22)+229*Y(23)+230*Y(25)+231*Y(27)+232*Y(21) F (22) 23 3*Y(21)+234*Y(22) F 23) =23 5*Y(21)+236*Y(23)+237*Y(24) F (24) =23 8*Y(23)+239*Y (24) F (25) =24 0*Y(21)+241*Y(25)+242*Y(26)+Y(53)!PORTAL F (26 )=24 3*Y(25)+244*Y(26) F (27) =24 5*Y(21)+246*Y(27)+247*Y(28) F (28) =24 8*Y( 27) +2493:Y(28) C AUXILIARY VALUES C C COMPUTE C GLUCOSE DISTRIBUTION IN MG/DL: IF (NEWDT.E2.0) GO TO 230 Y(50)=Y(1)/22. Y(49)=Y(8)/24. Y(48)=Y(7)/70. Y(47)=Y(5)/6. C IS COMPARTMENT INTO WHICH THE INSULIN IS ADDED. LIVER PLASMA=>PORTAL INFUSION; HEART PLASIA=> Y(46)=Y(6)/20. INSULIN DISTRIBUTION IN MU/L: Y(45)=Y(21)/1.44 Y(44)=Y(27)/1.44 Y(43)=Y(23)/.24 - 99 - Y(42)=Y(25)/.48 C 230 CONTINUE C C C C C C C C C MEASUREMENT DELAY IF(NEWDT.E2.0) GO TO 250 IF(DELAYTIME.GT.0) GO TO 240 Y49DELAYED=Y(49) GO TO 250 240 NDELAYCOUNT=MOD(NDELAYCOUNT+1,NDELAYINT) TIME TO PROPOGATE THE MEASUREMENT IF(NDELAYCOUNT.GT.0) GO TO 250 Y49DELAYED=Y49HOLD Y49HOLD=Y(49) Y35DELAYED=Y35HOLD Y35HOLD=Y(35) DY39=(Y49DELAYED-Y(39))/NDELAYINT FULL ORDER GLUCOSE-INSULIN OBSERVER 250 CONTINUE GID=GIDM !POSITIVE/NEGATIVE GAMMA IF(Y(33).GT.0) GID=GIDP F(33)=C11*Y(33) +C12*Y(34) +CANALPHA*CANBETA*Y(53) 1 +C11*SETI26 F(34)=C21*Y(33) +C22*Y(34) +CANZ*CANBETA*Y(53) 1 +C21*SETI26 F(35)= +Y(36) F(36)= Y( 37) F(37)= -GID*Y(33) -GIA*Y( 35)-GIB*Y(36)-GIC*Y(37) F(37)=F(37)-GIA*SETI49 Y(40)=Y(35)+SETI49 INTEGRATOR Y35=Y(35) !GET GLUCOSE ERROR STATE Y35=AMIN1(Y35, Y35LIM) !SATURATION LIMIT "T"v Y35=AMAX1(Y35,-Y35LIM) F(10)=Y35 !DO THE INTEGRATION MEASUREMENT AND MEASUREMENT E RROR IF(DELAYTIME.EQ.0) Y(39)=Y (49) !IF NO MEAS DELAY IF(NEWDT.EQ.0) GO TO 260 Y(39)=Y(39)+DY39 !SYNTHETIC MEASUREMENT 260 F(33)=F(33)-K1*Z*FACTOR F(34)=F(34)-92*Z*FACTOR F(35)=F(35)-K3*Z*FACTOR F(36)=F(36)-K4*Z*FACTOR F(37)=F(37)-K5*Z*FACTOR CONTROL LAW: IFCNEWDT.EQ.0) RETURN Y41=G1*Y(33)+G2*Y(34)+G3*Y (35)+G4*Y(36)+G5*Y(37) 1+G6*Y(10) IF(PUMPDH.GT.0) GO TO 270 !PUNP CONSTRAINTS Y(41)=Y41 !NO PUMP CcNST; SET ACTUATOR SIGNAL RETURN :NTEGRATE CONTROL ACTION AND WAIT FOR IT TO BE BIG ENOUGH TO TURN THE PUMP ON 270 F(38)=Y41 - 100 IF(NEWDT.E2.0) RETURN NFUMPCOUNT=MOD(NPUMPCOUNT+1 IF(NPUMPCOUNT.GT.0) RETURN ,NPUMPINT) Y( 41)=IFIX(Y(38)/(PUMPDT*PUt1PDH)) !MULTIPLY BY PUMPING INCREMENT Y(41)=Y(41)*PUNPDH !CORRECT CONTROL INTEGRAL Y(38)=Y(38)-Y(41)*PUMPDT RETURN END FUNCTION R(X,Z,TAB,NT) C C C PURPOSE --LINEAR INTERPOLATION FUNCTION C INPUT C C C C, C C C C --- TAB(2,NT)? COORDINATES X C VARIABLE INDEPENDENT VALUE INTERPOLATED SAME OF FUNCTION AS R TAB(2,NT) OF EXECUTABLE CODE START INPUT --- OUTPUT z R REAL C C C (INDEPENDENT,DEPENDENT) OF ORDERED PAIRS --- IF(X.GT.TAB(1,1)) GO TO 10 Z=TAB(2,1) GO TO 50 10 IF(X.GE.TAB(1,NT)) GO TO 30 SCAN FOR X<TAB(1,I1) DO 20 I1=2,NT GO IF(X.LT.TAB(1,I1)) 40 TO 20 CONTINUE 30 Z=TAB(Z,NT) GOTO 50 40 DX=TAB(-1,I1)-TAB(1,Il-1) DY=TAB(2,I1)-TAB(2,Il-1) Z=TAB(2,Il-1)+(DY/DX)*(X-TAB(1,Il-1)) 50 R=Z RETURN END - 101 - REFERENCES 1. ACCESS User's Guide, Joint Computer Facility, MIT, Cambridge. 2. Albisser, A. M., Botz, C. K., Leibel, B. S., "Blood Glucose Regulation Using an Open-Loop Insulin Delivery System in Pancreatomized Dogs Given Glucose Infusions", Diabetologia, Vol. 16, 1979. 3. Albisser, A. M., et alii, "Studies With An Artificial Endocrine Pancreas", Archives of Internal Medicine, Vol. 137, May 1977. 4. Bale, Gurunanjappa S., Entmacher, Paul S., "Estimated Life Expectancy of Diabetics", Diabetes, Vol. 26 No. 5, May 1977. 5. Bergman, R. N., Bucolo, R. J., "Nonlinear Metabolic Dynamics of the Pancreas and Liver", Journal of Dynamic Systems, Measurement, and Control, Sept. 1973. 6. Bergman, Richard N., Refai, Mahmoud El, "Dynamic Studies by Control of Glucose Metabolism: Experiment and Computer Simulation", Annals of Biomedical Engineerinq, Vol. 3, 1975. 7. Botz, Charles K, "An Improved Control Algorithm for an Artificial iS Cell", IEFE Transactions on Biomedical Enctineerinci, Vol. BME-23 No. 3, May, 1976. 8. Carson, E. R., Cramp, Derek G., "A Systems Model of Blood Glucose Control", International Journal of Biomedical Computina, Vol. 7, 1976. 9. Carson, E. R., et al., "Mathematical Modelling of of Metabolic and Endocrine Systems", Institute 1980. July U.1K., Measurement and Control, Guilford, 10. "Development of an H. et alii, Clemens, A. Electrochemical Glucose Analyzer and New Algorithms for a Glucose Controlled Insulin Infusion System (Artificial S Cell)", Proceedings, 9th Congress of Diabetes Federation, Mew Delhi, the International 1976. Excerpta Nedica, Princeton, 1976. 11. Cobelli, Claudio, Romanin-Jacur, Giorgio, "Controllability, Observability and Structural Identifiability of Multi Input and Multi Output Biological Compartmental Systems", IEEE Transactions on Biomedical Engineering, Vol. BME-23 No. 2, Mar. 1976. 12. Colton, Clark K., Giner, Jose, Lerner, Harry, Marincic, Ljiljana, Soeldner, J. S., "Development of an Implantable Electrochemical Glucose Sensor", Vol. Transplantation and Clinical Immunology, Lyon, May 1978. 10, 13. Creque, Halimena M., Langer, Robert, Folkman, Judah, "One Month of Sustained Release of Insulin from a Polymer Implant", Diabetes, Vol. 29, Jan. 1980. 14. Dorf, Richard C., Modern Control Systems, Wesley, Reading, 1976. 15. DYSYS User's Guide, Cambridge, 1979. 16. Eschwege, et alii, "Delayed Progression of Diabetic A Retinopathy by Divided Insulin Administration: Further Follow Up", Diabetologia, Vol. 16, 1979. 17. Finkelstein, Stanley M, et Glucose Joint Computer Homeostasis", Biomedical Engineering, 1975. Facility, MIT, "In alii, IEEE Addison- Vivo Modelling Transactions Vol. BME-22 No. for on 1, Jan. 18. Foster, Richard 0., "The Dynamics of Blood Sugar Regulation", MS Thesis, MIT, Cambridge, July 1970. 19. Gann, Donald S., "On the Description of Physiological -Epistemological Considerations", Annals of Systems: 3, 1975. Biomedical Engineering, Vol. 20. Textbook of Medical Guyton, Arthur C., Saunders, Philadelphia, 1976. 21. "A Mathematical Model of Immediate Guyton, John R., Glucose Homeostasis", HMS Thesis, Harvard Medical School, Boston, 1973. 22. "A Model of Glucose - Insulin Guyton, John R., et al., Homeostasis in Man that Incorporates the Heterogeneous Fast Pool Theory of Pancreatic Insulin Response", Diabetes, Vol. 27 No. 10., Oct. 1978. 23. Hedrick, J. Karl, "A Guide User's Cambridge. - B2 - Physiology, to CPTSYS III", MIT, 24. Hillman, Robert S., "The -Dynamics and Control of Glucose Metabolism", MS Thesis, MIT, Cambridge, 1976. Dec. "Fault Tolerant System Design: Print", Computer, Vol. 13 No. 25. Hopkins, Albert L. Jr., Broad Brush and Fine 3, Mar. 1990 26. "Optimization Strategies in Adaptive Jarvis, R. A., Control: A Selective Survey", IEEE Transactions on 1, Systems, Man, and Cybernetics, Vol. SMC-5 No. Jan. 1975. 27. Marinicic, Ljiljana, Soeldner, J. Stuart, Colton, Clark K., Giner, Jose, Morris, Scott, "Electrochemical Glucose Oxidation on a Platinized Platinum Electrode in Krebs-Ringer Solution", Journal of the Electrochemical Society, Vol. 126 No. 1, Jan. 1579. 28. The Medical Clinics of North America, Vol. Jul. 1978, Saunders, Philadelphia. 29. "Biomedical Implantable Meindl, James D., Microelectronics", Science, Vol. 210, Oct. 62 No. 4, 1980. 30. BIOSTATOR Glucose Controller Insulin Infusion System, Miles Laboratories, Elkhart, In., USA. 31. Narenda, Kumpati S., Kudva, Prabhakar, "Stable Adaptive Schemes for System Identification and Control", IEEE Transactions on Systems, ran, and Cybernetics, Vol. 6, Nov. 1974. SMC-4 No. 32. Ogata, Katsuhiko, Modern Control Engineering, PrenticeHall, Englewood Cliffs, 1970. 33. Pfeiffer, E. F., Thum, C., Clemens, A. H., "The Artifical P, Cell - A Continuous Control of Blood Sugar by External Regulation of Insulin Infusion (Glucose Controlled Insulin Infusion System)", Hormone Metabolism Research, 1974. 34. Schultz, Donald G., Melsa, James L., State Functions and Linear Control Svstems, McGraw-Hill, New York, 1967. 35. Schwartz, S. S., et alii, "Use of a Glucose Controlled Insulin Infusion System (Artificial 4 Cell) to Control Diabetes During Surgery", Diabetologia, Vol. 16, 1979. 36. rammed Insulin Spencer, W. J., "A Revieu of Pr Delivery Syetems", :3TE Transactions on Biomedical 1981. 3, Nar. Vol. B:E-28 No. EngineerinT, - ",3 - 37. "Modified Hospital Pumps for Spencer, W. J., et alii, Delivery", Medical Progress Throuah Pulsed Insulin Technology, Vol. 7, 1980. 38. al., "Diabetes Mellitus; A et Soeldner, J. S., An Implantable Glucose Bioengineering Approach -Sensor", Diabetes Mellitus, HEW Publication #76-854, 1976. 39. Soeldner, J. S., personal communication - unpublished clinical results of Oral Glucose Tolerance Test on 145 adult males and females, Joslin Diabetes Center, Boston, 1981. 40. New Advances May Throw Sun, Marjorie, "Insulin Wars: Market Into Turbulence", Science, Vol. 210 No. 12, 1980. Dec. 41. Tepperman, Jay, Metabolic and Endocrine Physiology, Year Book Medical Publishers, Chicago, 1973. 42. Tiran, J., Avruch, L. I., Albisser, A. M., "A Circulation and Organs Model for Insulin Dynamics", American Journal of Physiology, Vol. 237 No. 4, 1979. 43. Tiran, J., Broekhuyse, H., Albisser, A. M., "Glucose A and Insulin Dynamics in the Anaesthetized Dog: Progress Medical Study", Mathematical Modelling through Technoloav, Vol. 7, 1980. 44. Tiran, Joseph, et alii, "A Simulation Model of Extracellular Glucose Distribution in the Human Body", Annals of Biomedical Engineering, Vol. 3, 1975. 45. Verdonk, C. A., et alii, "Glucose Clamping Using the Biostator GCIIS", Hormone Metabolism Research, 1980. 46. West, Constance E., "Study and Evaluation of a Computer Model of Glucose and Insulin Metabolism and Distribution", BS Thesis, MIT, Cambridge, 1980. 47. Youcef-Toumi, Kamal,. "Influence of Measurement on the Transient Performance of the Steady Selection State Kalman Filter", MS Thesis, MIT, Mar. 1981. - B4 -