%solves logistic equation with Euler  


global c ad bd delay;

tdelay=2.1;
c=0;
%ad=17;
%bd=3.7;
ad=14.5;
bd=3.8;

tmax=300;
dt=.1;
%y(1)=0.67;
y(1)=2.73;
time=0;
nt=1;
t(1)=time;
delay=tdelay/dt
 

 
while time < tmax
 
timep=time+dt;

if timep > tmax
  dt
  time
  dt=tmax-time
end

[time,y,nt]=euler(time,y,nt,dt);
time=time+dt;
t(nt)=time;

end
 
nt
time
 
figure(1);
%plot(t(1:nt),y(1:nt),'+');
plot(t(1:nt),y(1:nt));
ylabel('u');
axis([0 tmax 2 3]);


