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 ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
27<br />
90 MATLAB kode til fit af data<br />
28 % Plot of Cobelli <strong>Model</strong> and data<br />
29 h1 = figure(1);<br />
30 plot(T,Qsto,'LineWidth',2)<br />
31 hold on<br />
32 plot(Time,Data,'.r','MarkerSize',20)<br />
33 xlabel('Time [min]','fontsize',14);<br />
34 ylabel('Relative amount of glucose in stomach','fontsize',14);<br />
35 legend('Cobelli','Data')<br />
36 set(get(h1,'CurrentAxes'),'fontsize',14)<br />
37 axis([0 400 0 1])<br />
38 print('−depsc', '−tiff', ['cobelli1 stomach fit'])<br />
39 print('−dpng', '−loose', ['cobelli1 stomach fit'])<br />
40<br />
41 %%%%%%%%%%%%%%%%%%%%%%%% Elashoff %%%%%%%%%%%%%%%%%%%%%%%%<br />
42<br />
43 % Guess of initial value<br />
44 x0 = [0.015; 1.03]; % [k; beta]<br />
45 XE = fmincon(@Efun,x0,A,B);<br />
46<br />
47 D = 75; % [g]<br />
48 kabs = 0.231; % rate constant of intestinal absorption [1/min].<br />
49 k = XE(1); % rate of emptying [1/min].<br />
50 beta = XE(2); % shape factor [−].<br />
51<br />
52 % Løsning af differentialligning<br />
53 [T,Q] = ode15s(@Elashoff,[0 400],[0;0],[],D,kabs,k,beta);<br />
54 qduo = Q(:,1);<br />
55 qgut = Q(:,2);<br />
56 qsto = D − qduo;<br />
57 Qsto = qsto/max(qsto);<br />
58<br />
59 % Plot of Elashoff <strong>Model</strong> and data<br />
60 h2 = figure(2);<br />
61 plot(T,Qsto,'LineWidth',2)<br />
62 hold on<br />
63 plot(Time,Data,'.r','MarkerSize',20)<br />
64 xlabel('Time [min]','fontsize',14);<br />
65 ylabel('Relative amount of glucose in stomach','fontsize',14);<br />
66 legend('Elashoff','Data')<br />
67 set(get(h2,'CurrentAxes'),'fontsize',14)<br />
68 axis([0 400 0 1])<br />
69 print('−depsc', '−tiff', ['elashoff stomach fit'])<br />
70 print('−dpng', '−loose', ['elashoff stomach fit'])<br />
71<br />
72 %%%%%%%%%%%%%%%%%%%%%% Goetze %%%%%%%%%%%%%%%%%%%%%%%%%%<br />
73<br />
74 % Guess of initial value<br />
75 x0 = [1.14; 16.23]; % [k; tempt]<br />
76 XG = fmincon(@Gfun,x0,A,B);<br />
77<br />
78 K = XG(1); % Lag phase [−]<br />
79 tempt = XG(2); % Emptying time constant [min]<br />
80<br />
81 D = 75; % Amount of glucose [g]