9.4. Example 2: x' = 2x - 2x^2 + xy, y' = 5y - 3y^2 + xy/2.
| > | with(DEtools):with(plots):with(plottools): # Load various packages |
| > | # First, I mark the three critical points with small blue disks. |
| > | C1:=disk([0,0],0.05,color=blue): |
| > | C2:=disk([0,5/3],0.05,color=blue): |
| > | C3:=disk([1,0],0.05,color=blue): |
| > | C4:=disk([2,2],0.05,color=blue): |
| > | # Then I create the solutions for several initial conditions. |
| > | solutioncurves:=phaseportrait([D(x)(t) = 2*x(t)-2*x(t)^2+x(t)*y(t), D(y)(t)= 5*y(t)-3*y(t)^2+x(t)*y(t)/2],[x(t),y(t)],t=0..3, [[x(0)=3,y(0)=3],[x(0)=2,y(0)=3],[x(0)=1,y(0)=3],[x(0)=0.5,y(0)=3],[x(0)=1,y(0)=0.1],[x(0)=0.5,y(0)=0.1],[x(0)=2,y(0)=0.1],[x(0)=0.1,y(0)=0.1],[x(0)=0.0,y(0)=0.1],[x(0)=3,y(0)=0],[x(0)=3,y(0)=1],[x(0)=3,y(0)=2],[x(0)=0.1,y(0)=3]],x=0..3,y=0..3,linecolor=red,arrows=none,numpoints=100): |
| > | # Then I create the vector field. |
| > | vectorfield:=fieldplot([2*x-2*x^2+x*y,5*y-3*y^2+x*y/2],x=0..3,y=0..3,arrows=slim,anchor=tail,fieldstrength=maximal(2),grid=[20,20]): |
| > | # Finally, this is all displayed. |
| > | display(solutioncurves,vectorfield,C1,C2,C3,C4); |
![]() |