function threeGenes();



x0=[0.6666666666666800E+00  0.5725442609222200E+00  0.4175669922760500E+00  0.3999999890200700E+00  ...
    0.3640816287435600E+00  0.2945636523866600E+00  0.1419111618608830E+01  0.9346086288821400E+00  ...
    0.1000000000000000E+00  0.5000000000000000E-01  ]; 

tspan = [0:6:120];
[t,p] = ode15s(@ode_linear,tspan,x0);
plot(t,p(:,1),'ro-');
hold on;
plot(t,p(:,2),'bs-');
plot(t,p(:,3),'gd-');
legend('G_1','G_2','G_3');




function dx = ode_linear(t,x);
dx = zeros(10,1); 

V1  =1.0;
Ki1 =1.0;
ni1=2.0;
Ka1 =1.0;
na1=2.0;
k_1 =1.0;

V2  =1.0;
Ki2 =1.0;
ni2=2.0;
Ka2 =1.0;
na2=2.0;
k_2 =1.0;

V3  =1.0;
Ki3 =1.0;
ni3=2.0;
Ka3 =1.0;
na3=2.0;
k_3 =1.0;

V4  =0.1;
K4  =1.0;
k_4 =0.1;

V5  =0.1;
K5  =1.0;
k_5 =0.1;

V6  =0.1;
K6  =1.0;
k_6 =0.1;

kcat1=1.0;
Km1 =1.0;
Km2 =1.0;

kcat2=1.0;
Km3 =1.0;
Km4 =1.0;

kcat3=1.0;
Km5 =1.0;
Km6 =1.0;


dx(1) = V1/(1+(x(10)/Ki1)^ni1+(Ka1/x(9))^na1)- k_1*x(1); % G1

dx(2) = V2/(1+(x(10)/Ki2)^ni2+(Ka2/x(7))^na2) - k_2*x(2); % G2

dx(3)= V3/(1+(x(10)/Ki3)^ni3+(Ka3/x(8))^na3) - k_3*x(3); % G3

dx(4) = V4*x(1)/(K4+x(1)) - k_4*x(4); % E1

dx(5)= V5*x(2)/(K5+x(2)) - k_5*x(5); % E2

dx(6)= V6*x(3)/(K6+x(3)) - k_6*x(6); % E3

dx(7)= kcat1*x(4)*(1/Km1)*(x(9)-x(7))/(1+x(9)/Km1+x(7)/Km2)-...
    kcat2*x(5)*(1/Km3)*(x(7)-x(8))/(1+x(7)/Km3+x(8)/Km4); % M1
              
dx(8) = kcat2*x(5)*(1/Km3)*(x(7)-x(8))/(1+x(7)/Km3+x(8)/Km4)-...
    kcat3*x(6)*(1/Km5)*(x(8)-x(10))/(1+x(8)/Km5+x(10)/Km6); % M2


dx(9)=0; % S
dx(10)=0; % P



 
