Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Setting up Differential Equations of Motion

  1. Oct 30, 2004 #1
    I'm studying Lagrangian Dynamics using a Schaum's Outline. This book seems to assume that the student can easily set up the Differential Equations of motion, but I can't seem to get the hang of it. The book does not give any actual methods or examples for setting up these Differential equations of motion, they seem to be more concerned with just solving the resulting differential equations.

    At the other extreme most of my classical physics books just give the standard equations of motion without really getting into calculus.

    Are their any books out there that focus on just setting up the differential equations for a particlar mechanical system.

    As an example there is a very simple problem in the Langrangian Dynamics book of a pendulum and spring system. (just one mass hanging from a spring allowed to move in the x-y plane only. It seems simple enough and they give the equations of motion as follows.

    [tex] \ddot{r} - r \dot{\theta}^2 - g \cos \theta + \frac {k} {m} \left( r - r_o \right) = 0 [/tex]


    [tex] r \ddot {\theta} + 2 \dot {r} \dot {\theta} + g \sin \theta = 0 [/tex]

    I'd like to find a book that shows methodological procedures for arriving at these types of differential equations from the standard classical physics equations.

    Any suggestions?

    Also if someone feels like taking the time to show how the above equations where formed from the basic equations of a spring and pendulum motion that would be cool too. :cool:

    Thank you.
    Last edited: Oct 30, 2004
  2. jcsd
  3. Oct 30, 2004 #2


    User Avatar
    Science Advisor
    Gold Member

    Right, Let's go. Let's use two general coordinates: r and theta.

    -Total Kinetic Energy of the Pendulum:(using polar coordinates)


    -Total Potential and Elastic Energy:




    Now, use the Lagrange equation for each Generalized coordinate:

    [tex]\frac{d}{dt}\frac{\partial L}{\partial \dot{r}}-\frac{\partial L}{\partial r}=\frac{d}{dt}[M\dot{r}]-[Mgcos\theta-K(r-r_o)+Mr\dot\theta^2]=0[/tex]

    So that;


    My advice is:
    i) choose the generalized coordinates (this is the MOST important step of the problem. Here the election is so easy as polar coordinates, but there are problems too difficult at this point).

    ii) Write the expressions of Kinetic Energy and Potential Energy as a function of that coordinates.

    iii) Employ the definition of Lagrange equations.

    iv) Watch the equations for a few time and put your brain on another problem. Be sure they are too difficult to solve analitycally so you have nothing to do with them (except you have some time to waste).

    What do you think?.

    BTW: the second equation is left to you.
  4. Oct 30, 2004 #3
    Ok. First, I thank you very much for the quick reply.

    I do see where you are going with [tex]L=T-V [/tex]. I understand that this is the Langrangian Method.

    However, I'm actually still in chapter 1 (Background Material) of the Schaum's Outline, and they really don't get into the actual Lagrangian until chapter 3.

    In fact, in chapter 2 they continue with (Backgound Material) discussing the mathematical forms of potential and kinetic energies in a build up to the Lagrangian methods.

    Evidently in this first chapter they are still looking at things from a strictly Newtonian point of view. Using [tex]F = m\ddot{x} [/tex] as the main basis for analysis.

    Is is possible to derive those same equations of motion using the Newtonian methods of [tex]F = m\ddot{x} [/tex]? I think that the point to these early chapters is to show that while it is possible to do this using Newtonian Equations the Lagrangian Equations are much easier.

    So I suppose my question now is can those same final differential equations be attained using only the Newtonian Equations of force, acceleration and mass?

    Or am I misunderstanding something here? They really don't even introduce the Langrangian [tex]L = T-V [/tex] until chapter 3 so I don't see how they can be expecting me to use that in chapter 1.

    By the way, your Lagrangian analysis was insightful for me and I will look at the second equation from that point of view. But I'd still like to do a couple of these using Newtonian Equations (if possible) just so I can see the difference between these methods.

    Thanks again for the reply.
  5. Oct 31, 2004 #4


    User Avatar
    Science Advisor
    Gold Member

    Sorry, you talked about "Lagrangian Dynamics", so I proceeded with Lagrange Equations.

    Nevertheless, take a look at the equation:


    and let me to reshape it as:


    That's the Newton second law for r coordinate. The first term on the right is the centrifugal force, the second one the gravity, and the third one the elastic force that avoids the mass to lenghten its distance from the center.

    I mean, this equation is the same as Newton Law if you draw a free body diagram. Try it and divide the forces in those acting in r direction and theta direction. Set up the second law for each coordinate (polar coordinate is a good choosing at first sight) and you will find this equation and the other for theta.
  6. Oct 31, 2004 #5
    Thank You, thank you, thank you! You're a genius!

    I actually got this far considering the effects of gravity and the elastic force:


    I just couldn't figure out where they were coming up with the [tex]Mr\dot\theta^2[/tex] term. I was completely ignoring the action of the pendulum and the effect of centrifugal force! I would have never thought of that on my own because I just wasn't thinking about the centrifugal force due to the pendulum action.

    This has helped me tremendously! Now I'll be able to sleep tonight. :approve:

    Thanks again!
  7. Oct 31, 2004 #6


    User Avatar
    Science Advisor
    Gold Member

    Thank YOU, NeutronStar, for walking around here questioning something interesting and for your acknowledgement. :smile:
  8. Nov 3, 2004 #7
    I'm pretty sure that I understand the first equation but I can't seem to derive the second one now. Here's what I'm trying to do,...

    First off I tried to calculate it using the Lagrangian as you suggested, but I'm either not doing it correctly, or I simply don't know how to take these derivatives properly.

    From what you gave me before,...

    [tex]\frac{d}{dt}\frac{\partial L}{\partial \dot{r}}-\frac{\partial L}{\partial r}=\frac{d}{dt}[M\dot{r}]-[Mgcos\theta-K(r-r_o)+Mr\dot\theta^2]=0[/tex]

    I'm thinking that I simply need to do the same thing for the second coordinate like so,...

    [tex]\frac{d}{dt}\frac{\partial L}{\partial \dot{\theta}}-\frac{\partial L}{\partial \theta}[/tex]

    First off, is that a correct assumption?

    And if it is, how is that done, I'm not real sure on how to take these partial derivatives.

    First I rewrote the original Lagrangian just to remove some brackets like so,...


    I just did that so that I can better see each term for taking the partial derivatives

    Then I get something like,...

    [tex]\frac{d}{dt}\frac{\partial L}{\partial \dot{\theta}}-\frac{\partial L}{\partial \theta}=\frac{d}{dt}[Mr^2\dot{\theta}]+Mgr\sin\theta=0[/tex]

    Then when all is said and done I finally get,...

    [tex]\dot {r}\ddot{\theta}+g\sin\theta=0[/tex]

    But this is a far cry from what the book gives as the second equation of motion for this model,...


    So what am I doing that is so terribly wrong?

    Also can you explain what each of these terms represents from a Netwonian point of view?


    I know that the last one comes from the gravitational force. But what are the other two terms? I'm thinking that they might be related to torque, or angular momentum but I can't quite figure out what's going on here.

    I'd really like to fully understand the mathematical description of this system perfectly before I move on to to the next system in the book which is far more complex.
  9. Nov 4, 2004 #8


    User Avatar
    Science Advisor
    Homework Helper

    The differentiation.Simply that.Try to make it again and u'll get your result.I won't make it for you.:wink:
  10. Nov 4, 2004 #9
    I have been trying to do this over and over again for a week! I'm also doing this entirely on my own as self-study so I have no instructor to ask or anything.

    This is the first time that I've ever done partial deriatives with repect to a varible that itself is a time derivative. So I'm not sure what the procedure is for that.

    As far as I can see the Lagrangian only has two terms it in that contain [tex]\theta[/tex]. So how am I ever going to end up with more than two terms with that contain [tex]\theta[/tex] unless a product rule is involved, but I don't see it.

    First off, what does [tex]\frac {\partial{L}}{\partial{\dot{\theta}}}[/tex] mean?

    Does it mean to take the derivative of the Lagrangian with respect to the time derivative of [tex]\theta[/tex]? If that's what it means then there is only one term in the Lagrangian that contains [tex]\dot\theta[/tex]. All the other terms would be treated as constants and go to zero wouldn't they? So I get,...

    [tex]\frac {\partial{L}}{\partial{\dot{\theta}}}=\frac {\partial{}}{\partial{\dot{\theta}}}\left[\frac{1}{2}mr2\dot{\theta}^2\right]=mr^2\dot{\theta}[/tex]

    If that's wrong it's just because I don't understand the rules of taking a derivative with repect to the time derivative of a variable. That's what I get and I can't see anything wrong with the procedure unless there's more to the rules that I know about.

    So now I need to do the other partial [tex]\frac {\partial{L}}{\partial{\theta}}[/tex]

    Again, I'm not sure how to do this because the Lagrangian contains two terms with theta, but one of them is a time derivative of theta. I don't know how to treat these. I'm taking it to mean that I just find the derivative with respect to theta, but not with respect to any time derivatives of theta. Like I say, I've never done partials with respect to time dependent variables before.

    So I'm taking the derivative of only the terms that contain theta without a time derivative,…

    [tex]\frac {\partial{L}}{\partial{\theta}}=\frac {\partial{}}{\partial{\theta}}\left[-mgr\cos\theta\right]=mgr\sin\theta[/tex]

    And that's the only term that contains theta that isn't a time derivative of theta. So all the rest go to zero. Obviously this must be wrong, but I just don't know the rules of partial differentiation with respect to variables that depend on time here.

    So I could do this for weeks and not get anywhere until someone gives me some rules. Like I say, I'm doing this on my own so I don't have an instructor. I'm not taking a course. I'm just studying out of a Schaum's outline that doesn't explain things like this at all.

    So have I done either one of these partials correctly? Or did I screw up both of them?
  11. Nov 4, 2004 #10


    User Avatar
    Science Advisor
    Homework Helper


    So far,so good.

    Very well done.You're on the right track.

    It's nothing wrong with the calculations so far.

    You treat generalized coordinates (like [tex] r,\theta,\phi,... [/tex]) and their time derivatives ([tex] \dot{r},\dot{\theta},\dot{\phi},... [/tex]) as independent variables and derive without any problem.

    Apparently you didn't see the mistake in your calculations for the second equation of motion.It's the result of the time derivative that sucks,not prior differentiations.
    Try to do it again:
    [tex] \frac{d}{dt}[Mr^2\dot{\theta}] [/tex] is equal to what????

    They were both correct.
  12. Nov 4, 2004 #11
    Try to do it again:
    [tex] \frac{d}{dt}[Mr^2\dot{\theta}] [/tex] is equal to what????

    [tex] \frac{d}{dt}[Mr^2\dot{\theta}] = 2Mr\dot{r}\dot{\theta}+Mr^2\ddot{\theta}[/tex]

    Well that's crazy!

    I've been tyring to do this all week with pencil and paper and I kept doing it wrong. Then I sit down here and type it in in Latex format and it comes out perfect! I better start doing all my calculations using Latex format! :biggrin:

    I know that a got real confused about taking the time derivative of these coodinate variables. Part of what was screwing me up is that I was used to working in terms of x and y's, while studying differential calculus in another book, and then working with t's and r's my mind just didn't see it the same way.

    In any case, I had actually done this product rule several times before getting a wrong answer each time. Funny how I got it right the first time when doing it in the Latex format.

    Anyhow, thanks for pointing the way. I really couldn't figure out where I was screwing up.

    Now I have yet another question that is actually more important to me.

    What do each of these terms represent physically in this final equation from a Newtonian point of view?


    Do I just put the r term back in again like so,...


    Then say the first term is torque, the second one angular momentum, and the last one gravity? Would that be correct?

    Edited to add:


    I guess I'd have to put the M's back in too if I really wanted to call this torque, angular mometum and gravitational force.

    But I'm unclear as to why there should be an angular momentum term in the second equation when there wasn't any linear momentum term in the first equation???

    I'll get this whole problem down pat eventually if it takes the rest of my life! (ha ha)
    Last edited: Nov 4, 2004
  13. Nov 4, 2004 #12
    Sorry, something's gone wrong with LaTeX. I'll try to fix.
    Last edited: Nov 4, 2004
  14. Nov 4, 2004 #13


    User Avatar
    Science Advisor
    Gold Member

    Well, the last equation is the representation of the Angular Momentum Conservation at the turning center. The first term on the left is the moment of inertia of the mass multiplied by angular acceleration. The third term on the left is the momentum of the gravity force at turning point. But I have problems with the second term. Just now I don't realize where it comes from.

    The fact is the sum of torques at the rotation center has to be equal to the inertia moment multiplied by angular acceleration. Remind this, linear coordinates will give you linear conservations laws, while angular coordinates will give you rotational dynamic equilibrium.
  15. Nov 4, 2004 #14
    I'll have to think about exactly why that should be true, but it sounds good. :approve:

    The Moment of Inertia is defined as [tex]I=mr^2[/tex] and torque is defined as [tex]\tau=I\alpha=mr^2\ddot{\theta}[/tex]. But it probably makes more sense to look at the first term like like you say, as the moment of inertia times the angular acceleration because that's really what's causing it.

    Thank you, that was a good reminder because I'm definitely rusty. :smile:

    The middle term appears to resemble the defintion of angular momentum. [tex]L=I\dot{\theta}=mr^2\dot{\theta}[/tex]. But I haven't yet justified to myself why it should be there doubled? I'll have to think about this a bit more.
  16. Nov 4, 2004 #15
    I'm afraid I don't get anything from this.

    Are you sure about this?:


    It doesn't look equal to me. But I could be wrong.

    Also isn't ,...


    I'm afraid I didn't get whatever it was that you were hinting at.
  17. Nov 5, 2004 #16


    User Avatar
    Science Advisor
    Gold Member

    Well, I think I've got it. The dynamic rotational equilibrium states:

    [tex] \frac{d}{dt}(I(t)\dot\theta(t))=\sum (M_i)[/tex]

    Where M_i are the external momentums applied at rotating center, named point O. In fact, the moment of inertia of the mass varies with time, because radial coordinates also varies with time. So that, if one wants to write the rotational equilibrium without having any idea about Lagrange equations, he must write the above conservation equation. Proceeding with that:

    [tex]\dot\theta(t)\dot I+I\ddot\theta=-Mgrsin\theta[/tex]

    because gravitational force is the unique force that exerts a torque at O.
    If you define the moment of inertia of the mass M around point O as:


    then you'll find your equation again.

    As a cautionary note, you can see the derivation of this problem is easy enough by Newton itself indeed, here employing Lagrangian is a bit exagerated way for obtaining the motion equations. BUT don't take it for granted in the rest of problems. When you have spent five minutes trying to write the equations only with Newton laws, and you don't have success, automatically go on with the Lagrangian, trying not fail in the derivation you will find surely the equations of motion.
  18. Nov 5, 2004 #17


    User Avatar
    Science Advisor
    Homework Helper

    Apparently we've got the problem solved.Fully.
  19. Nov 5, 2004 #18
    Yes, this fullly answers the questions that I put forth in this thread.

    I'd like to especially thank Clausius2 for his insightful physical interpretation of each term. This was the part that interests me the most.

    While the questions that I asked in this thread have been answered I'm hardly finished with this problem. I now need to go on an solve these equations and then analyze the resulting time dependent equations. But if I have questions with that I'll probably ask them in the mathematics forum.

    I do have one further question though while I'm here,...

    The original equation for the kinetic energy of this system was given as:
    If the pendulum was a solid rod instead of a spring would it be correct then to write the Total Kinetic Energy as simply:


    Or do you drop the r altogether since it's no longer a degree of freedom?

    I suppose that the r would still come into play as a constant for the potential energy though.

    I probably should have done that simpler case first! :biggrin:
  20. Nov 6, 2004 #19


    User Avatar
    Science Advisor
    Gold Member

    If the rod is solid and non elastic (K=0) then:

    [tex] r(t)=R [/tex]


    [tex] \dot r=\ddot r=0[/tex]

    All the terms that contain the above derivative are dropped, also the elastic terms. Check your new kinetic energy expression because that you posted is wrong.

    EDIT: This is another advice, it's a traditional advice said by engineers to begineers in physics and mechanics:

    Pay attention to physical DIMENSIONS of the expressions you write. For example:

    It hasn't got dimensions of energy (Joules), so that it is wrong at first sight without thinking anymore. Checking dimensions will enhance you to be forewarned about errors.
    Last edited: Nov 6, 2004
  21. Nov 6, 2004 #20


    User Avatar
    Science Advisor
    Homework Helper

    Your kinetic energy would be then
    [tex] T = \frac{1}{2}Mr^2 \dot{\theta}^2 [/tex] which is just the usual kinetic energy for the rotation movement:
    [tex] T = \frac{1}{2} I\omega^2 [/tex],identifying the momentum of inertia I with [tex] Mr^2 [/tex].

    The dimensional issue is valid only in classical dynamics.At a quantm level,usually this is neglected,because [tex] \hbar [/tex] and [tex] c [/tex] are set to 1.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook