Logistic map/Computer simulation

From Wikipedia

< Logistic map

HomePage | Recent changes | View source | Discuss this page | Page history | Log in |

Printable version | Disclaimers | Privacy policy

Here are some Octave scripts to experiment for yourself:


r_min = 2.5;
r_max = 4;
t_max = 1000;
p_max = 100;
n = 1000;
x0 = 0.1;
r = linspace(r_min, r_max, n);
pop = zeros(p_max, n);
for k = 1:n
  x = population(r(k), x0, t_max);
  pop(:, k) = x(t_max-p_max+1:t_max);
end
gset nokey;
plot(r, pop, 'b.');

function x =  population(r, x0, n)
  x = zeros(n, 1);
  x(1) = x0;
  for k = 1:n-1
    x(k + 1) = r * x(k) * (1 - x(k));
  end