{VERSION 3 0 "IBM INTEL LINUX" "3.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(plots):" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 14 "k:='k':c:='c':" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "#defini ng these saves typing later" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "fxns:=\{y1(t),y2(t)\};" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%fxnsG <$-%#y1G6#%\"tG-%#y2GF(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " #these are the equations " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "sys:=D(y1)(t)=y2(t), D(y2)(t)=-c*y2(t)-k*sin(y1(t));" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#>%$sysG6$/--%\"DG6#%#y1G6#%\"tG-%#y2GF,/--F)6#F/ F,,&*&%\"cG\"\"\"F.F7!\"\"*&%\"kGF7-%$sinG6#-F+F,F7F8" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "c:=3;k:=1;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"cG\"\"$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"kG\" \"\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "#trajectories start ing on the positive y2 axis" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 164 "for i from 1 to 14 do p[i]:=dsolve(\{sys,y1(0)=0,y2(0)=i*Pi/7\},f xns,type=numeric): pl[i]:=odeplot(p[i], [y1(t),y2(t)],0...15, numpoint s=250,view=[0...6,-3...3]): od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 313 "#so the way it \+ works is, the p[i] is defined to be the numerical solution of the diff erential equations with the initial data given in the curly brackets, \+ the pl[i] is then defined as the odeplot of this. the do loop runs thr ough various initial data, the numpoints gives the number of points us ed by the numerics" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "#trajectories starting on th e negative y2 axis" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 166 "for \+ i from 1 to 14 do q[i]:=dsolve(\{sys,y1(0)=i*Pi/8,y2(0)=0\},fxns,type= numeric): ql[i]:=odeplot(q[i], [y1(t),y2(t)],-15...15, numpoints=150,v iew=[0...6,-3...3]): od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "#trajectories starting \+ at the first saddle point" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "s:=dsolve(\{sys,y1(0)=Pi-.01,y2(0)=0\},fxns,type=numeric):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 73 "sl1:=odeplot(s, [y1(t),y2(t) ],0...40, numpoints=100,view=[0...6,-3...3]):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 74 "sl2:=odeplot(s, [y1(t),y2(t)],-12...0, numpoints =100,view=[0...6,-3...3]):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "z:=dsolve(\{sys,y1(0)=Pi+.01,y2(0)=0\},fxns,type=numeric):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 73 "sl3:=odeplot(z, [y1(t),y2(t) ],0...40, numpoints=100,view=[0...6,-3...3]):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 74 "sl4:=odeplot(z, [y1(t),y2(t)],-12...0, numpoints =100,view=[0...6,-3...3]):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "display(\{sl1,sl2,sl3,sl4\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "#trajectories starting at the 0 point" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 408 "t:=dsolve(\{sys,y1(0)=-.01,y2(0)=0 \},fxns,type=numeric):tl1:=odeplot(t, [y1(t),y2(t)],0...12, numpoints= 100,view=[0...6,-3...3]):\ntl2:=odeplot(t, [y1(t),y2(t)],-12...0, nump oints=100,view=[0...6,-3...3]):\nzt:=dsolve(\{sys,y1(0)=+.01,y2(0)=0\} ,fxns,type=numeric):\ntl3:=odeplot(zt, [y1(t),y2(t)],0...12, numpoints =75,view=[0...6,-3...3]):\ntl4:=odeplot(zt, [y1(t),y2(t)],-12...0, num points=75,view=[0...6,-3...3]):\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "display(\{tl1,tl2,tl3,tl4\});" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 118 "#display the plots, after trying various comb inations, it seems using only the odd trajectories gave the nicest out put" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 151 "display(\{ql[1],ql[3],ql[5],ql[7],ql[9],ql[ 11],ql[13],pl[1],pl[3],pl[5],pl[7],pl[9],pl[11],pl[13],sl1,sl2,sl3,sl4 ,tl1,tl2,tl3,tl4\},scaling=constrained);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 237 "#traje ctories starting on the negative y2 axis\nfor i from 1 to 14 do r[i]:= dsolve(\{sys,y1(0)=1.9*sin(Pi*i/7),y2(0)=1.9*cos(Pi*i/7)\},fxns,type=n umeric): rl[i]:=odeplot(r[i], [y1(t),y2(t)],0...15, numpoints=350,view =[-6...6,-3...3]): od:\n\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "display(\{rl[1],rl[3],rl[5],rl[7],rl[9],rl[11],rl[13]\});" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "32 0 0" 116 } {VIEWOPTS 1 1 0 1 1 1803 }