ECE 680 Selected Notes from Lecture 3 January 14, 2008 1 UsingtheLagrangiantoobtainEquationsofMotion In Section 1.5 ofthe textbook, Zak introduces theLagrangian L = K − U, which is the difference between the kinetic and potential energy ofthe system. He then proceeds toobtainthe Lagrange equationsofmotion in Cartesian coordinates for a point mass subject to conservative forces, namely, d dt ∂L ∂ ˙x i − ∂L ∂x i = 0 i = 1, 2, 3. (1) (Any nonconservative forces acting on the point mass would show up on the right hand side.) Here’s how the text gets from the definition tothe result. We know that for a point mass, force is equal to mass times acceleration, F = ma = m¨x = m d ˙x dt , and work is equal tothe integral over distance ofthe applied force. We can substitute for the force toobtain W = B A F · dx (2) = B A m¨x · dx (3) = B A m ˙x · d ˙x (4) where we have played fast and lo ose with the derivatives to conclude that ¨xdx = (d ˙x/dt)dx = d ˙x(dx/dt) = ˙xd ˙x. Assuming conservative forces, we can then integrate toobtain W = m 2 ˙x T ˙x B A (5) so the work is the difference between the kinetic energy at point B and that at point A. Conservation of energy requires that an increase in kinetic energy must b e balanced by decrease in potential energy so we can write − B A F · dx = ∆U (6) and thus F = −∇U, ECE 680 Selected Notes from Lecture 3 January 14, 2008 2 where we use the notation ∇U := ∂U ∂x 1 ∂U ∂x 2 ∂U ∂x 3 T . We have used the fact that if we measure change in potential energy with respect to a constant reference, the derivative ofthe constant reference is zero so we have ∇ (∆U) = ∇U. We’re almost ready to rewrite Newton’s equation in its Lagrangian form. We know that ∂K ∂ ˙x i = m ˙x i (7) so Newton’s law becomes F = − (∇U) i = d dt ∂K ∂ ˙x i = m¨x i i = 1, 2, 3. (8) Now with L = K − U, we see that K does not depend on position and U does not depend on velocity, so ∂L ∂ ˙x i = ∂K ∂ ˙x i (9) ∂L ∂x i = − ∂U ∂x i (10) so Newton’s equation can be rewritten as d dt ∂L ∂ ˙x i − ∂L ∂x i = 0 i = 1, 2, 3 (11) as asserted earlier. Next, in Section 1.6, Zak extends the above analysis to generalized coordinates by ex- pressing each ofthe x i in terms of new coordinates q i . By the chain rule we then have ˙x i = ∂x i ∂q 1 ˙q 1 + ∂x i ∂q 2 ˙q 2 + ∂x i ∂q 3 ˙q 3 (12) and after repeating the derivation with the new coordinates q i we obtain, (surprise, sur- prise,) d dt ∂L ∂ ˙q i − ∂L ∂q i = 0 i = 1, 2, 3. (13) If the applied force has a nonconservative component, the right-hand side is equal tothe nonconservative component rather than zero. Let’s do a couple of simple examples to demonstrate that this is a viable method for obtaining theequationsof motion. ECE 680 Selected Notes from Lecture 3 January 14, 2008 3 Example 1: Pendulum Consider a pendulum of mass m and length with angular displacement θ from the vertical. From the geometry, the expressions for the kinetic and potential energies are K = 1 2 m l ˙ θ 2 (14) U = mgl (1 − cos θ) . (15) Accordingly, L = K − U = 1 2 m 2 ˙ θ 2 − mgl(1 − cos θ). (16) The ∂L ∂θ = −mg sin θ (17) and ∂L ∂ ˙ θ = m 2 ˙ θ (18) so d dt ∂L ∂ ˙ θ = m 2 ¨ θ (19) and finally solving for θ we have ¨ θ = − g sin θ . (20) Example 2: Pendulum on Cart This may have seemed like a very difficult way to get the equation ofmotionof a pendulum, so let’s try a more complicated example. We hang the pendulum from a cart of mass M and position x, acted upon by a force u in the direction of x, and moving on frictionless rails. Thethe x position ofthe pendulum is x+ sin θ and the y position is cos θ, so the kinetic energy is K = 1 2 M ˙x 2 + 1 2 m d dt (x + sin θ) 2 + 1 2 m d dt ( cos θ ) 2 . (21) First taking the time-derivatives, then squaring, then noting that cos 2 θ + sin 2 θ = 1 we obtain K = 1 2 (M + m) ˙x 2 + m ˙x ˙ θ cos θ + 1 2 m 2 ˙ θ 2 . (22) The potential energy is as before, so L = K − U = 1 2 (M + m) ˙x 2 + m ˙x ˙ θ cos θ + 1 2 m 2 ˙ θ 2 − mg (1 − cos θ) . (23) ECE 680 Selected Notes from Lecture 3 January 14, 2008 4 Clearly ∂L/∂x = 0 and ∂L ∂ ˙x = (M + m) ˙x + m ˙ θ cos θ (24) so d dt ∂L ∂ ˙x = (M + m) ¨x + m ¨ θ cos θ − ˙ θ 2 sin θ = u (25) Next we consider the θ direction and velocity, taking ∂L ∂θ = −m ˙x ˙ θ sin θ + mg ˙ θ sin θ (26) and ∂L ∂ ˙ θ = m ˙x cos θ + m 2 ˙ θ. (27) Taking the time derivative yields d dt ∂L ∂ ˙ θ = m¨x cos θ − m ˙x ˙ θ sin θ + m 2 ¨ θ. (28) TheLagrangian equation ofmotion is thus m ¨x cos θ + ¨ θ − g sin θ = 0. (29) We can write this as a matrix differential equation M + m m cos θ cos θ ¨x ¨ θ = m ˙ θ 2 sin θ + u g sin θ . (30) Of course the cart pendulum is really a fourth order system so we’ll want to define a new state vector x ˙x θ ˙ θ T in order to solve the nonlinear state equation. (31) For comparison, it will be instructive to read Section 1.7 in which Zak presents an example of a cart with inverted pendulum. Instead ofusingtheLagrangianequationsof motion, he applies Newton’s law in its usual form. There are a couple of differences between the examples. Specifically, in the example in Section 1.7 1. the pendulum is a distributed rather than point mass, and 2. frictional force on the cart wheels is considered. . 1 Using the Lagrangian to obtain Equations of Motion In Section 1.5 of the textbook, Zak introduces the Lagrangian L = K − U, which is the difference between the kinetic and potential energy of. instructive to read Section 1.7 in which Zak presents an example of a cart with inverted pendulum. Instead of using the Lagrangian equations of motion, he applies Newton’s law in its usual form. There. way to get the equation of motion of a pendulum, so let’s try a more complicated example. We hang the pendulum from a cart of mass M and position x, acted upon by a force u in the direction of