function [ dx ] = competitive_verhulst_dynamical_r( t,x,ODToChange )
%competitives growing with dynamical reproduction rate
%   t=time span
%   x= every odd value is a growing rate and every even value is the
%   population

global tOver1;
global firstTimeover1;

k = 4.92; % capacity in OD

species_multiply_2= length(x);
% display(species2);

%sum of alls species
sumSpecies=0;

%generate vector
dx=zeros(species_multiply_2,1);

%add all OD of all different adapted E. colis
for j= 1:species_multiply_2/2
    sumSpecies=sumSpecies+x(j*2);
end

%counter
i=1;

while i < species_multiply_2
    
    %change of reproduction rate in dependence of the OD
    if x(i+1)< ODToChange
        dx(i)= 0;
    else
        if firstTimeover1 ==true
            dx(i)=1*x(i)*(1-x(i)/0.67);
        else
            tOver1=t;
            firstTimeover1=true;
            dx(i)=1*x(i)*(1-x(i)/0.67);
        end
        
    end
    
    %cȟange of one adapted e. coli
    %reproduction rate* population * ration of remaining capacity with
    %stochastic
    dx(i+1) = (x(i)+0.01*randn(1))*x(i+1)*(1- sumSpecies/k);
    i=i+2;
end

% display(sumSpecies);
% display(dx);


end

