setdefault;

% Enter the range of k here
k = [200:1:2500];
ss = zeros( length(k), 3 );

for j = 1:length(k)
   M = [    r/k(j)    r/k(j)       b;
            r/k(j)*a  r/k(j)       b-eps;
            c*b       c*(b-eps) 0       ];
   temp = inv(M) * [r;r;d];
   ss(j,1) = temp(1);
   ss(j,2) = temp(2);
   ss(j,3) = temp(3);
end

plot3(ss(:,1),ss(:,2),ss(:,3));
hold on;
xlabel('N_1^*');ylabel('N_2^*');zlabel('P^*');
title('Nontrivial fixed point as parametrized by k');
grid on;

% Label some reference points
N = length(k);
zdisp = 2;

str = ['k = ' num2str( k(1) )];
t1  = text( ss(1,1), ss(1,2), ss(1,3)+zdisp, str );
set(t1, 'FontWeight', 'bold')
plot3(ss(1,1),ss(1,2),ss(1,3),'g*');

str2 = ['k = ' num2str( k(N) )];
t2  = text( ss(N,1), ss(N,2), ss(N,3)+zdisp, str2 );
set(t2, 'FontWeight', 'bold')
plot3(ss(N,1),ss(N,2),ss(N,3),'r*');

