% thickness
th = 0.2;
% arbitrary displacement
disp = 1;

% First find the steady state
M = [   r/k    r/k       b;
        r/k*a  r/k       b-eps;
        c*b    c*(b-eps) 0       ];
ss = inv(M) * [r;r;d]

figure;
hold on;
for j=1:length(y_ss(:,1))
   % The section is made against N_1 = ss(1)
   if( (y_ss(j,1) > (ss(1)+disp-th)) & (y_ss(j,1) < (ss(1)+disp+th)) )
       % Reports printed values
       % [y(j,2) y(j,3)]
       plot(y_ss(j,2),y_ss(j,3),'.');
   end 
end

xlabel('N_2');
ylabel('P');
title('Poincare section through N_1-P plane passing through fixed point');
grid on;

str1 = ['Section made against N_1 = ' num2str( ss(1)+disp )];
str2 = ['Thickness of slice, th = ' num2str( th )];

x = 375;
y = 100;
t1 = text( x, y, str1 );
t2 = text( x, y-5, str2 );

set(t1, 'FontWeight', 'bold')
set(t1, 'FontWeight', 'bold')