Professional Documents
Culture Documents
Advanced Dynamics 2016 Assignment
Advanced Dynamics 2016 Assignment
0
Table of Contents
1
1. Problem Formulation
A free-swinging double pendulum system is attached on a pole, rotating along its axis at a
constant angular velocity of Ω. Define coordinate systems, generalized coordinates and
derive Lagrangian in cases both with and without friction.
2. Assumptions
1) The pendulum links are thin cylindrical rods.
2) Joints are massless.
3) There are no elastic nor plastic deformation occurring in the system.
4) Two pendulum links are identical to each other.
5) Mass is uniformly distributed along each component.
6) Pendulum joints are located at the tip of each pendulum link and coincide with the
longitudinal axis of the link. (i.e. Spacial overlapping of 2 links is possible)
𝑄 = {𝜃1 , 𝜃2 }
2
With the two degree of freedom and the two generalised coordinates, there are no constraint
equation used in this system.
5. Derivation of Lagrangian
5.1. Defining Rotation Matrices
cos(𝛺𝑡) − sin(Ω𝑡) 0
0
1𝑅 = [ sin(Ω𝑡) cos(Ω𝑡) 0 ]
0 0 1
1 0 0
1
2𝑅 = [0 cos(𝜃1 ) −sin(𝜃1 )]
0 sin(𝜃1 ) cos(𝜃1 )
1 0 0
1 0 cos(𝜃 ) −sin(𝜃
3𝑅 = [ 2 2 )]
0 sin(𝜃2 ) cos(𝜃2 )
2𝜔
2 = 12𝑅 𝑇 1𝜔2
𝜃1̇
= [ Ωsin(𝜃1 ) ]
Ωcos(𝜃1 )
Link 2
1𝜔
3 = 1𝜔1 + 1𝜔3,1
0 𝜃2̇
= [0] + [ 0 ]
Ω 0
𝜃2̇
= [0]
Ω
3𝜔
3 = 13𝑅 𝑇 1𝜔3
𝜃2̇
= [ Ωsin(𝜃2 ) ]
Ωcos(𝜃2 )
3
Finding the position vector and linear velocity of each link:
Link 1
0
2𝑟 0
𝑂𝐺1 = [−𝑙]
2
0
𝑙
sin(𝜃1 )
1𝑟
𝑂𝐺1 = 12𝑅 ∙ 2𝑟𝑂𝐺1 = 2
−𝑙
[ 2 cos(𝜃1 )]
1𝑟 ̇ ′
𝑂𝐺1 = 1𝑟𝑂𝐺1 + 1𝜔1 × 1𝑟𝑂𝐺1
0 0
𝑙 0 𝑙
𝜃 ̇ cos(𝜃1 ) sin(𝜃1 )
= 2 1 + [0] × 2
−𝑙 Ω −𝑙
̇
[ 2 𝜃1 sin(𝜃1 )] [ 2 cos(𝜃1 )]
−𝑙
Ωsin(𝜃1 )
2
𝑙
= 𝜃 ̇ cos(𝜃1 )
2 1
−𝑙
̇
[ 2 𝜃1 sin(𝜃1 )]
Link 2
0
2𝑟
𝑂𝐴 = [0]
−𝑙
0
3 0
𝑟𝐴𝐺2 = [−𝑙]
2
1𝑟
𝑂𝐺2 = 1𝑟𝑂𝐴 + 1𝑟𝐴𝐺2
= 𝟏𝟐𝑅 2𝑟𝑂𝐴 + 𝟏𝟑𝑅 1𝑟𝐴𝐺2
0
0 𝑙
sin(𝜃2 )
=[ 𝑙 sin(𝜃1) ] + 2
−𝑙 cos(𝜃1 ) 𝑙
[− 2 cos(𝜃2 )]
0
1
𝑙 (𝑠𝑖𝑛(𝜃1 ) + 𝑠𝑖𝑛(𝜃2 ))
= 2
1
−𝑙 (cos(𝜃1 ) + cos(𝜃2 ))
[ 2 ]
4
0
𝑙 0
𝑙 (𝜃1̇ cos(𝜃1 ) +
𝜃 ̇ cos(𝜃2 ))
2 2= + [0]
𝑙 Ω
𝑙 (𝜃 1
̇ sin(𝜃1 ) + 𝜃2̇ sin(𝜃2 ))
[ 2 ]
0
1
𝑙 (𝑠𝑖𝑛(𝜃1 ) + 𝑠𝑖𝑛(𝜃2 ))
× 2
1
−𝑙 (cos(𝜃 1 ) + cos(𝜃2 ))
[ 2 ]
1
−Ω𝑙 (sin 𝜃1 + sin 𝜃2 )
2
1
= 𝑙 (𝜃1̇ cos 𝜃1 + 𝜃2̇ cos 𝜃2 )
2
1
𝑙(𝜃 ̇ sin 𝜃1 + 𝜃2̇ sin 𝜃2
1
[ 2 ]
Based on assumption 2, the inertia tensor of the two links are given by the inertial
tensor of a cylindirical rod.
𝑚𝑙2
0 0
2𝐼 𝐺1 3𝐼 𝐺2
12 𝑚𝑙2 1 0 0
1 = 2 = 𝑚𝑙2 = [0 1 0]
0 0 12
12 0 0 0
[ 0 0 0]
5.3. Calculating Kinetics Energy
Kinetics Energy of n rigid bodies can be calculated by :
𝑛
1
𝑇 = ∑(𝑚𝑖 𝑟𝑂𝐺̇ 𝑖 𝑇 𝑟𝑂𝐺̇ 𝑖 + 𝜔𝑖𝑇 𝐼𝑖𝐺 𝜔𝑖 )
2
𝑖=1
1 𝐺 𝐺
= (𝑚 1𝑟𝑂𝐺̇ 1 𝑇 1𝑟𝑂𝐺̇ 1 + 𝑚 1𝑟𝑂𝐺̇ 2 𝑇 1𝑟𝑂𝐺̇ 2 + 2 𝜔2𝑇 2𝐼1 1 2𝜔2 + 3𝜔3𝑇 3𝐼2 2 3𝜔3 )
2
1 𝑙 1 𝑙 1 1
− Ω sin 𝜃1 − Ω sin 𝜃1 −Ω𝑙 (sin 𝜃1 + sin 𝜃2 )
2 2 2
𝑚 𝑙 ̇ 𝑙 ̇ 1
=
2
𝜃 cos 𝜃1
2 1
∙ 𝜃 cos 𝜃1
2 1
+ 𝑙 (𝜃1̇ cos 𝜃1 + 𝜃2̇ cos 𝜃2 ) ∙
2
𝑙 ̇ 𝑙 ̇ 1
𝜃 sin 𝜃1 𝜃 sin 𝜃1 𝑙(𝜃1̇ sin 𝜃1 + 𝜃2̇ sin 𝜃2
( [ 2 1 ] [ 2 1 ] [ 2 ]
1 1
−Ω𝑙 (sin 𝜃1 + sin 𝜃2 ) 2 𝑇 2 2
2 𝜃1̇ 1 0 0 𝜃1̇
1 𝑚𝑙2
𝑙 (𝜃1̇ cos 𝜃1 + 𝜃2̇ cos 𝜃2 ) +
12
( [ Ω sin 𝜃1 ] [0 1 0] [ Ω sin 𝜃1 ] +
2
1 Ω cos 𝜃1 0 0 0 Ω cos 𝜃1
̇ ̇
[ 𝑙(𝜃1 sin 𝜃1 + 𝜃2 cos 𝜃2 ) ]
2 )
3 𝑇3 3
𝜃2̇ 1 0 0 𝜃2̇
[ Ω sin 𝜃2 ] [0 1 0] [ Ω sin 𝜃2 ])
Ω cos 𝜃2 0 0 0 Ω cos 𝜃2
5
𝑚 𝑙2 2 2
= [ (Ω 𝑠𝑖𝑛 𝜃1 + +𝜃12̇ 𝑠𝑖𝑛2 𝜃1 )
2 4
1
+ 𝑙 2 (Ω2 (𝑠𝑖𝑛𝜃1 + 𝑠𝑖𝑛𝜃2 )2 + 𝜃12̇ 𝑐𝑜𝑠 2 𝜃1 + 𝜃1̇ 𝜃2̇ cos 𝜃1 cos 𝜃2
2
1 1
+ 𝜃22̇ 𝑐𝑜𝑠 2 𝜃2 + 𝜃12̇ 𝑠𝑖𝑛2 𝜃1 + 𝜃1̇ 𝜃2̇ sin 𝜃1 sin 𝜃2 + 𝜃22̇ 𝑠𝑖𝑛2 𝜃2 )]
4 4
𝑚𝑙2 2̇
+ (𝜃 + Ω2 𝑠𝑖𝑛2 𝜃1 + 𝜃22̇ + Ω2 𝑠𝑖𝑛2
12 1
𝑚𝑙2 2 2 1 1
= [Ω 𝑠𝑖𝑛 𝜃1 + 𝜃12̇ + 4 (Ω2 (𝑠𝑖𝑛𝜃1 + 𝑠𝑖𝑛𝜃2 )2 + 𝜃12̇ + 𝜃1̇ 𝜃2̇ 𝑐𝑜𝑠(𝜃1 − 𝜃2 ) + 𝜃22̇ )]
8 2 4
𝑚𝑙2 2̇
+ (𝜃 + Ω2 𝑠𝑖𝑛2 𝜃1 + 𝜃22̇ + Ω2 𝑠𝑖𝑛2 𝜃2 )
12 1
𝑚𝑙2 1
= (3Ω2 𝑠𝑖𝑛2 𝜃1 + 3𝜃12̇ + 12Ω2 (𝑠𝑖𝑛𝜃1 + 𝑠𝑖𝑛𝜃2 )2 + 12𝜃12̇ + 12𝜃1̇ 𝜃2̇ 𝑐𝑜𝑠(𝜃1 − 𝜃2 )
24 2
+ 3𝜃 2̇ + 2𝜃 2̇ + 2Ω2 𝑠𝑖𝑛2 𝜃 + 2𝜃 2̇ + 2Ω2 𝑠𝑖𝑛2 𝜃 )
2 1 1 2 2
𝑚𝑙2
= (17Ω2 𝑠𝑖𝑛2 𝜃1 + 17𝜃12̇ + 12Ω2 sin 𝜃1 sin 𝜃2 + 5Ω2 𝑠𝑖𝑛2 𝜃2 + 12𝜃1̇ 𝜃2̇ 𝑐𝑜𝑠(𝜃1 − 𝜃2 )
24
+ 5𝜃 2̇ ) 2
𝐿 =𝑇−𝑉
Therefore, the lagrangian of the system is:
6
𝑚𝑙2
𝐿= (17Ω2 𝑠𝑖𝑛2 𝜃1 + 17𝜃12̇ + 12Ω2 sin 𝜃1 sin 𝜃2 + 5Ω2 𝑠𝑖𝑛2 𝜃2 + 12𝜃1̇ 𝜃2̇ 𝑐𝑜𝑠(𝜃1
24
𝑚𝑙𝑔
− 𝜃2 ) + 5𝜃22̇ ) − (− (3 cos 𝜃1 + cos 𝜃2 ))
2
𝑚𝑙2
= (17Ω2 𝑠𝑖𝑛2 𝜃1 + 17𝜃12̇ + 12Ω2 sin 𝜃1 sin 𝜃2 + 5Ω2 𝑠𝑖𝑛2 𝜃2 + 12𝜃1̇ 𝜃2̇ 𝑐𝑜𝑠(𝜃1
24
𝑚𝑙𝑔
− 𝜃2 ) + 5𝜃22̇ ) + (3 cos 𝜃1 + cos 𝜃2 ))
2
𝑑 𝜕𝐿 𝜕𝐿
( ) − 𝜕𝜃 = 0
𝑑𝑡 𝜕𝜃2̇ 2
Where,
(eq6.1.1)
𝜕𝐿 17 1 1 3𝑔
= 𝑚𝑙 2 (12 Ω2 sin(𝜃1 ) cos(𝜃1 ) + 2 Ω2 cos(𝜃1 ) sin(𝜃2 ) − 2 𝜃1̇ 𝜃2̇ sin(𝜃1 − 𝜃2 ) − sin(𝜃1 ))
𝜕𝜃1 2𝑙
(eq6.1.2)
(eq6.1.3)
𝜕𝐿 1 5 1 𝑔
= 𝑚𝑙 2 (2 Ω2 sin(𝜃1 ) cos(𝜃2 ) + 12 Ω2 sin(𝜃2 ) cos(𝜃2 ) + 2 𝜃1̇ 𝜃2̇ sin(𝜃1 − 𝜃2 ) − 2𝑙 sin(𝜃2 ))
𝜕𝜃1
(eq6.1.4)
(eq6.1.5)
2
6𝜃1̈ cos(𝜃1 − 𝜃2 ) + 5𝜃2̈ + 6 𝜃̇1 sin(𝜃1 − 𝜃2 ) − Ω2 cos(𝜃2 ) (6 sin(𝜃1 ) + 5 sin(𝜃2 )) +
𝑔
6 𝑙 sin(𝜃2 ) = 0
(eq6.1.6)
Applying the elimination method to both Equation (8-9), the two independent equation
motions are obtained:
7
𝟓 x (𝒆𝒒𝟔. 𝟏. 𝟓) − 𝟔 𝐜𝐨𝐬(𝜽𝟏 − 𝜽𝟐 ) x (𝒆𝒒𝟔. 𝟏. 𝟔) yields:
1 2 2
𝜃1̈ = (−36 𝜃1̇ sin(𝜃1 − 𝜃2 ) cos(𝜃1 − 𝜃2 ) − 30 𝜃2̇ sin(𝜃1 − 𝜃2 ) +
(85 − 36 cos2 (𝜃1 − 𝜃2 ))
(eq6.1.7)
(eq6.1.8)
This force is then transformed to the generalised force based on the two chosen
independent generalised coordinates
𝜕𝐹𝑓𝑟𝑖𝑐𝑡𝑖𝑜𝑛
𝑄𝜃1 = = −𝑐1 𝜃1̇ − 𝑐12 𝜃2̇
𝜕𝜃1̇
𝜕𝐹𝑓𝑟𝑖𝑐𝑡𝑖𝑜𝑛
𝑄𝜃2 = = −𝑐2 𝜃2̇ − 𝑐12 𝜃1̇
𝜕𝜃2̇
Therefore, the two Euler-Lagrange equations from the previous section have to be
modified according to the Hamilton’s principle incorporating the friction force as the
generalised force.
𝑑 𝜕𝐿 𝜕𝐿
( )− = 𝑄𝜃1
𝑑𝑡 𝜕𝜃1̇ 𝜕𝜃1
𝑑 𝜕𝐿 𝜕𝐿
( )− = 𝑄𝜃2
𝑑𝑡 𝜕𝜃2̇ 𝜕𝜃2
Where,
(𝜕𝜃 ̇ ) = 𝑚𝑙 2 (12 𝜃1̈ + 2 𝜃2̈ cos(𝜃1 − 𝜃2 ) − 2 𝜃1̇ 𝜃2̇ sin(𝜃1 − 𝜃2 ) + 2 𝜃̇2 sin(𝜃1 − 𝜃2 ))
𝑑 𝜕𝐿 17 1 1 1 2
𝑑𝑡 1
(eq6.2.1)
𝜕𝐿 17 1 1 3𝑔
= 𝑚𝑙 2 (12 Ω2 sin(𝜃1 ) cos(𝜃1 ) + 2 Ω2 cos(𝜃1 ) sin(𝜃2 ) − 2 𝜃1̇ 𝜃2̇ sin(𝜃1 − 𝜃2 ) − 2𝑙 sin(𝜃1 ))
𝜕𝜃1
(eq6.2.2)
8
(𝜕𝜃 ̇ ) = 𝑚𝑙 2 (12 𝜃2̈ + 2 𝜃1̈ cos(𝜃1 − 𝜃2 ) + 2 𝜃1̇ 𝜃2̇ sin(𝜃1 − 𝜃2 ) − 2 𝜃̇1 sin(𝜃1 − 𝜃2 ))
𝑑 𝜕𝐿 5 1 1 1 2
𝑑𝑡 2
(eq6.2.3)
𝜕𝐿 1 5 1 𝑔
= 𝑚𝑙 2 (2 Ω2 sin(𝜃1 ) cos(𝜃2 ) + 12 Ω2 sin(𝜃2 ) cos(𝜃2 ) + 2 𝜃1̇ 𝜃2̇ sin(𝜃1 − 𝜃2 ) − 2𝑙 sin(𝜃2 ))
𝜕𝜃1
(eq6.2.4)
(eq6.2.5)
2
6𝜃1̈ cos(𝜃1 − 𝜃2 ) + 5𝜃2̈ + 6 𝜃̇1 sin(𝜃1 − 𝜃2 ) − Ω2 cos(𝜃2 ) (6 sin(𝜃1 ) + 5 sin(𝜃2 )) +
𝑔 12𝑄𝜃2
6 𝑙 sin(𝜃1 ) = 𝑚𝑙2
(eq6.2.6)
Applying the elimination method to both Equation (8-9), the two independent equation
motions are obtained:
𝟓 x (𝒆𝒒𝟔. 𝟐. 𝟓) − 𝟔 𝐜𝐨𝐬(𝜽𝟏 − 𝜽𝟐 ) x (𝒆𝒒𝟔. 𝟐. 𝟓) yields:
1 2 2
𝜃1̈ = (−36 𝜃1̇ sin(𝜃1 − 𝜃2 ) cos(𝜃1 − 𝜃2 ) − 30 𝜃2̇ sin(𝜃1 − 𝜃2 )
(85 − 36 cos 2 (𝜃1 − 𝜃2 ))
(eq6.2.7)
(eq6.2.8)
9
7. Simulation
7.1. Instructions
There are 4 .m files in simPendulum folder. Simply run “doSim.m” will generate state plot,
energy plot and 3D animation in parallel windows. All parameters are defined in “Define
constants” section of the code, including length, mass of pendulum links, damping
coefficients, angular velocity, and initial state conditions. Starting position, width and
height of plotting windows can be set by “Gx, Gy, Gw, Gh” respectively. Definition of all
parameters are well commented in the code.
In the frictionless system ideally, due to the stability characteristics of the rotating
pendulum, asymptotic stability could never be reached if initial conditions of the states
are not set to equilibrium points specified as below. The states, kinetic energy and
potential energy will present as periodic signals, while total energy remains constant
throughout time (i.e. scenario 1, 3, 7). Note that when either of 𝑚 or 𝑛 is set to an odd
number, the system is at its unstable equilibrium where accumulated errors can cause
the pendulum to go unstable over time. Thus an additional influx of energy caused by a
non-zero Ω would increase the total energy of the system (i.e. scenario 5, 9).
𝜃1 (0) 𝑚π
𝜃2 (0) 𝑛π
= [ ] 𝑤ℎ𝑒𝑟𝑒 𝑚, 𝑛 ∈ ℤ
𝜃1̇ (0) 0
̇
[𝜃2 (0)] 0
In the system where friction plays a decent role, the damping effect will cause work to be done to
dissipate total energy of the system, hence an asymptotic stability will be reached whether or not
the initial conditions are at equilibrium. Note that the equilibrium position of the pendulum may
possess constant non-zero 𝜃1 , 𝜃2 (i.e. scenario 4, 6, 8, 10). When the initial states are at an
unstable equilibrium (i.e. scenario 6, 10), the accumulated errors will as well kick in and make the
system unstable over time due to a non-zeroΩ, introducing a sudden increase of total energy
before an equilibrium is reached.
10
𝜋
𝜃1 (0)
3
𝜃2 (0) 𝜋 𝑐1 0
1. Ω = 0, ̇ = 2 , [𝑐 ] = [ ] , Video URL: https://youtu.be/JCYMxZycofs
𝜃1 (0) 2 0
0
[ 𝜃2̇ (0) ] [0]
𝜋
𝜃1 (0)
3
𝜃2 (0) 𝜋 𝑐1 2
2. Ω = 0, ̇ = 2 , [𝑐 ] = [ ] , Video URL: https://youtu.be/BYCPpbTRWRg
𝜃1 (0) 2 2
0
̇
[ 𝜃2 (0) ] [0]
11
𝜋
𝜃1 (0)
3
𝜃2 (0) 𝜋 𝑐1 0
3. Ω = π, ̇ = 2 , [𝑐 ] = [ ] , Video URL: https://youtu.be/W2PLWjLcDgY
𝜃1 (0) 2 0
0
[ 𝜃2̇ (0) ] [0]
𝜋
𝜃1 (0)
3
𝜃2 (0) 𝜋 𝑐1 2
4. Ω = π, ̇ = 2 , [𝑐 ] = [ ] , Video URL: https://youtu.be/mahp9PviQ4w
𝜃1 0( ) 2 2
0
[ 𝜃2̇ (0) ] [0]
12
𝜃1 (0) π
𝜃2 (0) π 𝑐1 0
5. Ω = π, ̇ = [ ] , [𝑐 ] = [ ] , Video URL: https://youtu.be/9Sm-CaU1M1Y
𝜃1 (0) 0 2 0
̇
[ 𝜃2 (0) ] 0
𝜃1 (0) π
𝜃2 (0) π 𝑐1 2
6. Ω = π, ̇ = [ ] , [𝑐 ] = [ ] , Video URL: https://youtu.be/O0ypqHirQng
𝜃1 (0) 0 2 2
̇
[ 𝜃2 (0) ] 0
13
𝜋
𝜃1 (0)
3
𝜃2 (0) 𝜋 𝑐1 0
7. Ω = 2π, ̇ = 2 , [𝑐 ] = [ ] , Video URL: https://youtu.be/GTeigfCRpFk
𝜃1 (0) 2 0
0
[ 𝜃2̇ (0) ] [0]
𝜋
𝜃1 (0)
3
𝜃2 (0) 𝜋 𝑐1 2
8. Ω = 2π, ̇ = 2 , [𝑐 ] = [ ] , Video URL: https://youtu.be/XxxlaK1WHbs
𝜃1 (0) 2 2
0
[ 𝜃2̇ (0) ] [0]
14
𝜃1 (0) π
𝜃2 (0) π 𝑐1 0
9. Ω = 2π, ̇ = [ ] , [𝑐 ] = [ ] , Video URL: https://youtu.be/F08MPMAcBFU
𝜃1 (0) 0 2 0
̇
[ 𝜃2 (0) ] 0
𝜃1 (0) π
𝜃2 (0) π 𝑐1 2
10. Ω = 2π, ̇ = [ ] , [𝑐 ] = [ ] , Video URL: https://youtu.be/ZGMvQQl8w4I
𝜃1 (0) 0 2 2
̇
[ 𝜃2 (0) ] 0
15