Introduction To The Lagrange Multiplier Method

An introductory video on the use of the Lagrange Multiplier Method to derive the equations of motion for the simple pendulum using a constrained optimization approach.
A COUPLE OF TYPOS TO NOTE:
The 2nd term of Equation 8 should have a + sign. It should be + g/l sin θ.
Equations of Motion for the Simple Pendulum:
• Equation of Motion for...
Download notes for THIS video HERE: bit.ly/3gKKRDI
Download notes for my other videos: bit.ly/37OH9lX
0:00 Introduction
1:46 Modeling the simple pendulum using Lagrange's equations
4:41 Constrained optimization problems
5:24 Modeling the simple pendulum using the Lagrange Multiplier Method
11:00 What is the Lagrange multiplier?
17:19 Summary of the Lagrange Multiplier Method
18:15 Quick recap

Пікірлер: 57

  • @blazeraz7666
    @blazeraz7666 Жыл бұрын

    Since there is no equation for the time derivative of lambda how is this going to be solved numerically?

  • @Freeball99

    @Freeball99

    Жыл бұрын

    Excellent question! I probably should have addressed this in the video, but will pin this question and answer to the top of the discussion board... You are correct that you cannot write the constraint equation in the same matrix form as the equations of motion. For one thing, it's nonlinear, and secondly (as you correctly pointed out) there is no time derivative and so trying to incorporate it with the two equations of motion would produce a singular mass matrix. That said, the way to solve this using a time-stepping solution would be to treat these equations (EOMs and constraints) separately. So for each time step, first calculate λ using the equation on the final page (I never numbered it, but had I numbered it, it would have been eqn. 22). From this equation, one can calculate the initial λ using the initial state of the system. Then apply this λ to the equations of motion and take the next step. With each successive step, update λ before calculating x & y for the following step. Voila!

  • @blazeraz7666

    @blazeraz7666

    Жыл бұрын

    So in the general case we have to differentiate the constraint equation until the accelerations show up and solve the nonlinear system for the accelerations and λ ?

  • @Freeball99

    @Freeball99

    Жыл бұрын

    I'm hesitant to say "in general", but I think what you have stated is probably true for the typical classical examples that are often used to demonstrate Lagrange multipliers (eg simple pendulum, Atwood machine, disc rolling down a slope, etc.). I not sure, for example, if this necessarily works for problems with non-holonomic constraints. I'd need to play around with more Lagrange multiplier problems before I could come up with a general rule. It's not something I've spent much time with.

  • @blazeraz7666

    @blazeraz7666

    7 күн бұрын

    @@Freeball99 Having stumbled back to this comment , I have managed to solve the pendulum equation with the Backwards - Eulers scheme without differentiating the constraint at all just by introducing the constraint equation in the algebraic system of equations to be solved.

  • @Freeball99

    @Freeball99

    5 күн бұрын

    @@blazeraz7666 You know, every now and again I get a comment like this that really makes me smile. You are, of course, exactly correct. Using an implicit integrator like backward Euler affords one a direct way of incorporating the Lagrange multiplier constraint, whereas using an explicit integrator required additional iteration. I had been focused on explicit integration (usually RK4 or RK5 is my go-to integrator of choice). Typically implicit integrators are a little more computationally expensive, but for this sort of problem allows a direct and simple method of incorporating the constraint. SIDE NOTE: implicit integrators tend to be more stable than explicit integrators and thus are more useful for so-called "stiff" systems of equations which can product numerical instabilities. Great job!!

  • @colinwise8044
    @colinwise8044 Жыл бұрын

    I wish there had been access to resources like these 50 years ago when I was studying Langranges equations and, later, optimal control.

  • @joelasaucedo
    @joelasaucedo Жыл бұрын

    Freshman physics major here. Very appreciative of your channel. Thank you for making this accesible for those of us who are motivated.

  • @ryanmckenna2047
    @ryanmckenna20475 ай бұрын

    I have seen the Lagrangian multipliers being used in robotics research for inverse-kinematics equations, the dynamics of the system can be described in a more computationally tractable way to help real-time algorithms perform better, like you said "more equations but simpler equations". Great lesson!

  • @meoliv
    @meoliv Жыл бұрын

    Highly appreciated! Thank you for your beautiful work!

  • @hesammortazavi9371
    @hesammortazavi93712 ай бұрын

    Absolutely amazing video. like many other students I was familiar with topics, but unfortunately we do not have insight to relate these topics.

  • @hakobchakhoyan1803
    @hakobchakhoyan1803 Жыл бұрын

    Great! Now I am waiting for the video of Rigorous Mathematical Proof of Lagrange's Multipliers)) You are so helpful)

  • @soroushasadian9100
    @soroushasadian9100 Жыл бұрын

    Brilliant, Enjoyed so much. Thanks

  • @CD_Yujin
    @CD_Yujin7 ай бұрын

    Helpful and easy to understand material with detailed step by step solve Thank you!

  • @jxchtajxbt53
    @jxchtajxbt539 ай бұрын

    Excellent presentation - Feynman would be proud.

  • @inotmark
    @inotmark Жыл бұрын

    Much appreciated. Thank you.

  • @nucleushyena8330
    @nucleushyena8330 Жыл бұрын

    I think there was a slight problem with the result of the Lagrange equation around 4:30. I found that it should be “(theta)’’ + (g/l)sin(theta) = 0”, but otherwise, great video!

  • @Freeball99

    @Freeball99

    Жыл бұрын

    Correct. This is a typo. There should be a "+' sign before the (g/l). I have added this correction to the video's description.

  • @jaafars.mahdawi6911

    @jaafars.mahdawi6911

    Жыл бұрын

    @@Freeball99 what about eq.16? (-mg) that's the reason for the ensuing mistake in 19 and 20, which you did correct in the description. And i don't think eq.8 was wrong, you just differentiated cosØ, hence the minus sign, or am i missing something here?

  • @averagegamer9513
    @averagegamer9513 Жыл бұрын

    Thank you so much for this video, I am struggling to understand Lagrange related topics, and this helped me a lot.

  • @Freeball99

    @Freeball99

    Жыл бұрын

    Glad it helped!

  • @BlackBox019
    @BlackBox019 Жыл бұрын

    Hey, your videos are incredible, I'd like to see a video on modal analysis. Can't find any good video on that subject. Thank you !

  • @Freeball99

    @Freeball99

    Жыл бұрын

    Next on my list!

  • @tshebeletsotjabane4979
    @tshebeletsotjabane497910 ай бұрын

    Thank you

  • @michacichowski6206
    @michacichowski6206 Жыл бұрын

    Once again, great material! Thank you for this awesome reminder about Lagrange Multiplier Method! Do you also plan to cover the problems with free endpoints or with constraints that have integral form (catenary for example)? Still waiting for more material about aeroelasticity or optimal control.

  • @Freeball99

    @Freeball99

    Жыл бұрын

    Will get to aeroelasticity eventually. Perhaps just a 2 DOF system to begin. Before then , I will do at least one problem with a mixed-type boundary condition. I do, however, have a video on the catenary problem: kzread.info/dash/bejne/d3x_qMSlY7ndfdI.html

  • @fredda6787
    @fredda67872 ай бұрын

    Thank you!

  • @Alliban59
    @Alliban598 ай бұрын

    The constraint equation can be written in a dimensionless form as well, i.e. divide through by l^2. Than lambda equals the (normal) rod force. In that case, terms like x/l and y/l appear in the equations, which represent the sine and cosine function at last.

  • @thedorantor
    @thedorantor Жыл бұрын

    Perfect!!! Seems to save also a lot of substitution work for the double pendulum case from your earlier videos. Although I wonder what the extra constraint eqs would be...

  • @Freeball99

    @Freeball99

    Жыл бұрын

    Your point is right on! Modeling the double pendulum as a constrained optimization problem really shows off the simplicity of this method. Constraint equations would be: x1^2 + y1^2 = L1^2 (x2 - x1)^2 + (y2 - y1)^2 = L2^2

  • @DEChacker
    @DEChacker Жыл бұрын

    Fabulous video. Really appreciated

  • @nunetoyamato
    @nunetoyamato10 ай бұрын

    Great video, as usual! Just a side note on a couple of typos: in the governing equation 8, "g/l*sin(theta)" should have a plus sign I think; in addition, on the last page, equation 22, the term "gY" should have a minus sign. Hope I got it right, otherwise just disregard my message. Thanks!

  • @Freeball99

    @Freeball99

    9 ай бұрын

    Yes, you're correct. Equation 8 has a typo - the last term must have a plus sign (else the system blows up exponentially) and in equation 22, the last term should have a minus sign. Thanks for catching that.

  • @junsup_kim
    @junsup_kim Жыл бұрын

    Your video enlightens me every time. Thanks a lot. The sign of equation #8 looks typo error. (i.e. +g/l instead of -g/l).

  • @Freeball99

    @Freeball99

    Жыл бұрын

    Yes, you're right. Careless error!! I'll add something to the description to let folks know. Thanks for this.

  • @junsup_kim

    @junsup_kim

    Жыл бұрын

    There seems to be another typo in eqn #20 after substituting eqn #21 into eqn #20(i.e. -gy instead of +gy). It is amazing to see the lambda reveal itself as a constraint force by introducing it as a generalized coordinate. Thanks again for your great video.

  • @youturbs
    @youturbs Жыл бұрын

    Nice content, I used this method to model the dynamics of an UAV formation transporting a payload. I have one video from this simulation in my channel.

  • @Freeball99

    @Freeball99

    Жыл бұрын

    Very cool stuff!! Thanks for sharing. What is the purpose of this project? Is this for school? Work? Or just for fun?

  • @youturbs

    @youturbs

    Жыл бұрын

    @@Freeball99 It is for my master's degree in mech. eng.

  • @Kamil-mo3kj
    @Kamil-mo3kj Жыл бұрын

    Sir, I have a request. It's off topic. Can you please show me how write a program to animate the behavior of two identical blocks; one at rest and having an appended spring on the back face and the other moving toward it from the back and squeezing the spring and causing the stationary block to move from rest?

  • @Freeball99

    @Freeball99

    Жыл бұрын

    Can't really explain it here except to say that you should consider the animation in 3 parts. First is prior to collision, second is during collision and third is after collision. This video might give you a little insight into how to model the problem: kzread.info/dash/bejne/lqOD1sejoLSzgrg.html

  • @mohamedelshami3823
    @mohamedelshami3823 Жыл бұрын

    your demonstration is perfect. but i have a question here which is a little bit confusing to me when searching about modeling in different resources, some of them model the mass as translating and rotating at the same time then both terms appear in kinetic energy equation, and some other resources comnsider either one of them but not at the same time. my question is when consider translation term and rotation term at the sma moment and when not? thaks in advance.

  • @Freeball99

    @Freeball99

    Жыл бұрын

    Typically when examining the simple pendulum, the mass is treated as a point mass, so we can ignore the rotatory kinetic energy (and typically we also ignore the mass of the rod). Usually I would mention this at the start of the problem, but in this case it's a problem that I have addressed several times before, so I neglected to mention it here. In reality, this is not a bad assumption as the rotatory kinetic energy is usually much less than the contribution from the translational kinetic energy. HOWEVER, as the radius of the mass increases relative to the length of the rod, then the rotational affects will become more significant. Also, if you are specifically told to include the rotational effects or if you are given an I value for the mass then you should include it. If you are unsure, then you should include it. In the case of a compound pendulum, you should always include rotational effects.

  • @mohamedelshami3823

    @mohamedelshami3823

    Жыл бұрын

    @@Freeball99 Thank you very much for your reply, I appreciate it. And again your explanation is perfect, now it is clear thanks a lot.

  • @joansgf7515
    @joansgf751511 ай бұрын

    When using Lagrange multipliers, we impose the gradient of L+λG to be 0. My question is wrt to what variables have you partially differentiated it? Would it be t (time), x, y and λ, or did you include the velocities too? Or you didn't because the velocities vary wrt time?

  • @Freeball99

    @Freeball99

    11 ай бұрын

    Not sure I understand the question correctly. If you are asking about the derivation of this method, then the functional would be a function of time (the independent variable), the generalized coordinated and the time-derivatives of the generalized coordinates. You need to consider the variation of each of these coordinates.

  • @joansgf7515

    @joansgf7515

    11 ай бұрын

    @@Freeball99 Yes, something like that. Let me reformulate though: so we want to minimize L with the given constraint G=x^2+y^2-l^2=0, namely, we want to find x(t) and y(t) such that ∇(L+λG)=0. Since L(y(t), ẋ(t), ẏ(t))+λG(x(t), y(t)) depends on t, x, y, ẋ, ẏ and λ, then should ∇=(∂/∂t, ∂/∂x, ∂/∂y, ∂/∂ẋ, ∂/∂ẏ, ∂/∂λ)? I'm asking this because I want to get the same result as you but instead of using the Euler-Lagrange eq. on L+λG, I want to use the method they taught me in Calculus III (I havent taken any Lagrangian mechanics classes yet, I'm starting this autumn).

  • @Shakti258
    @Shakti2589 ай бұрын

    Hi bro, can u explain lever principle without using torque concept or without using work done by effort = work by load logic.. in short how is force multiplied ????

  • @Freeball99

    @Freeball99

    9 ай бұрын

    The lever principle allows you to multiply force by altering the distance over which that force is applied. Imagine a seesaw. If you push down on one end, the other end goes up. Now, if you move your pushing point further away from the pivot (the seesaw's balance point), you'll find it easier to lift the same weight on the other end. You're using the same amount of force, but you're able to lift a heavier weight because you're applying that force over a longer distance. In this way, the lever principle allows you to "multiply" force, making it easier to lift or move objects that would otherwise require much more effort.

  • @LuisCobb-vx5uo
    @LuisCobb-vx5uoАй бұрын

    A COUPLE OF TYPOS TO NOTE: The 2nd term of Equation 8 should have a + sign. It should be + g/l sin θ. ALSO: Equation 20 should read -gy. Agree with the first typo but why should eq. 20 have -gy ?

  • @Freeball99

    @Freeball99

    Ай бұрын

    Not sure what I was thinking when I wrote this. As I look at equation 20 now, it seems correct to me. Will edit my comment. Thanks for the feedback.

  • @Pherecydes
    @Pherecydes Жыл бұрын

    Ok, after watching this I understand HOW you are able to convert the initial Lagrangian and constraint equation into Lagrange's equations with the Lagrange multiplier, but I still don't understand WHY you would do this or what this accomplishes. Why bother putting the problem into this form? What does this allow you to calculate that you couldn't do before?

  • @Freeball99

    @Freeball99

    Жыл бұрын

    It makes it simpler to model (for more complicated problems). Instead of having to substitute the kinematics into the equations of motion and perform a bunch of algebra, we can put the equations into the computer in a much more simple form and have the computer do the math for us. This is achieved by over-parameterizing the equations of motion and, in doing so, making life very simple, then adding some constraint equations to reduce the number of independent degrees of freedom. As an example, try to model the triple or quadruple pendulum (typically a very tedious process) and see how much more simple this makes the process.

  • @Pherecydes

    @Pherecydes

    Жыл бұрын

    @@Freeball99 ok, thanks for the reply, I'll have to look into that.

  • @jmsolangi
    @jmsolangi5 ай бұрын

    I was the bright spark *not Not the bright spark

  • @gbpferrao
    @gbpferrao Жыл бұрын

    NOOOOO! NOT LAMBDAS AGAIN! 😱😓