function  y = metapop2_lines(imi1,ext1,imi2,ext2,domcon)
%This is a function calculating equilibrium lines for metapopulation dynamics of two species 


nobin = 400;

incr1 = 1.1*max([1-ext1/imi1,1-ext2/imi2,(imi2-ext2)/(imi1+imi2)])/nobin;
x = [];
y1 = [];
y2 = [];
for t=0:nobin
   x1 = incr1*t;
   if (domcon)
      y1t = (imi2-ext2-(imi1+imi2)*x1)/imi2;
   else
      y1t = (1-x1-ext1/imi1);
      y2t = (1-x1-ext2/imi2);
   end
   x = [x x1];
   y1=[y1 y1t];
   if (~domcon)
      y2=[y2 y2t];
      
   end
end

if (domcon)
   y=[x; y1];
else
   y=[x; y1; y2];
end

   
   
   