function [A_, d, V]= p11_sh_np(n,p)
% CEE 2016

% April 2016, March 2017, J. Gaspar

% nonlinear dynamics (local evolution)
u= n.*(1-n-p);
v= p.*(.5-p/4 -3*n/4);

% linearized dynamics (get eigenvalues and eigenvectors to show)
A= mk_fn(n,p);
[V,D]= eig(A);
d= diag(D);

% return data or print it
if nargout>0
    A_=A;
    return;
end

% print results
fprintf(1, '\n---- Case:  N=%.1f P=%.1f => dN=%.1f dP=%.1f\n', n,p, u,v)
fprintf(1, 'lambda1=%f \t lambda2=%f', d(1), d(2));
if sum(d<0)==2
    fprintf(1, '\t** stable equilibrium point **\n');
else
    fprintf(1, '\n');
end
V


function A= mk_fn(n,p)
% linearization at (n,p)
% n,p : 1x1
% A   : 2x2

A= [1-2*n-p -n; -3*p/4 .5-p/2-3*n/4];
