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 ...

26.07.2013 Views

112 MATLAB kode til simulering af forsøgsscenarie 44 [tx,Gx,Ix,Xx] = HovorkaModelSimulation2Pancreas... 45 (T(t+1):T(t+5),Xx,IV ins(t+1:t+5),IV glu(t+1:t+5),D(t+1:t+5),par); 46 Xx = Xx(end,:)'; 47 if Gx > BS 48 iv glu bolus = iv glu bolus − 0.5; 49 elseif Gx < BS 50 iv glu bolus = iv glu bolus + 0.5; 51 end 52 if iv glu bolus < 0 53 iv glu bolus = 0; 54 end 55 Tx = [Tx; tx(1)]; 56 G = [G; Gx(1)]; 57 I = [I; Ix(1)]; 58 X = [X; Xx(1)]; 59 end 60 61 % Plot of glucose concentration in plasma. 62 h = figure(1); 63 subplot(221) 64 plot([Tx(1) Tx(end)],[2.5 2.5],'r−',Tx,G,'b−','linewidth',2); grid; 65 xlabel('time [min]','fontsize',14); ylabel('G (mmol/L)','fontsize',14); 66 ylim([0 10]); xlim([Tx(1) Tx(end)]); 67 text(60,6,'\downarrow','fontsize',14) 68 hold on; 69 fill([Tx(1) Tx(end) Tx(end) Tx(1)],... 70 [70/par.MwG*10 70/par.MwG*10 140/par.MwG*10 140/par.MwG*10],... 71 'g','facealpha',0.2) 72 hold off 73 set(get(h,'CurrentAxes'),'fontsize',14) 74 legend('Target value of BS','Actual value of BS','Location','NorthEast') 75 76 % Plot of insulin concentration in plasma. 77 subplot(222) 78 plot(Tx,I,'b−','linewidth',2); grid; 79 xlabel('time [min]','fontsize',14); ylabel('I (mU/L)','fontsize',14); 80 xlim([Tx(1) Tx(end)]); 81 set(get(h,'CurrentAxes'),'fontsize',14) 82 83 % Plot of oral glucose load and iv glucose infusion. 84 T=T/60; 85 subplot(223) 86 stairs(T,D,'b−','linewidth',2) 87 hold on 88 stairs(T,IV glu,'m−','linewidth',2); grid; 89 xlabel('time [hr]','fontsize',14); ylabel('Glucose (g/min)','fontsize',14); 90 xlim([T(1) T(end)]); ylim([0 8]); 91 text(2.9,5,['Total glucose = ' num2str(sum(IV glu)) 'g'],'fontsize',12) 92 set(get(h,'CurrentAxes'),'fontsize',14) 93 legend('Meal','IV glucose','Location','NorthEast') 94 95 % Plot of insulin infusion. 96 subplot(224) 97 stairs(T,IV ins,'b−','linewidth',2); grid; 98 xlabel('time [hr]','fontsize',14);

99 ylabel('Insulin infusion (mU/min)','fontsize',14); 100 xlim([T(1) T(end)]); ylim([0 41]); 101 set(get(h,'CurrentAxes'),'fontsize',14) 113

99 ylabel('Insulin infusion (mU/min)','fontsize',14);<br />

100 xlim([T(1) T(end)]); ylim([0 41]);<br />

101 set(get(h,'CurrentAxes'),'fontsize',14)<br />

113

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!