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: Vertical Spring Forced Pendulum (Lagrange equations)

  1. Apr 5, 2013 #1
    1. The problem statement, all variables and given/known data
    The problem states that a pendulum is attached to a spring that can only oscillate in the vertical direction. I am supposed to derive equations of motion for the spring/pendulum system under my chosen generalized coordinates.

    2. Relevant equations
    Lagrange equations of motion

    3. The attempt at a solution
    I choose a to describe the system by the height of the pendulum mass and the angle at which it swings. So the two coordinates are y and θ, respectively.

    Given a spring constant, k, and the assumption of a massless spring, I formulated the potential energy of the system to be:
    U = (1/2)ky^2+mg(y-l*cos(θ))

    where l is the length of the pendulum, and I have chosen the potential to be zero at y = 0 & θ = pi/2.

    The kinetic energy of the system should be that given only by the mass of the pendulum. I formulated this to be:
    T = (1/2)m((vx)^2 + (vy)^2) = (1/2)m((l*θ'*cos(θ))^2 + (y' + l*θ'*sin(θ))^2)

    Without attempting to put up all the math on the board, I computed the Lagrange equations on y and θ, and found the two differential equations:
    y'' + (k/m)y +l*θ''*sin(θ) + l*(θ')^2*cos(θ)+g = 0
    θ'' + (1/l)y''*sin(θ) + (1/l)*g*sin(θ) = 0

    I am unsure if I have made any mistakes, but am I going about this problem at all correctly?

  2. jcsd
  3. Apr 5, 2013 #2


    User Avatar
    Homework Helper
    Gold Member
    2017 Award

    Just to be clear, did you choose y as the height of the pendulum mass or the height of the point where the pendulum is attached to the spring?

    Everything looks good to me except I think you might be missing a term involving y'θ' in the following
  4. Apr 5, 2013 #3
    I chose y as the height of the point where the pendulum is attached to the spring. So the mass potential = 0 at y = 0 & θ = pi/2. Is this good?

    As far as the y'θ' term, I was actually surprised to find out at the end that there were two terms of these that exactly canceled out. I could have made a mistake though.
  5. Apr 5, 2013 #4


    User Avatar
    Homework Helper
    Gold Member
    2017 Award

    Yes, that's good.
    I seem to still be getting that extra term. Hope I'm not missing something.
  6. Apr 5, 2013 #5
    When I copy over my work in a typed version I will see if I did anything wrong. It can be easy for me to make the mistake of forgetting to continue the chain rule through when taking a full derivative versus a partial.

  7. Apr 6, 2013 #6

    I have copied over my work, and I still see the term canceling out. I have collected the calculations in a screen shot so that you can see them and see if one of us is doing it incorrectly. See in the attachment, on the last line, the first and last terms.

    Attached Files:

    • p.png
      File size:
      6.3 KB
  8. Apr 6, 2013 #7


    User Avatar
    Homework Helper
    Gold Member
    2017 Award

    OK, Good. It was my mistake. I did overlook a term. Thanks for setting me straight. Hope I didn't cause you too much grief with my oversight.
  9. Apr 6, 2013 #8
    No problem. Thanks for the help.
  10. Apr 16, 2013 #9
    I am working on the same problem, I got stuck on the linearization of these equations.

    In my form the angle is q2 and the spring length is q1, I have an additional horizontal force working on the mass, my equations look like:

    q1''+q2''*l*cos(q2) -q2'^2*l*sin(q2)+k/m(q1-l0)-g=0


    After linearization I get:



    I linearized around q2 = 0, therefore sin(q2)=q2, cos(q2)=1, tan(q2)=q2 and q2'*q2=0

    Obviously the linearized equation I get are only a function of q1 and q2 without their derivatives, I probably did something wrong does anyone know what I did wrong?
  11. Mar 17, 2015 #10
    I am working on this same problem but need to compare the lagrange solution to the newtonian solution. I am stuck on summing the forces and moments of the problem, anyone have any ideas?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted