

function yp = patterner(t, y, p)

% Define set of parameters
plux=p(1);
Rlux=p(2);
YXlux=p(3);
pRhl=p(4);
RRhl=p(5);
YXRhl=p(6);
ac=p(7);
n1=p(8);
n2=p(9);
n3=p(10);
n4=p(11);
n5=p(12);
Kxlux=p(13);
Yc=p(14);
al=p(15);
alm1=p(16);
alm2=p(17);
KxRhl=p(18);
Yl=p(19);
at=p(20);
Bc=p(21);
Bl=p(22);
Bt=p(23);
Yt=p(24);
ag=p(25);
Yg=p(26);
ar=p(27);
Yr=p(28);
ailux=p(29);
Yilux=p(30);
airhl=p(31);
Yirhl=p(32);
% n6=p(33);
% aActivator= p(34);
% KAct= p(35);
% YAct= p(36);


%ODEs

% · [y(1)] Xlux : LuxR/LuxI complex concentration
% · [y(2)]XRhl : RhlR/RhlI complex concentration
% · [y(3)]C : CI concentration
% · [y(4)]L : lacI concentration
% · Lm : LacImin concentration
% · [y(5)]T : tetR concentration
% · [y(6)]G : GFP concentration
% · [y(7)]R : RFP concentration
%   [y(8)]Ilux : LuxI concentration
% · [y(9)]IRhl : RhlI concentration
% . [y(10)] X  : RhlR compitor ( to neutralize RhlI)


yp=[
plux*Rlux^2*y(8)*y(8)- YXlux*y(1);
pRhl*RRhl*RRhl*y(9)*y(9)- YXRhl*y(2);
ac* y(1).^n1/(Kxlux.^n1+ y(1).^n1) - Yc*y(3);
al/(1+(y(3)/Bc).^n3)+ alm1*y(1).^n1./(Kxlux.^n1+y(1).^n1)+alm2*y(2)^n2/(KxRhl^2+y(2)^n2) - Yl*y(4);
at./(1+(y(4)/Bl).^n4) - Yt*y(5);
ag./(1+(y(4)/Bl).^n4) - Yg*y(6);
ar./(1+(y(5)/Bt).^n5) - Yr*y(7);
0;
0;
%ailux./(1+(y(5)/Bt).^n5) - Yilux*y(8)-plux*Rlux^2*y(8)*y(8); %Original
%Version
ailux./(1+(y(5)/Bt).^n5) - Yilux*y(8)-plux*Rlux^2*y(8)*y(8)-plux2*X^2*y(8)*y(8);
%airhl./(1+(y(4)/Bl).^n4) - Yirhl*y(9)- pRhl*RRhl*RRhl*y(9)*y(9); %Orignial version
%airhl./(1+(y(9)/KAct).^n6) - Yirhl*y(9);%with 2nn activator with high coopartivity
%aActivator./(1+(y(4)/Bl).^n4) - YAct*y(10); % """ 
aX./(1+(L/Bl).^n4 - YX*X;

];



  
