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: Lagrangian mechanics, Lagrange multiplier.

  1. May 5, 2014 #1
    1. The problem statement, all variables and given/known data
    I've thought of a problem to help me with Lagrange multipliers but have got stuck.

    Consider a particle of mass m moving on a surface described by the curve y = x2, the particle is released from rest at t = 0 and a position x = l. I'm trying to work out the EOM's but have got stuck.

    2. Relevant equations

    [itex]\grave{L}[/itex] = T - V - λ(y - x2)

    T = [itex]\frac{1}{2}[/itex]m([itex]\dot{x}[/itex]2+[itex]\dot{y}[/itex]2)

    V = -mgy

    3. The attempt at a solution

    The Euler Lagrange equations give,

    m[itex]\ddot{x}[/itex] = 2λx (1)

    m[itex]\ddot{y}[/itex] = mg - λ (2)

    attempt at solving for (1)

    x = Asinh(kt) + Bcosh(kt)

    which gives

    k = [itex]\sqrt{\frac{2λ}{m}}[/itex]

    initial conditions give A = 0, B = l

    This is where I get confused, I don't understand how the solution is cosh, surely it would be sinusoidal? And I'm unsure how to solve for λ? Thanks.
  2. jcsd
  3. May 5, 2014 #2


    User Avatar
    Gold Member

    You could also assume λ<0 and get some Asin(kt) + Bcos(kt) solution.
    Then you can get y from the constraint and go on to find λ and finally get the frequency of oscillation.
    Also check the direction of the y-axis: is V=+mgy or is V=-mgy ?
    Last edited: May 5, 2014
  4. May 5, 2014 #3
    Hi. I've done that and got,

    x = lcos(kt)
    y = l2cos2(kt)

    where k = [itex]\frac{2g}{1+4l^{2}}[/itex]

    But when substituting [itex]\ddot{x}[/itex] and [itex]\ddot{y}[/itex] back into (1) and (2), I get two different values for λ

    for (1)

    λ = -[itex]\frac{mg}{1+4l^{2}}[/itex]

    for (2)

    λ = mg(1 - [itex]\frac{4l^{2}}{1+4l^{2}}[/itex]cos(kt))

    I've placed my axis as y vertical, x horizontal, as the acceleration is in the negative y wouldn't V = -mgy?
  5. May 5, 2014 #4


    User Avatar
    Gold Member

    I suggest you to cheat a little bit.
    You could solve the same problem by the standard way: the Newton's equations and taking a reaction force perpendicular to the surface, but unknown.
    In this way you will know the solution, and see where the problems come from.
    In addition, you will see the relation between the Lagrange multipliers (method) and the reaction force.

    (is y upward or downward ?)
  6. May 5, 2014 #5
    y is in the up direction. When doing it by Newtons second law I get,

    [itex]\ddot{x}[/itex] = -mgsin(θ)cos(θ)
    = -mg[itex]\frac{2x}{1+4x^{2}}[/itex]

    [itex]\ddot{y}[/itex] = -mgcos(θ)cos(θ)
    = -mg[itex]\frac{1}{1+4y}[/itex]

    Where mgcos(θ) is the reaction force and θ = arctan([itex]\frac{dy}{dx}[/itex])

    I then get for x and y

    x = [itex]\sqrt{\frac{1}{4}(1-e^{-α})+l^{2}e^{-α}}[/itex]

    y = [itex]\frac{1}{4}(1-e^{-α})+l^{2}e^{-α}[/itex]

    where α = 2[itex]\frac{\dot{x}^{2}}{g}[/itex]

    I'm not sure how to go further after that. Also when using the Lagrange multiplier I was trying to use the reaction force to solve for the initial conditions, should the reaction force come out naturally with the solution?
  7. May 5, 2014 #6
    The potential seems to have the wrong sign. is Y downward?
  8. May 5, 2014 #7
    no I've put y up, as a normal x,y plot of y = x^2, if g is pointing in the negative y, why is the potential the opposite sign?
  9. May 6, 2014 #8


    User Avatar
    Gold Member

    With y upward and gravity downward, it takes energy to bring a mass upward.
    Therefore, the potential energy increases with y .
  10. May 6, 2014 #9


    User Avatar
    Gold Member

    The end-result is less interesting than the derivation, specially if you want some insight in the Lagrange method. Only your derivation can help in a discussion.
    Also, your final result must be wrong, at least the dimensions are wrong.

    Note: The constraint y=x² is dimensionally wrong too. This is really bad.
  11. May 6, 2014 #10


    User Avatar
    Homework Helper
    Gold Member
    2017 Award

    As others have pointed out, the mg in (2) should have a negative sign. V = +mgy. When a mass is raised, its gravitational potential energy increases.

    But, more importantly, you cannot assume λ is a constant. In general, λ is an unknown function of time. So, you have three unknown functions to determine: x(t), y(t), and λ(t). Your constraint equation y = x2 gives a third equation to work with.

    The equations look to me to be very difficult to solve in general. But I think you could solve them approximately for small oscillations.
  12. May 6, 2014 #11


    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Gold Member
    2017 Award

    It seems to me you are mixing functionals and functions in your Lagrange multiplier. The problem your are solving is equivalent to extremizing

    [itex]S[x(t),y(t)] = \int (T-V) dt[/itex]

    under the condition that

    [itex]F[x(t),y(t)] = \int (y - x^2) dt = C[/itex]

    where C is a constant, not under the constraint that y = x2. In order to write down the equations of motion for the constrained system, all you have to do is to use the constraint to replace one of the degrees of freedom in the Lagrangian with the other and you end up with a system with one degree of freedom. Do this and fix your dimensions and you should be fine.
  13. May 6, 2014 #12
    So I can't use λ(y-x2)? Would I fix the dimensions by just multiplying x2 by a constant with units m-1?
  14. May 6, 2014 #13


    User Avatar
    Gold Member

    Concerning constrained motion treated by the Lagrange method, read this up to eq 720:


    Go back to the Newtonian laws of motion.
    The normal force that is explicitly used in the Newton eom, is related to that.

    Concerning the dimensions problem: just write y = a x², with a having the ad-hoc dimensions.
    Alternatively, write y/yo = (x/xo)² .
    Having dimensions is not only needed for correctness, but it is also helpful to detect mistakes.
  15. May 7, 2014 #14
    So after comparing the two methods, I've concluded that λ is the vertical component of the reaction force. And after attempting the Lagrange multiplier method again I have

    λ = [itex]\frac{mg}{1-4a^{2}l^{2}cos(αt)}[/itex]

    where α is a function of λ in my solution to (1) x = lcos(αt). This seems sensible because when I substitute for t = 0 and x(t=0) = l

    λ = [itex]\frac{mg}{1-4a^{2}l^{2}}[/itex] = [itex]\frac{mg}{1-\grave{y}^{2}}[/itex] = mgcos2(θ) = Ncos(θ)

    Where N is the reaction force. Can I determine the frequency of oscillation considering α = α(t)?
  16. May 7, 2014 #15


    User Avatar
    Gold Member

    It is difficult to give you an answer.
    Your derivation is missing and it is more important for the discussion that the end result.
    You are right that λ is directly related to the reaction force.

    You don't explain the meaning of a in the expression for λ .
    Therefore, I cannot check your claim in the second equation in detail.

    Missing your derivation, I cannot identify how you might derive the actual motion, or how you could determine α(t).
    I am also a little bit puzzled that the derivative of α(t) doesn't appear anywhere in your post.
    Are you sure you did all the calculations assuming α=α(t)?
    Didn't you need to write a derivative of α(t) somewhere?
    The second derivative you mentioned earlier (see below) should end up with derivatives of α(t) (which is = k?).
    Isn't it?

  17. May 7, 2014 #16


    User Avatar
    Gold Member

    Ok, maybe this is the wrong place to ask this:
    I've dealt with the Lagrangian before, but what's happening here seems different than what I did; so can someone explain, How is ##T - V - \lambda (y - x^2)## any different than ## T - V##, considering that y is defined:## y = x^2##, this seems to me what OP has is ##T - V - \lambda (y-y) = T - V##. I don't see how this is any more useful than the ##T - V## definition, also, OP went from hyperbolic functions to regular trig functions?
    Or is that a typo? Just trying to follow along here.
  18. May 7, 2014 #17


    User Avatar
    Homework Helper
    Gold Member
    2017 Award

    A brief discussion of this example is here.
  19. May 7, 2014 #18


    User Avatar
    Homework Helper
    Gold Member
    2017 Award

    It turns out that adding ## \lambda (y - x^2)## to the Lagrangian allows you to formally treat x and y as independent variables even though they are not really independent. So, x and y can be treated on an equal footing after introducing the λ term. If you don't introduce the Lagrange multiplier term, then you would need to write the Lagrangian in terms of one independent variable in this problem (x or y). This is very easy to do for this problem since the constraint y = x2 is already solved for y! So, you can easily eliminate y from the Lagrangian and find the equation of motion for x without using a Lagrange multiplier.

    But for a more complicated constraint equation, it might not be easy to solve the constraint explicitly for one of the variables. If you use the Lagrange multiplier method, you don't need to bother to do this. Also, it turns out that the the Lagrange multiplier λ is closely related to the force of constraint. So, if you are interested in the forces of constraint, the Lagrange multiplier method can be helpful.
  20. May 7, 2014 #19


    User Avatar
    Gold Member

    I think I see what you're saying. So is that term intended to be implicitly 0?
  21. May 7, 2014 #20


    User Avatar
    Homework Helper
    Gold Member
    2017 Award

    Well, it's zero whenever x and y satisfy the constraint. But when you modify the Lagrangian with the multiplier term, x and y are to be thought of as independent and therefore not necessarily satisfying the constraint ab initio. The multiplier λ is also treated as an independent variable in the Lagrangian and Lagrange's equation for λ is just the constraint equation. So, x and y end up having to satisfy the constraint! It's kind of weird, but it works.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted