% three candidates
a=2;
b=.55;
dt=.05;
total=1000;
n=floor(total/dt);
x=zeros(n,1);
y=zeros(n,1);
z=zeros(n,1);
t=zeros(n,1);

x(1)=.4;
y(1)=.45;
z(1)=.55;
t(1)=0.0;
for j=2:n
       xx=x(j-1);
       yy=y(j-1);
       zz=z(j-1);
t(j)=t(j-1)+dt;
x(j)=xx+dt*xx*(1-xx-a*yy-b*zz);
y(j)=yy+dt*yy*(1-yy-a*zz-b*xx);
z(j)=zz+dt*zz*(1-zz-a*xx-b*yy);
end
figure
plot(t,x)
hold on
  plot(t,y)
hold on
  plot(t,z)
figure 
  scatter(x,y,'.')

