You are on page 1of 20

function mccupl

clear;
format short e
global model r p V0 RTP Vout kpropus tmax procent CNutG CNutP

% program simulare 2 module cuplate pentru reglarea homeostatica


% a sintezei a 2 proteine celulare
% in ipoteza volumului variabil si a presiunii osmotice constante
% (c) G. Maria, 2003

% Legenda specii:
% (1)NutG (2)NutP (3)MetG1 (4)MetG2
% (5)MetP1 (6)MetP2 (7)P1 (8)P2
% (9)G1 (10)G2 (11)G1P1 (12)G2P2

while 1
clc;
disp(' ')
disp(' Variante de cuplare a doua module de reglare homeostatica G/P:')
disp(' ')
disp('Varianta 1 = antagonista, fara cuplare directa G1(P1)0; G2(P2)0')
disp('Varianta 2 = cooperativa, cuplare functionala G1(P1)0; G2(P2)0')
disp('Varianta 3 = cooperativa, cuplare functionala G1(P1)1; G2(P2)1')
disp(' ')
model=input('Varianta aleasa pentru simulare (1,2,3)? =');
if model==1 | model==2 | model==3 break; end;
end;

perturb=input('Solutie stationara (0) sau perturbata (1) ? =');


if perturb==1
procent=input('Raport [P1]perturbat/[P1]s (0.9-1.1) =');
end

% input data
r=12; % nr. maxim de specii incluse in modelele cinetice
C0(1:r)=0; % setare concentratii
p=12; % nr. maxim constante cinetice in modele
kpropus(1:p)=0; % initializare constante cinetice
alfas=log(2)/100; % viteza medie de crestere celulara (1/min)
tmax=1000; % timp maxim de integrare
V0=1.660434503e-15; % volum initial (L)

1
% concentratii stationare nominale (nM)
CNutGs=100; CNutPs=100000;
if model==1 | model==2
CP1s=1000; CG1s=1;
CP2s= 100; CG2s=1;
CMetG1s=10000; CMetG2s=10000;
CMetP1s=10000; CMetP2s=10000;
end
if model==3
CP1s=1000; CG1s=1/2; CG1P1s=1/2;
CP2s= 100; CG2s=1/2; CG2P2s=1/2;
CMetG1s=10000; CMetG2s=10000;
CMetP1s=10000; CMetP2s=10000;
end
% end iputs

RGbeta=[ CNutGs/CNutPs ] ;
npoint=max(size(RGbeta));
Css=zeros(npoint+1,r);
key=0;

%-- Module [G1(P1)0;G2(P2)0] necuplate (model=1) sau cuplate (model=2)


if model==1 | model==2
final=1; % doar o simulare dinamica

% calcul constante cinetice din conditiile de concentratii stationare


syms r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 sumnj
syms CNutG CNutP CMetG1 CMetG2 CMetP1 CMetP2 CP1 CP2 CG1 CG2
syms k1 k2 k3 k4 k5 k6 k7 k8
syms eqMetG1 eqMetG2 eqMetP1 eqMetP2 eqP1 eqP2 eqG1 eqG2
syms f1 f2 f3 f4 f5 f6 f7 f8
syms f1p f2p f3p f4p f5p f6p f7p f8p
syms FAC alfa RTP J B X

%formuleaza sistemul QSS de ecuatii de bilant


if model==1
r1=k1*CNutG*CP1;
r2=k2*CNutP*CP1;
r3=k3*CMetG1*CP1;
r4=k4*CMetP1*CG1;
r5=k5*CNutG*CP2;
r6=k6*CNutP*CP2;

2
r7=k7*CMetG2*CP2;
r8=k8*CMetP2*CG2;
end
if model==2
r1=k1*CNutG*CP1;
r2=k2*CNutP*CP1;
r3=k3*CMetG1*CP2;
r4=k4*CMetP1*CG1;
r5=k5*CNutG*CP1;
r6=k6*CNutP*CP1;
r7=k7*CMetG2*CP2;
r8=k8*CMetP2*CG2;
end
eqMetG1= r1-r3;
eqMetG2= r5-r7;
eqMetP1= r2-r4;
eqMetP2= r6-r8;
eqP1= r4;
eqP2= r8;
eqG1= r3;
eqG2= r7;
sumnj=eqMetG1+eqMetG2+eqMetP1+eqMetP2+eqP1+eqP2+eqG1+eqG2;
alfa=RTP*sumnj;
f1= eqMetG1 - FAC*CMetG1;
f2= eqMetG2 - FAC*CMetG2;
f3= eqMetP1 - FAC*CMetP1;
f4= eqMetP2 - FAC*CMetP2;
f5= eqP1 - FAC*CP1;
f6= eqP2 - FAC*CP2;
f7= eqG1 - FAC*CG1;
f8= eqG2 - FAC*CG2;
f1p= eqMetG1 - alfa*CMetG1;
f2p= eqMetG2 - alfa*CMetG2;
f3p= eqMetP1 - alfa*CMetP1;
f4p= eqMetP2 - alfa*CMetP2;
f5p= eqP1 - alfa*CP1;
f6p= eqP2 - alfa*CP2;
f7p= eqG1 - alfa*CG1;
f8p= eqG2 - alfa*CG2;

% estimare [k]-uri din concentratii-QSS


[k1,k2,k3,k4,k5,k6,k7,k8]=solve(f1,f2,f3,f4,f5,f6,f7,f8);

3
% construieste Jacobianul modelului cinetic [df(i)/dC(j)]
J = jacobian( [f1p;f2p;f3p;f4p;f5p;f6p;f7p;f8p], [CMetG1,CMetG2,CMetP1,CMetP2,CP1,CP2,CG1,CG2] );
B1=-jacobian( [f1p;f2p;f3p;f4p;f5p;f6p;f7p;f8p], [CNutG] );
B2=-jacobian( [f1p;f2p;f3p;f4p;f5p;f6p;f7p;f8p], [CNutP] );

% salveaza estimatul [kpropus] si celelalte date in fisierul 'temp'


FAC=double(alfas);

% Legenda specii:
% (1)NutG (2)NutP (3)MetG1 (4)MetG2
% (5)MetP1 (6)MetP2 (7)P1 (8)P2
% (9)G1 (10)G2 (11)G1P1 (12)G2P2
CNutG=double(CNutGs); CNutP=double(CNutPs);
CMetG1=double(CMetG1s); CMetG2=double(CMetG2s);
CMetP1=double(CMetP1s); CMetP2=double(CMetP2s);
CP1=double(CP1s); CP2=double(CP2s);
CG1=double(CG1s); CG2=double(CG2s);
Css(:,1)=CNutG; Css(:,2)=CNutP;
Css(:,3)=CMetG1; Css(:,4)=CMetG2;
Css(:,5)=CMetP1; Css(:,6)=CMetP2;
Css(:,7)=CP1; Css(:,8)=CP2;
Css(:,9)=CG1; Css(:,10)=CG2;

disp('Concentratii stationare nominale (nM):')


fprintf('NutG=%11.4e NutP=%11.4e \n',Css(1,1:2))
fprintf('MetG1=%11.4e MetG2=%11.4e \n',Css(1,3:4))
fprintf('MetP1=%11.4e MetP2=%11.4e \n',Css(1,5:6))
fprintf('P1=%11.4e P2=%11.4e \n',Css(1,7:8))
fprintf('G1=%11.4e G2=%11.4e \n',Css(1,9:10))

% grupul RTP=(RT/press)=constant
RTP=1/(CMetG1+CMetG2+CMetP1+CMetP2+CP1+CP2+CG1+CG2);
k1=vpa(subs(k1)); k2=vpa(subs(k2));
k3=vpa(subs(k3)); k4=vpa(subs(k4));
k5=vpa(subs(k5)); k6=vpa(subs(k6));
k7=vpa(subs(k7)); k8=vpa(subs(k8));
kpropus(1)=double(k1); kpropus(2)=double(k2);
kpropus(3)=double(k3); kpropus(4)=double(k4);
kpropus(5)=double(k5); kpropus(6)=double(k6);
kpropus(7)=double(k7); kpropus(8)=double(k8);
fprintf('Varianta cuplate module nr.=%1.0f \n',model)

4
fprintf('Estimat k1=%24.16e k2=%24.16e \n',kpropus(1),kpropus(2))
fprintf('Estimat k3=%24.16e k4=%24.16e \n',kpropus(3),kpropus(4))
fprintf('Estimat k5=%24.16e k6=%24.16e \n',kpropus(5),kpropus(6))
fprintf('Estimat k7=%24.16e k8=%24.16e \n',kpropus(7),kpropus(8))
save temp model C0 kpropus RTP Css RGbeta key npoint

% calculeaza senzitivitatile / pantele D(Cjs)/D(Crouts)


J=vpa(subs(J)); B1=vpa(subs(B1)); B2=vpa(subs(B2));
slop1=J\B1; slop2=J\B2;
fprintf('Slope D(CP1)/D(CNutG) at QSS = %14.6e \n', double(vpa(slop1(5))) )
fprintf('Slope D(CP1)/D(CNutP) at QSS = %14.6e \n', double(vpa(slop2(5))) )
fprintf('Slope D(CP2)/D(CNutG) at QSS = %14.6e \n', double(vpa(slop1(6))) )
fprintf('Slope D(CP2)/D(CNutP) at QSS = %14.6e \n', double(vpa(slop2(6))) )

% calculeaza valorile proprii Jacobian la QSS


fprintf('Jacobian DF(j)/D[CMetG1,CMetG2,CMetP1,CMetP2,CP1,CP2,CG1,CG2] val.proprii (crescator) = \n')
xxx=eig(J);
for i=1:max(size(xxx))
fprintf('Real(Eigenvalue) = %12.4e \n', double(vpa(real(xxx(i)))) )
end
end % model==1 | model==2

%-- Module [G1(P1)1;G2(P2)1] cuplate functional (model=3)-------------


if model==3
final=1; % doar o simulare dinamica
% calcul constante cinetice din conditiile de concentratii stationare
syms r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 sumnj
syms CNutG CNutP CMetG1 CMetG2 CMetP1 CMetP2 CP1 CP2 CG1 CG2 CG1P1 CG2P2
syms k1 k2 k3 k4 k5 k6 k7 k8 k9 k10 k11 k12
syms eqMetG1 eqMetG2 eqMetP1 eqMetP2 eqP1 eqP2 eqG1 eqG2 eqG1P1 eqG2P2
syms f1 f2 f3 f4 f5 f6 f7 f8 f9 f10
syms f1p f2p f3p f4p f5p f6p f7p f8p f9p f10p
syms FAC alfa RTP J B X

%formuleaza sistemul QSS de ecuatii de bilant


r1=k1*CNutG*CP1;
r2=k2*CNutP*CP1;
r3=k3*CMetG1*CP2;
r4=k4*CMetP1*CG1;
r5=k5*CNutG*CP1;
r6=k6*CNutP*CP1;
r7=k7*CMetG2*CP2;

5
r8=k8*CMetP2*CG2;
r9=k9*CG1*CP1;
r10=k10*CG1P1;
r11=k11*CG2*CP2;
r12=k12*CG2P2;

eqMetG1= r1-r3;
eqMetG2= r5-r7;
eqMetP1= r2-r4;
eqMetP2= r6-r8;
eqP1= r4-r9+r10;
eqP2= r8-r11+r12;
eqG1= r3-r9+r10;
eqG2= r7-r11+r12;
eqG1P1= r9-r10;
eqG2P2= r11-r12;
sumnj=eqMetG1+eqMetG2+eqMetP1+eqMetP2+eqP1+eqP2+eqG1+eqG2+eqG1P1+eqG2P2;
alfa=RTP*sumnj;
f1= eqMetG1 - FAC*CMetG1;
f2= eqMetG2 - FAC*CMetG2;
f3= eqMetP1 - FAC*CMetP1;
f4= eqMetP2 - FAC*CMetP2;
f5= eqP1 - FAC*CP1;
f6= eqP2 - FAC*CP2;
f7= eqG1 - FAC*CG1;
f8= eqG2 - FAC*CG2;
f9= eqG1P1 - FAC*CG1P1;
f10=eqG2P2 - FAC*CG2P2;
f1p= eqMetG1 - alfa*CMetG1;
f2p= eqMetG2 - alfa*CMetG2;
f3p= eqMetP1 - alfa*CMetP1;
f4p= eqMetP2 - alfa*CMetP2;
f5p= eqP1 - alfa*CP1;
f6p= eqP2 - alfa*CP2;
f7p= eqG1 - alfa*CG1;
f8p= eqG2 - alfa*CG2;
f9p= eqG1P1 - alfa*CG1P1;
f10p=eqG2P2 - alfa*CG2P2;

% estimare [k]-uri din concentratii-QSS


% Matlab nu face fata !
%%%[k1,k2,k3,k4,k5,k6,k7,k8,k9,k11]=solve(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10)

6
% solutie din Maple-7
k6 = FAC*(CMetP2+CP2+CG2P2)/CNutP/CP1;
k1 = FAC*(CMetG1+CG1+CG1P1)/CNutG/CP1;
k5 = FAC*(CMetG2+CG2+CG2P2)/CNutG/CP1;
k2 = FAC*(CMetP1+CP1+CG1P1)/CNutP/CP1;
k3 = FAC*(CG1+CG1P1)/CMetG1/CP2;
k7 = FAC*(CG2+CG2P2)/CMetG2/CP2;
k4 = FAC*(CP1+CG1P1)/CMetP1/CG1;
k8 = FAC*(CP2+CG2P2)/CMetP2/CG2;
k11 = CG2P2*(k12+FAC)/CG2/CP2;
k9 = CG1P1*(k10+FAC)/CG1/CP1;

% construieste Jacobianul modelului cinetic [df(i)/dC(j)]


J = jacobian( [f1p;f2p;f3p;f4p;f5p;f6p;f7p;f8p;f9p;f10p], [CMetG1,CMetG2,CMetP1,CMetP2,CP1,CP2,CG1,CG2,CG1P1,CG2P2] );
B1=-jacobian( [f1p;f2p;f3p;f4p;f5p;f6p;f7p;f8p;f9p;f10p], [CNutG] );
B2=-jacobian( [f1p;f2p;f3p;f4p;f5p;f6p;f7p;f8p;f9p;f10p], [CNutP] );

% salveaza estimatul [kpropus] si celelalte date in fisierul 'temp'


FAC=double(alfas);

% Legenda specii:
% (1)NutG (2)NutP (3)MetG1 (4)MetG2
% (5)MetP1 (6)MetP2 (7)P1 (8)P2
% (9)G1 (10)G2 (11)G1P1 (12)G2P2
CNutG=double(CNutGs); CNutP=double(CNutPs);
CMetG1=double(CMetG1s); CMetG2=double(CMetG2s);
CMetP1=double(CMetP1s); CMetP2=double(CMetP2s);
CP1=double(CP1s); CP2=double(CP2s);
CG1=double(CG1s); CG2=double(CG2s);
CG1P1=double(CG1P1s); CG2P2=double(CG2P2s);
Css(:,1)=CNutG; Css(:,2)=CNutP;
Css(:,3)=CMetG1; Css(:,4)=CMetG2;
Css(:,5)=CMetP1; Css(:,6)=CMetP2;
Css(:,7)=CP1; Css(:,8)=CP2;
Css(:,9)=CG1; Css(:,10)=CG2;
Css(:,11)=CG1P1; Css(:,12)=CG2P2;

disp('Concentratii stationare nominale (nM):')


fprintf('NutG=%11.4e NutP=%11.4e \n',Css(1,1:2))
fprintf('MetG1=%11.4e MetG2=%11.4e \n',Css(1,3:4))
fprintf('MetP1=%11.4e MetP2=%11.4e \n',Css(1,5:6))
fprintf('P1=%11.4e P2=%11.4e \n',Css(1,7:8))

7
fprintf('G1=%11.4e G2=%11.4e \n',Css(1,9:10))
fprintf('G1P1=%11.4e G2P2=%11.4e \n',Css(1,11:12))

% grupul RTP=(RT/press)=constant
RTP=1/(CMetG1+CMetG2+CMetP1+CMetP2+CP1+CP2+CG1+CG2+CG1P1+CG2P2);
k10=vpa(1e+5);
k12=vpa(1e+5);
k1=vpa(subs(k1)); k2=vpa(subs(k2));
k3=vpa(subs(k3)); k4=vpa(subs(k4));
k5=vpa(subs(k5)); k6=vpa(subs(k6));
k7=vpa(subs(k7)); k8=vpa(subs(k8));
k9=vpa(subs(k9));
k11=vpa(subs(k11));
kpropus(1)=double(k1); kpropus(2)=double(k2);
kpropus(3)=double(k3); kpropus(4)=double(k4);
kpropus(5)=double(k5); kpropus(6)=double(k6);
kpropus(7)=double(k7); kpropus(8)=double(k8);
kpropus(9)=double(k9); kpropus(10)=double(k10);
kpropus(11)=double(k11); kpropus(12)=double(k12);
fprintf('Varianta cuplate module nr.=%1.0f \n',model)
fprintf('Estimat k1=%24.16e k2=%24.16e \n',kpropus(1),kpropus(2))
fprintf('Estimat k3=%24.16e k4=%24.16e \n',kpropus(3),kpropus(4))
fprintf('Estimat k5=%24.16e k6=%24.16e \n',kpropus(5),kpropus(6))
fprintf('Estimat k7=%24.16e k8=%24.16e \n',kpropus(7),kpropus(8))
fprintf('Estimat k9=%24.16e k10=%24.16e \n',kpropus(9),kpropus(10))
fprintf('Estimat k11=%24.16e k12=%24.16e \n',kpropus(11),kpropus(12))
save temp model C0 kpropus RTP Css RGbeta key npoint

% calculeaza senzitivitatile / pantele D(Cjs)/D(Crouts)


J=vpa(subs(J)); B1=vpa(subs(B1)); B2=vpa(subs(B2));
slop1=J\B1; slop2=J\B2;
fprintf('Slope D(CP1)/D(CNutG) at QSS = %14.6e \n', double(vpa(slop1(5))) )
fprintf('Slope D(CP1)/D(CNutP) at QSS = %14.6e \n', double(vpa(slop2(5))) )
fprintf('Slope D(CP2)/D(CNutG) at QSS = %14.6e \n', double(vpa(slop1(6))) )
fprintf('Slope D(CP2)/D(CNutP) at QSS = %14.6e \n', double(vpa(slop2(6))) )

% calculeaza valorile proprii Jacobian la QSS


fprintf('Jacobian DF(j)/D[CMetG1,CMetG2,CMetP1,CMetP2,CP1,CP2,CG1,CG2,CG1P1,CG2P2] val.proprii (crescator) = \n')
xxx=eig(J);
for i=1:max(size(xxx))
fprintf('Real(Eigenvalue) = %12.4e \n', double(vpa(real(xxx(i)))) )
end

8
end % model==3

% simulare dinamica din punctul initial C0=Css(average,1:r) ;


% datele se transmit prin fisierul 'temp'
if all(kpropus)>=0
Cout=simcupl(perturb);
end
% end program

-----------------------------------------------------------------------------
function Cout=simcupl(perturb)

% Program simulare dinamica modele de reglare (volum variabil)


% cu constante cinetice evaluate anterior
% G. Maria, 2003

format short e
global model r p V0 RTP Vout kpropus tmax procent CNutG CNutP
load temp

for i=1:p
if kpropus(i)<0
disp('AVERTISMENT ! PARAMETRII NEGATIVI')
pause
end
end

% Legenda specii:
% (1)NutG (2)NutP (3)MetG1 (4)MetG2
% (5)MetP1 (6)MetP2 (7)P1 (8)P2
% (9)G1 (10)G2 (11)G1P1 (12)G2P2

iloc=1;
C0=Css(iloc,1:r); % concentratii initiale

if perturb==1
CP1s=C0(7); % conc. stationara nominala P1
levelP1=CP1s*procent; % nivel de perurbatie Dirac [P1]s
% recalculare conc. perturbata dupa contractie volum
C0(7)=levelP1*RTP*(sum(C0(1:r))-C0(1)-C0(2))/(1-levelP1*RTP);
end

9
%setare NutG si NutP (constanti in timpul integrarii)
C0(1)=CNutG; C0(2)=CNutP;

% domeniul de timp [tmin,tmax,nr.incremente](min)


x=linspace(0,tmax,3000);

% generare numar de moli initial al speciilor: vecor (y); (n-moli)


y(1,1:r)=C0(1:r)*V0;
% calcul volum mediu exterior (conc. exterioara 1e+8 nM)
Vout=V0*1e+8/(sum(C0(1:r))-C0(1)-C0(2)); %(L)
y(1,1:2)=C0(1:2)*Vout;

% integrare model cinetic in termeni de moli: ym[n,r]


options=odeset('Abstol',[ones(1,r)*1e-40]);
[tm,ym]=ode15s('simcuplf',x,y(1,1:r),options);
nn=max(size(tm));

% genereaza curbele de concentratie (numar moli / volum)


for i=1:nn
V(i)=( sum(ym(i,1:r)) - ym(i,1) - ym(i,2) )*RTP;
Cm(i,1:r)= abs(ym(i,1:r))/V(i); %(nM)
Cm(i,1)=ym(i,1)/Vout;
Cm(i,2)=ym(i,2)/Vout;
end

disp('Vectori concentratii simulate (nM) pentru speciile:')


disp('[NutG, NutP, MetG1, MetG2, MetP1, MetP2, P1, P2, G1, G2, G1P1, G2P2]')
for i=1:round(nn/10):nn
fprintf('t=%5.1f V(L)=%11.4e Conc.=',tm(i),V(i));
fprintf(' %11.4e ',Cm(i,1:r));
fprintf('\n');
end
fprintf('t=%5.1f V(L)=%11.4e Conc.=',tm(nn),V(nn));
fprintf(' %11.4e ',Cm(nn,1:r));
fprintf('\n');

%plot curbe cinetice simulate


figure(1)
subplot(5,2,1),plot(tm,Cm(:,3),'g-',tm,ones(1,nn)*Css(iloc,3),'k:');
ylabel('[MetG1] (nM)');
axis([min(tm) max(tm) min(Cm(:,3))*0.98 max(Cm(:,3))*1.02])
if model==1

10
title('G1(P1)0;G2(P2)0 necuplate')
end
if model==2
title('G1(P1)0;G2(P2)0 cuplate')
end
if model==3
title('G1(P1)1;G2(P2)1 cuplate')
end
subplot(5,2,2),plot(tm,Cm(:,4),'g-',tm,ones(1,nn)*Css(iloc,4),'k:');
ylabel('[MetG2] (nM)');
axis([min(tm) max(tm) min(Cm(:,4))*0.98 max(Cm(:,4))*1.02])
subplot(5,2,3),plot(tm,Cm(:,5),'g-',tm,ones(1,nn)*Css(iloc,5),'k:');
ylabel('[MetP1] (nM)');
axis([min(tm) max(tm) min(Cm(:,5))*0.98 max(Cm(:,5))*1.02])
subplot(5,2,4),plot(tm,Cm(:,6),'g-',tm,ones(1,nn)*Css(iloc,6),'k:');
ylabel('[MetP2] (nM)');
axis([min(tm) max(tm) min(Cm(:,6))*0.98 max(Cm(:,6))*1.02])
subplot(5,2,5),plot(tm,Cm(:,7),'r-',tm,ones(1,nn)*Css(iloc,7),'k:');
ylabel('[P1] (nM)');
axis([min(tm) max(tm) min(Cm(:,7))*0.98 max(Cm(:,7))*1.02])
subplot(5,2,6),plot(tm,Cm(:,8),'r-',tm,ones(1,nn)*Css(iloc,8),'k:');
ylabel('[P2] (nM)');
axis([min(tm) max(tm) min(Cm(:,8))*0.98 max(Cm(:,8))*1.02])
subplot(5,2,7),plot(tm,Cm(:,9),'b-',tm,ones(1,nn)*Css(iloc,9),'k:');
ylabel('[G1] (nM)');
axis([min(tm) max(tm) min(Cm(:,9))*0.98 max(Cm(:,9))*1.02])
subplot(5,2,8),plot(tm,Cm(:,10),'b-',tm,ones(1,nn)*Css(iloc,10),'k:');
ylabel('[G2] (nM)');
axis([min(tm) max(tm) min(Cm(:,10))*0.98 max(Cm(:,10))*1.02])
subplot(5,2,9),plot(tm,Cm(:,11),'c-',tm,ones(1,nn)*Css(iloc,11),'k:');
ylabel('[G1P1] (nM)'); xlabel('timp (min)')
axis([min(tm) max(tm) min(Cm(:,11))*0.98 max(Cm(:,11))*1.02])
subplot(5,2,10),plot(tm,Cm(:,12),'c-',tm,ones(1,nn)*Css(iloc,12),'k:');
ylabel('[G2P2] (nM)'); xlabel('timp (min)')
axis([min(tm) max(tm) min(Cm(:,12))*0.98 max(Cm(:,12))*1.02])

% Legenda specii:
% (1)NutG (2)NutP (3)MetG1 (4)MetG2
% (5)MetP1 (6)MetP2 (7)P1 (8)P2
% (9)G1 (10)G2 (11)G1P1 (12)G2P2

% calcul timpi de recover specii

11
nmin=20;
error=0.01; % eroare de recover (relativa)
disp('Timpi de recover (min) pt. speciile index:')
disp(' (3)MetG1 (4)MetG2')
disp(' (5)MetP1 (6)MetP2')
disp(' (7)P1 (8)P2')
disp(' (9)G1 (10)G2')
disp(' (11)G1P1 (12)G2P2')
disp(' ')

for key=3:r
if Css(iloc,key)<=1e-10
break;
else
Cqss=Css(iloc,key);
Cqssmin=Cqss*(1-error); Cqssmax=Cqss*(1+error);
nqss=min(find(Cm(nmin:nn,key)>Cqssmin & Cm(nmin:nn,key)<Cqssmax));
nqssa=nqss;
nqssb=1;
non=(find(Cm(nmin+nqssa:nn,key)>Cqssmin & Cm(nmin+nqssa:nn,key)<Cqssmax));
nonm=max(non);
nqssb=nonm;
nonk=max(size(non));
if nonk>2
for i=1:nonk
kk=nonk-i;
if(kk<1) break; end;
nxxx= non(kk);
if abs(nxxx-nqssb)~=1 break; end;
nqssb=nxxx;
end
end
nqss=max(nqssa,nqssb);
if isempty(tm(nqss))~=1
fprintf( 'specia nr.%2.0f t-rec = %11.3e \n',key,tm(nqss))
else
fprintf( 'specia nr.%2.0f t-rec = neglijabil \n',key)
end
end % if break
end % key
Cout(1:r)=Cm(nn,1:r);
return

12
------------------------------------------------------------------------------
function dy=simcuplf(t,N)
format short e
global model r p V0 RTP Vout kpropus tmax procent CNutG CNutP

% Rutina de evaluare derivate doua module cinetice de reglare cuplate


% volum variabil (in termeni de numar de n-moli)
% dy= vector derivate concentratii specii
% (evaluate pentru modelul curent 'model' si constantele k)
% k[p] = vectorul constantelor cinetice
% (c) G. Maria, 2003

% verifica pozitivitatea nr. de moli


for i=1:r
if N(i)<0 N(i)=1e-40; else; end;
end

% Legenda specii:
% (1)NutG (2)NutP (3)MetG1 (4)MetG2
% (5)MetP1 (6)MetP2 (7)P1 (8)P2
% (9)G1 (10)G2 (11)G1P1 (12)G2P2
NutG=N(1); NutP=N(2);
MetG1=N(3);MetG2=N(4);
MetP1=N(5);MetP2=N(6);
P1=N(7); P2=N(8);
G1=N(9); G2=N(10);
G1P1=N(11);G2P2=N(12);
% evaluare volum instantaneu
V= (sum(N(1:r))-N(1)-N(2))*RTP; %(L)
% setare constante cinetice
k(1:p)=kpropus(1:p);

% evaluare vector viteze de reactie [v] (nM/min)


if model==1 | model==2
if model==1
v=[...
V*k(1)*(NutG/Vout)*(P1/V), ...
V*k(2)*(NutP/Vout)*(P1/V), ...
V*k(3)*(MetG1/V)*(P1/V), ...
V*k(4)*(MetP1/V)*(G1/V), ...
V*k(5)*(NutG/Vout)*(P2/V), ...
V*k(6)*(NutP/Vout)*(P2/V), ...

13
V*k(7)*(MetG2/V)*(P2/V), ...
V*k(8)*(MetP2/V)*(G2/V) ...
];
end
if model==2
v=[...
V*k(1)*(NutG/Vout)*(P1/V), ...
V*k(2)*(NutP/Vout)*(P1/V), ...
V*k(3)*(MetG1/V)*(P2/V), ...
V*k(4)*(MetP1/V)*(G1/V), ...
V*k(5)*(NutG/Vout)*(P1/V), ...
V*k(6)*(NutP/Vout)*(P1/V), ...
V*k(7)*(MetG2/V)*(P2/V), ...
V*k(8)*(MetP2/V)*(G2/V) ...
];
end

% vy= matrice coeficienti stoiciometrici [nr.specii x nr. reactii]


% Reactiile sunt in ordinea elementelor vectorului 'v'
nv=max(size(v));
% r1 r2 r3 r4 r5 r6 r7 r8
vy(1:r,1:nv)= [...
zeros(1,nv); %NutG
zeros(1,nv); %NutP
1, 0, -1, 0, 0, 0, 0, 0; %MetG1
0, 0, 0, 0, 1, 0, -1, 0; %MetG2
0, 1, 0, -1, 0, 0, 0, 0; %MetP1
0, 0, 0, 0, 0, 1, 0, -1; %MetP2
0, 0, 0, 1, 0, 0, 0, 0; %P1
0, 0, 0, 0, 0, 0, 0, 1; %P2
0, 0, 1, 0, 0, 0, 0, 0; %G1
0, 0, 0, 0, 0, 0, 1, 0; %G2
zeros(1,nv); %G1P1
zeros(1,nv) ]; %G2P2
end % model==1 | model==2

if model==3
v=[...
V*k(1)*(NutG/Vout)*(P1/V), ...
V*k(2)*(NutP/Vout)*(P1/V), ...
V*k(3)*(MetG1/V)*(P2/V), ...
V*k(4)*(MetP1/V)*(G1/V), ...

14
V*k(5)*(NutG/Vout)*(P1/V), ...
V*k(6)*(NutP/Vout)*(P1/V), ...
V*k(7)*(MetG2/V)*(P2/V), ...
V*k(8)*(MetP2/V)*(G2/V) ...
V*k(9)*(G1/V)*(P1/V) ...
V*k(10)*(G1P1/V) ...
V*k(11)*(G2/V)*(P2/V) ...
V*k(12)*(G2P2/V) ...
];

nv=max(size(v));
% r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12
vy(1:r,1:nv)= [...
zeros(1,nv); %NutG
zeros(1,nv); %NutP
1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0; %MetG1
0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0; %MetG2
0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0; %MetP1
0, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0; %MetP2
0, 0, 0, 1, 0, 0, 0, 0, -1, 1, 0, 0; %P1
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 1; %P2
0, 0, 1, 0, 0, 0, 0, 0, -1, 1, 0, 0; %G1
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1, 1; %G2
0, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0; %G1P1
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1]; %G2P2
end % model==3
% evalueaza derivatele (nM/min)
dy=zeros(1,r);
for i=1:r
dy(i)= sum( v.*vy(i,:) );
end
dy=dy';
return
------------------------------------------------------------------------------

15
Varianta 1 =
antagonista, fara cuplare directa G1(P1)0; G2(P2)0

Varianta aleasa pentru simulare (1,2,3)? =1


Solutie stationara (0) sau perturbata (1) ? =0
Concentratii stationare nominale (nM):
NutG=1.0000e+002 NutP=1.0000e+005
MetG1=1.0000e+004 MetG2=1.0000e+004
MetP1=1.0000e+004 MetP2=1.0000e+004
P1=1.0000e+003 P2=1.0000e+002
G1=1.0000e+000 G2=1.0000e+000
Varianta cuplate module nr.=1
Estimat k1= 6.9321649527800131e-004 k2= 7.6246189861593988e-007
Estimat k3= 6.9314718055994532e-010 k4= 6.9314718055994533e-004
Estimat k5= 6.9321649527800131e-003 k6= 7.0007865236554471e-006
Estimat k7= 6.9314718055994536e-009 k8= 6.9314718055994527e-005
Slope D(CP1)/D(CNutG) at QSS = -4.733395e+000
Slope D(CP1)/D(CNutP) at QSS = -5.207895e-003
Slope D(CP2)/D(CNutG) at QSS = -4.739253e-001
Slope D(CP2)/D(CNutP) at QSS = -4.764290e-004
Jacobian DF(j)/D[CMetG1,CMetG2,CMetP1,CMetP2,CP1,CP2,CG1,CG2] val.proprii
(crescator) =
Real(Eigenvalue) = 4.2216e-003
Real(Eigenvalue) = -1.0887e-002
Real(Eigenvalue) = -1.4801e-002
Real(Eigenvalue) = -1.3954e-002
Real(Eigenvalue) = -6.9322e-003
Real(Eigenvalue) = -6.9315e-003
Real(Eigenvalue) = -6.9315e-003
Real(Eigenvalue) = -6.9315e-003
Vectori concentratii simulate (nM) pentru speciile:
Timpi de recover (min) pt. speciile index:
(3)MetG1 (4)MetG2
(5)MetP1 (6)MetP2
(7)P1 (8)P2
(9)G1 (10)G2
(11)G1P1 (12)G2P2

specia nr. 3 t-rec = 0.000e+000


specia nr. 4 t-rec = 0.000e+000
specia nr. 5 t-rec = 0.000e+000
specia nr. 6 t-rec = 0.000e+000
specia nr. 7 t-rec = 0.000e+000
specia nr. 8 t-rec = 0.000e+000
specia nr. 9 t-rec = 0.000e+000
specia nr.10 t-rec = 0.000e+000
>> print CUP_1a -dbitmap

Varianta aleasa pentru simulare (1,2,3)? =1


Solutie stationara (0) sau perturbata (1) ? =1
Raport [P1]perturbat/[P1]s (0.9-1.1) =0.9
>> print CUP_1b -dbitmap

16
17
Varianta 2 =
cooperativa, cuplare functionala G1(P1)0; G2(P2)0

Varianta aleasa pentru simulare (1,2,3)? =2


Solutie stationara (0) sau perturbata (1) ? =1
Raport [P1]perturbat/[P1]s (0.9-1.1) =0.9
Concentratii stationare nominale (nM):
NutG=1.0000e+002 NutP=1.0000e+005
MetG1=1.0000e+004 MetG2=1.0000e+004
MetP1=1.0000e+004 MetP2=1.0000e+004
P1=1.0000e+003 P2=1.0000e+002
G1=1.0000e+000 G2=1.0000e+000
Varianta cuplate module nr.=2
Estimat k1= 6.9321649527800131e-004 k2= 7.6246189861593988e-007
Estimat k3= 6.9314718055994536e-009 k4= 6.9314718055994533e-004
Estimat k5= 6.9321649527800131e-004 k6= 7.0007865236554473e-007
Estimat k7= 6.9314718055994536e-009 k8= 6.9314718055994527e-005
Slope D(CP1)/D(CNutG) at QSS = -4.733342e+000
Slope D(CP1)/D(CNutP) at QSS = -5.211956e-003
Slope D(CP2)/D(CNutG) at QSS = -4.721482e-001
Slope D(CP2)/D(CNutP) at QSS = -6.110030e-004
Jacobian DF(j)/D[CMetG1,CMetG2,CMetP1,CMetP2,CP1,CP2,CG1,CG2] val.proprii
(crescator) =
Real(Eigenvalue) = -5.1784e-003
Real(Eigenvalue) = -9.3710e-003
Real(Eigenvalue) = -1.3940e-002
Real(Eigenvalue) = -6.9322e-003
Real(Eigenvalue) = -6.9315e-003
Real(Eigenvalue) = -6.9315e-003
Real(Eigenvalue) = -6.9315e-003
Real(Eigenvalue) = -6.9315e-003
Timpi de recover (min) pt. speciile index:
(3)MetG1 (4)MetG2
(5)MetP1 (6)MetP2
(7)P1 (8)P2
(9)G1 (10)G2
(11)G1P1 (12)G2P2

specia nr. 3 t-rec = 0.000e+000


specia nr. 4 t-rec = 0.000e+000
specia nr. 5 t-rec = 0.000e+000
specia nr. 6 t-rec = 0.000e+000
specia nr. 7 t-rec = 2.574e+002
specia nr. 8 t-rec = 4.955e+002
specia nr. 9 t-rec = 4.968e+002
specia nr.10 t-rec = 4.968e+002
>> print CUP_2 -dbitmap

18
Varianta 3 =
cooperativa, cuplare functionala G1(P1)1; G2(P2)1
Varianta aleasa pentru simulare (1,2,3)? =3
Solutie stationara (0) sau perturbata (1) ? =1
Raport [P1]perturbat/[P1]s (0.9-1.1) =0.9
Concentratii stationare nominale (nM):
NutG=1.0000e+002 NutP=1.0000e+005
MetG1=1.0000e+004 MetG2=1.0000e+004
MetP1=1.0000e+004 MetP2=1.0000e+004
P1=1.0000e+003 P2=1.0000e+002
G1=5.0000e-001 G2=5.0000e-001
G1P1=5.0000e-001 G2P2=5.0000e-001
Varianta cuplate module nr.=3
Estimat k1= 6.9321649527800131e-004 k2= 7.6249655597496785e-007
Estimat k3= 6.9314718055994536e-009 k4= 1.3869875083004507e-003
Estimat k5= 6.9321649527800131e-004 k6= 7.0011330972457271e-007
Estimat k7= 6.9314718055994536e-009 k8= 1.3932258329254902e-004
Estimat k9= 1.0000000693147180e+002 k10= 1.0000000000000000e+005
Estimat k11= 1.0000000693147181e+003 k12= 1.0000000000000000e+005
Slope D(CP1)/D(CNutG) at QSS = -3.806212e+000
Slope D(CP1)/D(CNutP) at QSS = -4.057841e-003
Slope D(CP2)/D(CNutG) at QSS = -3.749535e-001
Slope D(CP2)/D(CNutP) at QSS = -4.564632e-004
Jacobian DF(j)/D[CMetG1,CMetG2,CMetP1,CMetP2,CP1,CP2,CG1,CG2,CG1P1,CG2P2]
val.proprii (crescator) =
Real(Eigenvalue) = -2.0005e+005
Real(Eigenvalue) = -2.0050e+005
Real(Eigenvalue) = -1.7647e-002
Real(Eigenvalue) = -1.1499e-002
Real(Eigenvalue) = -6.3178e-003
Real(Eigenvalue) = -6.9322e-003
Real(Eigenvalue) = -6.9315e-003
Real(Eigenvalue) = -6.9315e-003
Real(Eigenvalue) = -6.9315e-003

19
Real(Eigenvalue) = -6.9315e-003
Timpi de recover (min) pt. speciile index:
(3)MetG1 (4)MetG2
(5)MetP1 (6)MetP2
(7)P1 (8)P2
(9)G1 (10)G2
(11)G1P1 (12)G2P2

specia nr. 3 t-rec = 0.000e+000


specia nr. 4 t-rec = 0.000e+000
specia nr. 5 t-rec = 0.000e+000
specia nr. 6 t-rec = 0.000e+000
specia nr. 7 t-rec = 8.570e+001
specia nr. 8 t-rec = 3.148e+002
specia nr. 9 t-rec = 3.254e+002
specia nr.10 t-rec = 2.774e+002
specia nr.11 t-rec = 3.971e+002
specia nr.12 t-rec = 4.351e+002
>> print CUP_3 -dbitmap
>>

20

You might also like