function yOut = logisticEuler(x,param)
%%% param vector is of the form growth rate and carrying capacity
%%% x vector is of the form y0, and dt (intervals), nTimsteps
%%% Solves logisitic model using forward Euler method, with a reality
%%% constraint of a purely positive population size
a = param(1);
K = param(2);

y0=x(1);
dt=x(2);
nOut=x(3);


%yp = a*y*(1-y./K);


yOut=zeros(1,nOut);
yOut(1)=y0;
for i=2:nOut
	yp = a*yOut(i-1)*(1-yOut(i-1)./K);
	yOut(i)=max(yOut(i-1)+yp*(dt),0);  %%% Reality constraint so that it doesn't go negative
end
