function dY = repressilator(time,Y,FLAG,struct)

%space allocation for the derivative
dY=zeros(3,1);

%Y(1) is x1
dY(1)=struct.V1/(struct.K1+Y(2)^struct.n1)-Y(1);

%Y(2) is x2
dY(2)=struct.V2/(struct.K2+Y(3)^struct.n2)-Y(2);

%Y(3) is x3
dY(3)=struct.V3/(struct.K3+Y(1)^struct.n3)-Y(3);