restart:
ode:=diff(p1(t),t)=p1(t)*(a*p1(t)-a*p1(t)^2-b*p2(t)^2),diff(p2(t),t)=p2(t)*(b*p2(t)-a*p1(t)^2-b*p2(t)^2);
with(DEtools):
a:=-1:b:=-2:
DEplot([ode],[p1(t),p2(t)],t=0..20,
[[p1(0)=.8,p2(0)=.2],[p1(0)=.1,p2(0)=.9]],
stepsize=.05,
scene=[p1(t),p2(t)],
linecolour=sin(t*Pi/2),title="a<0,b<0");
restart:
with(plots): with(DEtools):
DEplot(D(x)(t)=(x(t)*(1-x(t))*(-2*x(t)+1*(1-x(t)))),x(t),t=0..8,[[x(0)=0],[x(0)=1],[x(0)=.5],[x(0)=.3],[x(0)=0.72]],title=`a=-2,b=-1`,colour=magenta,linecolor=[gold,yellow,black,red,blue],stepsize=0.05);
restart:with(DEtools):with(plots):with(LinearAlgebra):
A:=Matrix([[0,-2,1],[1,0,1],[1,3,0]]);
X:=<x1,x2,x3>;
Transpose(X).A.X;
s:=expand(%);
L:=A.X;
L[1]-s;L[2]-s;L[3]-s;
DEplot3d({D(p1)(t)=p1(t)*(-2*p2(t)+p3(t)+p1(t)*p2(t)-2*p1(t)*p3(t)-4*p2(t)*p3(t)),
D(p2)(t)=p2(t)*(p1(t)+p3(t)+p1(t)*p2(t)-2*p1(t)*p3(t)-4*p2(t)*p3(t)),
D(p3)(t)=p3(t)*(p1(t)+3*p2(t)+p1(t)*p2(t)-2*p1(t)*p3(t)-4*p2(t)*p3(t))},{p1(t),p2(t),p3(t)},
t=0..10,
[[p1(0)=0.1,p2(0)=0.2,p3(0)=.7],[p1(0)=0.6,p2(0)=.2,p3(0)=.2],[p1(0)=1/3,p2(0)=1/3,p3(0)=1/3],[p1(0)=0,p2(0)=0,p3(0)=1]],scene=[t,p1(t),p2(t)],
stepsize=.1,orientation=[139,-106],linecolor=t);
restart:with(DEtools):with(plots):with(LinearAlgebra):
A:=Matrix([[0,1,-1],[-1,0,1],[1,-1,0]]);
X:=<x1,x2,x3>;
Transpose(X).A.X;
s:=expand(%);
L:=A.X;
L[1]-s;L[2]-s;L[3]-s;
ode:={D(p1)(t)=p1(t)*(p2(t)-p3(t)),
D(p2)(t)=p2(t)*(-p1(t)+p3(t)),
D(p3)(t)=p3(t)*(p1(t)-p2(t))};
subs(p3=1-p1-p2,ode);
G:=simplify(%);
DEplot3d({G[1],G[2]},{p1(t),p2(t)},
t=0..20,
[[p1(0)=0.1,p2(0)=0.2],[p1(0)=0.6,p2(0)=.2],[p1(0)=1/3,p2(0)=1/3]],
scene=[t,p1(t),p2(t)],
stepsize=.1,linecolor=t,title="Cycle around the steady state");