Sub­sec­tions

### A.1 Clas­si­cal La­grangian me­chan­ics

La­grangian me­chan­ics is a way to sim­plify com­pli­cated dy­nam­i­cal prob­lems. This note gives a brief overview. For de­tails and prac­ti­cal ex­am­ples you will need to con­sult a good book on me­chan­ics.

#### A.1.1 In­tro­duc­tion

As a triv­ial ex­am­ple of how La­grangian me­chan­ics works, con­sider a sim­ple mol­e­c­u­lar dy­nam­ics sim­u­la­tion. As­sume that the forces on the par­ti­cles are given by a po­ten­tial that only de­pends on the po­si­tions of the par­ti­cles.

The dif­fer­ence be­tween the net ki­netic en­ergy and the net po­ten­tial en­ergy is called the “La­grangian.” For a sys­tem of par­ti­cles as con­sid­ered here it takes the form

where in­di­cates the par­ti­cle num­ber and the po­ten­tial of the at­trac­tions be­tween the par­ti­cles and any ex­ter­nal forces.

It is im­por­tant to note that in La­grangian dy­nam­ics, the La­grangian must math­e­mat­i­cally be treated as a func­tion of the ve­loc­i­ties and po­si­tions of the par­ti­cles. While for a given mo­tion, the po­si­tions and ve­loc­i­ties are in turn a func­tion of time, time de­riv­a­tives must be im­ple­mented through the chain rule, i.e. by means of to­tal de­riv­a­tives of the La­grangian.

The canon­i­cal mo­men­tum of par­ti­cle in the di­rec­tion, (with 1, 2, or 3 for the , , or com­po­nents re­spec­tively), is de­fined as

For the La­grangian above, this is sim­ply the nor­mal mo­men­tum of the par­ti­cle in the -​di­rec­tion.

The La­grangian equa­tions of mo­tion are

This is sim­ply New­ton’s sec­ond law in dis­guise: the left hand side is the time de­riv­a­tive of the lin­ear mo­men­tum of par­ti­cle in the -​di­rec­tion, giv­ing mass times ac­cel­er­a­tion in that di­rec­tion; the right hand side is the mi­nus the spa­tial de­riv­a­tive of the po­ten­tial, which gives the force in the di­rec­tion on par­ti­cle . Ob­vi­ously then, use of La­grangian dy­nam­ics does not help here.

#### A.1.2 Gen­er­al­ized co­or­di­nates

One place where La­grangian dy­nam­ics is very help­ful is for macro­scopic ob­jects. Con­sider for ex­am­ple the dy­nam­ics of a Fris­bee. No­body is go­ing to do a mol­e­c­u­lar dy­nam­ics com­pu­ta­tion of a Fris­bee. What you do is ap­prox­i­mate the thing as a solid body, (or more ac­cu­rately, a rigid body). The po­si­tion of every part of a solid body can be fully de­ter­mined us­ing only six pa­ra­me­ters, in­stead of the count­less po­si­tion co­or­di­nates of the in­di­vid­ual atoms. For ex­am­ple, know­ing the three po­si­tion co­or­di­nates of the cen­ter of grav­ity of the Fris­bee and three an­gles is enough to fully fix it. Or you could just choose three ref­er­ence points on the Fris­bee: giv­ing three po­si­tion co­or­di­nates for the first point, two for the sec­ond, and one for the third is an­other pos­si­ble way to fix its po­si­tion.

Such pa­ra­me­ters that fix a sys­tem are called “gen­er­al­ized co­or­di­nates.” The word gen­er­al­ized in­di­cates that they do not need to be Carte­sian co­or­di­nates; of­ten they are an­gles or dis­tances, or rel­a­tive co­or­di­nates or an­gles. The num­ber of gen­er­al­ized co­or­di­nates is called the num­ber of de­grees of free­dom. It varies with the sys­tem. A bunch of solid bod­ies mov­ing around freely will have six per solid body; but if there are link­ages be­tween them, like the bars in your car’s sus­pen­sion sys­tem, it re­duces the num­ber of de­grees of free­dom. A rigid wheel spin­ning around a fixed axis has only one de­gree of free­dom, and so does a solid pen­du­lum swing­ing around a fixed axis. At­tach a sec­ond pen­du­lum to its end, maybe not in the same plane, and the re­sult­ing com­pound pen­du­lum has two de­grees of free­dom.

If you try to de­scribe such sys­tems us­ing plain old New­ton­ian me­chan­ics, it can get ugly. For each solid body you can ap­ply that the sum of the forces must equal mass times ac­cel­er­a­tion of the cen­ter of grav­ity, and that the net mo­ment around the cen­ter of grav­ity must equal the rate of change of an­gu­lar mo­men­tum, which you then pre­sum­ably de­duce us­ing the prin­ci­pal axis sys­tem.

In­stead of mess­ing with all that com­plex vec­tor al­ge­bra, La­grangian dy­nam­ics al­lows you to deal with just a sin­gle scalar, the La­grangian. If you can merely fig­ure out the net ki­netic and po­ten­tial en­ergy of your sys­tem in terms of your gen­er­al­ized co­or­di­nates and their time de­riv­a­tives, you are in busi­ness.

If there are link­ages be­tween the mem­bers of the sys­tem, the ben­e­fits mag­nify. A brute-force New­ton­ian so­lu­tion of the three-di­men­sion­al com­pound pen­du­lum would in­volve six lin­ear mo­men­tum equa­tions and six an­gu­lar ones. Yet the thing has only two de­grees of free­dom; the an­gu­lar ori­en­ta­tions of the in­di­vid­ual pen­du­lums around their axes of ro­ta­tion. The rea­son that there are twelve equa­tions in the New­ton­ian ap­proach is that the sup­port forces and mo­ments ex­erted by the two axes add an­other 10 un­knowns. A La­grangian ap­proach al­lows you to just write two equa­tions for your two de­grees of free­dom; the sup­port forces do not ap­pear in the story. That pro­vides a great sim­pli­fi­ca­tion.

#### A.1.3 La­grangian equa­tions of mo­tion

This sec­tion de­scribes the La­grangian ap­proach to dy­nam­ics in gen­eral. As­sume that you have cho­sen suit­able gen­er­al­ized co­or­di­nates that fully de­ter­mine the state of your sys­tem. Call these gen­er­al­ized co­or­di­nates , , ...and their time de­riv­a­tives , , .... The num­ber of gen­er­al­ized co­or­di­nates is the num­ber of de­grees of free­dom in the sys­tem. A generic canon­i­cal co­or­di­nate will be in­di­cated as .

Now find the ki­netic en­ergy and the po­ten­tial en­ergy of your sys­tem in terms of these gen­er­al­ized co­or­di­nates and their time de­riv­a­tives. The dif­fer­ence is the La­grangian:

Note that the po­ten­tial en­ergy de­pends only on the po­si­tion co­or­di­nates of the sys­tem, but the ki­netic en­ergy also de­pends on how fast they change with time. Dy­nam­ics books give lots of help­ful for­mu­lae for the ki­netic en­ergy of the solid mem­bers of your sys­tem, and the po­ten­tial en­ergy of grav­ity and within springs.

The canon­i­cal mo­menta are de­fined as

 (A.1)

for each in­di­vid­ual gen­er­al­ized co­or­di­nate . The equa­tions of mo­tion are
 (A.2)

There is one such equa­tion for each gen­er­al­ized co­or­di­nate , so there are ex­actly as many equa­tions as there are de­grees of free­dom. The equa­tions are sec­ond or­der in time, be­cause the canon­i­cal mo­menta in­volve first or­der time de­riv­a­tives of the .

The terms are called gen­er­al­ized forces, and are only needed if there are forces that can­not be mod­eled by the po­ten­tial . That in­cludes any fric­tional forces that are not ig­nored. To find the gen­er­al­ized force at a given time, imag­ine that the sys­tem is dis­placed slightly at that time by chang­ing the cor­re­spond­ing gen­er­al­ized co­or­di­nate by an in­fin­i­tes­i­mal amount . Since this dis­place­ment is imag­i­nary, it is called a vir­tual dis­place­ment. Dur­ing such a dis­place­ment, each force that is not mod­elled by pro­duces a small amount of “vir­tual work.” The net vir­tual work di­vided by gives the gen­er­al­ized force . Note that fric­tion­less sup­ports nor­mally do not per­form work, be­cause there is no dis­place­ment in the di­rec­tion of the sup­port force. Also, fric­tion­less link­ages be­tween mem­bers do not per­form net work, since the forces be­tween the mem­bers are equal and op­po­site. Sim­i­larly, the in­ter­nal forces that keep a solid body rigid do not per­form work.

The bot­tom line is that nor­mally the are zero if you ig­nore fric­tion. How­ever, any col­li­sions against rigid con­straints have to be mod­eled sep­a­rately, just like in nor­mal New­ton­ian me­chan­ics. For an in­fi­nitely rigid con­straint to ab­sorb the ki­netic en­ergy of an im­pact re­quires in­fi­nite force, and would have to be an in­fi­nite spike if de­scribed nor­mally. Of course, you could in­stead con­sider de­scrib­ing the con­straint as some­what flex­i­ble, with a very high po­ten­tial en­ergy penalty for vi­o­lat­ing it. Then make sure to use an adap­tive time step in any nu­mer­i­cal in­te­gra­tion.

It may be noted that in rel­a­tivis­tic me­chan­ics, the La­grangian is not the dif­fer­ence be­tween po­ten­tial and ki­netic en­ergy. How­ever, the La­grangian equa­tions of mo­tion (A.1) and (A.2) still ap­ply.

The gen­eral con­cept that ap­plies both non­rel­a­tivis­ti­cally and rel­a­tivis­ti­cally is that of “ac­tion.” The ac­tion is de­fined as the time in­te­gral of the La­grangian:

 (A.3)

Here and are suit­ably cho­sen start­ing and end­ing times that en­close the time in­ter­val of in­ter­est. The ac­tion is un­changed by in­fin­i­tes­i­mal imag­i­nary dis­place­ments of the sys­tem. It turns out that that is all that is needed for the La­grangian equa­tions of mo­tion to ap­ply.

See {D.3.1} for a de­riva­tion of the above claims.

#### A.1.4 Hamil­ton­ian dy­nam­ics

For a sys­tem with gen­er­al­ized co­or­di­nates the La­grangian ap­proach pro­vides one equa­tion for each gen­er­al­ized co­or­di­nate . These equa­tions in­volve sec­ond or­der time de­riv­a­tives of the un­known gen­er­al­ized co­or­di­nates . How­ever, if you con­sider the time de­riv­a­tives as ad­di­tional un­knowns, you get first or­der equa­tions for these un­knowns. An ad­di­tional equa­tions are:

These are no longer triv­ial be­cause they now give the time de­riv­a­tives of the first un­knowns in terms of the sec­ond of them. This trick is of­ten needed when us­ing canned soft­ware to in­te­grate the equa­tions, be­cause canned soft­ware typ­i­cally only does sys­tems of first or­der equa­tions.

How­ever, there is a much neater way to get first or­der equa­tions in un­knowns, and it is par­tic­u­larly close to con­cepts in quan­tum me­chan­ics. De­fine the “Hamil­ton­ian” as

 (A.4)

In the right hand side ex­pres­sion, you must rewrite all the time de­riv­a­tives in terms of the canon­i­cal mo­menta

be­cause the Hamil­ton­ian must be a func­tion of the gen­er­al­ized co­or­di­nates and the canon­i­cal mo­menta only. (In case you are not able to read­ily solve for the in terms of the , things could be­come messy. But in prin­ci­ple, the equa­tions to solve are lin­ear for given val­ues of the .)

In terms of the Hamil­ton­ian, the equa­tions of mo­tion are

 (A.5)

where the , if any, are the gen­er­al­ized forces as be­fore.

If the Hamil­ton­ian does not ex­plic­itly de­pend on time and the gen­er­al­ized forces are zero, these evo­lu­tion equa­tions im­ply that the Hamil­ton­ian does not change with time at all. For such sys­tems, the Hamil­ton­ian is the con­served to­tal en­ergy of the sys­tem. In par­tic­u­lar for a non­rel­a­tivis­tic sys­tem, the Hamil­ton­ian is the sum of the ki­netic and po­ten­tial en­er­gies, pro­vided that the po­si­tion of the sys­tem only de­pends on the gen­er­al­ized co­or­di­nates and not also ex­plic­itly on time.

See {D.3.2} for a de­riva­tion of the above claims.

#### A.1.5 Fields

The pre­vi­ous sub­sec­tions dis­cussed dis­crete me­chan­i­cal ob­jects like mol­e­cules, Fris­bees, and pen­du­lums. How­ever, the La­grangian and Hamil­ton­ian for­malisms can be gen­er­al­ized to fields like the elec­tro­mag­netic field. That is mainly im­por­tant for ad­vanced physics like quan­tum field the­o­ries; these are not re­ally cov­ered in this book. But since it does ap­pear in one ad­vanced ad­den­dum, {A.22}, this sub­sec­tion will sum­ma­rize the main points.

The sim­plest clas­si­cal field is the elec­tro­sta­tic po­ten­tial . How­ever, there may be more than one po­ten­tial in a sys­tem. For ex­am­ple, in elec­tro­dy­nam­ics there are also vec­tor po­ten­tials. So the generic po­ten­tial will be in­di­cated as , where the in­dex in­di­cates what par­tic­u­lar po­ten­tial it is. A sin­gle po­ten­tial is still char­ac­ter­ized by in­fi­nitely many vari­ables: there is a value of the po­ten­tial at each po­si­tion.

In ad­di­tion there may be dis­crete vari­ables. Elec­tro­mag­net­ics would be pretty bor­ing if you would not have some charged par­ti­cles around. A generic co­or­di­nate of such a par­ti­cle will be in­di­cated as . For ex­am­ple, if there is just one charged par­ti­cle, , , and could rep­re­sent the , , and com­po­nents of the po­si­tion of the par­ti­cle. If there are more par­ti­cles, just keep in­creas­ing .

Un­der the above con­di­tions, the La­grangian will in­volve an in­te­gral:

Here is called the “La­grangian den­sity.” It is es­sen­tially a La­grangian per unit vol­ume. The in­te­gral is over all space.

The first part is as be­fore. It will de­pend on the dis­crete vari­ables and their time de­riv­a­tives:

The dot in­di­cates the time de­riv­a­tive of the vari­able.

The La­grangian den­sity will de­pend on both the fields and the dis­crete co­or­di­nates:

Here the sub­scripts on the field in­di­cate par­tial de­riv­a­tives:

In prin­ci­ple, there is no rea­son why the La­grangian could not con­tain higher or­der de­riv­a­tives, but for­tu­nately you do not see such things in quan­tum field the­o­ries.

This brings up one prac­ti­cal point. Con­sider a con­tri­bu­tion such as the po­ten­tial en­ergy of a par­ti­cle called with charge in an elec­tro­sta­tic field . As­sum­ing that the par­ti­cle is a point charge, that po­ten­tial en­ergy is where is the po­ten­tial eval­u­ated at the po­si­tion of the par­ti­cle. But po­ten­tials eval­u­ated at a point are prob­lem­atic. You would re­ally want the po­ten­tials to al­ways ap­pear in­side in­te­grals. To achieve that, you can as­sume that the par­ti­cle is not re­ally a point charge. That its charge is spread out just a lit­tle bit around the nom­i­nal po­si­tion . In that case, the po­ten­tial en­ergy takes the form:

Here is some cho­sen func­tion that is zero ex­cept within some small dis­tance of , and that in­te­grates to one. Be­cause this func­tion is zero ex­cept very close to , you can ap­prox­i­mate by and then take it out of the in­te­gral. That gives the orig­i­nal ex­pres­sion for the po­ten­tial en­ergy. But the in­te­gral is eas­ier to use in the La­grangian. Its in­te­grand be­comes part of the La­grangian den­sity. And you can al­ways take the limit at the end of the day to get point charges.

The La­grangian equa­tions for the dis­crete pa­ra­me­ters are ex­actly the same as be­fore, but of course now the La­grangian in­cludes the in­te­gral, {D.3.3}:

 (A.6)

There is one such equa­tion for each dis­crete pa­ra­me­ter , valid at any time.

The La­grangian equa­tions for the field are based on the La­grangian den­sity in­stead of the La­grangian it­self. That is why you re­ally want to have the terms in­volv­ing the field as in­te­grals. The equa­tions are

 (A.7)

There is one such equa­tion for each field , valid at any po­si­tion and time.

The canon­i­cal mo­menta are now

 (A.8)

Note that the field mo­men­tum is per unit vol­ume.

The Hamil­ton­ian is

 (A.9)

The time de­riv­a­tives and must again be ex­pressed in terms of the cor­re­spond­ing canon­i­cal mo­menta.

Hamil­ton’s equa­tions for dis­crete vari­ables are as be­fore:

 (A.10)

The equa­tions for the fields are a bit tricky. If there are no dis­crete vari­ables, there is no prob­lem. Then the Hamil­ton­ian can be writ­ten in terms of a Hamil­ton­ian den­sity as

In that case Hamil­ton’s equa­tions are

Un­for­tu­nately, if there are dis­crete pa­ra­me­ters, prod­ucts of in­te­grals will ap­pear. Then there is no Hamil­ton­ian den­sity. So the only thing you can do do is dif­fer­en­ti­ate the full Hamil­ton­ian in­stead of a Hamil­ton­ian den­sity . At the end of every dif­fer­en­ti­a­tion, you will then need to drop an and a . In par­tic­u­lar, dif­fer­en­ti­ate the Hamil­ton­ian un­til you have to start dif­fer­en­ti­at­ing in­side an in­te­gral, like, say,

At that time, make the sub­sti­tu­tion

This will pro­duce the right an­swer, al­though the left hand side above is math­e­mat­i­cally com­plete non­sense.

See {D.3.3} for a jus­ti­fi­ca­tion of this pro­ce­dure and the other claims in this sub­sec­tion.