clear
clear global
clc
close all
global SRex Km Ke V IL6b RaIL6 Tv t_start t_end dataIL6GLP1 t
t_start=1;
t=[0 10 20 30 40 60 90 120 150 180];
dataGLP1out=[-0.0611404034260573;0.153761026536856;0.381887441294696;0.577225771343123;0.785935420734692;1.02732340392451;1.28878665794757;1.46511064263731;1.60857337534354;1.75203610804977;1.79782967573179;1.72437887843715;1.63132839759097;1.49215509632929;1.40577198333615;1.31946203761713;1.21963443800674;1.14002844377781;1.05353557987351;0.927440928858545;0.867507785455261;0.788267627596867]';
dataIL6out=[-0.0611404034260573;0.153761026536856;0.381887441294696;0.577225771343123;0.785935420734692;1.02732340392451;1.28878665794757;1.46511064263731;1.60857337534354;1.75203610804977;1.79782967573179;1.72437887843715;1.63132839759097;1.49215509632929;1.40577198333615;1.31946203761713;1.21963443800674;1.14002844377781;1.05353557987351;0.927440928858545;0.867507785455261;0.788267627596867]'*(1/6);
SRex = 0.050;
Km= 0.009;
Ke = 0.059;
V = 14;
IL6b =1.7;
RaIL6 = Ke*IL6b*V;
Tv =67;
t_end = 155;
dataIL6GLP1 = [dataGLP1out dataIL6out];
V=14;
K1_0 = 1;
K2_0 = 0.1;
RaINCb_0=217;
startpar = [K1_0 K2_0 RaINCb_0];
options=optimset('Display','Iter','TolFun',1E-20,'TolX',1E-7,'MaxFunEvals',3000,'MaxIter',500)';
[bestpar, resnorm, residual, exitflag, output, lmd, jacobian]=lsqnonlin(@fz_costo_sana.m,startpar[0.01 0.01 .01] [10 10 10]options)'; nnnnnnnnnnnnnn
K1_0=bestpar(1);
K2_0=bestpar(2);
RaINCb_0=bestpar(3);
[m,n]=size(residual);
E=inv(jacobian'*jacobian);
std_K1=sqrt(E(1,1));
std_K2=sqrt(E(2,2));
std_RaINCb=sqrt(E(3,3));
CV_K1=(std_Gama/Gama)*100;
CV_K2=(std_K8/K8)*100;
CV_RaINCb=(std_M/M)*100;
figure(1)
sim('MCBS_project_than',t)
plot(t,GLP1_data_VICT,'ro')
xlabel('time (min)')
ylabel('GLP1 (mmol/L)')
hold on
plot(tout,GLP1out,'k')
figure(2)
plot(t,IL6_data_VICT,'ro')
xlabel('time (min)')
ylabel('insulin (mU/L)')
hold on
plot(tout,IL6mout,'k')
RMSEogtt=sqrt(resnorm/(3*(length(GLP1_data_VICT))));
Best Answer