Matematisk Model for Mavesækkens Tømning - Danmarks Tekniske ...
Matematisk Model for Mavesækkens Tømning - Danmarks Tekniske ...
Matematisk Model for Mavesækkens Tømning - Danmarks Tekniske ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
90<br />
91 % Plot of iv insulin infusion.<br />
92 subplot(224)<br />
93 stairs(T,IV ins,'b−','linewidth',2); grid;<br />
94 xlabel('time [hr]','fontsize',14);<br />
95 ylabel('Insulin infusion (mU/min)','fontsize',14);<br />
96 xlim([T(1) T(end)]); ylim([0 uss+1]);<br />
97 set(get(h,'CurrentAxes'),'fontsize',14)<br />
1 clear all; close all;<br />
2<br />
Listing D.8: experiment simulation pan con 25.m<br />
3 % Parameters <strong>for</strong> the Steady State.<br />
4 BodyWeight = 70.0;<br />
5 par = HovorkaParametersPancreas(BodyWeight);<br />
6 uss = 0.0; % Basal rate of insulin.<br />
7 dss = 0.0; % Basal rate of glucose.<br />
8<br />
9 % Compute Steady State.<br />
10 Ipo0 = par.Sb;<br />
11 xinit = [0 0 55.9483 23.3399 5.7677 0.0295 0.0047 0.2997 Ipo0 0]';<br />
12 [Gss,Iss,xss]=HovorkaBasalState2Pancreas(uss,0,dss,par,xinit);<br />
13 gss = Gss*par.MwG/10;<br />
14<br />
15 Ts = 10; % Time to eat the glucose [min].<br />
16 dmeal = 40/Ts; % Amount of oral glucose [g/min].<br />
17<br />
18 T = 0:1:5*60; % Time of simulation [min].<br />
19 N = length(T);<br />
20<br />
21 D = repmat(dss,1,N);<br />
111<br />
22 idd = round([60 61 62 63 64 65 66 67 68 69] + 1); % Time <strong>for</strong> meal [min].<br />
23 D(1,idd) = D(1,idd)+dmeal; % Meal vector.<br />
24<br />
25 BS = 2.5; % Target value of blood glucose [mmol/L].<br />
26 Tx = [];<br />
27 G = [];<br />
28 I = [];<br />
29 X = [];<br />
30 IV ins = repmat(0,1,N);<br />
31 IV ins(0+1:60+1) = IV ins(0+1:60+1)+40; % Insulin infusion first<br />
32 % hour [mU/min].<br />
33 IV ins(61+1:300+1) = IV ins(61+1:300+1)+20; % Insulin infusion last four<br />
34 % hours [mU/min].<br />
35 IV glu = zeros(1,N);<br />
36 iv glu bolus = 0; % Glucosebolus at the beginning [g/min].<br />
37<br />
38 % Control algorithm <strong>for</strong> iv glucoseadministration.<br />
39 <strong>for</strong> t = 0:5:N−2<br />
40 if t == 0<br />
41 Xx = xss;<br />
42 end<br />
43 IV glu(t+1:t+5) = IV glu(t+1:t+5)+iv glu bolus;