% derivsub_ratio.m

function [out]=derivsub(t, in);

global I_n f s I_p r q m k alpha;


% set values
N=in(1,1);
P=in(2,1);

% calculate derivatives
out(1,1)=I_n - s*N + (1 - (1 / (1 + exp(-alpha*(N./P + k)))));
out(2,1)=I_p + (r*P^q/(m^q + P^q)) - s*P;
