%iGEM 2008: MB
%Function : computes the time derivatives of ODEs for Inducible Promoter 1 and
%returns them in a vector.  This is for use with a ODE solver 

function dxdt=InduciblePromoter_ODE(t,x)
global K_1 K_2 K_3 K_4 K_5 K_6 K_7 K_8 delta1 delta2;

T = x(1); % LacI
U = x(2); % IPTG
V = x(3); % LacI2-IPTG
W = x(4); % P
X = x(5); % P-LacI2
Y = x(6); % GFP


dTdt = K_1-delta1*T -K_2*U*T*T+K_3*V -K_4*W*T*T+K_5*X;
dUdt = -K_2*U*T*T+K_3*V -K_6*U*X+K_7*W*V;
dVdt = K_2*U*T*T-K_3*V+K_6*U*X-K_7*W*V;
dWdt = -K_4*W*T*T+K_5*X+K_6*U*X-K_7*W*V;
dXdt = K_4*W*T*T-K_5*X - K_6*U*X+K_7*W*V;
dYdt = K_8*W-delta2*Y;

dxdt=[dTdt; dUdt; dVdt; dWdt; dXdt; dYdt];



