function lv2_3d_ini(r1,k1,r2,k2,alfa12,alfa21,n0ini,n0end,n0step,nostep)
%Lotka Volterra system 
%This function plots response surface of one species to initial population values
%and growth rate of one species

%r1, r2 - intrinsic growth rates for species 1 
%k1, k2 - carrying capacities
%alfa12, alfa21 - competition coefficients
%n0ini,n0end,n0step - initial population sizes: minimum, maximum and difference between adjacent values
%nostep - number of steps for simulation



if n0ini >= n0end | n0step<=0 
   return;
end

start=min(100,nostep/2);
x=[];
z=[];
for n01=n0ini:n0step:n0end
   y=[];
   z1=[];
   for n02=n0ini:n0step:n0end
      x1=lv2_time(r1,k1,n01,r2,k2,n02,alfa12,alfa21,nostep);
      a=mean(x1(2,start:nostep)/(x1(1,start:nostep)+x1(2,start:nostep)));
      y=[y n02];
      z1=[z1 a];
   end
   x=[x n01];
   z=[z;z1];
end
%plot3(x,y,z);
surf(x,y,transpose(z));
xlabel('n01');
ylabel('n02');
zlabel('Proportion of species 2');

return;



