Lagrangian & Hamiltonian mechanics Proof of the Beltrami Identity Newton’s Second Law for a single particle
1 2 2 2 Rather than starting from the traditional beginnings dL L L L L m x y z V(,,) x y z xx Chain Rule 2 of Conservation of Energy, Conservation of momentum ii dt ti xii x zˆ rx xˆ yy ˆ z zˆ or Newton’s Second Law, the Lagrangian (and related d L L Euler-Lagrange Equation Hamiltonian) formulations of dynamics offer a more d L L d L dx L dx L dt dt x x L x,, x t ii systematic solution mechanism for mechanical dt x x dt x dt x dt t dt ii d V V yˆ systems, especially those with multiple variables. mx mx dL L d L L dt xi x xxii ˆ xyzˆ ˆ ˆ 1 In Classical Mechanics, the Lagrangian L is defined as: dt t dt x x d V V x i ii my my dt y y LTV dL L d L i xi Product rule d V V dt ti dt xi mz mz Kinetic Potential dt zi z energy energy d L L Lx i mVr dti xi t d L L LL ˆ ˆ ˆ The Euler-Lagrange equation i.e. using rx x y y z z 0 Lx i constant yields the equations of motion Cartesian dt xii x txi i VVV basis vectors V xyzˆ ˆ ˆ x y z Leonhard Euler xi Position or angular coordinate 1707-1783 dx Conservation of Energy for a single particle i.e. we associate a force with a gradient x i Rate of change of position or of potential energy, which is entirely i angle with time t 1 2 dt L2 mv V(,,) x y z consistent with any conservative field such as gravity or electromagnetism. L1 m x2 y 2 z 2 V(,,) x y z The idea is that the Euer-Lagrange equation 2 extremizes* a quantity called the Action L Hamiltonians & total energy Beltrami Identity L xi k i x t2 i From the penultimate line of the proof S Lxx 1, 2 ,... xxxNN , 1 , 2 ,... xtdt , t of the Beltrami Identity: 1 LLL Joseph-Louis k L x y z x y z d L L Lagrange 1736-1813 In many problems the Lagrangian is independent Lxi 2 2 2 2 1 dti x t of time, so the Euler-Lagrange equation reduces k2 m x y z V xmx ymy zmz i to the Beltrami Identity. This is often the best starting 2 point for problem solving in Lagrangian mechanics. k 1 m x2 y 2 z 2 V Define the Hamiltonian 2 ‘Canonical 2 H p x L 1 2 2 2 ii monentum’ L E 2 m x y z V() E k i If 0 this means L t LHpi i.e. we can associate energy with the (negative) x L pxii i Lxconstant of the constant in the Beltrami Identity xpii i x i i dH L So we can associate the Hamiltonian with the total dt t energy. H is constant if L is Sir William Rowan time invariant. Hamilton 1805–1865
*i.e. yields either a maximum or minimum value Mathematics topic handout – Mechanics – Lagrangian and Hamiltonian dynamics Dr Andrew French. www.eclecticon.info PAGE 1 Example #1: dynamics of a Hookean spring From above: An ellipse defined in plane 2 polar coordinates ˆ L11 mx22 kx 22JJJ θ 22 rr rˆ x is the spring extension m mr2 m 2 r 3 rd d L L k is the spring constant 1 2 2 GM dA 2 r d dt x x rr r2 Semi- mx kx i.e. Hooke’s Law, SHM... minor 2 2 is the eccentricity r ba 1- J GM axis r 2 3 2 of the ellipse This is perhaps a bit contrived to start with the m r r 2b quadratic Elastic Potential Energy expression! b2 .. But at least this shows consistency with the 1 If orbits are elliptical (Kepler’s First Law) 2 a(1 ) Newtonian method. a aa1122 r cos 1 Example #2: Kepler’s Laws for a 1 cos r planet orbiting a massive star (i.e. Semi-major axis 2 2a no movement of star due to gravitational a 1 sin r2 sin r attraction to planet, only vice versa) 1 cos 2 a 1 2 dA122 1 J 1 2 2 2 2 2r 2 2 G1 a vrr rθˆ v r r Plane polar J sin dt m coordinates r 2 GMm ma 1 1 2 2 2 So equal areas are swept out in equal times, which is L2 m r r Note sign! r 2 GPE is negative JJJcos a 1 Kepler’s Second Law. so –V becomes d L L r 22 1 2 positive ma11 r ma mr dt r r Since equal areas are swept out in equal times, the orbital period is the area of the ellipse divided by the rate GMm 2 of area sweep. This proves Kepler’s Third Law. mr mr 2 2 r J22 GMa 1 J 1 GM Confirm Newton II, with 2 3 2 2 2 2 rr 2 m r r r m a1 r 22 2 correct formula for ab a 1 Ellipse area is r centripetal acceleration PP J2 GM J 2 J 2 dA 1 GM1 2 a ab d L L 2 m2 r 3 r 2 m 2 r 3 m2ar1 22 dt dt 2 234 d 2 22 Pa mr 0 Conservation of angular momentum J GMm a 1 GM dt mr2 J So elliptical orbits satisfy the laws of Kepler’s Third Law: The square of the orbital motion, and yield an expression for total period of a planet is directly proportional to the The last result is the first glimpse of the utility of angular momentum J, which is constant. cube of the semi-major axis of its orbit. the Lagrangian method. The conservation of angular momentum comes straight from the fact that the Lagrangian has no explicit dependence on angle, since KE doesn’t, and Newton’s Law of Gravitation acts purely radially.
Mathematics topic handout – Mechanics – Lagrangian and Hamiltonian dynamics Dr Andrew French. www.eclecticon.info PAGE 2 d L L Applying the Euler-Lagrange equation Example #3: Moving plane* for mass m dt x22 x h x g d 2 mx2 m x 1 x 2 tan mg tan dt d 2 mx2 m x 1 x 2 tan mg tan
d Hence: Mx12 mx 0 Mx mx 0 Which is a statement of conservation dt 12 M of linear momentum in the horizontal Consider a rectangular block of mass m xx21 direction i.e. where there is no m sliding frictionlessly from the top net external force (there is gravity, of a planar wedge of mass M. This also M 2 but this acts downwards) Mx11 mx1 tan mg tan slides frictionlessly on a horizontal surface. m 22 Assuming the block has not reached the Mx1 mx 1tan Mx 1 tan mg tan horizontal surface, after t seconds the horizontal x M1 tan22 m tan mg tan separation is: 1 2 M sin sin 1 sin x m mg 2 x x12 x 1 22 1 tan 2 , tan cos cos cos cos cos h x x tan vertical drop of block 12 2 x1 M msin mg sin cos The Lagrangian for the system is: LTV mg sin cosg sin cos x1 22 2 2 2 M 1 1 1 Mmsinm sin T2 Mx12 2 mx 2 mh Mgsin cos g sin cos Kinetic energy x 2 22m V mgh Mmsin 1M sin Gravitational potential energy L 1 Mx2 1 mx 2 1 m x x2 tan 2 mg x x tan i.e. constant acceleration motion for both 21 2 2 2 1 2 1 2 block and wedge. If system starts from rest: Limiting case when Mm
g sin cos g sin cos x1 0 x2 gt sin cos d L L Applying the Euler-Lagrange equation xt1 2 xt2 2 M m 1 2 m sin 1 sin x 0 for mass M 1 x2 2 gt sin cos dt x11 x M g sin cos g sin cos xt 1 2 xt 1 2 d 2 1 2 M 2 2 2 m 2 Mx1 m x 1 x 2 tan mg tan m sin 1 M sin dt 2 .. which is consistent with no horizontal movement when the angle tends to 90o. Mx11 m x x2 tan mg tan i.e. in this case the block simply falls vertically!
* Morin, Classical Mechanics problem 6.1 Mathematics topic handout – Mechanics – Lagrangian and Hamiltonian dynamics Dr Andrew French. www.eclecticon.info PAGE 3 Example #4: Hoop & Pulley* Now since the string is inextensible: sin sin eq sin sin cos cos sin h R h h0 R eq eq V MgR MgRcos mgh mgR sin m cos g 0 M eq cos22 sin 1 m2 sin m 1 2 M M 2 cos 1 sin The Lagrangian for the system is therefore: Positive root O m 1 22 sin MM Mm in range of germane h LTV m 1 to this system 1 22 sin MM (M m )( M m ) L2 m M R MgRcos MgR mgh0 mgR
Hence: Applying the Euler-Lagrange equation: Mass M is fixed to a circular hoop g m M sin d L L of negligible mass, which can freely rotate R m M about fixed origin O. Between M and m dt is a light inextensible string, which runs over 1 22 m Mm 1 ( M m )( M m ) 2 M m R MgRcos mgR MgR mgh0 g MM a light and frictionless pulley. When the d R m M system is disturbed by a small amount from M m R2 MgRsin mgR equilibrium it undergoes small oscillations dt g m m ( M m )( M m ) of frequency f. 2 M m R MgRsin mgR R m M The speed of mass M (which is g m M sin g M m tangential to the hoop) is: R m M R M m vR Equilibrium occurs when: Since the string is inextensible, This is the equation of simple harmonic motion 2 this must also be the speed of 0 where frequency: So as M becomes much larger the vertically hanging mass m. f mM sin 0 than m, mass M will tend to 2 the bottom of the hoop 1 m The total kinetic energy is therefore: sin M i.e. = 0 which makes sense! Hence frequency of small oscillations is: 112 2 2 2 T22 MR mR Let us consider small angle deviations 1 4 from this point: 1 g M m f 2 The total (gravitational) potential energy R M m of the system is: eq , eq , 1 sin m V Mg R Rcos mgh eq M
* Morin, Classical Mechanics problem 6.10 Mathematics topic handout – Mechanics – Lagrangian and Hamiltonian dynamics Dr Andrew French. www.eclecticon.info PAGE 4 Now consider small angle approximations: Example #5: Pendulum with free support* The total kinetic energy of the system is therefore: 1 2 sin , cos 1 2 112 2 2 M T22 Mx m xmm y 2 X g 112 2 2 2 2 2 2 2 M m x mlsin ml cos 0 T22 Mx m x 2 xl cos l cos l sin M m x ml22 ml 10 1 T11 Mx2 m x 2 2 xl cos l 2 2 2 l 22 221 M m x ml ml 2 ml 0 m The potential energy of the system (taking zero to be M m x ml 0 x at the block height) is: V mgl cos l xcos g sin 0 Hence: A mass m swings from the central underside X of rectangular block of mass l x g 0 Hence the Lagrangian for the system is: M m g l ml 0 M. The mass m is connected to X via a x g l light inextensible string of length l. LTV l M m m g M m 112 2 2 2 g L22 Mx m x 2 xl cos l mgl cos m Block M is free to slide horizontally without 1 M friction. l
Applying the Euler-Lagrange equation: 2 SHM: f cos t It is assumed oscillations of the system are 2 0 small and the amplitude is such that M d L L does not collide with the side walls. g 1 g 1 dt x x f 1 1 m 2 1 m 2 2 l M l M d Let x be the displacement of block M Mx mx ml cos 0 from the centre point between the side dt x g l General solution is CF+ PI walls. The horizontal position of the 2 M m x mlsin ml cos 0 m CF is solution to: pendulum is therefore: x g g 1 M x0 x At B x m gcos t CF xm x l sin M 0 d L L x x l cos m PI is of the dt xPI Ccos t form: 2 m The vertical displacement of the d 2 Ccos t g cos t mxlcos ml mxl sin mgl sin M 0 pendulum is: dt m M 00gmm l1 ml 2 Cg 2 MM0 1 ylm cos mxlcos mxl sin ml mxl sin mgl sin g m M l xcos g sin 0 ylm sin Sensible initial ml x( t ) At B 0 cos t conditions mM 0,B 0
(tt ) 0 cos xA(0)
* Morin, Classical Mechanics problem 6.14 Mathematics topic handout – Mechanics – Lagrangian and Hamiltonian dynamics Dr Andrew French. www.eclecticon.info PAGE 5 Example #6: Two masses, one swinging* Applying the Euler-Lagrange equation: Hence:
d L L cos t g dt r r sin t d 2mr mr2 mg mg cos h dt 1122 112 r24 r g r 22 r g cos 1 112 2 2 2 2 r 24 r sin t g cos t g r 11 r2sin 2 t g 2 cos 2 t Two masses are connected via d L L 24 r light and inextensible string which dt 112 2 2 run over light and frictionless pulleys. r 22 gsin t cos t d 2 mr mgr sin r 11 g21 cos 2 t cos 2 t Since in general the left mass may move, dt 22 we must assume the most general g r 1 g221 3 cos t expression ( in polar coordinates r, ) sin 22 for the speed of the right mass. r 2 1 The average value of the harmonic term is: cos t 2 Since the string is inextensible, the Let us assume a small angle rate of increase of r is also the upward 1223 1 1 approximation ** : Hence: r2 g1 2 2 8 g velocity of the left mass. g hr r So we might expect the amplitude of the pendulum swing to slowly increase and therefore the left mass to slowly rise. h() t h0 r 12 1 1 2 1 2 1 2 r2 r 2 g11 2 2 4 g Hence total kinetic energy is:
112 2 2 2 Let us also assume r changes slowly T22 mr m r r compared to the pendulum speed. Total potential energy is (taking The angular equation is therefore SHM zero to be at the level of the pulley) (i.e. r is essentially time invariant compared to ). V mgh mgr cos is the angular V mg h0 r r cos cos t amplitude g of the SHM Hence the Lagrangian for the system is: r LTV
1 2 2 2 L2 m2 r r mg h0 r r cos 2o r001m, g 9.81ms , 5 , (0) 0, t 0.01s Verlet solver ** sin , cos 1 1 2 i.e. constant acceleration 2 motion between fixed time steps
* Morin, Classical Mechanics problem 6.4 Mathematics topic handout – Mechanics – Lagrangian and Hamiltonian dynamics Dr Andrew French. www.eclecticon.info PAGE 6 g Example #7: Bead on a rotating hoop* Applying the Euler-Lagrange equation: 1 Let us also consider small oscillations about: 0 cos 2 R g d L L , 1, cos 002 g dt R d mR2 mR 2 2 sin cos mgR sin dt sin sin 0 sin 0 cos cos 0 sin sin 0 cos 0
g 2 cos cos cos cos sin sin cos sin cos sin 0 0 0 0 0 R m
sin cos sin 0 cos 0 cos 0 sin 0 So equilibrium when: 2 2 2 sin cos sin 0 cos 0 cos 0 sin 0 sin 0 cos 0 A bead of mass m is free to slide g 2 2 cos0 0 sin cos sin cos 1 2sin frictionlessly on a circular hoop R 0 0 0 of radius R. The hoop itself rotates at constant angular speed 1 g 0 cos 2 about a vertical axis. R g 2 cos sin sin0 0 R
The kinetic energy of the bead is: 0 0, g 2 2 2 (noting motion is constrained to the circle sin 0 cos 0 sin 0 cos 0 1 2sin 0 R in the plane, and also circular into the plane) The ‘bead at the top of the hoop’ g g2 g 2 2 2 is clearly an unstable equilibrium. 11 2 sin 0 22 sin 0 1 2sin 0 T22 m R m Rsin RRR Using a small angle perturbation from 1 2 2 2 2 g 2 T2 mR sin the bottom of the hoop: 2 2 2 2 2 22 sin 00 sin R Taking zero GPE to be the lowest point on the g 2 g 2 hoop, the potential energy of the bead is: R 2 2 2 2 2 2 22 cos 00 sin R V mgR(1 cos ) 22 which is SHM of frequency gg 2 2 2 2 2 2 4 sin 0 Hence the Lagrangian for the system is: RR 1 g 2 f 2 22 LTV R 2 2 2gg 2 sin 0 1 2 4 2 2 RR 1 2 2 2 2 L2 mR sin mgR cos mgR which is SHM of frequency:
g 2 f 1 2 (t ) cos 2 ft 2 R22 0
* Morin, Classical Mechanics problem 6.11 Mathematics topic handout – Mechanics – Lagrangian and Hamiltonian dynamics Dr Andrew French. www.eclecticon.info PAGE 7 Example #8: Small oscillations of whirly Applying the Euler-Lagrange equation: Consider small perturbation in r about this value: bungs on a table* J 2 d L L r3 0 g dt mMg
d rr0 ,1 mr2 0 dt mr2 J i.e. conservation of J 2 angular momentum J m M r Mg mr3 J 2 Mass m can slide without friction m M 3 Mg on a horizontal table. It is connected d L L mr3 1 0 r0 via a light an inextensible string of length dt r r J2 mMg l to mass M through a hole in the table. 112 2 2 3 22m M r mr Mgl Mgr m M 2 1 r Mg It is assumed that M only moves vertically. mJ 0 d 2 Mg Mg m M r mr Mg 3 1 r The kinetic energy of the system is: dt m M0 m M m M r mr 2 Mg 112 2 2 2 3Mg T22 m r r Mr m M r0 J Note since the string is inextensible, the 2 which is SHM of frequency: downward velocity of M is r mr J 2 m M r mr Mg 3Mg 24 f 1 Taking zero GPE to be the level of the table mr 2 r( t ) r00 cos 2 ft m M r0 J 2 V Mg() l r m M r Mg mr3
Hence the Lagrangian for the system is: Equilibrium when: LTV J 2 112 2 2 2 3 Mg 0 L22 m r r Mr Mgl Mgr mr 1 112 2 2 2 3 L22 m M r mr Mgl Mgr J r0 mMg
i.e. circular motion of mass m
* Morin, Classical Mechanics pp 240-241 Mathematics topic handout – Mechanics – Lagrangian and Hamiltonian dynamics Dr Andrew French. www.eclecticon.info PAGE 8