# # Glucose Tolerance Test # # The glucose tolerance test is used clinically to evaluate the # ability of the pancreas to release insulin in response to a large # dose of glucose given either orally or intraveneously. The normal # pancreas releases enough insulin to lower the plasma glucose # within a few hours, sometimes to the point of hyperglycemia. The # deficiency of insulin release, characteristic of Type 1 diabetes, # also termed juvenile-onset diabetes, prolongs the fall of glucose # for many hours (1). # # (1) Randall, James E., Microcomputers and Physiological Simula- # tion, Addison-Wesley Publishing Company, Inc., Reading, MA, 1980, # p69. # # The following differential equations can be used to compute the # glucose and insulin levels as a function of time: # # Cg*dG/dt = Q + In - (Gg*I*G) - Dd*G, G < Gk (1) # # Cg*dG/dt = Q + In - (Gg*I*G) - Dd*G - Mu*(G - Gk), G >= Gk (2) # # Ci*dI/dt = -Aa*I, G < G0 (3) # # Ci*dI/dt = -Aa*I + Bb*(G - G0), G >= G0 (4) # # where # # Symbol Parameters/Variables Normal Values # # Ex extracellular space 15000 ml # # Cg glucose capacitance = Ex/100 150 ml # # Ci insulin capacitance = Ex/100 150 ml # # Q liver release of glucose 8400 mG/hr # # Gt glucose infusion rate 80000 mG/hr # # In glucose infusion, Gt or 0 # # Dd first-order glucose loss 24.7 mG/hr/mGml # # Gg controlled glucose loss 13.9 mG/hr/mGml/mIml # # Gk renal threshold 250 mGml # # Mu renal loss rate 72 mG/hr/mGml # # G0 pancreas threshold 51 mGml # # Bb insulin release rate 14.3 mI/hr/mGml # # Aa first-order insulin rate 76 mI/hr/mGml # # G extracellular glucose 81 mGml (t = 0) # # I extracellular insulin 5.7 mIml (t = 0) # # t time hr # # The mass and concentration units are: # # mG milligrams of glucose # # mI milligrams of insulin # # mGml milligrams of glucose/100 ml extracellular fluid # # mIml milligrams of insulin/100 ml extracellular fluid # # ml milliliter = cubic centimeter = 0.001 liter # # The glucose infusion function, In, is given by: # # In = Gt, 0 <= t < 0.5 # # In = 0, 0.5 <= t <= 12 # # Equations (1) to (4) are integrated for four cases: # # (1) (ncase = 1) # # normal pancreatic sensitivity (Bb = 14.3) # (without glucose infusion, Gt = 0) # # (2) (ncase = 2) # # normal pancreatic sensitivity (Bb = 14.3) # (with glucose infusion) # # (3) (ncase = 3) # # reduced pancreatic sensitivity (Bb = 0.2(14.3)) # (with glucose infusion) # # (4) (ncase = 4) # # elevated pancreatic sensitivity (Bb = 2.0(14.3)) # (with glucose infusion) # # Library of R ODE solvers library("deSolve") # # ODE routine setwd("c:/R/bme_ode/chap2") source("glucose_1.R") # # Vectors, matrices for the graphical output nout=49 Gplot=matrix(0,nrow=nout,ncol=4) Iplot=matrix(0,nrow=nout,ncol=4) tplot=rep(0,nout) # # Step through four cases for(ncase in 1:4){ # # Select the case parameters if(ncase==1){Bb=14.3; Gt=0} if(ncase==2){Bb=14.3; Gt=80000} if(ncase==3){Bb=0.2*14.3; Gt=80000} if(ncase==4){Bb=2.0*14.3; Gt=80000} # # Model parameters Ex=15000; Cg=150; Ci=150; Q=8400; Dd=24.7; Gg=13.9; Gk=250; Mu=72; G0=51; Aa=76; # # Initialize counter for calls to glucose_1 ncall=0 # # Initial condition yini=c(81.14,5.671) yini # # t interval times=seq(from=0,to=12,by=12/(nout-1)) # # ODE integration out=ode(y=yini,times=times,func=glucose_1,parms=NULL) # # ODE numerical solution for(it in 1:nout){ if(it==1){ cat(sprintf( "\n ncase = %2d \n\n t In G I",ncase))} # # Glucose infusion function t=times[it] if((t>=0)&(t<=0.51)){In=Gt} if( t>0.51) {In=0 } cat(sprintf("\n %8.2f%8.0f%8.2f%8.3f",out[it,1],In,out[it,2],out[it,3])) } # # Store solution for plotting Gplot[,ncase]=out[,2] Iplot[,ncase]=out[,3] if(ncase==1)tplot=out[,1] # # Calls to glucose_1 cat(sprintf("\n\n ncall = %5d\n\n",ncall)) # # Next case } # # Single plot for G par(mfrow=c(1,1)) # # G, ncase = 1 plot(tplot,Gplot[,1],xlab="t (hr)", ylab="G(t) (mg glucose/100 ml) vs t", xlim=c(0,12),ylim=c(0,300),type="b",lty=1,pch="1",lwd=2, main="Extracellular glucose, G(t), ncase = 1,2,3,4") # # G, ncase = 2 lines(tplot,Gplot[,2],type="b",lty=1,pch="2",lwd=2) # # G, ncase = 3 lines(tplot,Gplot[,3],type="b",lty=1,pch="3",lwd=2) # # G, ncase = 4 lines(tplot,Gplot[,4],type="b",lty=1,pch="4",lwd=2) # # Single plot for I par(mfrow=c(1,1)) # # I, ncase = 1 plot(tplot,Iplot[,1],xlab="t (hr)", ylab="I(t) (mg insulin/100 ml) vs t", xlim=c(0,12),ylim=c(0,25),type="b",lty=1,pch="1",lwd=2, main="Extracellular insulin, I(t), ncase = 1,2,3,4") # # I, ncase = 2 lines(tplot,Iplot[,2],type="b",lty=1,pch="2",lwd=2) # # I, ncase = 3 lines(tplot,Iplot[,3],type="b",lty=1,pch="3",lwd=2) # # I, ncase = 4 lines(tplot,Iplot[,4],type="b",lty=1,pch="4",lwd=2)