Академический Документы
Профессиональный Документы
Культура Документы
JJ II Abstract
The double pendulum will be analyzed using Lagrangian and Hamil-
J I tonian methods. The system’s behavior is then visualized using Matlab’s
ODE45 routine. Finally, the different behaviors are categorized.
Page 1 of 20
Go Back
Full Screen
Close
Quit
Contents
1 Introduction 3
Full Screen
Close
Quit
1. Introduction
In order to analyze the system by using Newton’s second law, all the forces acting
on the system have to be known and be able to be expressed. Because the double
Home Page pendulum problem is quite complex, Lagrangian and Hamiltonian equations are
used to simplify the analysis. This approach is more suitable because it uses
Title Page • energy, a scalar quantity, as a basis for analysis rather than force, a vector
quantity, and
Contents • generalized coordinates of any suitable quantity, rather than the limiting
rectangular, polar, or spherical coordinates.
Close
Quit
2. Derivation
A double pendulum consists of two pendulums with the first suspended from
a point in space and the second suspended from the end of the first. Consider
Home Page the double pendulum shown in Figure 1 with masses m1 and m2 attached by
rigid massless rods of lengths l1 and l2 . To simplify the analysis of the system,
the system’s motion will be constricted to a plane. Let the angles the two rods
Title Page
make with the vertical be denoted as θ1 and θ2 , and let gravity be given by g.
Close
Quit
Home Page y
Title Page x1 x2 x
Contents θ1
l1
JJ II m1
y1
l2
J I θ2 m2
y2
Page 5 of 20
Go Back
Full Screen
Quit
V = m1 gy1 + m2 gy2 (5)
Home Page
= m1 g(−l1 cos θ1 ) + m2 g(−l1 cos θ1 − l2 cos θ2 )
Contents
The kinetic energy of the system is given by
JJ II
1 1
T = m1 v12 + m2 v22 (7)
2 2
J I
1 1
= m1 (ẋ21 + ẏ12 ) + m2 (ẋ22 + ẏ22 )
Page 6 of 20 2 2
1 1
= m1 l12 θ̇12 + m2 [l12 θ̇12 + l22 θ̇22 + 2l1 l2 θ˙1 θ˙2 cos(θ1 − θ2 )]. (8)
Go Back 2 2
Quit
V (θ1 , θ2 ). The Lagrangian function is defined as
L ≡ T − V. (9)
Thus the Lagrangian function of the generalized coordinates (θ1 , θ2 ) is
Home Page
1 1
L = (m1 + m2 )l12 θ˙12 + m2 l22 θ˙22 + m2 l1 l2 θ˙1 θ˙2 cos(θ1 − θ2 )
2 2
Title Page
d ∂L
Go Back = (m1 + m2 )l12 θ¨1 + m2 l1 l2 θ¨2 cos(θ1 − θ2 )
dt ∂ θ˙1
− m2 l1 l2 θ˙2 sin(θ1 − θ2 )(θ˙1 − θ˙2 ) (13)
Full Screen
∂L
= l1 (m1 + m2 )g sin θ1 − m2 l1 l2 θ˙1 θ˙2 sin(θ1 − θ2 ), (14)
Close ∂θ1
Quit
and substituting these in Equation 11, we obtain
d ∂L
J I = m2 l2 θ¨2 + m2 l1 l2 θ¨1 cos(θ1 − θ2 )
dt ∂ θ˙2
− m2 l1 l2 θ˙1 sin(θ1 − θ2 )(θ˙1 − θ˙2 ) (18)
Page 8 of 20
∂L
= m2 l1 l2 θ˙1 θ˙2 sin(θ1 − θ2 ) − l2 m2 g sin θ2 , (19)
Go Back ∂θ2
and substituting these in equation (16) gives
Full Screen m2 l22 θ¨2 + m2 l1 l2 θ¨1 cos(θ1 − θ2 ) − m2 l1 l2 θ̇12 sin(θ1 − θ2 ) + l2 m2 g sin θ2 = 0. (20) eq20
Quit
depend on four unknowns. In order to solve the system numerically using Mat-
lab’s ODE45 routine, a system of four first-order ordinary differential equations
is needed.
Home Page
2.5. Generalized Momenta
Since the system is closed, the equations of motion can also be written in the
Title Page Hamiltonian formalism. This introduces the generalized momenta p1 and p2 ,
so the motion of the system depends on four initial conditions (θ1 , θ2 , p1 , p2 ).
Computing the generalized momenta gives
Contents
∂L
p1 = = (m1 + m2 )l12 θ˙1 + m2 l1 l2 θ˙2 cos(θ1 − θ2 ) (21) eq21
˙
∂ θ1
JJ II
∂L
p2 = = m2 l22 θ˙2 + m2 l1 l2 θ˙1 cos(θ1 − θ2 ). (22) eq22
J I ∂ θ˙2
Quit
Solving the generalized momenta, Equation 21 and Equation 22, for θ˙1 and θ˙2
and substituting back into equation Equation 24 gives
Go Back
∂H
p˙1 = − = −(m1 + m2 )gl1 sin θ1 − C1 + C2 (28)
∂θ1
Full Screen
∂H
p˙2 = − = −m2 gl2 sin θ2 + C1 − C2 (29)
Close ∂θ2
Quit
p1 p2 sin(θ1 − θ2 )
C1 ≡ (30)
l1 l2 [m1 + m2 sin2 (θ1 − θ2 )]
Home Page
l22 m2 p21 + l12 (m1 + m2 )p22 − l1 l2 m2 p1 p2 cos(θ1 − θ2 )
C2 ≡ sin[2(θ1 − θ2 )] (31)
2l12 l22 [m1 + m2 sin2 (θ1 − θ2 )]2
Title Page
Contents
JJ II
J I
Page 11 of 20
Go Back
Full Screen
Close
Quit
3. Finding a Numerical Solution
3.1. Creating a Function M-File
Home Page
Solutions for θ1 and θ2 can be found by solving the system of first-order differ-
ential equations numerically using Matlab’s ODE45 routine. The first step is to
create a function m-file in the Matlab editor.
Title Page
function xprime=doublependulum(t,x,flag,g,l1,l2,m1,m2)
Contents C1=(x(3).*x(4).*sin(x(1)-x(2)))./...
l1*l2*(m1+m2*(sin(x(1)-x(2))).^2);
C2=((l2^2*m2*(x(3)).^2+l1^2*(m1+m2)*...
JJ II (x(4)).^2-l1*l2*m2*x(3).*x(4).*cos(x(1)-x(2)))...
./2*l1^2*l2^2*(m1+m2*(sin(x(1)-x(2))).^2).^2)...
.*sin(2*(x(1)-x(2)));
J I
xprime=zeros(4,1);
Page 12 of 20 xprime(1)=(l2*x(3)-l1*x(4).*cos(x(1)-x(2)))...
./l1^2*l2*(m1+m2*(sin(x(1)-x(2))).^2);
xprime(2)=(l1*(m1+m2)*x(4)-l2*m2*x(3).*cos(x(1)-x(2)))...
Go Back ./l1*l2^2*m2*(m1+m2*(sin(x(1)-x(2))).^2);
xprime(3)=-(m1+m2)*g*l1*sin(x(1))-C1+C2;
xprime(4)=-m2*g*l2*sin(x(2))+C1-C2;
Full Screen
This m-file defines the system of four first-order differential equations, where
flag sets the parameters of the system.
Close
Quit
3.2. Using ODE45
Below is an example of how to execute Matlab’s ODE45 routine. First the func-
tion is initiated, then a time interval is given followed by the initial conditions of
Home Page the system, and finally the parameters of the system are given values. Four nu-
merical solutions are produced by this example, where x is a vector that contains
the solutions, x = [θ1 (t), θ2 (t), p1 (t), p2 (t)].
Title Page
[t,x]=ode45(’doublependulum’,[0,25],[pi;pi;0;0],[],9.8,1,1,1,1);
Contents
To call up the numerical equation θ1 , the first column of the vector x is initiated
x(:,1). Solutions for θ2 , p1 , and p2 are produced by calling the appropriate
column of the vector x. These solutions can then be plugged into the position
JJ II Equation 1, Equation 2, Equation 3, and Equation 4 to model the behavior of
the masses in the system.
J I x1=sin(x(:,1));
y1=-cos(x(:,1));
x2=sin(x(:,1))+sin(x(:,2));
Page 13 of 20 y2=-cos(x(:,1))-cos(x(:,2));
Go Back
Full Screen
Close
Quit
4. Behaviors of the System
Depending on the given initial conditions, the double pendulum exhibits three
types of behavior:
Home Page
• Periodic motion
• Chaotic motion
Contents
4.1. Periodic Motion
In periodic behavior, the system’s motion is cyclic. This occurs when the energy
JJ II
of the system is either small or extremely large. Figure 2 shows the trace of m2
when the system is given a substantial amount of energy. The mass stays on the
J I same path indefinitely, or the motion is periodic. The following is the code that
produced Figure 2.
Page 14 of 20 [t,x]=ode45(’doublep’,[0,0.7],[pi;pi;10;-8.898788999]);
x1=sin(x(:,1));
y1=-cos(x(:,1));
Go Back x2=sin(x(:,1))+sin(x(:,2));
y2=-cos(x(:,1))-cos(x(:,2));
plot(x2,y2)
Full Screen axis([min(-2) max(2)...
min(-2) max(2)])
Close
Quit
2
Home Page
1.5
Title Page
1
Contents 0.5
y−axis
0
JJ II
−0.5
J I
−1
Page 15 of 20 −1.5
−2
Go Back −2 −1 0 1 2
x−axis
Close
Quit
4.2. Quasiperiodic Motion
In quasiperiodic behavior, the system’s motion is almost periodic. This behavior
occurs at all energy levels, yet is rare at middle range energy values. Figure 3
Home Page shows the trace of m2 when the system is given appropriate values to produce
quasiperiodic behavior. Here is the code that produced Figure 3.
Page 16 of 20
Go Back
Full Screen
Close
Quit
4.3. Chaotic Motion
In chaotic behavior, the system’s motion is unpredictable and non-repetitive.
Two systems with almost identical initial conditions show very different long
Home Page term behavior. The system produces chaotic behavior at all energy levels un-
less the system is given an infinite amount of energy where only periodic and
quasiperiodic behavior exist. Figure 4 is an example of chaotic behavior exhib-
Title Page ited by the system. The code for Figure 4 follows.
[t,x]=ode45(’doublep’,[0,25],[pi;pi;0;0]);
Contents x1=sin(x(:,1));
y1=-cos(x(:,1));
x2=sin(x(:,1))+sin(x(:,2));
JJ II
y2=-cos(x(:,1))-cos(x(:,2));
plot(x2,y2)
J I axis([min(-2) max(2) ...
min(-2) max(2)])
Page 17 of 20
Go Back
Full Screen
Close
Quit
2
Home Page
1.5
Title Page
1
Contents 0.5
y−axis
0
JJ II
−0.5
J I
−1
Page 18 of 20 −1.5
−2
Go Back −2 −1 0 1 2
x−axis
Close
Quit
2
Home Page
1.5
Title Page
1
Contents 0.5
y−axis
0
JJ II
−0.5
J I
−1
Page 19 of 20 −1.5
−2
Go Back −2 −1 0 1 2
x−axis
Close
Quit
References
[1] Arya, Atam P. (1998). Introduction to Classical Mechanics
(2nd ed.). Upper Saddle River, NJ: Prentice Hall.
Home Page
[2] Marion, Jerry B., & Thornton, Stephen T. (1988).
Classical Dynamics of Particles & Systems(3rd ed.). San
Title Page Diego, CA: Harcourt Brace Jovanovich.
JJ II
J I
Page 20 of 20
Go Back
Full Screen
Close
Quit