Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Logistic equation with delay
Replies: 8   Last Post: Mar 24, 2014 3:42 AM

 Search Thread: Advanced Search

 Messages: [ Previous | Next ]
 Sankar Posts: 4 Registered: 3/20/14
Logistic equation with delay
Posted: Mar 20, 2014 11:26 PM
 Plain Text Reply

I am trying to solve a logistic equation with delay WITHOUT using dde23. So the delay is of the form: ddtN(t)=N(t)(a-bN(t-?t)),a>0,b>0

I have a function called logistic that looks like this:
function dN = logistic(t,N)
global a b;
dN = (a-N.*b)*N;

And another file that calls this function with ode45 like this:
global a b;
a = 4;
b = 1;
[t, N] = ode45('logistic', [0:.01:5], 10);

I think I understand how to write a for-loop to calculate the logistic equation with delay of 1 since I'm picking my ? to be 1; but I'm not getting the correct results. Here is the code:
S=zeros(501,1);
t=zeros(501,1);
S(1)=0;

for iterate=1:501
S(i) = S(i-1) + r*S(i-1)*(1-b*S(i-1))
end
plot(t,S)

Any ideas?

Date Subject Author
3/20/14 Sankar
3/21/14 Torsten
3/21/14 Sankar
3/21/14 Torsten
3/21/14 Sankar
3/21/14 Torsten
3/21/14 Steven Lord
3/21/14 Sankar
3/24/14 Torsten

© The Math Forum at NCTM 1994-2018. All Rights Reserved.