1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Spring pendulum

  1. May 21, 2010 #1

    fluidistic

    User Avatar
    Gold Member

    1. The problem statement, all variables and given/known data
    If I consider a 3 dimensional problem related to a spring pendulum (a mass attached to the end of a spring of constant k and the other end of the spring remains fixed) and I want to find the equations of motion of the mass (for several initial conditions), what system of coordinates would you choose? I'm trying to find the Lagrangian of the system and I chose spherical coordinates to express the position of the mass, its velocity and its kinetic energy. However the expression is really long (5 lines in my draft, I may post what I obtained here if you ask for it), I just wonder if I should have used another coordinate system.
    I didn't get any term which canceled out with others. I'm going to redo the arithmetics tomorrow (it's 2 a.m. now) but I don't think I made some error. So is it normal to get an enormous expression for the Lagrangian of the system? Say a roughly 5 times longer Lagrangian than for the common double pendulum system?




    2. Relevant equations



    3. The attempt at a solution
     
  2. jcsd
  3. May 22, 2010 #2
    I'm not sure but I think Cartesian coordinate in easier than Spherical coordinate.
     
  4. May 22, 2010 #3
    No, Cartesian coordinates are definitely not the way to go for this spherical pendulum problem.

    Consider first the Lagrangian for a spherical pendulum with a rigid (but massless) rod:

    [tex]L=\frac{1}{2}mr^2\left(\dot{\theta}^2+\sin^2\theta\dot{\phi}^2\right)+mgr\cos\theta[/tex]

    What would you need to change in this Lagrangian to include a spring?
     
    Last edited: May 22, 2010
  5. May 22, 2010 #4

    fluidistic

    User Avatar
    Gold Member

    Thanks to both for the help.
    I think I'd need to subtract the potential energy stored within the spring from the Lagrangian you gave. Not sure it is all, but I think it's a good start. What else could I add? Maybe the influence on the velocity of the mass due to the movement of the spring.

    Anyway, via my way I reached [tex]\dot \vec r = \left [ \dot \theta r \cos (\phi) \cos (\theta) + \dot r \sin (\theta) \cos (\phi )- r \dot \phi \sin (\phi) \sin (\theta) \right ] \hat i + \left [ \dot r \sin (\phi) \sin (\theta) + r \dot \phi \cos (\phi ) \sin (\theta ) + r \dot \theta \sin (\phi) \cos (\theta) \right ] \hat j + \left [ \dot r \cos (\theta) - r \dot \theta \sin (\theta) \right ] \hat k[/tex].
    But for the Lagrangian I need the modulus squared of this expression. So I have to sum up each components squared... I got that no term cancel out, you can imagine how large the expression is.
     
  6. May 22, 2010 #5
    Don't forget that

    [tex]\left|\vec{r}\right|^2=\vec{r}\cdot\vec{r}=r_i^2+r_j^2+r_k^2[/tex]

    and that

    [tex]r^2\sin^2[\phi]\cos^2[\theta]+r^2\sin^2[\phi]\sin^2[\theta]=r^2\sin^2[\phi]\left(\cos^2[\theta]+\sin^2[\theta]\right)=r^2\sin^2[\phi][/tex]

    There are specifically two terms you would need to add (or subtract) to the Lagrangian I gave to make it work for you (you pointed out one, and using the above, you should figure out the other).
     
  7. May 22, 2010 #6

    fluidistic

    User Avatar
    Gold Member

    Yeah I'm not forgetting. That's why I said "So I have to sum up each components squared..."
    Ok perfect, I didn't notice I could use this simplification. I'll be looking for it in the "giant" expression.
     
  8. May 22, 2010 #7
    Now I notice that statement, whoops :blushing:

    When you finish simplifying, you should pat yourself on the back and then memorize that form for the kinetic energy (assuming it is correct), as it is a very common formula in classical mechanics.
     
  9. May 22, 2010 #8

    fluidistic

    User Avatar
    Gold Member

    No problem, your help is very much appreciated.

    Ok, good to know. I just want to make sure I'll be memorizing a useful formula instead of an erroneous one!
    After a lot of arithmetic and simplification, I reach [tex]|\vec{r}|^2=r^2 \left [ \dot \theta ^2 \cos ^2 (\theta) + (\dot \phi ^2 + \dot \theta ^2) \sin ^2 (\theta) \right ]+ \dot r ^2 + 2 \sin (\theta) \left { (r^2-1) \dot \theta \dot \phi \cos (\phi) \cos (\theta) \sin (\phi) + r \dot r \dot \theta \cos (\theta) \sin ^2 (\phi) \right }[/tex].
    I doubt it's correct. Do you get something similar?
     
  10. May 22, 2010 #9
    I think you might have made a mistake somewhere. For ease, I'll look at each component individually:

    [tex]\dot{r}_x^2=\dot{\theta}^2r^2\cos^2\phi\cos^2\theta+\dot{r}^2\sin^2\phi\cos^2\theta-r^2\dot{\phi}^2\sin^2\phi\sin^2\theta+2r\dot{r}\sin\theta\cos\theta\cos^2\phi-2r^2\dot{\theta}\dot{\phi}\cos\phi\sin\phi\cos\theta\sin\theta-2r\dot{r}\dot{\phi}\cos\phi\sin\phi\sin^2\theta[/tex]

    [tex]\dot{r}_y^2=\dot{r}^2\sin^2\theta\sin^2\phi+r^2\dot{\phi}^2\cos^2\phi\sin^2\theta+r^2\dot{\theta}^2\sin^2\phi\cos^2\theta+2r\dot{r}\dot{\phi}\cos\phi\sin\phi\sin^2\theta+2r\dot{r}\dot{\theta}\sin\theta\cos\theta\sin^2\phi+2rr^2\dot{\phi}\dot{\theta}\cos\theta\sin\theta\cos\phi\sin\phi[/tex]

    [tex]\dot{r}_z^2=\dot{r}^2\cos^2\theta-r^2\dot{\theta}^2\sin^2\theta-2r\dot{r}\dot{\theta}\sin\theta\cos\theta[/tex]

    You can see clearly that a couple terms will cancel. Another three terms will cancel when you use the sine-square plus cosine-square law:

    [tex]2r\dot{r}\dot{\theta}\sin\theta\cos\theta\cos^2\phi+2r\dot{r}\dot{\theta}\sin\theta\cos\theta\sin^2-2r\dot{r}\dot{\theta}\sin\theta\cos\theta=2r\dot{r}\dot{\theta}\sin\theta\cos\theta\left(\cos^2\phi+\sin^2\right)-2r\dot{r}\dot{\theta}\sin\theta\cos\theta=2r\dot{r}\dot{\theta}\sin\theta\cos\theta-2r\dot{r}\dot{\theta}\sin\theta\cos\theta=0[/tex]

    This will then reduce your equation to

    [tex]\dot{r}_{x}^{2}=\dot{\theta}^{2}r^{2}\sin^{2}\phi\cos^{2}\theta+\dot{r}^{2}\sin^{2}\phi\cos^{2}\theta-r^{2}\dot{\phi}^{2}\sin^{2}\phi\sin^{2}\theta[/tex]

    [tex]\dot{r}_{y}^{2}=\dot{r}^{2}\sin^{2}\theta\sin^{2}\phi+r^{2}\dot{\phi}^{2}\cos^{2}\phi\sin^{2}\theta+r^{2}\dot{\theta}^{2}\sin^{2}\phi\cos^{2}\theta[/tex]

    [tex]\dot{r}_{z}^{2}=\dot{r}^{2}\cos^{2}\theta-r^{2}\dot{\theta}^{2}\sin^{2}\theta[/tex]

    When you add these & simplify, you should get

    [tex]\left|\dot{\vec{r}}\right|^2=\dot{r}^2+r^2\dot{\theta}^2+r^2\dot{\phi}^2\sin^2\theta[/tex]

    EDIT: I keep finding more errors each time I look at this (I wasn't too careful about minus signs and keeping my order straight of sines, cosines, thetas, & phis). The last line is correct, you should redo your math and convince yourself that it is because I could be here all night as well fixing my minor mistakes above.
     
    Last edited: May 22, 2010
  11. May 22, 2010 #10

    fluidistic

    User Avatar
    Gold Member

    Ok thank you very much for all this (I know how tedious it is to write so much latex and do the math). I'm going to redo the math to see if I can reach your last line.
     
  12. May 22, 2010 #11

    gabbagabbahey

    User Avatar
    Homework Helper
    Gold Member

    A quicker method to calculating [itex]\dot{\mathbf{r}}[/itex], [itex](\dot{\mathbf{r}})^2[/itex] and [itex]\ddot{\mathbf{r}}[/itex] in Spherical coordinates is to first calculate the time derivatives of the spherical unit vectors, and then use those results. For example,

    [tex]\begin{aligned}\frac{d \hat{\mathbf{r}} }{dt} &= \frac{d}{dt} \left( \sin\theta \cos\phi \hat{\mathbf{x}}+\sin\theta \sin\phi \hat{\mathbf{y}}+\cos\theta \hat{\mathbf{z}} \right) \\ &= \left( \cos\theta \cos\phi \hat{\mathbf{x}}+\cos\theta \sin\phi \hat{\mathbf{y}}-\sin\theta \hat{\mathbf{z}} \right)\dot{\theta}+\left( -\sin\theta \sin\phi \hat{\mathbf{x}}+\sin\theta \cos\phi \hat{\mathbf{y}} \right)\dot{\phi} \\ &= \dot{\theta}\hat{\mathbf{\theta}}+\sin\theta\dot{\phi}\hat{\mathbf{\phi}}\end{aligned}[/tex]

    And so

    [tex]\dot{\mathbf{r}}=\frac{d}{dt}\left(r\hat{\mathbf{r}}\right)=\dot{r}\hat{\mathbf{r}}+r\dot{\theta}\hat{\mathbf{\theta}}+r\sin\theta\dot{\phi}\hat{\mathbf{\phi}}[/tex]
     
  13. May 22, 2010 #12

    fluidistic

    User Avatar
    Gold Member

    Hey there :smile:. Thanks a lot for this shortcut, I was having a very hard time to simplify the expression I had to reach the answer.
    I can understand 3 out of the 5 equal sign of your answer. I don't understand why do the 2nd and 3rd equal sign hold. For the second, it seems you considered the x, y and z unit vectors as constant. For the 3rd equal sign, how do you convert the x, y and z unit vectors into the phi and theta unit vectors?
     
  14. May 22, 2010 #13

    gabbagabbahey

    User Avatar
    Homework Helper
    Gold Member

    Of course! The only reason that curvilinear unit vectors aren't constant is that they depend on position, which in turn depends on time. The Cartesian unit vectors are position independent.(Draw the spherical unit vectors for two different position vectors [itex]\textbf{r}[/itex], and you will see they point in different directions, while the Cartesian unit vectors remain unchanged)

    Simple:

    [tex]\hat{\mathbf{r}}=\sin\theta\cos\phi\hat{\mathbf{x}}+\sin\theta\sin\phi\hat{\mathbf{y}}+\cos\theta\hat{\mathbf{z}}[/tex]

    [tex]\hat{\mathbf{\theta}}=\cos\theta\cos\theta\hat{\mathbf{x}}+\cos\theta\sin\phi\hat{\mathbf{y}}-\sin\theta\hat{\mathbf{z}}[/tex]

    and

    [tex]\hat{\mathbf{\phi}}=-\sin\phi\hat{\mathbf{x}}+\cos\phi\hat{\mathbf{y}}[/tex]
     
  15. May 23, 2010 #14

    fluidistic

    User Avatar
    Gold Member

    You're right, I missed those points.
    I'll be trying to get the Lagrangian now.
     
  16. May 23, 2010 #15

    fluidistic

    User Avatar
    Gold Member

    Someone correct me if I'm wrong: the Lagrangian of the system is worth [tex]\frac{m}{2} (\dot r ^2 + r ^2 \dot \theta ^2+ \dot \phi ^2 r ^2 \sin ^2 \theta )+mg \cos \theta +\frac{k}{2} (\Delta r)^2[/tex].
    I'm not sure how to express [tex]\Delta r[/tex]. I think it is [tex]\vec r - \vec r_0[/tex]. I already have [tex]\vec r[/tex], I need to find out [tex]r_0[/tex]. In Cartesian's coordinates I'd just take [tex]\vec r_0=(x_0, y_0, z_0)[/tex]. I'm not sure in spherical coordinates. May I have a bit more of help?
    Or maybe it's just [tex](r, \phi , \theta)-(r_0, \phi _0 , \theta _0)=(r-r_0 , \phi - \phi _0 , \theta - \theta _0)[/tex]? But I have nothing like the expression I have for [tex]\vec r[/tex] expressed with spherical unit vectors.
     
  17. May 23, 2010 #16

    gabbagabbahey

    User Avatar
    Homework Helper
    Gold Member

    First, the kinetic energy should involve [itex](\dot{\mathbf{r}})^2[/itex], not just [itex]\dot{\mathbf{r}}[/itex]. Second, what is the equilibrium length of the spring?
     
  18. May 23, 2010 #17

    fluidistic

    User Avatar
    Gold Member

    Yes, you're absolutely right, I corrected it a few minutes after I saw I made the error, just before you replied.
    I wanted to solve the problem for an arbitrary equilibrium length. But in the problem it is 1 m, originally on the y axis. (and with an initial velocity different from 0).
     
  19. May 23, 2010 #18

    gabbagabbahey

    User Avatar
    Homework Helper
    Gold Member

    Well, wouldn't the displacement of the spring from equilibrium just be [itex]|r-d|[/itex], where [itex]d[/itex] is the equilibrium length?
     
  20. May 23, 2010 #19

    fluidistic

    User Avatar
    Gold Member

    Looks true. :biggrin:
    So the Lagrangian is [tex]L=\frac{m}{2}(\dot r ^2 + r^2 \dot \theta ^2 + \dot \phi ^2 r^2 \sin ^2 \theta)+mg r \cos \theta - \underbrace{\frac{k}{2}(r^4-2r^2+1)}_{\geq 0}[/tex].
    Is this right?
     
  21. May 24, 2010 #20

    fluidistic

    User Avatar
    Gold Member

    From the Lagrangian I posted (I hope it's right), I reached 3 equations of motions. I'm not really sure what to do from them. Should I calculate the modulus of [tex]\ddot r[/tex]?
    Here they are: [tex]m[\dot \theta ^2 r + \dot \phi ^2 r \sin ^2 (\theta ) + g \cos (\theta) + \ddot r]+2kr (1-r^2)=0[/tex].
    [tex]mr\sin (\theta)[(\ddot \phi r + \dot \phi 2 \dot r)\sin (\theta)+\dot \phi r^2 2 \cos (\theta)]=0[/tex].
    Lastly, [tex]\cos (\theta ) \sin (\theta) \dot \phi r^2 -gr \sin (\theta)-2r \dot r \dot \theta+ r^2 \ddot \theta=0[/tex].
    Now if I want to write a program to get say [tex](r, \phi, \theta)[/tex] in function of time, should I reduce these equations? The exercise states to "integrate the motion equations", so I guess I should integrate with respect to time the 3 equations I just posted?
     
  22. May 24, 2010 #21
    You should put these in the [tex]\ddot{x}=[/tex] form (where [itex]x=r,\theta,\phi[/tex], clearly) and then integrate. Were you given any initial conditions?
     
  23. May 24, 2010 #22

    fluidistic

    User Avatar
    Gold Member

    Thanks for helping once again.
    Do you mean [tex]\ddot x[/tex], [tex]\ddot y[/tex] and [tex]\ddot z[/tex]? Also, isn't [tex]x=r \cos (\phi ) \sin (\theta)[/tex] instead of [itex]x=r,\theta,\phi[/tex]? I guess I'm misunderstanding you.
    Yes I am given initial conditions, though I want to write a program that solve for any given initial condition.
     
  24. May 24, 2010 #23
    No, sorry to mislead you. I meant you need to solve for [tex]\ddot{r}=[/tex], [tex]\ddot{\theta}=[/tex], and [tex]\ddot{\phi}[/tex] and not for x, y, & z.
     
  25. May 24, 2010 #24

    gabbagabbahey

    User Avatar
    Homework Helper
    Gold Member

    Shouldn't the spring term of your Lagrangian just be [itex]\frac{k}{2}(x-d)^2[/itex]?
     
  26. May 24, 2010 #25

    fluidistic

    User Avatar
    Gold Member

    Ah ok, perfect. Thank you.

    Hey Gabba Gabba Hey. :smile: Hmm, I really don't see why x would be privileged over y and z. I thought that r instead of x made sense. When r=1, there was no elongation of the spring which made sense to me. Could you precise a bit more why x? I'm clueless.
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook