Generalized Coordinates, Lagrange's Equations, And
Total Page:16
File Type:pdf, Size:1020Kb
Generalized Coordinates, Lagrange’s Equations, and Constraints CEE 541. Structural Dynamics Department of Civil and Environmental Engineering Duke University Henri P. Gavin Fall, 2016 1 Cartesian Coordinates and Generalized Coordinates The set of coordinates used to describe the motion of a dynamic system is not unique. For example, consider an elastic pendulum (a mass on the end of a spring). The position of the mass at any point in time may be expressed in Cartesian coordinates (x(t), y(t)) or in terms of the angle of the pendulum and the stretch of the spring (θ(t), u(t)). Of course, these two coordinate systems are related. For Cartesian coordinates centered at the pivot point, y x(t) = (l + u(t)) sin θ(t) (1) y(t) = −(l + u(t)) cos θ(t) (2) x θ l θ l where is the un-stretched length of the spring. Let’s define " # " # " # r1(t) x(θ(t), u(t)) (l + u(t)) sin θ(t) u r(t) = = = (3) K r2(t) y(θ(t), u(t)) −(l + u(t)) cos θ(t) y = −(l+u)cos M g and " # " # q1(t) θ(t) x = (l+u)sin θ q(t) = = (4) q2(t) u(t) so that r(t) is a function of q(t). The potential energy, V , may be expressed in terms of r or in terms of q. In Cartesian coordinates, the velocities are " # " # r˙1(t) u˙(t) sin θ(t) + (l + u(t)) cos θ(t)θ˙(t) r˙(t) = = (5) r˙2(t) −u˙(t) cos θ(t) + (l + u(t)) sin θ(t)θ˙(t) So, in general, Cartesian velocities r˙(t) can be a function of both the velocity and position of some other coordinates (q˙(t) and q(t)). Such coordinates q are called generalized coordinates. The kinetic energy, T , may be expressed in terms of either r˙ or, more generally, in terms of q˙ and q. Small changes (or variations) in the rectangular coordinates, (δx, δy) consistent with all displacement constraints, can be found from variations in the generalized coordinates (δθ, δu). ∂x ∂x δx = δθ + δu = (l + u(t)) cos θ(t)δθ + sin θ(t)δu (6) ∂θ ∂u 2 CEE 541. Structural Dynamics – Duke University – Fall 2020 – H.P. Gavin ∂y ∂y δy = δθ + δu = (l + u(t)) sin θ(t)δθ − cos θ(t)δu (7) ∂θ ∂u 2 Principle of Virtual Displacements Virtual displacements δri are any displacements consistent with the constraints of the system. The principle of virtual displacements1 says that the work of real external forces through virtual external displacements equals the work of the real internal forces arising from the real external forces through virtual internal displacements consistent with the real external displacements. In system described by n coordinates ri, with n internal inertial forces mir¨i(t), potential energy V (r), and n external forces pi collocated with coordinates ri, the principle of virtual dispalcements says, n ! n X ∂V X mir¨i + δri = (pi(t)) δri (8) i=1 ∂ri i=1 3 Derivation of d’Alembert’s principle from Minimum Total Potential Energy The total potential energy, Π, is defined as the internal potential energy, V , minus the potential energy of external forces2. In terms of the r (Cartesian) coordinate system and n forces fi collocated with the n displacement coordinates, ri, the total potential energy is given by equation (??). n X Π(r) = V (r) − firi . (9) i=1 The principle of minimum total potential energy states that the total potential energy is minimized in a condition of equilibrium. Minimizing the total potential energy is the same as setting the variation of the total potential energy to zero. For any arbitrary set of “vari- ational” displacements δri(t), consistent with displacement constraints, n n n X ∂Π X ∂V X min Π(r) ⇒ δΠ(r) = 0 ⇔ δri = 0 ⇔ δri − fi δri = 0 , (10) r i=1 ∂ri i=1 ∂ri i=1 In a dynamic situation, the forces fi can include inertial forces, damping forces, and external loads. For example, fi(t) = −mir¨i(t) + pi(t) , (11) where pi is an external force collocated with the displacement coordinate ri. Substituting equation (??) into equation (??), and rearranging slightly, results in the d’Alembert equa- tions, the same as equation (??) found from the principle of virtual displacements, n ! X ∂V mir¨i(t) + − pi(t) δri = 0 . (12) i=1 ∂ri 1d’Alembert, J-B le R, 1743 2In solid mechanics, internal strain energy is conventionally assigned the variable U, whereas the potential energy of external forces is conventionally assigned the variable V . In Lagrange’s equations potential energy is assigned the variable V and kinetic energy is denoted by T . cbnd H.P. Gavin September 1, 2020 Generalized Coordinates and Lagrange’s Equations 3 In equations (??) and (??) the virtual displacements (i.e., the variations) δri must be ar- bitrary and independent of one another; these equations must hold for each coordinate ri individually. ∂V mir¨i(t) + − pi(t) = 0 . (13) ∂ri 4 Derivation of Lagrange’s equations from d’Alembert’s principle For many problems equation (??) is enough to determine equations of motion. However, in coordinate systems where the kinetic energy depends on the position and velocity of some generalized coordinates, q(t) and q˙(t), expressions for inertial forces become more complicated. P The first goal, then, is to relate the work of inertial forces ( i mir¨i δri) to the kinetic energy in terms of a set of generalized coordinates. To do this requires a change of coordinates from variations in n Cartesian coordinates δr to variations in m generalized coordinates δq, m m m X ∂ri X ∂r˙i d X ∂r˙i δri = δqj = δqj and δri = δr˙i = δqj . (14) j=1 ∂qj j=1 ∂q˙j dt j=1 ∂qj Now, consider the kinetic energy of a constant mass m. The kinetic energy in terms of 1 2 2 2 velocities in Cartesian coordinates is given by T (r˙) = 2 m(r ˙1 +r ˙2 +r ˙3), and ∂T δri = mir˙i δri . (15) ∂r˙i Applying the product and chain rules of calculus to equation (??), d ∂T ! d δri = mir¨i δri + mir˙i δri (16) dt ∂r˙i dt m d ∂T X ∂r˙i ∂T δqj = mir¨i δri + δr˙i (17) dt ∂r˙i j=1 ∂q˙j ∂r˙i m m d ∂T X ∂r˙i ∂T X ∂r˙i mir¨i δri = δqj − δqj . (18) dt ∂r˙i j=1 ∂q˙j ∂r˙i j=1 ∂qj P Equation (??) is a step to getting the work of inertial forces ( i mir¨i δri) in terms of a set of generalized coordinates qj. Next, changing the derivatives of the potential energy from ri to qj, m ∂V X ∂V ∂qj ∂ri δri = δqj . (19) ∂ri j=1 ∂qj ∂ri ∂qj Finally, expressing the work of non-conservative forces pi in terms of the new coordinates qj, n n m m n m X X X ∂ri X X ∂ri X pi(t) δri = pi(t) δqj = pi(t) δqj = Qj(t) δqj , (20) i=1 i=1 j=1 ∂qj j=1 i=1 ∂qj j=1 cbnd H.P. Gavin September 1, 2020 4 CEE 541. Structural Dynamics – Duke University – Fall 2020 – H.P. Gavin where Qj(t) are generalized forces, collocated with the generalized coordinates, qj(t). Substi- tuting equations (??), (??) and (??) into d’Alembert’s equation (??), rearranging the order of the summations, factoring out the common δqj, canceling the ∂ri and ∂r˙i terms, and eliminating the sum over i, leaves the equation in terms of qj andq ˙j, n m m m m X d ∂T X ∂r˙i ∂T X ∂r˙i X ∂V ∂qj ∂ri X ∂ri δqj − δqj + δqj − pi(t) δqj = 0 i=1 dt ∂r˙i j=1 ∂q˙j ∂r˙i j=1 ∂qj j=1 ∂qj ∂ri ∂qj j=1 ∂qj m n " ! # X X d ∂T ∂r˙i ∂T ∂r˙i ∂V ∂qj ∂ri ∂ri − + − pi δqj = 0 j=1 i=1 dt ∂r˙i ∂q˙j ∂r˙i ∂qj ∂qj ∂ri ∂qj ∂qj m " ! # X d ∂T ∂T ∂V − + − Qj δqj = 0 j=1 dt ∂q˙j ∂qj ∂qj The variations δqj must be arbitrary and independent of one another; this equation must hold for each generalized coordinate qj individually. Removing the summation over j and 3 canceling out the common δqj factor results in Lagrange’s equations, d ∂T ! ∂T ∂V − + − Qj = 0 (21) dt ∂q˙j ∂qj ∂qj are which are applicable in any coordinate system, Cartesian or not. 5 The Lagrangian Lagrange’s equations may be expressed more compactly in terms of the Lagrangian of the energies, L(q, q˙, t) ≡ T (q, q˙, t) − V (q, t) (22) Since the potential energy V depends only on the positions, q, and not on the velocities, q˙, Lagrange’s equations may be written, d ∂L ! ∂L − − Qj = 0 (23) dt ∂q˙j ∂qj 3Lagrange, J.L., Mecanique analytique, Mm Ve Courcier, 1811. cbnd H.P. Gavin September 1, 2020 Generalized Coordinates and Lagrange’s Equations 5 6 Derivation of Hamilton’s principle from d’Alembert’s principle The variation of the potentential energy V (r) may be expressed in terms of variations of the coordinates ri n n X ∂V X δV = δri = fi δri . (24) i=1 ∂ri i=1 where fi are potential forces collocated with coordiantes ri. In Cartesian coordinates, the variation of the kinetic energy T (r˙) n X 1 2 T = mir˙i (25) i=1 2 may be expressed in terms of variations of the coordinate velocities,r ˙i n n X ∂T X δT = δr˙i = mr˙i δr˙i .