{VERSION 5 0 "IBM INTEL LINUX" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "" -1 256 "" 1 24 0 0 0 0 0 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 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 256 59 "Example: Pendulum animation using the equations of motion:" } }{PARA 0 "" 0 "" {TEXT -1 55 " mu'' + g * \+ u' + k u =f(t)" }}{PARA 0 "" 0 "" {TEXT -1 93 "(Note: g is usually r eserved for gravity, but Maple has \"gamma\" reserved for something el se," }}{PARA 0 "" 0 "" {TEXT -1 58 "which is why we're using \"g\" for the friction coefficient)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "f:= 0; #This is the forcing function" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "m:=1; g:=0; k:=1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "de:=m*diff(u(t),t$2)+g*diff(u(t),t)+k*u(t)=f;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "U:=rhs(dsolve(\{de,u(0)=1, D(u)(0)=-1\},u(t)));" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "dU:=diff(U,t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(plots):" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 16 "with(plottools):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 108 "Here, we show the \"Actu al\" Pendulum- For the animation, I took the length of the pendulum t o be fixed at 1." }}{PARA 0 "" 0 "" {TEXT -1 107 "Remember that the \" u\" we solved for is the angle the pendulum makes with the vertical ax is- An interesting" }}{PARA 0 "" 0 "" {TEXT -1 109 "question is: Wha t are the (x,y) coordinates of the pendulum's bob? It's answered belo w in the animation set" }}{PARA 0 "" 0 "" {TEXT -1 87 "of commands. Y ou will not have to change anything here, except for \"noffm\" and \" divs\"" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 71 "numsteps:=100; divs:=5; #The time values go from 0 to numsteps/5 = 20" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "for i from 0 by 1 to numsteps do" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 24 "theta:=subs(t=i/divs,U);" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 46 "x1:=evalf(sin(theta)); y1:=evalf(-cos(theta));" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "rod[i]:=curve([[0,0],[x1,y1]]):" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "ms[i]:=disk([x1,y1],0.02,color=red) :" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "anima[i]:=display(\{rod[i],ms[ i]\});" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "od:" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 86 "display([seq(anima[i],i=0..numsteps)],insequen ce=true,scaling=constrained, axes=none);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 100 "Here is the \"Phase Plan e\" plot of u(t) versus u'(t)- Same behavior, just a different visual ization." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "plot([U,dU,t=0..20]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 53 "Here is the standard visu alization of u(t) and u'(t):" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "plot([U,dU],t=0..20,color=[r ed,black]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK " 17" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }