% step2.m 
% compute the eigenvalues of the Jacobian 
% for beta in an interval
% and plot the real and imaginary parts of the eigenvalues 

bbeta=[.88:.00001:.92];     % create vector of beta values, short interval
% bbeta=[.01:.01:30];     % create vector of beta values, long interval
N=size(bbeta,2); 

arr=arrhen(Xbar(2)); 
arrprime=arr*gamma*Xbar(2)^(-2);

clear lamm

for j=1:N
  beta=bbeta(j);
  A=[-1-arr -Xbar(1)*arrprime; alpha*arr -1-beta+alpha*Xbar(1)*arrprime];
  lamm(:,j)=eig(A);
end

figure(2)
clf
% plot the real part (green) and imaginary part (red) of lamm versus bbeta
plot(bbeta,real(lamm)','g',bbeta,imag(lamm)','r')
hold
plot(bbeta,zeros(size(bbeta)))  % the beta axis
