close all;
clear all;

% Discrete Logistic Model
% Investigate the long-time behavior of the model using
% different values of P0 and r

% create two vectors of zeros [t, p(t)]
N = 21; % number of all time periods to be checked
y = linspace(0,20,N);
p = zeros(1,N);

% initial values for r, p
K = 1; % population is normalized, so capacity is 1
r = 1.7;
p(1) = 0.01;

% calculate population for all time periods
for i = 2:N
  p(i) = p(i-1) + r*p(i-1)*(1-p(i-1)/K);  
end

figure (1);
plot (y,p(:)); 
xlabel('Steps');
ylabel('Population');


