function [Xdot] = UCD2013RiboTALe(t,X)
%Xdot(6)-Xdot(9) are set to zero for ease of solving this system repeatedly
%for multivariate induction conditions--Set inducer concentrations and TALe
%dissociation constant as initial values when you call this function. 

C0_tetR =  10^-5   ;C0_araC = 10^-5  ;
n_pBad = 2.8; n_pTet = 1;%source: openwetware supplemental materials

Kd_pTet = 3.83*10^-9; %source: openwetware supplemental materials 
Kd_pBad = .09*10^-3;%source: openwetware supplemental materials
Kd_tbs = 1.3*10^-9; %for tal8, for tal 1 the value is 240 nM, source: Meckler et al.
Kd_RS =  3.2*10^-3;%adjusted from Gallivan et al

C_tetR = (C0_tetR) * (X(7)^n_pTet/ (Kd_pTet^n_pTet + X(7)^n_pTet));
C_araC = (C0_araC) * (X(6)^n_pBad / (Kd_pBad^n_pBad + X(6)^n_pBad));
Cf_tetR = C0_tetR - C_tetR;
Cf_araC = C0_araC - C_araC;

K1_pBad = 0.009; K1_pTet = 350; K2_pBad = 37.5/C0_araC; K2_pTet = 160/C0_tetR; K3_pBad = 3.4/C0_araC; 

PBad = (K1_pBad + Kd_pBad*C_araC)/ (1+K1_pBad+K2_pBad*C_araC+K3_pBad*Cf_araC);
PTet = K1_pTet / (1+K1_pTet+2*K2_pTet*Cf_tetR+(K2_pTet^2)*(Cf_tetR^2));
Pribo= 1 / (1 + Kd_RS/X(8));
Ptbs = 1 / (1 + X(2)/X(9));

tc_rsTAL = .01; tl_rsTAL = .02;%source: bionumbers
tc_GFP = .03;  tl_GFP = .06;%source: bionumbers
mRNAdeg = .0017; %source: bionumbers
protdeg_TAL = .000056;
protdeg_GFP = .0002;%with LVA tag
mat = .00067; %GFP maturation rate (20-30 minutes)

Xdot(1) = tc_rsTAL*PBad - mRNAdeg*X(1); %riboswitch_TAL mRNA
Xdot(2) = tl_rsTAL*Pribo - protdeg_TAL*X(2); %TAL protein 
Xdot(3) = tc_GFP*PTet*Ptbs - mRNAdeg*X(3); %GFP mRNA
Xdot(4) = tl_GFP*X(3) - protdeg_TAL*X(4)-mat*X(4);%GFP intermediate
Xdot(5) = mat*X(4) - protdeg_GFP*X(5); %GFP protein
Xdot(6) = 0; %[ara]
Xdot(7) = 0; %[aTC]
Xdot(8) = 0; %[theo]
Xdot(9) = 0; %[Kd tbs] 

Xdot = Xdot';
end



