- #1

- 3

- 0

I am trying to input these 2 equations of motion for a double acting pendulum into mathematica in hopes of solving for θ2, θ2', and θ2''. I am fairly new to the program and I am having trouble inputting the equations. I am swinging a prosthetic leg like a pendulum and I am trying to predict what the second angle (θ2) will be. Can someone please tell me what I am doing wrong?

1. θ1'' = −g (2 m1 + m2) sin θ1 − m2 g sin(θ1 − 2 θ2) − 2 sin(θ1 − θ2) m2 (θ2'2 L2 + θ1'2 L1 cos(θ1 − θ2))/L1 (2 m1 + m2 − m2 cos(2 θ1 − 2 θ2))

NDSolve[Subscript[\[Theta], 1]''[

t] == [[\[Minus]9.8*[ Subscript[m, 1] + Subscript[m, 2]]*

sin [Subscript[\[Theta], 1][t]]] \[Minus] [

Subscript[m, 2]*9.8*

sin[Subscript[\[Theta], 1][t] \[Minus]

2 Subscript[\[Theta], 2][t]]] \[Minus] [2*

sin[Subscript[\[Theta], 1][t] \[Minus]

Subscript[\[Theta], 2][t]]* Subscript[m,

2]*[(Subscript[\[Theta], 2]'[t])^2 Subscript[L,

2] + (Subscript[\[Theta], 1]'[t])^2*2* Subscript[L, 1]*

cos[Subscript[\[Theta], 1][t] \[Minus]

Subscript[\[Theta], 2][t]]]/[

Subscript[L,

1] (2*Subscript[m, 1] +

Subscript[m, 2] \[Minus]

Subscript[m, 2] *

cos (2*Subscript[\[Theta], 1][t] \[Minus]

2*Subscript[\[Theta], 2][t]))],

Subscript[\[Theta], 1][0] == 0,

Subscript[\[Theta], 2][0] == 0, (Subscript[\[Theta], 1],

Subscript[\[Theta], 2]), {t, 0, 10}]]]

2. θ2'' = 2 sin(θ1 − θ2) (θ1'2 L1 (m1 + m2) + g(m1 + m2) cos θ1 + θ2'2 L2 m2 cos(θ1 − θ2))/L2 (2 m1 + m2 − m2 cos(2 θ1 − 2 θ2))

NDSolve[Subscript[\[Theta], 2]''] == [[

2*sin ((\[Pi]/6)*sin (55*[t]) - Subscript[\[Theta],

2])]*[(c)^2*1.61*.3 + [

9.8*1.61*

cos ((\[Pi]/6)*sin (55*[t]))]] + [(Subscript[\[Theta],

2]')^2*0.48*1.61*

cos ( (\[Pi]/6)*cos (55*[t]) - Subscript[\[Theta], 2])]/[

0.48*(1.61 - (1.61*

cos ((2*(\[Pi]/6)*cos (55*[t])) - (2*Subscript[\[Theta],

2]))))]]

I also attached the first equation with the numbers plugged in. I am using the equations of motion found here http://www.myphysicslab.com/dbl_pendulum.html This is the final step to completing my thesis so any help offered is much appreciated. Thank you in advanced.

1. θ1'' = −g (2 m1 + m2) sin θ1 − m2 g sin(θ1 − 2 θ2) − 2 sin(θ1 − θ2) m2 (θ2'2 L2 + θ1'2 L1 cos(θ1 − θ2))/L1 (2 m1 + m2 − m2 cos(2 θ1 − 2 θ2))

NDSolve[Subscript[\[Theta], 1]''[

t] == [[\[Minus]9.8*[ Subscript[m, 1] + Subscript[m, 2]]*

sin [Subscript[\[Theta], 1][t]]] \[Minus] [

Subscript[m, 2]*9.8*

sin[Subscript[\[Theta], 1][t] \[Minus]

2 Subscript[\[Theta], 2][t]]] \[Minus] [2*

sin[Subscript[\[Theta], 1][t] \[Minus]

Subscript[\[Theta], 2][t]]* Subscript[m,

2]*[(Subscript[\[Theta], 2]'[t])^2 Subscript[L,

2] + (Subscript[\[Theta], 1]'[t])^2*2* Subscript[L, 1]*

cos[Subscript[\[Theta], 1][t] \[Minus]

Subscript[\[Theta], 2][t]]]/[

Subscript[L,

1] (2*Subscript[m, 1] +

Subscript[m, 2] \[Minus]

Subscript[m, 2] *

cos (2*Subscript[\[Theta], 1][t] \[Minus]

2*Subscript[\[Theta], 2][t]))],

Subscript[\[Theta], 1][0] == 0,

Subscript[\[Theta], 2][0] == 0, (Subscript[\[Theta], 1],

Subscript[\[Theta], 2]), {t, 0, 10}]]]

2. θ2'' = 2 sin(θ1 − θ2) (θ1'2 L1 (m1 + m2) + g(m1 + m2) cos θ1 + θ2'2 L2 m2 cos(θ1 − θ2))/L2 (2 m1 + m2 − m2 cos(2 θ1 − 2 θ2))

NDSolve[Subscript[\[Theta], 2]''] == [[

2*sin ((\[Pi]/6)*sin (55*[t]) - Subscript[\[Theta],

2])]*[(c)^2*1.61*.3 + [

9.8*1.61*

cos ((\[Pi]/6)*sin (55*[t]))]] + [(Subscript[\[Theta],

2]')^2*0.48*1.61*

cos ( (\[Pi]/6)*cos (55*[t]) - Subscript[\[Theta], 2])]/[

0.48*(1.61 - (1.61*

cos ((2*(\[Pi]/6)*cos (55*[t])) - (2*Subscript[\[Theta],

2]))))]]

I also attached the first equation with the numbers plugged in. I am using the equations of motion found here http://www.myphysicslab.com/dbl_pendulum.html This is the final step to completing my thesis so any help offered is much appreciated. Thank you in advanced.