% find Henon param where p-1 goes unstable and splits into 2 p-2 sinks.
% barnett 10/12/09

N=3e4;                 % how many its: need to increase this when zoom in in a!
x = zeros(2,N+1); b = -0.3;
figure;
for a=1.267:1e-4:1.268 %a=1.2:0.001:1.28 % for coarse use N=1e3, then N=3e4
  f = @(x) [a-x(1,:).^2+b*x(2,:);  x(1,:)]; % Henon map w/ params a,b
  x(:,1) = [.5;.5];                                   % initial value
  for n=1:N, x(:,n+1) = f(x(:,n)); end                % iterate a lot
  plot([a a],x(1,end-1:end), '.'); hold on; drawnow
end

% ans: a_crit = 1.2674 to 4 decimals
