The Double Pendulum First Year Project R. Ø. Nielsen (23051992), E. Have (08091993), B. T. Nielsen (15051991) Supervisors: Namiko Mitarai, Jörg Helge Müller Pro ject 2013-14 The Niels Bohr Institute March 21, 2013 Abstract The main endeavour of this article is to establish whether the double pendulum exhibits chaotic motion and, if so, to identify the chaotic regimes corresponding to initial angles θ1 (0) = θ2 (0) ∈ [0, 1.8] and initial angular velocities θ̇1 (0) = θ̇2 (0) = 0. This is done using experimental as well as theoretical and computer simulation based techniques. A survey of the needed theoretical results and considerations is included which leads to a derivation of the equations of motion of the double pendulum using the techniques of analytical mechanics due mainly to Joseph Louis Lagrange(1) . The numerical solution to this set of dierential equations forms the basis for computer simulations of the evolution of the pendulum in phase space with the goal of calculating the Lyapunov exponent as a function of initial angle. This allows us to directly identify the chaotic regimes. Our ndings indicate that the pendulum behaves non-chaotically for initial angles of θ1 (0) = θ2 (0) ∈ [0, 0.69] while initial angles of θ1 (0) = θ2 (0) ∈ [0.69, 1.55] lead to chaotic behaviour. There are some indications that a narrow region of largely non-chaotic behaviour corresponding to θ1 (0) = θ2 (0) ∈ [1.55, 1.60] may exist. This would be an obvious subject for further investigation in a later article. Dedicated to Cornelius Lanczos (1893 − 1974) For his exceptionally clear exposition of the variational principles of mechanics Number of pages: Main text: 15 pages Appendices: 14 pages (1) 1736-1813 Contents 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2 The Equations of Motion of the Double Pendulum . . . . . . . . . . . . . . . . . . . . . 3 3 The Concept of the Phase Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 4 Chaos in Mechanical Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 5 The Lyapunov Exponent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 6 The Experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 6.1 Measuring the Moments of Inertia and the Centre of Gravity of our Double Pendulum . . 10 6.2 Measuring Chaos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 7.1 Initial conditions and predictability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 7.2 Comparison of experimentally determined trajectories with simulation . . . . . . . . . . . 14 7.3 The Lyapunov Exponent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 7 8 A The Lagrangian Formalism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 B The Fundamental Lemma of the Calculus of Variations . . . . . . . . . . . . . . . . . . 19 C Equations of Motion for the Simple Double Pendulum: Where It All Started . . . . 20 D Derivation of the Equations of Motion for the Simple Double Pendulum from Newtonian Mechanics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 E On the Constancy of the Mechanical Energy . . . . . . . . . . . . . . . . . . . . . . . . . 25 F 26 MatLab Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 R. Ø. Nielsen, E. Have, B. T. Nielsen 1 The Double Pendulum 2/31 Introduction The double pendulum is of considerable interest as a model system exhibiting deterministic chaotic behaviour. The motion of the pendulum is governed by a set of coupled dierential equations and is determined entirely by these. Nonetheless our ability to predict the behaviour of the double pendulum is very limited in certain regimes, i.e. for certain initial conditions. This is due to the extreme sensi- tivity towards even small perturbations. To qualitatively investigate this phenomenon we shall compare experimental results obtained by video analysis to theoretically based computer simulations. To assess the degree of chaoticity we shall determine the principal Lyapunov exponent of the system a quantity which measures the rate of separation of nearby trajectories in phase space and thus serves as a useful measure of chaotic behaviour. Before we delve into the experimental results and the outcome of the simulations an exposition of the necessary theoretical results is in order. Much of our work, including the following derivation, is based on the principles of Lagrangian Mechanics and the Calculus of Variations. For an introduction to the key concepts and mathematical results of Lagrangian Mechanics, please refer to Appendices A and B. It is worth noting that much of the theoretical material which is collected in the appendices is essential for the full appreciation of this article. Figure 1: The double pendulum used in this project. R. Ø. Nielsen, E. Have, B. T. Nielsen 2 The Double Pendulum 3/31 The Equations of Motion of the Double Pendulum We wish to derive the equations of motion for a double pendulum which is composed of two physical pendula of arbitrary shape and mass distribution. We will do this using the methods of Lagrangian (2) . mechanics Figure 2: Schematic representation of the compound double pendulum. The positions of the centres of mass of the two pendula in Cartesian coordinates are given by: where d1 and of suspension. d2 x1 = d1 sin(θ1 ), (2.1) y1 = d1 cos(θ1 ), (2.2) x2 = h1 sin(θ1 ) + d2 sin(θ2 ), (2.3) y2 = h1 cos(θ1 ) + d2 cos(θ2 ), (2.4) are the distances to the centres of mass of the two pendula from their respective points h1 is the distance between the two points of suspension. We notice that the four Cartesian coordinates can be expressed as functions of θ1 and θ2 (as seen on Figure 2) leading us to choose these two variables as the generalized coordinates of the system. The number of generalized coordinates is, in our case, equal to the number of degrees of freedom of our (3) [1] pendulum, namely 2 (2) [2]. A more concise Lagrangian derivation of the equations of motion for the simpler, idealized double pendulum consisting of point masses connected by massless rods can be found in Appendix C. The same equations can be derived from Newtonian mechanics, albeit not as easily. This is discussed in Appendix D (3) Actually denitions dier; some authors dene the number of degrees of freedom as minimum number of generalized coordinates required to describe the evolution of the system, while others dene it as the number of parameters needed to describe the initial conguration of the system, which would be four in our case.[4]. The rst of these two denitions is mainly used in mechanics while the second denition has found widespread use in system dynamics. We opted for the rst one. R. Ø. Nielsen, E. Have, B. T. Nielsen The Double Pendulum 4/31 We wish to derive an expression for the total kinetic energy of the double pendulum. The upper pendulum always rotates about a stationary axis and as a consequence it has only rotational kinetic energy: 1 2 T1 = I1 θ˙1 , 2 where I1 (2.5) is the moment of inertia of the upper pendulum about an axis through the point of suspension and perpendicular to the pendulum rod. The lower pendulum, on the other hand, rotates about an axis through its point of attachment on the upper pendulum. The calculation of the kinetic energy T2 of the lower pendulum is simplest if the motion is separated into a translation of the center of mass and a rotation around the center of mass. 1 1 2 T2 = I2,cm θ˙2 + m2 (ẋ22 + ẏ22 ), 2 2 Where (2.6) I2,cm is the moment of inertia of the second pendulum about an axis through its center of mass, per- pendicular to the pendulum rod. By dierentiation of the Cartesian coordinates the following expressions for the velocity of the center of mass are obtained: ẋ2 = h1 θ̇1 cos(θ1 ) + d2 θ̇2 cos(θ2 ), (2.7) ẏ2 = −h1 θ̇1 sin(θ1 ) − d2 θ̇2 sin(θ2 ). (2.8) We are in fact mainly interested in the squares of the velocities: 2 2 ẋ22 = h1 θ̇1 cos(θ1 ) + d2 θ̇2 cos(θ2 ) + 2h1 θ̇1 cos(θ1 )d2 θ̇2 cos(θ2 ) = h21 θ̇12 cos2 (θ1 ) + d22 θ̇22 cos2 (θ2 ) + 2h1 d2 θ̇1 θ̇2 cos(θ1 ) cos(θ2 ), ẏ22 = h21 θ̇12 sin2 (θ1 ) + d22 θ̇22 sin2 (θ2 ) + 2h1 d2 θ̇1 θ̇2 sin(θ1 ) sin(θ2 ). (2.9) (2.10) ẋ22 + ẏ22 = h21 θ̇12 + d22 θ̇22 + 2h1 d2 θ̇1 θ̇2 cos(θ1 ) cos(θ2 ) + 2h1 d2 θ̇1 θ̇2 sin(θ1 ) sin(θ2 ) = h21 θ̇12 + d22 θ̇22 + 2h1 d2 θ̇1 θ̇2 (cos(θ1 ) cos(θ2 ) + sin(θ1 ) sin(θ2 )) = h21 θ̇12 + d22 θ̇22 + 2h1 d2 θ̇1 θ̇2 cos(θ1 − θ2 ), where we have used the trigonometric relation cos(x) cos(y) + sin(x) sin(y) = cos(x − y). (2.11) R. Ø. Nielsen, E. Have, B. T. Nielsen The Double Pendulum 5/31 This leads to the following expression for the total kinetic energy: 1 2 T = I1 θ˙1 + 2 1 ˙2 = I 1 θ1 + 2 where m2 1 2 I2,cm θ˙2 + 2 1 2 I2,cm θ˙2 + 2 1 m2 (ẋ22 + ẏ22 ) 2 1 1 m2 h21 θ̇12 + m2 d22 θ̇22 + m2 h1 d2 θ̇1 θ̇2 cos(θ1 − θ2 ), 2 2 is the mass of the lower pendulum. potential energy V (2.12) We wish to obtain an expression for the gravitational of the system as well. Trigonometric considerations lead to: V = −m1 gy1,cm − m2 gy2,cm = −m1 gd1 cos(θ1 ) − m2 gh1 cos(θ1 ) − m2 gd2 cos(θ2 ), where g is the magnitude of the acceleration due to gravity and m1 (2.13) is the mass of the upper pendulum. θ1 = π 2 . Other zero points are just as valid since the potential energy is determined only up to an additive The zero point for the potential energy has been chosen such that the potential energy is zero at θ2 = constant[1]. The Lagrangian for the system thus becomes: L =T −V 1 1 1 1 2 2 = I1 θ˙1 + I2,cm θ˙2 + m2 h21 θ̇12 + m2 d22 θ̇22 + m2 h1 d2 θ̇1 θ̇2 cos(θ1 − θ2 ) 2 2 2 2 + m1 gd1 cos(θ1 ) + m2 gh1 cos(θ1 ) + m2 gd2 cos(θ2 ). (2.14) The Euler-Lagrange equations for the system then take the form d ∂L ∂L = , ∂θ1 dt ∂ θ̇1 ∂L d ∂L . = ∂θ2 dt ∂ θ̇2 (2.15) (2.16) The desired derivatives are calculated below. ∂L = −m2 h1 d2 θ̇1 θ̇2 sin(θ1 − θ2 ) − m1 gd1 sin(θ1 ) − m2 gh1 sin(θ1 ), ∂θ1 ∂L = I1 θ˙1 + m2 h21 θ̇1 + m2 h1 d2 θ̇2 cos(θ1 − θ2 ), ∂ θ̇1 d ∂L = I1 θ¨1 + m2 h21 θ̈1 + m2 h1 d2 θ̈2 cos(θ1 − θ2 ) − m2 h1 d2 θ̇2 (θ̇1 − θ̇2 ) sin(θ1 − θ2 ). dt ∂ θ̇1 (2.17) (2.18) (2.19) R. Ø. Nielsen, E. Have, B. T. Nielsen The Double Pendulum 6/31 ∂L = m2 h1 d2 θ̇1 θ̇2 sin(θ1 − θ2 ) − m2 gd2 sin(θ2 ), ∂θ2 ∂L = I2,cm θ˙2 + m2 d22 θ̇2 + m2 h1 d2 θ̇1 cos(θ1 − θ2 ), ∂ θ̇2 d ∂L = I2,cm θ¨2 + m2 d22 θ̈2 + m2 h1 d2 θ̈1 cos(θ1 − θ2 ) − m2 h1 d2 θ̇1 (θ̇1 − θ̇2 ) sin(θ1 − θ2 ). dt ∂ θ̇2 (2.20) (2.21) (2.22) This nally allows us to write the equations of motion for the double pendulum: −m2 h1 d2 θ̇1 θ̇2 sin(θ1 − θ2 ) − m1 gd1 sin(θ1 ) − m2 gh1 sin(θ1 ) = I1 θ¨1 + m2 h21 θ̈1 + m2 h1 d2 θ̈2 cos(θ1 − θ2 ) − m2 h1 d2 θ̇2 (θ̇1 − θ̇2 ) sin(θ1 − θ2 ). (2.23) and m2 h1 d2 θ̇1 θ̇2 sin(θ1 − θ2 ) − m2 gd2 sin(θ2 ) = I2,cm θ¨2 + m2 d22 θ̈2 + m2 h1 d2 θ̈1 cos(θ1 − θ2 ) − m2 h1 d2 θ̇1 (θ̇1 − θ̇2 ) sin(θ1 − θ2 ). (2.24) For a rst substantiation of these equations, please refer to Appendix E where the constancy of the energy is veried. 3 The Concept of the Phase Space It is often fruitful to study the evolution of a mechanical system in what is known as phase space. space is an abstract space characterized by having on the axes the generalized momenta to the generalized coordinates qi pi Phase corresponding as well as these coordinates themselves. The generalized momenta are dened somewhat dierently from the momenta known from Newtonian mechanics: pi = ∂L . ∂ q̇i (3.1) For the double pendulum these take the form: ∂L , ∂ θ̇1 ∂L . p2 = ∂ θ̇2 p1 = (3.2) (3.3) It is worth noting that the generalized momenta do not necessarily have units of mass times velocity but (4) . can take other units for instance units corresponding to angular momenta (4) In fact there are no general limitations on the dimensions of the generalized momenta[7]. Expressions for p1 and p2 R. Ø. Nielsen, E. Have, B. T. Nielsen The Double Pendulum 7/31 have already been derived in equations (2.18) and (2.21). One system which behaves particularly simply in phase space is the ordinary physical pendulum (in the small oscillation limit sin(φ) ≈ φ, ellipses in phase space. where φ is the angle to the vertical). This system is known to describe That this is the case can be seen by considering the Lagrangian for such a (5) : system 1 L = I φ̇2 + mgd cos(φ), 2 ∂L = −mgd sin(φ) ≈ −mgdφ, ∂φ ∂L = I φ̇. ∂ φ̇ Since it is known that We see that the φ(t) = A cos(ωt) phase space trajectory (3.4) (3.5) (3.6) is a solution the the resulting E-L equation, we get: φ(t) = A cos(ωt), (3.7) p(t) = −IAω sin(ωt). (3.8) of the system is an ellipse parametrised by the time t (one direct way of recognizing this is that the equations above represent a circle which has been scaled by dierent scalars along the two axes, so to speak). It is clear that the harmonic oscillator must evolve similarly in phase space since the pendulum in the small angle limit is nothing but an angular oscillator. 4 Chaos in Mechanical Systems The double pendulum is what is called a Hamiltonian system, which essentially means that the total mechanical energy of the system is constant in time, or conserved. This is of course only approximately true over short periods of time in the real world as there is some disspation due to air resistance and internal friction in the bearings. Our system is also in principle deterministic, given exact initial conditions. Given these facts one might ask how it can undergo chaotic motion, and in what sense it may be considered chaotic. These questions nessecitate a brief discussion of what is meant by chaos. One denition is that chaotic systems are highly sensitive to initial conditions. In practice this means that if the initial conditions of the double pendulum (initial angles and angular velocities) are altered only slightly, the consequent evolution of the double pendulum will dier drastically. This denition of chaos is somewhat qualitative, but it is very useful in practice and it encapsulates what (5) We see that the generalized momentum actually represents the angular momentum in this case. R. Ø. Nielsen, E. Have, B. T. Nielsen The Double Pendulum 8/31 is important about chaotic systems in physical applications; our limited ability to predict the evolution of a given system over long periods of time. 5 The Lyapunov Exponent It is to be expected that the double pendulum behaves chaotically only in certain regimes, meaning that some sets of initial conditions lead to chaotic behaviour, while others do not. It is expected that small initial angles (meaning that the pendula are displaced only slightly from the vertical) combined with small initial velocities will lead to non-chaotic behaviour while larger initial angles and velocities lead to chaotic behaviour. A system is said to evolve chaotically if an initial seperation between two phase space trajectories grows exponentially with time. If the initial separation vector in phase space is separation at a time t is δ x(t) δ x0 and the we may write |δ x(t)| = eλt |δ x0 |. (5.1) The system is said to behave chaotically if the Lyapunov exponent λ exponent less than or equal to zero denotes non-chaotic behaviour. It is possible to dene separate is positive, while a Lyapunov Lyapunov exponents for dierent directions in phase space, and the largest of these exponents is said to be the principal Lyapunov exponent. We calculate the principal Lyapunov in such a way that it does not correspond to one single direction in phase space more on this later. It is clear from 5.1 that this denition of the Lyapunov exponent relies on some concept of distance in phase space. There are a few seemingly problematic aspects in relation to this. One is dimensional; phase space is the space of generalized momenta and coordinates, and the Euclidean norm is bound to have nonsensical dimensionality in this space, meaning that the dimensions of an expression of the form p p2 + q 2 are undened. The second issue is that we have no a priori reason to assume that phase space is Euclidean. These issues do not concern us, however, since we are only interested in the sign of the Lyapunov exponent, which is not aected by the imposed metric[3]. We have determined the principal Lyapunov exponent for the system as a function of initial conditions by means of a computer simulation. The relevant script, lyap.m, is included in Appendix F. The method we have employed (which is loosely based on the methods described in [3] and [8]) involves simulating two trajectories in phase space separated by a very small initial separation letting the two trajectories evolve for a short, xed, amount of time trajectories is denoted δX i ∆t. δ Xi0 of length and The resulting separation of the . The procedure is illustrated in Figure 3. This provides us with an average R. Ø. Nielsen, E. Have, B. T. Nielsen The Double Pendulum 9/31 Figure 3: Schematic presentation of the method for determining the principal Lyapunov exponent. value λi for the Lyapunov exponent in this short interval λi = ln |δ Xi | |δ Xi0 | . (5.2) The next Lyapunov exponent is calculated by the same method. We let the rst trajectory start where it ended during the previous short simulation, but we let the new initial separation be given by: = δ Xi+1 0 δ Xi . |δ Xi | (5.3) The reason we choose to separate the two trajectories along this particular direction is that we wish to measure the principal Lyapunov exponent, meaning the exponent associated with the direction of the highest rate of separation. Once again we let λi+1 = ln |δ Xi+1 | |δ Xi+1 0 | . (5.4) This process is repeated many times until the total simulation time reaches the i'th Lyapunov exponents λi T (we chose 80s) after which are averaged so as to give the principal Lyapunov exponent for the entire trajectory: λ= N 1X λi . T (5.5) i=1 We see that this denition of the principal Lyapunov exponent leads to an exponent which does not correspond to one single direction in phase space, since the separation vectors δ Xi0 are not, in general, parallel. They are chosen such that the initial separation is along the (approximate) direction in which the separation between the two trajectories locally grows the fastest. discussed in Section 7.3 on page 15. The actual results obtained are R. Ø. Nielsen, E. Have, B. T. Nielsen 6 The Double Pendulum 10/31 The Experiment To ascertain the validity of our theoretical methods there is need for experimental verication. section details the experiments involving the motion of the double pendulum. This The setup to test our equations of motion consisted of a physical double pendulum with some movable masses (See Figure 1 on page 2) such that the center of mass can be adjusted. To analyse the behaviour of this physical double (6) . pendulum we record its motion with a high speed camera By video analysis it is possible to track the trajectory of one or more points on the pendulum, and these data can be analysed using Matlab. The tracking software used was Tracker (7) , which is capable of auto-tracking. For this purpose, we tted the pendula with brightly coloured stickers and illuminated the pendulum which allowed eective auto-tracking. 6.1 Measuring the Moments of Inertia and the Centre of Gravity of our Double Pendulum In order to simulate the motion of our double pendulum, we need to know the moments of inertia and (8) the distances from the respective points of attachment to the centres of gravity for the constituent pendula. The centres of gravity were found by carefully balancing the pendula until equilibrium occurred. The moments of inertia were obtained by taking the double pendulum apart and measuring the periods of small oscillations of the pendula (9) , which, upon insertion into (6.2), yields the sought moments of inertia. The torque acting on a single pendulum due to gravity is given by distance from the point of attachment to the centre of gravity, acceleration due to gravity, and angles, ϕ ≈ 0, ϕ m τ = −dmg sin ϕ, where d is the is the mass of the pendulum, g is the is the angle of the pendulum relative to vertical. However, for small a series expansion of sine yields the well-known result that sine of small angles may be approximated as the angle itself, i.e, sin ϕ ≈ ϕ(10) . For the torque, we may then write in the small angle approximation: τ = I ϕ̈ ≈ −dmgϕ ⇒ ϕ̈ = − (6) dmg ϕ, I (6.1) Using the moderate setting of 300fps http://www.cabrillo.edu/~dbrown/tracker/ (8) Which coincide with the centres of mass since the acceleration due to gravity can be treated as constant in this experiment. (9) suspended, of course, from the same point as in the double pendulum (10) This requires, of course, that the angles are measured in radians. This is assumed throughout the article. (7) R. Ø. Nielsen, E. Have, B. T. Nielsen The Double Pendulum 11/31 and thus, by using the denition of torque, and comparing this to the familiar dierential equation governing periodic phenomena of this kind, ẍ = −ω 2 x, mgd = ω2 = I 2π T we nd: 2 ⇒I= Plugging into this formula, we get the moments of inertia is included rather than I2 I1 mgdT 2 . 4π 2 and (6.2) I2 . I2 can be found in Table 1. I2,cm since what we actually need for the lower pendulum is the moment of inertia around the center of mass. The reason for this is discussed in Section 2. This necessitates the use of the Huygens-Steiner Theorem (11) : I2 = I2,cm + m2 d22 ⇔ I2,cm = I2 − m2 d22 . The masses of the pendula were measured as well, as were the distances (6.3) d1 and d2 involved in the equations of motion for the compound double pendulum, (2.23) and (2.24). We may calculate the error Table 1: Experimental Results I1 = 0.0862kg · m2 ± 0.0018kg · m2 d1 = 0.148m ± 0.005m m1 = 0.955kg ± 0.002kg T1 = 1.316s ± 0.0102s (12) , σ I on the moments of inertia as follows: s σI = r = I2,cm = 0.0177kg · m2 ± 0.0014kg · m2 d2 = 0.0800m ± 0.005m m2 = 0.630kg ± 0.002kg T2 = 1.566s ± 0.016s ∂I ∂m 2 2 σm + ∂I ∂T 2 σT2 + ∂I ∂d 2 σd2 m2 g 2 T 2 2 g 2 d2 T 4 2 m2 g 2 d2 T 2 2 σm + σT + σ , 4 4 16π 4π 16π 4 d (6.4) which, upon insertion of the experimentally established values, yields the results shown in Table 1. The standard deviations of the periods, of which many measurements were made, were obtained using the familiar expression: v u N u1 X σT = t (Ti − µT )2 , N i=1 where (11) (12) N is the number of measurements made and µT is the average period. Also known as the Parallel Axis Theorem, see [6] T and m are, of course, independent variables, ensuring the validity of the error propagation law. (6.5) R. Ø. Nielsen, E. Have, B. T. Nielsen 6.2 The Double Pendulum 12/31 Measuring Chaos Since chaos is dened as being very sensitive to initial conditions, our method to experimentally determine the degree of chaoticity of the system relies on measuring the initial conditions and the positions and velocities after a certain time. In all cases we chose the initial conditions such that θ̇1 (0) = θ̇2 (0) = 0. θ1 (0) = θ2 (0) and We have, in other words, only studied a limited subset of the set of practically feasible initial conditions. We tracked the motion of the pendulum for 10s for each set of initial conditions. This time was chosen such that dissipation would be negligible and such that any chaotic tendencies would become apparent. In total 107 measurements at angles θ1 (0) = θ2 (0) ∈ [0; 2] were made. We have plotted the trajectory of the pendula for one of these measurements (obtained by video analysis) in Figure 4. Figure 4: Plot of trajectories of pendula in Cartesian coordinates constructed from experimental data. 7 7.1 Results Initial conditions and predictability On Figure 5 on the next page we see the experimental plot of initial angle for the case θ1 (0) = θ2 (0) and θ̇1 (0) = θ̇2 (0) = 0. We see that for in initial angle lead to small dierences in nal angle. θ1 (0) vs. nal angle 0 ≤ θ1 (0) / 0.7, θ1 (10s) small dierences This indicates a non-chaotic regime, or, in any case, a regime of such low chaoticity that there is a high degree of predictability for at least the rst R. Ø. Nielsen, E. Have, B. T. Nielsen 10s. For θ1 (0) ∈ [0.7, 1.8] The Double Pendulum (13) . the pendulum exhibits chaotic motion 13/31 If we compare this plot with the plot (see Figure 6) obtained by a MatLab simulation based on our equations of motion (Appendix F, initcondsimulation.m) we see the the plots share the same features, and that the change from the non- chaotic regime to the chaotic regime occurs where we theoretically predicted it. Figure 5: A plot of initial θ1 = θ2 vs. nal θ1 . Other initial conditions: θ̇1 = θ̇2 = 0 2 1.5 final value of theta1 [rad] 1 X: 0.6966 Y: 0.3823 0.5 0 −0.5 −1 −1.5 0 0.2 0.4 0.6 0.8 1 Initial value of theta1 [rad] 1.2 1.4 1.6 Figure 6: Simulation of initial θ1 = θ2 vs. nal θ1 . Other initial conditions: θ̇1 = θ̇2 = 0 (13) Except, possibly, for a narrow interval discussed in section 7.3 1.8 R. Ø. Nielsen, E. Have, B. T. Nielsen 7.2 The Double Pendulum 14/31 Comparison of experimentally determined trajectories with simulation Our ability to predict the motion of the double pendulum in the non-chaotic regime is most easily demonstrated by a comparative plot of a simulated trajectory and one determined by video analysis. Such a plot may be found in Figure 7 the initial conditions are θ1 (0) = θ2 (0) = 0.35 with the pendula starting from rest. In the chaotic regime our ability to predict the motion of the pendulum for more than a few seconds breaks down. This can be clearly seen in Figure 8 on the following page. Since some dissipation is to be expected, we have limited our analysis to 10 seconds, since we deemed the eects of dissipation as negligible over such a short amount of time. X: 0 0.4 Y: 0.3477 Experimental Simulated 0.3 Angle theta1/rad 0.2 0.1 0 −0.1 −0.2 −0.3 −0.4 0 2 4 6 Time/s 8 10 12 Figure 7: Comparison of simulated trajectory with trajectory obtained by video analysis. Non-chaotic regime. R. Ø. Nielsen, E. Have, B. T. Nielsen The Double Pendulum 15/31 X: 0 1.5 Y: 1.351 Experimental Simulated Angle theta1/rad 1 0.5 0 −0.5 −1 −1.5 0 2 4 6 Time/s 8 10 12 Figure 8: Comparison of simulated trajectory with trajectory obtained by video analysis. Chaotic regime. 7.3 The Lyapunov Exponent In Figure 9 on the next page we present a plot of the Lyapunov exponent computed by the method described in Section 5. We see that the Lyapunov exponent conrms our earlier nding that chaotic behaviour becomes apparent at θ1 ≈ 0.7 (again for the case note the apparent existence of a narrow interval around only slightly positive, θ1 (0) = θ2 (0), θ̇1 (0) = θ̇2 (0) = 0). θ1 (0) = 1.6, We also where the Lyapunov exponent is (14) . indicating a region of more predictable behaviour Unfortunately we do not have sucient amounts of data close to this initial angle, but it is denitely an interesting observation which warrants further investigation at some point. It is, however, interesting to note that this non-chaotic region shows up on Figure 6 as well and that we see a lump of points in the experimentally based Figure 5 in the same general area. Lumpiness, of course, indicates predictability as well, since it means that initial conditions which dier only slightly produce similar nal conditions. However, as noted, more measurements will be necessary before we can draw any conclusions with condence. We expect that, given a longer run-time and higher precision in the numerical integration of the dierential equations, the Lyapunov exponents for small angles would approach zero even more closely. (14) Note that this narrow interval of non-chaoticity is also present in Figure 6 on page 13 R. Ø. Nielsen, E. Have, B. T. Nielsen The Double Pendulum 16/31 1.4 1.2 Lyapunov exponent [1/s] 1 0.8 0.6 0.4 X: 0.693 Y: 0.2028 0.2 0 −0.2 0 0.2 0.4 0.6 0.8 1 1.2 Initial angle (theta2=theta1) [rad] 1.4 1.6 1.8 2 Figure 9: The Lyapunov exponent as a function of initial angle (θ1 (0) = θ2 (0), θ̇1 (0) = θ̇2 (0) = 0) 8 Conclusion We have utilized methods for characterizing chaotic motion, both experimentally and theoretically and veried the agreement between these. chaotic motion for Our ndings suggest that our double pendulum exhibits non- θ1 (0) = θ2 (0) ∈ [0, 0.69], while initial angles of θ1 (0) = θ2 (0) ∈ [0.69, 1.55] do indeed lead to chaotic behaviour, although, seemingly, a region of non-chaoticity occurs for initial angles near 1.6, corroborated by our simulations and by the experiment, to some degree, though our experimental data in this region is scarce. We have, to a satisfactory degree of accuracy, been able to reproduce the results obtained experimentally by simulating the equations of motion derived using the methods of analytical mechanics, thus arming the validity of our equations. Indeed, the resemblance between Figure 5 and Figure 6 on page 13 is striking. R. Ø. Nielsen, E. Have, B. T. Nielsen A The Double Pendulum 17/31 The Lagrangian Formalism The fundamental quantity in the Lagrangian formulation of classical mechanics is the Lagrangian which may in general depend on the n generalized coordinates qi (15) , their derivatives q̇i L (q̇i , qi , t), and time t, dened as the dierence between the kinetic and potential energies of the system: L (q̇i , qi , t) = T − V. The governing principle is known as the action S Hamilton's Principle or (A.1) The Principle of Least Action (16) . We dene as follows: Z tb S= L (q̇i , qi , t)dt. (A.2) ta The requirement that the action be stationary is thus: where δS is the variation δS = 0, (A.3) of the action, to be dened. The action is a so-called functional, that is, it depends not only on the value of on in the range t ∈ [ta , tb ]. L at a particular point, but rather on its innitely many values taken Characteristic of the actual path q̄i is then that the action remain unchanged (to a rst order approximation) with respect to slight variations of the path xed, that is, δqi (ta ) = δqi (tb ) = 0. δqi with the endpoints held This is exemplied in Figure 10: Figure 10: A possible variation of the i'th generalized coordinate. (15) These are merely the coordinates with which we describe our system; for example spatial position coordinates such as (x1 , x2 , . . . , y1 , . . . , z1 , . . . ), or angles, (θ1 , θ2 , . . . ). The coordinates are themselves understood to be functions of time. (16) For historical reasons the principle is known as The Principle of Least Action. However there is actually no requirement that the action must be minimized - all that is required is that the action be stationary. R. Ø. Nielsen, E. Have, B. T. Nielsen The Double Pendulum 18/31 Analogous to the dierential of a regular function, one may obtain the variation of a functional (for xed i) as follows: δS = S[qi + δqi ] − S[qi ], (A.4) substituting for the action the denition (A.2) yields: Z tb L (q̇i + δ q̇i , qi + δqi , t)dt ∂L ∂L L (q̇i , qi , t) + = δ q̇i + δqi dt ∂ q̇i ∂qi ta Z tb ∂L ∂L = S [qi ] + δ q̇i + δqi dt . ∂ q̇i ∂qi ta | {z } S[qi + δqi ] = ta Z tb (A.5) =δS Now, we need to evaluate the integral. Consider then the rst term, which may readily be integrated by parts (17) : Z tb ta Z tb Z tb ∂L d ∂L d ∂L ∂L tb δ q̇i dt = δqi − δqi dt = − δqi dt, ∂ q̇i ∂ q̇i ta ta dt ∂ q̇i ta dt ∂ q̇i due to the restrictions imposed upon the endpoints (δqi (ta ) expression for δS = δqi (tb ) = 0). (A.6) Plugging this result into our found in (A.5), we nd: Z tb δS = δqi ta ∂L d ∂L − ∂qi dt ∂ q̇i dt. (A.7) Equating this to zero, we see that this implies the following equality (in fact due to the fundamental lemma of the calculus of variations see Appendix B): ∂L d ∂L − = 0, ∂qi dt ∂ q̇i which is known as the (A.8) Euler-Lagrange equation. We note that for the action to be truly stationary, it must be stationary with respect to each of the variables on which it depends. coordinates qi It follows that the Euler-Lagrange equation must hold for any of the one might choose to consider. One may also derive the Euler-Lagrange equation from what is known as (17) D'Alembert's Principle [5], which This is actually hinged on the fact that variation and dierentiation are permutable processes, that is that the derivative of the variation is equal to the variation of the derivative as is proved in [5] R. Ø. Nielsen, E. Have, B. T. Nielsen states that P F − ma = 0. −ma The Double Pendulum 19/31 is called the inertial force, and is included such that the sum of the impressed forces is zero. This makes it possible to use the well-known methods of statics (particularly dV = 0). We see that this indicates that the E-L equation follows from Newton's laws in inertial systems. It is very interesting to note that our derivation of the Euler-Lagrange equation is an example of a way of looking at mechanical problems which is quite dierent from what one usually sees in courses on Newtonian mechanics. Usually, in vectorial mechanics, one is given a set of initial conditions in the form of the coordinates and velocities at one specic time, t0 , from which one can extrapolate the subsequent motion given knowledge of the forces involved, by the use of Newton's laws. It is, in other words, understood that the motion must obey Newton's second law at every point along the trajectory. In this sense, Newton's laws can be said to constitute a local principle. Our derivation takes a dierent approach in that we are given two sets of initial conditions; a set of position coordinates qi (ta ) at the time ta and another set of position coordinates at time tb . We then formulate a principle the principle of least action which takes the form of a requirement on an integral which is dependent on the shape of the entire trajectory. In other words, we know only where we are at two distinct times, and how long it took us to move from one point to the other. It is reassuring to see that this somewhat holistic viewpoint gives rise to a local principle after all, namely the Euler-Lagrange equation B (18) which must hold for every point along the trajectory. The Fundamental Lemma of the Calculus of Variations Also known as Lagrange's Lemma, this theorem states that: (The Fundamental Lemma of the Calculus of Variations): Let f : [a, b] → R be continuous R on the interval [a, b] ⊂ R and assume that ∀η(x) ∈ C 0 [a, b] | η(a) = η(b) = 0 : ab f (x)η(x)dx = 0. Then f (x) = 0 for all x ∈ [a, b]. Lemma B.1 Assume that the lemma does not hold, i.e., for some x0 ∈ [a, b] : f (x0 ) 6= 0. Due to the continuity of η(x) on the interval [a, b], there must be some interval I ⊂ [a, b] for which f (x) is either positive or negative, depending on its original value in x0 , for x ∈ I . Consider then the specic function η(x) = f (x)(x − a)(b − x), which is positive for x ∈ (a, b) and zero for x = a ∧ x = b, hence yielding: Proof Zb f (x)2 (x − a)(b − x)dx > 0, (B.1) a thus contradicting the assumption that the integral were to vanish for all functions η . We have strictly speaking only established that ∀x ∈ (a, b) : f (x) = 0, but as f ∈ C 0 [a, b], it must also vanish at the (18) Or, rather, one E-L equation for each generalized coordinate qi . R. Ø. Nielsen, E. Have, B. T. Nielsen The Double Pendulum 20/31 endpoints, and thence we arrive at the desired result: f (x) = 0, ∀x ∈ [a, b] An alternative, more informal proof which utilizes the Dirac δ function may be given as well: Assume that the lemma does not hold, i.e., for some ξ ∈ [a, b] : f (ξ) 6= 0. Choosing η(x) = δ(x − ξ) where δ is the Dirac delta function, we thus have Proof Zb Zb f (x)δ(x − ξ)dx = f (ξ) 6= 0 f (x)η(x)dx = a (B.2) a contradicting the assumption that the integral were to vanish for all functions η . We may thus conclude that the desired result holds, namely that ∀x ∈ [a, b] : f (x) = 0. C Equations of Motion for the Simple Double Pendulum: Where It All Started Consider the simple double pendulum depicted in the gure below: Figure 11: Schematics of the Simple Double Pendulum Taking the ordinate axis to be positive when pointing upwards, we may immediately write the following R. Ø. Nielsen, E. Have, B. T. Nielsen The Double Pendulum relations between the Cartesian coordinates (x, y) and our generalised coordinates, 21/31 θ1 and θ2 : x1 = l1 sin θ1 , (C.1) y1 = l2 + l1 (1 − cos θ1 ), x2 = l1 sin θ1 + l2 sin θ2 , y2 = l2 − l2 cos θ2 + l2 − l1 cos θ1 The total kinetic energy, T , is, of course, merely the sum of the respective kinetic energies of the constituent pendula: 1 1 1 T = m1 ẋ21 + ẏ12 + m2 ẋ22 + ẏ22 = m1 l12 cos2 θ1 θ̇12 + l12 sin2 θ1 θ̇12 2 2 2 2 2 1 + m2 l1 cos θ1 θ̇1 + l2 cos θ2 θ̇2 + l1 sin θ1 θ̇1 + l2 sin θ2 θ̇2 2 1 1 = m1 l12 θ̇12 + m2 (l12 cos2 θ1 θ̇12 + l22 cos2 θ2 θ̇22 + 2l1 l2 θ̇1 θ̇2 cos θ1 cos θ2 2 2 + l22 sin2 θ2 θ̇22 + l12 sin2 θ1 θ̇22 + 2l1 l2 θ̇1 θ̇2 sin θ1 sin θ2 ) 1 1 = m1 l12 θ̇12 + m2 l12 θ̇12 + l22 θ̇22 + 2l1 l2 θ̇1 θ̇2 (cos θ1 cos θ2 + sin θ1 sin θ2 ) . 2 2 Now, the following relation proves useful, ∀θ1 , θ2 ∈ R : cos θ1 cos θ2 + sin θ1 sin θ2 = cos(θ1 − θ2 ), (C.2) in that it allows us to rearrange (C.2) as follows: 1 1 T = m1 l12 θ̇12 + m2 l12 θ̇12 + l22 θ̇22 + 2l1 l2 θ̇1 θ̇2 cos(θ1 − θ2 ) . 2 2 The potential energy V of the double pendulum is given by: V = m1 gy1 + m2 gy2 = m1 g (l2 + l1 − l1 cos θ1 ) + m2 g (l2 − l2 cos θ2 + l1 − l1 cos θ1 ) , thus yielding, for the Lagrangian L, the following expression: L =T −V 1 1 = l12 θ̇12 (m1 + m2 ) + m2 l22 θ̇22 + m2 l1 l2 θ̇1 θ̇2 cos(θ1 − θ2 ) 2 2 − m1 g (l2 + l1 + l1 cos θ1 ) − m2 g (l2 − l2 cos θ2 + l1 − l1 cos θ1 ) . (C.3) R. Ø. Nielsen, E. Have, B. T. Nielsen The Double Pendulum 22/31 The rst equation of motion is obtained by simply plugging into the Euler-Lagrange equation: ∂L d ∂L = 0, − dt ∂ θ̇1 ∂θ1 (C.4) and so we need only compute the derivatives: i d ∂L d h2 2 = l1 θ̇1 (m1 + m2 ) + m1 l1 l2 θ̇2 cos(θ1 − θ2 ) dt ∂ θ̇1 dt = l12 θ̈1 (m1 + m2 ) + m2 l1 l2 θ̈2 cos (θ1 − θ2 ) − m2 l1 l2 θ̇2 sin (θ1 − θ2 ) θ̇1 − θ̇2 , ∂L = −m2 l1 l2 θ˙1 θ˙2 sin (θ1 − θ2 ) − m1 gl1 sin θ1 − m2 gl1 sin θ1 ∂θ1 = gl1 sin θ1 (m1 + m2 ) − m2 l1 l2 θ˙1 θ˙2 sin (θ1 − θ2 ) . (C.5) (C.6) Upon combining (C.5) and (C.6) as dictated by (C.4), we obtain the rst equation of motion: l12 θ̈1 + gl1 sin θ1 (m1 + m2 ) + m2 l1 l2 θ̈2 cos (θ1 − θ2 ) + θ̇22 sin (θ1 − θ2 ) = 0. (C.7) Similarly, the second equation may be found as follows: i d ∂L d h = m2 l22 θ̇2 + m2 l1 l2 θ̇1 cos (θ1 − θ2 ) dt ∂ θ̇2 dt h i = m2 l22 θ̈2 + m2 l1 l2 θ̈1 cos (θ1 − θ2 ) − θ̇1 sin (θ1 − θ2 ) θ̇1 − θ̇2 , ∂L = m2 l1 l2 θ̇1 θ̇2 sin (θ1 − θ2 ) − m2 gl2 sin θ2 , ∂θ2 ∴ h i m2 l22 θ̈2 + gl2 sin θ2 + m2 l1 l2 θ̈1 cos (θ1 − θ2 ) − θ̇12 sin (θ1 − θ2 ) = 0. And so we have derived the equations of motion for the simple double pendulum. (C.8) R. Ø. Nielsen, E. Have, B. T. Nielsen D The Double Pendulum 23/31 Derivation of the Equations of Motion for the Simple Double Pendulum from Newtonian Mechanics For the simple double pendulum, we have previously obtained the following expressions: x1 = l1 sin θ1 , (D.1) y1 = l2 + l1 (1 − cos θ1 ), x2 = l1 sin θ1 + l2 sin θ2 , y2 = l2 (1 − cos θ2 ) + l1 (1 − cos θ1 ) To derive the equations of motion using the Newtonian framework, we need to know the forces acting on both pendula. Figure 12 shows these forces. Figure 12: Forces on the Simple Double Pendulum From the diagram one immediately obtains the equations (19) using Newton's Second Law, P F = ma: X F1,x = m1 ẍ1 = −T1 sin θ1 + T2 sin θ2 , (D.2) X F1,y = m1 ÿ1 = T1 cos θ1 − T2 cos θ2 − m1 g, (D.3) X F2,x = m2 ẍ2 = −T2 sin θ2 , (D.4) X F2,y = m2 ÿ2 = T2 cos θ2 − m2 g. (D.5) We then make the observation that forces acting on the bob pertaining to the second pendulum, i.e., m2 , T2 does not depend on the tension multiplied by cosine and sine of (19) T1 , θ2 , while the forces on the rst bob does depend on the tension respectively. From (D.4) and (D.5) we may acquire exactly such It is rather unfortunate that the letter T is used to denote both kinetic energy and string tension (or rather rod tension we are, of course, assuming that the "pendulum strings" are perfectly rigid). R. Ø. Nielsen, E. Have, B. T. Nielsen The Double Pendulum 24/31 expressions: T2 sin θ2 = −m2 ẍ2 T2 cos θ2 = m2 (ÿ2 + g) , which, upon substitution into (D.2) and (D.3), yields: We may eliminate (D.7) by sin θ1 , T1 m1 ẍ1 = −T1 sin θ1 − m2 ẍ2 , (D.6) m1 ÿ1 = T1 cos θ1 − m2 (ÿ2 + g) − m1 g. (D.7) entirely from these equations by observing that if we multiply (D.6) by the factors containing T1 − cos θ1 and will be equal, thus, upon rearrangement, yielding: − cos θ1 (m1 ẍ1 + m2 ẍ2 ) = sin θ1 (m1 ÿ1 + m2 ÿ2 + (m1 + m2 ) g) . (D.8) T2 become equal if we We can do almost exactly the same for (D.4) and (D.5): the factors containing multiply the former by − cos θ2 and the latter by sin θ2 : ) − cos θ2 m2 ẍ2 = T2 sin θ2 cos θ2 , sin θ2 m2 ÿ2 = T2 sin θ2 cos θ2 − sin θ2 m2 g Now, all that remains is to nd expressions for ⇒ − cos θ2 m2 ẍ2 = sin θ2 (m2 ÿ2 + m2 g) . ẍ, ẍ2 , ÿ1 , ÿ2 . (D.9) Dierentiating (D.1) w.r.t time twice yields: ẍ1 = θ̈1 l1 cos θ1 − l1 sin θ1 θ̇12 , ẍ2 = θ̈1 l1 sin θ1 + l1 cos θ1 θ̇12 , ÿ1 = θ̈1 l1 cos θ1 − l1 sin θ1 θ̇12 + θ̈2 l2 cos θ2 − l2 sin θ2 θ̇22 , ÿ2 = θ̈1 l1 sin θ1 + l1 cos θ1 θ̈12 + θ̈2 l2 sin θ2 + (D.10) l2 cos θ2 θ̇22 . Plugging these values into (D.8) and (D.9) results in the full equations of motion for the simple double pendulum. Feeding these equations into MatLab or another similar program would be perfectly simple, and so we have derived the equations of motion using only the Newtonian framework. The computational superiority of the Lagrangian method is now obvious, and it is often pointed out that deriving these very equations using only Newton's equation, albeit possible, proves an arduous task. Nevertheless, it can be done without too much trouble, as we have shown. Useful though the Lagrangian and, by extension, the Hamiltonian - formalisms may be, they will, of course, do nothing (classically) that the Newtonian formalism won't! [7] R. Ø. Nielsen, E. Have, B. T. Nielsen E The Double Pendulum 25/31 On the Constancy of the Mechanical Energy To verify the equations of motion, (2.23) and (2.24), we may determine whether they give rise to a constant energy function, as they should in a Hamiltonian system such as ours. The energy is given by the sum of the potential and kinetic energies: E =T +V 1 1 1 1 2 2 = I1 θ˙1 + I2,cm θ˙2 + m2 h21 θ̇12 + m2 d22 θ̇22 + m2 h1 d2 θ̇1 θ̇2 cos(θ1 − θ2 ) 2 2 2 2 − m1 gd1 cos(θ1 ) − m2 gh1 cos(θ1 ) − m2 gd2 cos(θ2 ) (E.1) (E.2) To test whether our equations of motion guarantee the constancy of this function with respect to time, we entered the equations into MatLab and computed the energy as a function of time. Using this method, some numerical noise is to be expected, however we found that the energy is indeed conserved, as can be seen in Figure 13. The energy is constant to at least ve signicant gures over a period of witnessed by MatLab. The MatLab script which produced this plot, energy.m, 30s as is included in Appendix F. The initial conditions were chosen entirely at random. However, to calculate the energy we needed some physical constants pertaining to the double pendulum (moments of inertia, locations of centers of gravity, masses and so on). These were determined by the methods described in section 6.1. The actual initial conditions chosen were θ1 (0) = 1.3, θ2 (0) = 1.2, θ̇1 (0) = 0.3s−1 , θ̇2 (0) = −0.1s−1 . please bear in mind that the zero point of the potential energy is chosen at When viewing the plot, θ1 = θ2 = π/2. Energy/time. Initial energy:−1.2104 Final energy:−1.2104 −1.2104 −1.2104 −1.2104 Energy [J] −1.2104 −1.2104 −1.2104 −1.2104 −1.2104 −1.2104 0 5 10 15 Time [s] 20 25 30 Figure 13: Mechanical energy as a function of time. Notice the scale on the axis of ordinates. R. Ø. Nielsen, E. Have, B. T. Nielsen F 1 3 5 7 9 The Double Pendulum 26/31 MatLab Scripts f u n c t i o n xdot = odesample ( t , x ) % P h y s i c a l c o n s t a n t s o f the double pendulum i n SI u n i t s I1 =0.08623; I2 =0.017681; m1=0.955; m2=0.63; g =9.82; h1 =0.4035; d1 =14.8/100; d2 =8/100; 11 13 15 17 19 %%Here ar e the d i f f e r e n t i a l e q u a t i o n s ( transformed i n t o a system o f f o u r %%f i r s t o r d e r d i f f e r e n t i a l e q u a t i o n s ) . xdot=z e r o s ( 4 , 1 ) ; xdot ( 1 )=x ( 3 ) ; % Theta1−dot xdot ( 2 )=x ( 4 ) ; % Theta2−dot xdot ( 3 )=−(m2∗ h1 ∗ d2 ∗ x ( 4 ) ^2 ∗ s i n ( x ( 1 )−x ( 2 ) ) ∗ I2+m2^2 ∗ h1 ∗ d2^3 ∗ x ( 4 ) ^2 ∗ s i n ( x ( 1 )−x ( 2 ) )+m1∗ g ∗ d1 ∗ s i n ( x ( 1 ) ) ∗ I2+m1∗ g ∗ d1 ∗ s i n ( x ( 1 ) ) ∗m2∗ d2^2+m2∗ g ∗ h1 ∗ s i n ( x ( 1 ) ) ∗ I2+m2^2 ∗ g ∗ h1 ∗ s i n ( x ( 1 ) ) ∗ d2^2+m2^2 ∗ h1^2 ∗ d2^2 ∗ cos ( x ( 1 )−x ( 2 ) ) ∗ x ( 3 ) ^2 ∗ s i n ( x ( 1 )−x ( 2 ) )−m2^2 ∗ h1 ∗ d2^2 ∗ cos ( x ( 1 )−x ( 2 ) ) ∗ g ∗ s i n ( x ( 2 ) ) ) /( −m2^2 ∗ h1^2 ∗ d2^2 ∗ cos ( x ( 1 )−x ( 2 ) )^2+I1 ∗ I2+I1 ∗m2∗ d2^2+m2∗ h1^2 ∗ I2+m2^2 ∗ h1^2 ∗ d2 ^2) ; %theta1 −double −dot xdot ( 4 ) =(h1^2 ∗ cos ( x ( 1 )−x ( 2 ) ) ∗m2∗ d2 ∗ x ( 4 ) ^2 ∗ s i n ( x ( 1 )−x ( 2 ) )+h1 ∗ cos ( x ( 1 )−x ( 2 ) ) ∗m1∗ g ∗ d1 ∗ s i n ( x ( 1 ) )+h1 ^2 ∗ cos ( x ( 1 )−x ( 2 ) ) ∗m2∗ g ∗ s i n ( x ( 1 ) )+h1 ∗ x ( 3 ) ^2 ∗ s i n ( x ( 1 )−x ( 2 ) ) ∗ I1+h1^3 ∗ x ( 3 ) ^2 ∗ s i n ( x ( 1 )−x ( 2 ) ) ∗m2−g ∗ s i n ( x ( 2 ) ) ∗ I1 −g ∗ s i n ( x ( 2 ) ) ∗m2∗ h1 ^2) ∗m2∗ d2/( −m2^2 ∗ h1^2 ∗ d2^2 ∗ cos ( x ( 1 )−x ( 2 ) )^2+I1 ∗ I2+I1 ∗m2∗ d2^2+m2 ∗ h1^2 ∗ I2+m2^2 ∗ h1^2 ∗ d2 ^2) ; %theta2 −double −dot end ../Matlab/odesample.m 1 3 5 7 9 11 13 15 17 19 clear all ; % The purpose o f t h i s s c r i p t i s to i l l u s t r a t e the s e n s i t i v i t y to i n i t i a l % c o n d i t i o n s by r e c o r d i n g f i n a l a n g l e as f u n c t i o n o f i n i t i a l a n g l e t f i n a l =10.01; % S imu la tio n time n p o i n t s =10000; % S im ula ti on data p o i n t s t i n t e r v a l=t f i n a l / n p o i n t s ; % Time i n t e r v a l between p o i n t s . M=1000; % Number o f s i m u l a t i o n s to run max_angle =1.8 f o r i =1:M; % Inital conditions i n i t i a l ( 1 )=i ∗ ( max_angle/M) ; i n i t i a l ( 2 )=i ∗ ( max_angle/M) ; % t h e t a 1 ( 0 )=t h e t a 2 ( 0 ) i n i t i a l ( 3 ) =0; % I n i t i a l v e l o c i t i e s =0 i n i t i a l ( 4 ) =0; % Numerical ODE s o l u t i o n : [ t , y]= ode45 ( @odesample , 0 : t i n t e r v a l : t f i n a l , i n i t i a l ) ; % Record i n i t i a l c o n d i t i o n f o r p l o t t i n g r e c o r d i n i t ( i )= i n i t i a l ( 1 ) ; % Record f i n a l a n g l e t h e t a 1 r e c o r d f i n a l ( i )=y ( n p o i n t s +1 ,1) ; R. Ø. Nielsen, E. Have, B. T. Nielsen 21 23 25 The Double Pendulum i % P r i n t i t e r a t i o n number to CLI . end plot ( recordinit , recordfinal , ' . ' ) x l a b e l ( ' I n i t i a l value o f t h e t a 1 [ rad ] ' ) y l a b e l ( ' f i n a l value o f t h e t a 1 [ rad ] ' ) ../Matlab/initcondsimulation.m 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 clear all ; I1 =0.08623; I2 =0.017681; m1=0.955; m2=0.63; g =9.82; h1 =0.4035; d1 =14.8/100; d2 =8/100; % Total time o f s i m u l a t i o n s T = 80; % Length o f i n i t i a l phase space s e p a r a t i o n D = 1E− 4; % Degree o f " f i n e n e s s " o f each p a r t i a l s i m u l a t i o n ( that o f l e n g t h dt ) Npart = 1 0 0 0 ; % Length o f each p a r t i a l s i m u l a t i o n dt =0.1; % M i s the v a r i a b l e which i s incremented c a u s i n g the i n i t i a l a n g l e % to change . M=200; % Vector which w i l l c o n t a i n t h e t a 0 and Lyapunov exponent LYAPS=z e r o s (M+1 ,2) ; max_angle =1.8; f o r i =0:M t h e t a 0=i ∗ ( max_angle/M) ; % I n i t i a l i n i t i a l c o n d i t i o n s ( ahem ) : i n i t i a l 1 (1) = theta0 ; i n i t i a l 1 (2) = theta0 ; i n i t i a l 1 (3) = 0; i n i t i a l 1 (4) = 0; initial2 = initial1 ; f i n a l 1=i n i t i a l 1 ; f i n a l 2=i n i t i a l 2 ; t =0; L=0; while t < T i n i t i a l 1=f i n a l 1 ; i f norm ( f i n a l 2 − f i n a l 1 ) > 0 i n i t i a l 2=f i n a l 1 +(( f i n a l 2 − f i n a l 1 ) . / norm ( f i n a l 2 − f i n a l 1 ) ) . ∗ D; end i f norm ( f i n a l 2 − f i n a l 1 ) == 0 % I f the two phase space v e c t o r s ( f i n a l 1 , f i n a l 2 ) c o i n c i d e , we % cannot d e f i n e any r e a s o n a b l e d i r e c t i o n i n which to s e p a r a t e 27/31 R. Ø. Nielsen, E. Have, B. T. Nielsen % the two t r a j e c t o r i e s , so we j u s t choose the d i r e c t i o n % given by the u n i t v e c t o r (1/ s q r t ( 2 ) ) ∗ [ 1 , 1 , 0 , 0 ] i n i t i a l 2=f i n a l 1+D∗ (1/ s q r t ( 2 ) ) ∗ [ 1 , 1 , 0 , 0 ] ; 45 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 87 28/31 end [ t1 , y1]= ode45 ( @odesample , 0 : dt / Npart : dt , i n i t i a l 1 ) ; [ t2 , y2]= ode45 ( @odesample , 0 : dt / Npart : dt , i n i t i a l 2 ) ; l a s t e l e m=l e n g t h ( t1 ) ; f i n a l 1=y1 ( l a s t e l e m , : ) ; f i n a l 2=y2 ( l a s t e l e m , : ) ; % C o n f i g u r a t i o n space −> Phase Space t r a n s f o r m a t i o n o f c o o r d i n a t e s i n i t i a l P 1 ( 1 )=i n i t i a l 1 ( 1 ) ; i n i t i a l P 1 ( 2 )=i n i t i a l 1 ( 2 ) ; i n i t i a l P 1 ( 3 )=I1 ∗ i n i t i a l 1 ( 3 )+m2∗ h1^2 ∗ i n i t i a l 1 ( 3 )+m2∗ h1 ∗ d2 ∗ i n i t i a l 1 ( 4 ) ∗ cos ( i n i t i a l 1 ( 1 )− i n i t i a l 1 (2) ) ; i n i t i a l P 1 ( 4 )=I2 ∗ i n i t i a l 1 ( 4 )+m2∗ d2^2 ∗ i n i t i a l 1 ( 4 )+m2∗ h1 ∗ d2 ∗ i n i t i a l 1 ( 3 ) ∗ cos ( i n i t i a l 1 ( 1 )− i n i t i a l 1 (2) ) ; % C o n f i g u r a t i o n space −> Phase Space t r a n s f o r m a t i o n o f c o o r d i n a t e s i n i t i a l P 2 ( 1 )=i n i t i a l 2 ( 1 ) ; i n i t i a l P 2 ( 2 )=i n i t i a l 2 ( 2 ) ; i n i t i a l P 2 ( 3 )=I1 ∗ i n i t i a l 2 ( 3 )+m2∗ h1^2 ∗ i n i t i a l 2 ( 3 )+m2∗ h1 ∗ d2 ∗ i n i t i a l 2 ( 4 ) ∗ cos ( i n i t i a l 2 ( 1 )− i n i t i a l 2 (2) ) ; i n i t i a l P 2 ( 4 )=I2 ∗ i n i t i a l 2 ( 4 )+m2∗ d2^2 ∗ i n i t i a l 2 ( 4 )+m2∗ h1 ∗ d2 ∗ i n i t i a l 2 ( 3 ) ∗ cos ( i n i t i a l 2 ( 1 )− i n i t i a l 2 (2) ) ; % C o n f i g u r a t i o n space −> Phase Space t r a n s f o r m a t i o n o f c o o r d i n a t e s f i n a l P 1 ( 1 )=f i n a l 1 ( 1 ) ; f i n a l P 1 ( 2 )=f i n a l 1 ( 2 ) ; f i n a l P 1 ( 3 )=I1 ∗ f i n a l 1 ( 3 )+m2∗ h1^2 ∗ f i n a l 1 ( 3 )+m2∗ h1 ∗ d2 ∗ f i n a l 1 ( 4 ) ∗ cos ( f i n a l 1 ( 1 )− f i n a l 1 ( 2 ) ) ; f i n a l P 1 ( 4 )=I2 ∗ f i n a l 1 ( 4 )+m2∗ d2^2 ∗ f i n a l 1 ( 4 )+m2∗ h1 ∗ d2 ∗ f i n a l 1 ( 3 ) ∗ cos ( f i n a l 1 ( 1 )− f i n a l 1 ( 2 ) ) ; % C o n f i g u r a t i o n space −> Phase Space t r a n s f o r m a t i o n o f c o o r d i n a t e s f i n a l P 2 ( 1 )=f i n a l 2 ( 1 ) ; f i n a l P 2 ( 2 )=f i n a l 2 ( 2 ) ; f i n a l P 2 ( 3 )=I1 ∗ f i n a l 2 ( 3 )+m2∗ h1^2 ∗ f i n a l 2 ( 3 )+m2∗ h1 ∗ d2 ∗ f i n a l 2 ( 4 ) ∗ cos ( f i n a l 2 ( 1 )− f i n a l 2 ( 2 ) ) ; f i n a l P 2 ( 4 )=I2 ∗ f i n a l 2 ( 4 )+m2∗ d2^2 ∗ f i n a l 2 ( 4 )+m2∗ h1 ∗ d2 ∗ f i n a l 2 ( 3 ) ∗ cos ( f i n a l 2 ( 1 )− f i n a l 2 ( 2 ) ) ; dx=norm ( f i n a l P 2 − f i n a l P 1 ) ; dx0=norm ( i n i t i a l P 2 − i n i t i a l P 1 ) ; dx0 K=norm ( i n i t i a l 2 − i n i t i a l 1 ) t=t+dt ; Li=l o g ( dx/dx0 ) ; L=L+Li ; 47 85 The Double Pendulum end end L=(1/T) ∗ L ; LYAPS( i +1 ,1)=t h e t a 0 ; LYAPS( i +1 ,2)=L ; i % P r i n t i to CLI p l o t (LYAPS( : , 1 ) ,LYAPS( : , 2 ) ) x l a b e l ( ' I n i t i a l a n g l e ( t h e t a 2=t h e t a 1 ) ' ) ; y l a b e l ( ' Lyapunov exponent ' ) ; ../Matlab/laypps/lyap.m R. Ø. Nielsen, E. Have, B. T. Nielsen 2 4 6 8 10 12 14 16 18 The Double Pendulum clear all ; % Total time o f s i m u l a t i o n T=10 n p o i n t s =100000 % Number o f s i m u l a t e d p o i n t e A = importdata ( ' 2552 − t r a c k . csv ' , ' , ' ) ; % Experimental motion data . expt=A( : , 1 ) ; exptheta=A( : , 2 ) ; p l o t ( expt , exptheta ) l e g e n d ( ' Experimental ' ) i n i t i a l ( 1 )=exptheta ( 1 ) ; i n i t i a l ( 2 ) =3.467633769E− 1; % From Tracker i n i t i a l ( 3 ) =0; i n i t i a l ( 4 ) =0; [ t , y]= ode113 ( @odesample , 0 :T/ n p o i n t s : T, [ i n i t i a l ] ) ; hold on p l o t ( t , y ( : , 1 ) , ' red ' ) l e g e n d ( ' Experimental ' , ' Simulated ' ) x l a b e l ( ' Time [ s ] ' ) y l a b e l ( ' Angle t h e t a 1 [ rad ] ' ) ../Matlab/Trackcompare/comptrajectory.m 1 3 % Parametric p l o t o f double pendulum ( parametrized by e x p e r i m e n t a l l y % determined a n g l e s ) . P l o t s ( x , y ) t r a j e c t o r i e s o f pendula . L2 = 0 . 3 2 5 ; % Length o f pendulum 2 h1 = 0 . 4 0 3 5 ; % Distance between p o i n t s o f s u s p e n s i o n 5 7 9 11 13 15 17 19 21 23 25 27 A = importdata ( ' t r a c k . csv ' , ' , ' ) ; n=1; t=z e r o s ( l e n g t h (A) , 1 ) ; X1=z e r o s ( l e n g t h (A) , 2 ) ; % Will c o n t a i n c o o r d i n a t e s o f pendulum 1 . X2=X1 ; % Will c o n t a i n c o o r d i n a t e s o f pendulum 2 . N=l e n g t h (A) w h i l e n <= l e n g t h (A) t ( n , 1 )=A( n , 1 ) / 1 0 ; th1=A( n , 2 ) ; th2=A( n , 3 ) ; th3=A( n , 4 ) ; X1( n , 1 )=h1 ∗ s i n ( th1 ) ; X1( n , 2 )=−h1 ∗ cos ( th1 ) ; X2( n , 1 )=h1 ∗ s i n ( th1 )+L2 ∗ s i n ( th3 ) ; X2( n , 2 )=−h1 ∗ cos ( th1 )−L2 ∗ cos ( th3 ) ; n=n+1; end p l o t (X1 ( : , 1 ) ,X1 ( : , 2 ) ) hold on p l o t (X2 ( 1 :N, 1 ) ,X2 ( 1 :N, 2 ) , ' red ' ) l e g e n d ( ' Upper pendulum ' , ' Lower pendulum ' ) x l a b e l ( ' x [m] ' ) y l a b e l ( ' y [m] ' ) 29/31 R. Ø. Nielsen, E. Have, B. T. Nielsen 29 The Double Pendulum 30/31 t i t l e ( ' Double pendulum , e x p e r i m e n t a l data , runtime : 10 s ' ) a x i s equal ../Matlab/Paramplot/param.m 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 clear all ; I1 =0.08623; I2 =0.017681; m1=0.955; m2=0.63; g =9.82; h1 =0.4035; d1 =14.8/100; d2 =8/100; % Plot time t f i n a l =30; n p o i n t s =10000; % Number o f s i m u l a t e d p o i n t s t i n t e r v a l=t f i n a l / n p o i n t s ; % I n t e r v a l between p o i n t s . i n i t i a l ( 1 ) =1.3; i n i t i a l ( 2 ) =1.2; i n i t i a l ( 3 ) =0.3; i n i t i a l ( 4 ) = − 0.1; opts=o d e s e t ( ' r e l t o l ' , 1e − 9, ' a b s t o l ' ,1 e − 12) ; [ t , y]= ode113 ( @odesample , 0 : t i n t e r v a l : t f i n a l , i n i t i a l , opts ) ; n=1; E=z e r o s ( l e n g t h ( t ) , 2 ) ; w h i l e n<=l e n g t h ( t ) E( n , 1 )=t ( n , 1 ) ; E( n , 2 ) =0.5 ∗ I1 ∗ y ( n , 3 ) ^2+0.5 ∗ I2 ∗ y ( n , 4 ) ^2+0.5 ∗m2∗ h1^2 ∗ y ( n , 3 ) ^2+0.5 ∗m2∗ d2^2 ∗ y ( n , 4 ) ^2+m2∗ h1 ∗ d2 ∗ y ( n , 3 ) ∗ y ( n , 4 ) ∗ cos ( y ( n , 1 ) −y ( n , 2 ) )−m1∗ g ∗ d1 ∗ cos ( y ( n , 1 ) )−m2∗ g ∗ h1 ∗ cos ( y ( n , 1 ) )−m2∗ g ∗ d2 ∗ cos ( y ( n , 2 ) ) ; n=n+1; end p l o t (E ( : , 1 ) ,E ( : , 2 ) ) ; x l a b e l ( ' Time [ s ] ' ) ; y l a b e l ( ' Energy [ J ] ' ) ; E0 = E( 1 , 2 ) ; E30=E( l e n g t h ( t ) , 2 ) ; E0str = num2str (E0) ; E30str = num2str ( E30 ) ; p l o t t i t l e = s t r c a t ( ' Energy / time . I n i t i a l energy : ' , E0str , ' F i n a l energy : ' , E30str ) ; title ( plottitle ) ; ../Matlab/Energy/energy.m R. Ø. Nielsen, E. Have, B. T. Nielsen The Double Pendulum 31/31 References [1] Arnold, V. I. Graduate Texts in Mathematics: Mathematical Methods of Classical Mechanics, 2. ed. Springer, 2010. [2] Aruldhas, G. Classical Mechanics. [3] Gardiner, S. A. Prentice-Hall Of India Pvt. Limited. Quantum Measurement, Quantum Chaos, and Bose-Einstein Condensates. Uni- versität Innsbruck, 2000. [4] Hobbie, R., and Roth, B. Intermediate Physics for Medicine and Biology. Biological and Medical Physics, Biomedical Engineering Series. Springer, 2007. [5] Lanczos, C. [6] Morin, D. The Variational Principles of Mechanics. Dover Publications, 1970. Introduction to Classical Mechanics: With Problems and Solutions. Cambridge University Press, 2008. [7] Webber, B., and Barnes, C. Lecture Notes: Theoretical Physics 1. Cambridge University, 2008. [8] Wolf, A., Swift, J. B., Swinney, H. L., and Vastano, J. A. Determining Lyapunov Exponents from a Time Series. Physica (1985), 285317.
© Copyright 2025 Paperzz