[Home]Logistic map/Computer simulation

HomePage | Logistic map | Recent Changes | Preferences

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


HomePage | Logistic map | Recent Changes | Preferences
This page is read-only | View other revisions
Last edited September 24, 2001 1:24 am by 212.187.124.xxx (diff)
Search: