function [dx] = verhulst_growth_dynamicR( t , x, ODToChange)
% the logistic growth by verhulst 
%
% Input:	t:	time
%			x:	initial value of 1 growth rate; 2 population
%			ODToChange:	Gives the value when the growth change
% Output:	dx: function x'

%rember the timepoint wherehOD was reached to go dynamic reproduction rate 
global tOverOD;
%test if the culture is over a given OD
global firstTimeoverOD;

k = 4.92; % capacity in OD

dx=[0;0];

%change of reproduction rate
if x(2)< ODToChange
    dx(1)= 0;
else
    if firstTimeoverOD ==true
        dx(1)=1*x(1)*(1-x(1)/0.67);
    else
        tOverOD=t;
        firstTimeoverOD=true;
        dx(1)=1*x(1)*(1-x(1)/0.67);
    end
        
end

%change of ė. coli culture 
% reproduction rate* population * ration of remaining capacity
dx(2) = (x(1)+0.005*randn(1))*x(2)*(1- x(2)/k);
% dx(2) = x(1)*x(2)*(1- x(2)/k);

end