Animating Spherical Pendulum Using Jacobi's Elliptic Functions
Total Page:16
File Type:pdf, Size:1020Kb
Animating Spherical Pendulum Using Jacobi's Elliptic Functions A.C. Baroudy [email protected] Abstract Some years ago I have written a Maple document ( already on Maple's online home page) on the subject of animating a simple pendulum for large angles of oscillation. This gave me the chance to test Maple command JacobiSN(time, k). I was very much pleased to see Maple do a wonderful job in getting these Jacobi's elliptic functions without a glitch. Today I am back to these same functions for a similar purpose though much more sophisticated than the previous one. The idea is: 1- to get the differential equations of motion for the Spherical Pendulum (SP), 2- to solve them, 3- to use Maple for finding the inverse of these Elliptic Integrals i.e. finding the displacement z as function of time, 4- to get a set of coordinates [x, y, z] for the positions of the bob at different times for plotting, 5- finally to work out the necessary steps for the purpose of animation. It turns out that even with only 3 oscillations where each is defined with only 20 positions of the bob for a total of 60 points on the graph, the animation is so overwhelming that Maple reports: " the length of the output exceeds 1 million". Not withstanding this warning, Maple did a perfect job by getting the animation to my satisfaction. Note that with only 60 positions of the bob, the present article length is equal to 11000 KB! To be able to upload it, I have to save it without running the last command related to the animation. Doing so I reduced it to a mere 500 KB. It was tiring to get through a jumble of formulas, calculations and programming so I wonder why I have to go through all this trouble to get this animation and yet one can get the same thing with much better animation from the internet. I think the reason is the challenge to be able to do things that others have done before and secondly the idea of creating something form nothing then to see it working as expected, gives (at least to me) a great deal of pleasure and satisfaction. This is beside the fact that, to my knowledge, no such animation for (SP) has been published on Maple online home page with detailed calculations & programming as I did. Finding the differential equations of the SP motion with R being the radius of the sphere on which the pendulum bob is moving with no friction. , (1) . (1.1) The forces acting on the bob are 1- the gravity mg having the same direction as axis OZ, 2- the reaction N of the spherical surface which is always normal to the sphere. The moment about OZ of these two forces being equal to zero, the bob angular momentum C about OZ must be constant and equal to 2* area swept by the bob projection on x-y plane in unit time: = , where we consider moment of linear momentum per unit mass (= angular momentum per unit mass) at t = 0 with being the initial distance of the bob from OZ axis and its initial velocity. From we get . (2) A 3d equation is obtained from the fact that the system is conservative (no friction by hypothesis) with total energy ( kinetic + potential) constant: , here too we take both kinetic & potential energies per unit mass. Substituting values from (1.1) & (2) for: , & , into v : = , we get a relation between z, dz & dt: , (3) Which, once rearranged, gives the first differential equation between z & t: . (4) obtained by eliminating dt between & , resulting in: . (5) CONVERSION TO CANONICAL FORM We see that the polynomial under the radical dz is of degree 3. Let the 3 roots of this polynomial be z1 < z2 < z3 so that f(z) = becomes: , . Let u = , so f(z) becomes: = , and m = . The above equation becomes: Putting , we get : , This last equation is in the canonical form that we are looking for where: , = , , . The canonical form is : , (I) . (II) We solve for the inverse of this integral i.e. w = sn(pt) . Once we have w = sn (pt) we get z from: & . (III) See J.L. Synge & B. A. Griffith " Principles of Mechanics ", pages 337-340. As for the period we can see that z must have the same period as . Now from (II) , (pt) has for period : where the complete EI of the 1st kind is: K = , so that (t) in (I) must have for period . This is similar to what we have with circular function such as . = time for one cycle . The square of the Jacobian elliptic functions : have for period 2.K so has a real period = . The period of EQW is the same as that of EQZ since they are the same. This period of EQW is that of the complete integral of the first kind: 1 that we multiply by . Now why the period of EQZ is and not ? The reason is to be found in the nature of the relation between z & w: . This equation shows that z has the same period as while this latter has for period not . From the relation: , we get by squaring both sides: which shows that . See M. R. Spiegel " Advanced Calculus ", pages: 338 & 339. We simplify our problem by taking R = 1, m = 1, g = 1, = 1 where being parallel to x-y plane. We set the initial position of of the bob in z-x plane as : , , From which we get the two constants : C = angular momentum per unit mass of the bob, E = total energy per unit mass of the bob: , . We solve the 3d degree polynomial under the radical in EQZ to get the roots which are all real. We label them as z1 < z2 < z3. this polynomial must be positive for the radical to be real , hence z must be between z1 = & z2 = 0.324192354864376. See plot below. From (EQZ) we get elliptic integral whose solution, say t(z), is a function of z which represents the time for the pendulum to move from lower limit(z = z1) to upper limit (z=z2) of integration which correspond to w = 0 & w =1 for (EQW). However we need its inverse i.e. coordinate z as F(t) in order to get the position of the bob at any given time. To get z = F(t) we use JacobiSN( time found by integration of the EI , modulus = k ) which gives sn (w) = sn(pt). From equation (III) we get the value of z which we use as upper limit of integration in ( ). We thus obtain the value of z that we just found . We finally get [x,y,z] coordinates corresponding to different values of z as a list made of different points such as: , , z ] , where each one corresponds to one position of the bob. > being the radius of the sphere on which the pendulum bob is rolling > (1) The torque ( total force moment around OZ-axis) being = 0, the angular momentum C is constant and equal to 2* area swept by the bob on x-y plane in unit time = = moment of linear momentum per unit mass (= angular momentum per unit mass) at t = 0 where r being the distance of the bob from z-axis. From we get d4. > (2) (2) Energy equation: total energy (kinetic + potential ) = E = constant : > (3) Substituting values of , & , into v : , we get: > (4) Writing Energy Equation anew: > (5) Collecting terms in dz & dt in the above gives a relation between z, dz & dt which is the differential equation EQZ that once integrated gives the time as function of z-coordinate: > (6) (7) (2) and > (7) We simplify our problem by taking R = 1, m = 1, g = 1, = 1 where being parallel to x-y plane. We set the initial position of of the bob in z-x plane as : , From which we get the two constants : C = angular momentum per unit mass of the bob, E = total energy per unit mass of the bob: , > (8) > (9) (2) (7) > (9) We shall define : , and , for the purpose of integration. > (10) We solve f(z) = the 3d degree polynomial under the radical in Z to get the roots which are all real. We label them as z1 < z2 < z3. f(z) must be positive for the radical to be real , hence z must be between z1 = & z2 = 0.324192354864376. See plot below. > (11) (2) (7) > (9) > 30 20 10 1 2 3 z The range for the integration of Z is between z1 & z2 the two roots that make the radical in (eqz) positive. Here we define W = canonical form & both p & k that belong to it : > (12) Once (eqz) is integrated from z1 to z2 we get the time of a half period of oscillation.This time is where i runs from 1 to n. Actually we shall use the canonical form (EQW) instead of (eqz) Then with sphere equation , we get the projection of the pendulum bob on x-y plane. From ( ) we get angle , by integration from z = z1 to z = , hence the coordinates of the bob at time [ x = (2) (7) > (9) > cos , y = sin z = ] The half - period of Z is 1.886452973 seconds. that is what we get using canonical form W defined above. > 1.886452973 1.886452973 (13) > Our integral is in fact , , where we put T = pt. After integration we introduce a constant : . Now the inverse has the form: = sine of the amplitude of = the upper limit of integration = w, This means that JacobiSN = w = upper limit of integration.