function bacteriaODE(x0,T,pp,kk,s)

% solves the initial value problem x'= px -kx^2, x(0)=x0
% by Runge-Kutta-Fehlberg (explicit) or by the trapezoidal rule (implicit)
% parameter:
% initial value x0; final time T; birth rate p, competition rate k, 
% method selection explicit (s=0) or implicit (s=1)
% examples: bacteriaODE(1,1,4,2,s) versus  bacteriaODE(1,1,4000,2000,s)

global p;
global k;



p=pp;
k=kk;

if nargin==4 s=0; end

if s 
ode23t('bacteria',[0 T],x0,odeset('OutputFcn',@odeplot))
else 
ode45('bacteria',[0 T],x0,odeset('OutputFcn',@odeplot))
end

clear

return