{VERSION 2 3 "SUN SPARC SOLARIS" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 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 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "restart:with(plots): " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 33 "Mass=1, g=1, \"spring\" const ant=3." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 522 "ns:=1300: x:=.2: y:=0: h:=0.1: k:=3: \npl:=[x,-y]: vx:=0: vy:=0:\nfor i from 1 to ns d o\n l:=evalf(sqrt(x^2+y^2)):\n if l>1.0 then\n sf:=k*(l-1.)/l:\n \+ xf:=-x*sf:\n yf:=1.-y*sf:\n else\n xf:=0.:\n yf:=1.:\n f i:\n vx:=vx+h*xf;\n vy:=vy+h*yf;\n if vx>0 then vx:=vx-vx^2/1000: e lse vx:=vx+vx^2/1000: fi:\n if vy>0 then vy:=vy-vy^2/1000: else vy:=v y+vy^2/1000: fi:\n vx:=vx*.999:\n vy:=vy*.999:\n x:=x+h*vx;\n y:=y +h*vy:\n xx[i]:=x:\n yy[i]:=-y:\n pl:=pl,[x,-y]:\n#plt[i]:=pointplo t([[0,0],[x,-y]], connect=true, #):\nod:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "#display(seq(plt[i],i=1..ns));" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 63 "pointplot([pl], connect=true, scaling=constrai ned, axes=boxed);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 139 "anima te([t*xx[round(j)],t*yy[round(j)],t=0..1],j=1..ns, numpoints=2, frames =ns, scaling=constrained, axes=boxed, color=black, thickness=2);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}}{MARK "7 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 }