# Some simple Maple commands for Phase Portraits > with(DEtools): # First we define the set of ODEs > A:=[D(x)(t)=-y,D(y)(t)=x]; # Dfieldplot makes a aplot of the vector field. > dfieldplot(A,[x,y],t=0..1,x=-1..1,y=-1..1,title="Harmonic > Oscillator"); # An alternative derivative notation:s > eqs:=[diff(x(t),t)=mu-(x(t))^2,diff(y(t),t)=-y(t)]; > dfieldplot(subs(mu=2.0,eqs),[x(t),y(t)],t=-2..2,x=-4..4,y=-4..4,arrows > =SLIM); # Here is another set of ODEs, the "Parrot" > A := [D(x)(t)=y+y^2,D(y)(t)=-x+y/5-x*y+6*y^2/5]; > # phaseportrait can draw trajecties as well > phaseportrait(A,[x,y],t=-2..7,[[0,1.2,1.2],[0,1,.7],[0,0.1,0]],stepsiz > e=0.02,title="Phase Portrait"); # Standard Example of Attracting fixed point that is not Lyapunov Stable > r:= sqrt(x^2+y^2); > f:= D(x)(t)=(x^2*(y-x)+y^6)/(r^2*(1+r^4)); > g:= D(y)(t)=(y^2*(y-2*x))/(r^2*(1+r^4)); > A:= [f,g]; > phaseportrait(A,[x,y],t=-0..10,[[x(0)=0.01,y(0)=0.1],[x(0)=-0.2,y(0)=0 > .1],[x(0)=-.1,y(0)=0.1],[x(0)=-0.05,y(0)=0.1]],stepsize=0.2); > dfieldplot(A,[x,y],t=-10..10,x=-0.5..1,y=-0.5..1,title="Vector > Field");