clear all
d0=1e-12;
A=[];Le=[];
for a=0:0.001:1.4
x1=0;y1=0;
x2=0;y2=d0;
lsum=0;
for j=1:500
x3=a-x1*x1+0.3*y1;
y1=x1;
x1=x3;
x4=a-x2*x2+0.3*y2;
y2=x2;
x2=x4;
d1=sqrt((x2-x1)^2+(y2-y1)^2);
x2=x1+(d0/d1)*(x2-x1);
y2=y1+(d0/d1)*(y2-y1);
if j>100
lsum=lsum+log(d1/d0);
end
end
le=lsum/(j-100);
A=[A;a];Le=[Le;le];
end
subplot(2,1,1)
plot(A,Le,'k')
grid
hold on
b=0.3;
n=2000;
x=0;
y=0;
a=0:0.001:1.4;
for i=1:n/100
xprev=x;
yprev=y;
x=a-xprev.*xprev+b*yprev;
y=xprev;
end
for i=1:n
xprev=x;
yprev=y;
x=a-xprev.*xprev+b*yprev;
y=xprev;
if i>1990
hold on
subplot(2,1,2)
plot(a,x,'k.','markersize',1);
title('Henon Bifurcation');
end
end
grid