clear all

whitebg
figure(1);

disp('Enlarge Figure & Press Any Key to continue');

pause

for b=3.5:0.0005:3.99;
n=2047;
xinit=0.25;
x(1)=xinit;
time(1)=0;
for k=2:n+1;
time(k)=k-1;
x(k)=b*x(k-1)*(1-x(k-1));
end

y=diff(x);
X=fft(y,2048);
Pxx=X.*conj(X)/2048;
q1=x(1:length(x)-1);
q2=x(2:length(x));
pause(0.0000000000000000000000001);

subplot(221);
plot(x,'r.','MarkerSize',6);
axis([1 2045 0 1]);
title(['Logis. map for \alpha: ', num2str(b)]);
grid;

subplot(222);
plot(q1,q2,'.');
title('Poincaré section');
grid;

subplot(223);
hyyt(x,150);
title('Histogram');
grid;

subplot(224);
plot(Pxx,'b');
axis([1 2000 0 5]);
title('Spectrum');
grid;

end


% "Complex and Chaotic Nonlinear Dynamics. 
% Advances in Economics and Finance, 
% Mathematics and Statistics" 
% T.Vialar, Springer 2009.
% Copyright(c).