summaryrefslogtreecommitdiff
path: root/1202/CH22/EX22.3
diff options
context:
space:
mode:
Diffstat (limited to '1202/CH22/EX22.3')
-rwxr-xr-x1202/CH22/EX22.3/22_3.pngbin0 -> 19353 bytes
-rwxr-xr-x1202/CH22/EX22.3/22_3.sce52
2 files changed, 52 insertions, 0 deletions
diff --git a/1202/CH22/EX22.3/22_3.png b/1202/CH22/EX22.3/22_3.png
new file mode 100755
index 000000000..19e02fb9d
--- /dev/null
+++ b/1202/CH22/EX22.3/22_3.png
Binary files differ
diff --git a/1202/CH22/EX22.3/22_3.sce b/1202/CH22/EX22.3/22_3.sce
new file mode 100755
index 000000000..d93f2d307
--- /dev/null
+++ b/1202/CH22/EX22.3/22_3.sce
@@ -0,0 +1,52 @@
+
+clear
+clc
+
+//Example 22.3
+disp('Example 22.3')
+
+//Parameters
+p1=0.028735;p2=0.028344;p3=5.035E-5;V1=12;n=0.0926;
+Ib=15;//basal
+Gb=81;
+
+//Diet function
+function D=D(t)
+ D=9*exp(-0.05*t);
+endfunction
+
+
+//ODE model
+function ydot=model(t,y,U)
+ G=y(1);X=y(2);I=y(3);
+ Gdot=-p1*G-X*(G+Gb)+D(t);
+ Xdot=-p2*X+p3*I;
+ Idot=-n*(I+Ib)+U/V1;
+ ydot=[Gdot Xdot Idot]';
+endfunction
+
+
+t=0:0.1:400;t0=0;
+y0=[0 0 0]';//G,X,I are deviation variables
+
+U=0;
+y = Gb+ode(y0, t0, t, list(model,U))
+subplot(3,1,1);
+plot(t,y(1,:));
+xtitle("","Time(min)","Glucose (mg/L)")
+legend("$U=0\ mU/min$")
+
+U=15;
+y =Gb+ ode(y0, t0, t, list(model,U))
+subplot(3,1,2);
+plot(t,y(1,:));
+xtitle("","Time(min)","Glucose (mg/L)")
+legend("$U=15\ mU/min$")
+
+U=25;
+y = Gb+ode(y0, t0, t, list(model,U))
+subplot(3,1,3);
+plot(t,y(1,:));
+xtitle("","Time(min)","Glucose (mg/L)")
+legend("$U=25\ mU/min$")
+