{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 2 1 2 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 2 2 2 0 0 0 1 }{CSTYLE "2D Comment" -1 18 "Times" 0 1 0 0 0 0 0 0 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle12" -1 220 "Times" 1 18 0 0 0 1 2 1 1 2 2 2 0 0 0 1 }{CSTYLE "_cstyle13" -1 221 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle14" -1 222 "Times" 1 12 0 0 0 1 1 2 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle15" -1 223 "Courier" 1 12 255 0 0 1 2 1 2 2 1 2 0 0 0 1 }{CSTYLE "_cstyle16" -1 224 "Times" 1 12 0 0 0 1 1 1 2 2 2 2 0 0 0 1 }{CSTYLE "" 221 256 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 } {CSTYLE "" 221 257 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 221 258 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" 221 261 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 2 0 2 0 2 2 0 1 }{PSTYLE "_pstyle7" -1 207 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 1 2 2 2 1 1 1 1 }3 1 0 0 12 12 2 0 2 0 2 2 0 1 }{PSTYLE "_pstyle8" -1 208 1 {CSTYLE "" -1 -1 "Time s" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 2 0 2 0 2 2 0 1 } {PSTYLE "_pstyle9" -1 209 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 2 0 2 0 2 2 0 1 }{PSTYLE "_pstyle10" -1 210 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 256 1 {CSTYLE "" -1 -1 "T imes" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 2 0 2 0 2 2 0 1 } } {SECT 0 {EXCHG {PARA 207 "" 0 "" {TEXT 220 33 "Two Pendulums Coupled b y a Spring" }}{PARA 256 "" 0 "" {TEXT -1 29 "by Jason Schattman, Maple soft" }}{PARA 256 "" 0 "" {TEXT -1 26 "applications@maplesoft.com" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 208 "" 0 "" {TEXT 221 172 "We model the motion of two identical pendulums swinging in parall el planes, attached by a spring. We describe the motion by the pendul ums' angles of deflection over time, " }{XPPEDIT 2 0 "theta(t)" "6#-%& thetaG6#%\"tG" }{TEXT 221 5 " and " }{XPPEDIT 2 0 "alpha(t)" "6#-%&alp haG6#%\"tG" }{TEXT 221 3 ". " }}{PARA 208 "" 0 "" {TEXT -1 0 "" }} {PARA 208 "" 0 "" {TEXT 221 42 "We assume that the pendulums swing in \+ the " }{TEXT 222 4 "x-z " }{TEXT 221 24 "plane, their hinges are " } {TEXT 222 1 "d" }{TEXT 221 188 " units apart on the y-axis, they have \+ unit length and unit mass, and their mass is concentrated at the ends. Pendulum 1 swings about the origin, and pendulum 2 swings about the \+ point (0, " }{TEXT 222 1 "d" }{TEXT 221 47 ", 0). We assume the sprin g has natural length " }{TEXT 222 1 "d" }{TEXT 221 3 ". " }}{PARA 208 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 15 "Initi alizations" }}}{EXCHG {PARA 208 "> " 0 "" {MPLTEXT 1 223 8 "restart;" }}{PARA 208 "> " 0 "" {MPLTEXT 1 223 95 "with(plots):with(plottools):w ith(LinearAlgebra):with(VectorCalculus): interface(showassumed=0):" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 102 " Assume all values are real, and positive, if appropriate. This will h elp Maple simplify the formulas." }}}{EXCHG {PARA 208 "> " 0 "" {MPLTEXT 1 223 51 "assume( theta(t)::real, alpha(t)::real, t>0, d>0 ); " }}}{EXCHG {PARA 208 "" 0 "" {TEXT -1 0 "" }}{PARA 208 "" 0 "" {TEXT 221 44 "The radial vectors of the pendulums at time " }{TEXT 222 1 "t " }{TEXT 221 1 "." }}}{EXCHG {PARA 208 "> " 0 "" {MPLTEXT 1 223 113 "r adius1 := Vector([ sin(theta(t)), 0, -cos(theta(t)) ]);\nradius2 := Ve ctor([ sin(alpha(t)), d, -cos(alpha(t)) ]);" }}}{EXCHG {PARA 208 "" 0 "" {TEXT -1 0 "" }}{PARA 208 "" 0 "" {TEXT 221 11 "The vector " } {TEXT 224 1 "r" }{TEXT 221 26 " between the ends at time " }{TEXT 222 3 "t, " }{TEXT 221 103 "and the distance. Note that the distance form ula can be distilled down to just one trigonometric term." }}}{EXCHG {PARA 208 "> " 0 "" {MPLTEXT 1 223 107 "r := radius2 - radius1;\ndist0 := Norm( r, 2 );\ndist1 := simplify( dist0 );\ndist := combine( dist 1, trig );" }}}{EXCHG {PARA 208 "" 0 "" {TEXT -1 0 "" }}{PARA 208 "" 0 "" {TEXT 221 41 "The force of the spring on pendulum 1 is " } {XPPEDIT 18 0 "k*(dist - d)" "6#*&%\"kG\"\"\",&%%distGF%%\"dG!\"\"F%" }{TEXT 221 24 ", by Hooke's Law, where " }{TEXT 258 1 "k" }{TEXT 221 73 " is the spring stiffness. The direction of the force is the unit \+ vector " }{XPPEDIT 18 0 "r/dist" "6#*&%\"rG\"\"\"%%distG!\"\"" }{TEXT 221 2 ". " }}}{EXCHG {PARA 208 "> " 0 "" {MPLTEXT 1 223 40 "springForc e1 := k * (dist-d) * (r/dist);" }}}{EXCHG {PARA 208 "" 0 "" {TEXT -1 0 "" }}{PARA 208 "" 0 "" {TEXT 221 108 "The force of the spring on pen dulum 2 is equal and opposite to the force on pendulum 1, by Newton's \+ 3rd Law." }}}{EXCHG {PARA 208 "> " 0 "" {MPLTEXT 1 223 30 "springForce 2 := -springForce1;" }}}{EXCHG {PARA 208 "" 0 "" {TEXT -1 0 "" }} {PARA 208 "" 0 "" {TEXT 221 40 "Gravity acts downwards in the z-plane. " }{TEXT 256 1 "m" }{TEXT 221 60 " is the mass of the balls at the e nds of the pendulums, and " }{TEXT 257 1 "g" }{TEXT 221 32 " is the ac celeration of gravity." }}}{EXCHG {PARA 208 "> " 0 "" {MPLTEXT 1 223 82 "gravityForce1 := Vector([ 0, 0, -m*g ]); \ngravityForce2 := Vector ([ 0, 0, -m*g ]);" }}}{EXCHG {PARA 208 "" 0 "" {TEXT -1 0 "" }}{PARA 208 "" 0 "" {TEXT 221 356 "The vector sum of these forces induces a to rque about the hinges. The general definition of torque is r x F, but in this case, the pendulums have unit length, so we can greatly simpl ify the formulas by avoiding the cross product altogether. But to do \+ this, we need to work with the vectors tangent to the pendulums' paths instead of their radial vectors." }}{PARA 208 "" 0 "" {TEXT -1 0 "" } }{PARA 208 "" 0 "" {TEXT 221 76 "Because the motion is circular, the t angential vectors are perpendicular to " }{TEXT 222 7 "radius1" } {TEXT 221 5 " and " }{TEXT 222 7 "radius2" }{TEXT 221 37 ". There are two such vectors in the " }{TEXT 261 3 "x-z" }{TEXT 221 15 " plane, n amely " }{XPPEDIT 18 0 "`<,>`(cos(theta(t)),0, sin(theta(t)));" "6#-%$ <,>G6%-%$cosG6#-%&thetaG6#%\"tG\"\"!-%$sinG6#-F*6#F," }{TEXT 221 5 " a nd " }{XPPEDIT 18 0 "<-cos(theta(t)), 0, -sin(theta(t))>" "6#-%$<,>G6$ ,$-%$cosG6#-%&thetaG6#%\"tG!\"\"6$\"\"!,$-%$sinG6#-F+6#F-F." }{TEXT 221 105 ", which are negatives of each other. We choose the one that \+ points in the direction of increasing angle." }}}{EXCHG {PARA 208 "> \+ " 0 "" {MPLTEXT 1 223 132 "tangentialVector1 := Vector([ cos(theta(t)) , 0, sin(theta(t)) ]); \ntangentialVector2 := Vector([ cos(alpha(t)), \+ 0, sin(alpha(t)) ]);" }}}{EXCHG {PARA 208 "" 0 "" {TEXT -1 0 "" }} {PARA 208 "" 0 "" {TEXT 221 163 "The torque on each pendulum about its hinge is the component of the net force in the tangential direction, \+ that is, the dot product of the force and the direction." }}}{EXCHG {PARA 208 "> " 0 "" {MPLTEXT 1 223 125 "torque1 := (gravityForce1 + sp ringForce1) . tangentialVector1;\ntorque2 := (gravityForce2 + springFo rce2) . tangentialVector2;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 243 "To compute the motion of the system, we \+ solve the following system of differential equations, which is the ana logue of Newton's 2nd law for rotations. We have unit mass and length , so we do not include the moments of inertia in the equations." }}} {EXCHG {PARA 208 "> " 0 "" {MPLTEXT 1 223 169 "DESystem := \{diff(thet a(t),t,t)=torque1, \n diff(alpha(t),t,t)=torque2, \n \+ theta(0)=theta0, alpha(0)=0,\n D(theta)(0)=0, D(alp ha)(0)=0\};" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 30 "Specify unit mass and gravity." }}}{EXCHG {PARA 208 "> \+ " 0 "" {MPLTEXT 1 223 11 "m:=1; g:=1;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 99 "A procedure to animate th e motion. Enter the system DEsys, the initial deflection T0 of pendul um 1" }{TEXT -1 59 ", the distance between the hinges dd, the spring s tiffness " }{TEXT 260 1 "K" }{TEXT -1 27 ", and the number of swings \+ " }{TEXT 259 1 "n" }{TEXT -1 17 " to animate over." }}}{EXCHG {PARA 208 "> " 0 "" {MPLTEXT 1 223 1464 "DrawPendulum := proc( DEsys, T0, dd , K, n )\n\nlocal t,finalSys,sol,T,A,framesPerCycle,increment,\n \+ x1,x2,z1,z2,post1,post2,L0,L1,L2,L3,C,i,frame;\n\nfinalSys := subs( \+ \{d=dd, k=K, theta0=T0\}, DEsys );\n\nsol := dsolve( finalSys, numeric , range=0..2*n*Pi, output=listprocedure) ;\n\nT := rhs(sol[4]); #the n umerical solution theta(t) returned by dsolve\nA := rhs(sol[2]); #the \+ numerical solution alpha(t) returned by dsolve\n\n#The static backgrou nd\n\nL0 := line( [0,-1,0], [0,dd+1,0], thickness=4, color=black ):\np ost1 := line( [0,-1,0], [0,-1,-2], thickness=4, color=black ):\npost2 \+ := line( [0,dd+1,0], [0,dd+1,-2], thickness=4, color=black ):\nground \+ := plot3d( -2, x=-1..1,y=-1..dd+1, grid=[15,15], color=grey ):\nC0 := \+ pointplot3d( \{[0,0,0], [0,dd,0]\}, symbolsize=20, symbol=circle, colo r=red ):\n\nframesPerCycle := 30:\nincrement := 2*Pi/framesPerCycle;\n \nfor i from 1 to framesPerCycle*n do\n t := increment*i;\n x1 := si n(T(t)); \n z1 := -cos(T(t));\n x2 := sin(A(t)); \n z2 := -cos(A(t) );\n L1 := line( [0,0,0], [x1, 0, z1], thickness=2, color=blue ):\n \+ L2 := line( [0,dd,0], [x2, dd, z2], thickness=2, color=blue ):\n L3 : = line( [x1, 0, z1], [x2, dd, z2], thickness=2, color=green ):\n C := pointplot3d( \{[x1,0,z1], [x2,dd,z2]\}, symbolsize=20, symbol=circle, color=red ):\n frame[i] := display( L0,L1,L2,L3,C,C0,ground,post1,po st2 ):\nend do:\n\ndisplay( seq( frame[i], i=1..framesPerCycle*n ), \n insequence=true, axes=none, scaling=unconstrained );\nend pro c:\n" }}}{EXCHG {PARA 208 "> " 0 "" {MPLTEXT 1 223 43 "DrawPendulum( D ESystem, Pi/2, 2, 1.5, 6 ); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 209 "" 0 "" {TEXT -1 0 "" }}{PARA 210 "" 0 "" {TEXT -1 0 "" }}}{MARK "0 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 } {PAGENUMBERS 0 1 2 33 1 1 }