How to derive lagrangian for any classical system?

Click For Summary

Discussion Overview

The discussion revolves around deriving the Lagrangian for classical systems involving multiple particles and forces. Participants explore the general principles for determining potential and kinetic energies, particularly in systems with constraints and interactions, while considering various coordinate systems.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant inquires about the general rules for finding potential and kinetic energies for interconnected particles acted upon by forces.
  • Another participant suggests that deriving the Lagrangian often involves guessing based on the types of particles and fields involved, emphasizing that the result must be a scalar.
  • Concerns are raised about how to handle systems with multiple particles connected by rods or constraints, with a request for textbook examples and strategies for choosing generalized coordinates.
  • It is noted that for many problems, the Lagrangian can be expressed as the difference between kinetic and potential energy, with variations depending on the coordinate system used.
  • One participant describes a specific case involving constraints and proposes a method using Lagrange multipliers, detailing the formulation of a new Lagrangian that incorporates these constraints.
  • Another participant shares their experience with a specific Lagrangian and the resulting trajectory, questioning why the trajectory appears as an ellipse rather than a circle, despite applying constraints.
  • A later reply discusses the potential energy terms involved and suggests a transformation of coordinates to simplify the Lagrangian, while also providing equations of motion that lead to elliptical trajectories.
  • Discrepancies in the formulation of potential energy terms are pointed out, with one participant questioning the correctness of a previous calculation related to gravitational potential.

Areas of Agreement / Disagreement

Participants express differing views on the methods for deriving the Lagrangian, particularly regarding the treatment of constraints and the resulting equations of motion. There is no consensus on the correct approach or the implications of the derived equations.

Contextual Notes

Participants highlight limitations in their approaches, such as the need for careful consideration of initial conditions and constraints, as well as potential errors in the formulation of energy terms. The discussion remains open-ended with unresolved mathematical steps and assumptions.

Alexandre
Messages
29
Reaction score
0
Suppose I come up with a system that has certain number of particles with certain masses and are interconnected between each other in a certain way and are acted by forces which are also part of the system. What's the general rule for finding potential and kinetic energies as functions of coordinates and their derivatives? I don't expect the answer to be as simple to put it out here in comment section but maybe you could point me to some textbook or a video that explains that in full detail?
 
Physics news on Phys.org
As far as I know, there is no rule for deriving the Lagrangian. Instead, one guesses the Lagrangian based on the sort of particles and fields you expect to have.

In nonrelativistic single-particle physics, the ingredients that you have to play around with are scalars, vectors and tensors:
  1. The velocity vector [itex]\vec{v}[/itex]
  2. The electromagnetic vector potential [itex]\vec{A}[/itex]
  3. The electromagnetic scalar potential [itex]\phi[/itex]
  4. The electromagnetic field tensor, with components [itex]\vec{E}[/itex] and [itex]\vec{B}[/itex]
Then you go through the possible ways to combine these to get a scalar (a Lagrangian has to be a scalar). The simplest Lagrangian that leads to interesting dynamics is:

[itex]L = \frac{m}{2} |v|^2 - q \vec{v} \cdot \vec{A} - q \phi[/itex]

But you could certainly add more fields, or more complicated interactions between fields and particles. There is no rule other than the fact the result needs to be a scalar.
 
stevendaryl said:
But you could certainly add more fields, or more complicated interactions between fields and particles. There is no rule other than the fact the result needs to be a scalar.

Hmm interesting, thanks for the reply! I understand that now but what if there are many particles and they are not free but instead are bonded by either elastic or rigid rods to each other and/or to the ground/ceiling/wall. Are there any textbook examples for those kind of problems? Any useful tricks? How to chose generalized coordinates (cartesian, polar or any other coordinates) and so forth...
 
Well, for most such problems, the Lagrangian can just be written as [itex]KE - PE[/itex] where [itex]KE[/itex] is the kinetic energy, and [itex]PE[/itex] is the potential energy. The form of the kinetic energy changes, depending on whether you are using cartesian coordinates, or not. The potential energy for such problems usually involves two types of potential: (1) gravitational (or electrical, which is similar), (2) harmonic oscillator, the potential of a spring. It can be a little complicated to figure out the kinetic energy and potential energy for extended objects (such as rods and blocks and ropes and so forth).

Another wrinkle is that often such problems involve constraints. That is, some object is constrained to move in a circle (on tracks), or something like that. Problems with constraints are typically not solved by trying to figure out the forces or the potentials, but instead are solved using the method of Lagrange multipliers. The general idea is this: Suppose you have a problem involving coordinates [itex]x[/itex] and [itex]y[/itex] and you are constrained so that [itex]x^2 + y^2 = R^2[/itex] (so the motion is confined to a circle). Then one approach is this: If [itex]x[/itex] and [itex]y[/itex] are constrained so that [itex]F(x,y) =[/itex] a constant, then let [itex]L_0[/itex] be the lagrangian that you would have without the constraint. Then you create a new Lagrangian: [itex]L = L_0 - \lambda F(x,y)[/itex] where [itex]\lambda[/itex] is some unspecified constant. So this is like a new potential energy term to the Lagrangian, although the magnitude is unknown. If you solve the Lagrangian equations of motion using this potential energy term, you'll get equations of motion that might involve [itex]\lambda[/itex]. But then afterwards, [itex]\lambda[/itex] can be eliminated by imposing the constraint that [itex]F(x,y) =[/itex] whatever.
 
stevendaryl said:
Suppose you have a problem involving coordinates [itex]x[/itex] and [itex]y[/itex] and you are constrained so that [itex]x^2 + y^2 = R^2[/itex] (so the motion is confined to a circle). Then one approach is this: If [itex]x[/itex] and [itex]y[/itex] are constrained so that [itex]F(x,y) =[/itex] a constant, then let [itex]L_0[/itex] be the lagrangian that you would have without the constraint. Then you create a new Lagrangian: [itex]L = L_0 - \lambda F(x,y)[/itex] where [itex]\lambda[/itex] is some unspecified constant.

Well, I've actually tried solving this and added potential energy due to gravity along y axes ([itex]mgy[/itex]), Lagrangian I've got is:

[itex]L=\frac{m}{2}(ẋ²+ẏ²)-mgy-\lambda(x²+y²)[/itex]

I've solved the equations and It turns out [itex]\lambda[/itex] should equal to mass, otherwise I get Lissajous curve shaped trajectory which makes no sense. The problem I have is that the trajectory is not always a circle, most of the times it's an ellipse. Here you can check the animated solution and play around with it:

https://www.desmos.com/calculator/pm3uuxqoif
(L≡lambda)

My guess is that initial position and velocity along both axis should be somehow restricted to satisfy my confinements. The obvious restriction is that initial position should not be greater than the radius of the circle and probably initial velocity should be a cosine of initial position. But that doesn't seem to be enough, I'm still getting an ellipse and the weirder thing is that changing free fall acceleration g also has an effect on the trajectory. What am I getting wrong? Do I have to think through all of these details every time I'm using [itex]L = L_0 - \lambda F(x,y)[/itex] formula?

P.S.

One more restriction I figured out is y initial should be equal to plus or minus square root of [itex]1-x_0²[/itex] (where x0 is x component of initial position) because initial point should lay on the circle. But there should be more restrictions because I'm getting ellipses anyway. And it seems to me that this system should be equivalent to mathematical pendulum with a rigid rod but what I'm getting is far from that.
 
Last edited:
The Lagrangian you wrote down is the Lagrangian for a particle that moves in a plane and is subject to the constant gravitational force (an approximation valid close to the surface of the earth) and a harmonic-oscillator potential. The harmonic potential reads in physical terms
[tex]V_{\text{osc}}=\frac{m \omega^2}{2} (x^2+y^2).[/tex]
The total potential is
[tex]V=\frac{m \omega^2}{2} (x^2+y^2)+mg y = \frac{m \omega^2}{2} x^2 + \frac{m \omega^2}{2} \left (y+\frac{g}{2 \omega^2} \right )^2 - \frac{m g^2}{8 \omega^2}.[/tex]
Introducing the new coordinate [itex]y'=y+\frac{g}{2 \omega^2}[/itex] and dropping the irrelevant constant in the potential you get the corresponding new Lagrangian
[tex]L=\frac{m}{2} (\dot{x}^2+\dot{y}{}^2) - \frac{m \omega^2}{2} (x^2+y'{}^2).[/tex]
The equations of motion read
[tex]\ddot{x}=-\omega^2 x, \quad \ddot{y}=-\omega^2 y.[/tex]
The solutions are
[tex]x(t)=x_0 \cos(\omega t) +\frac{\dot{x}_0}{\omega} \sin(\omega t),[/tex]
[tex]y'(t)=y_0' \cos(\omega t) + \frac{\dot{y}_0'}{\omega} \sin(\omega t).[/tex]
The trajectory is an ellipse.

I do not understand your animations.
 
If that Lagrangian which I constructed has an oscillator (and I think it has) than what stevendaryl said is not quite correct:
stevendaryl said:
Suppose you have a problem involving coordinates [itex]x[/itex] and [itex]y[/itex] and you are constrained so that [itex]x^2 + y^2 = R^2[/itex] (so the motion is confined to a circle). Then one approach is this: If [itex]x[/itex] and [itex]y[/itex] are constrained so that [itex]F(x,y) =[/itex] a constant, then let [itex]L_0[/itex] be the lagrangian that you would have without the constraint. Then you create a new Lagrangian: [itex]L = L_0 - \lambda F(x,y)[/itex] where [itex]\lambda[/itex] is some unspecified constant.

I should look up Lagrange multipliers on google to understand how they work... And I think I've spotted an error here:

vanhees71 said:
[tex]V=\frac{m \omega^2}{2} (x^2+y^2)+mg y = \frac{m \omega^2}{2} x^2 + \frac{m \omega^2}{2} \left (y+\frac{g}{2 \omega^2} \right )^2 - \frac{m g^2}{8 \omega^2}.[/tex]

If you calculate backwards you get extra 2 in denominator of gravitational potential

[tex]\frac{m \omega^2}{2} x^2 + \frac{m \omega^2}{2} \left (y+\frac{g}{2 \omega^2} \right )^2 - \frac{m g^2}{8 \omega^2} = \frac{m \omega^2}{2} x^2 + \frac{m \omega^2}{2} \left (y^2+\frac{gy}{ \omega^2} + \frac{g^2}{4 \omega^4} \right ) - \frac{m g^2}{8 \omega^2}[/tex]

[tex]\frac{m \omega^2}{2} x^2 + \frac{m \omega^2}{2}y^2+\frac{mg}{2}y + \frac{mg^2}{8 \omega^2} - \frac{m g^2}{8 \omega^2} = \frac{m \omega^2}{2} \left (x^2 + y^2 \right)+\frac{mg}{2}y[/tex]
 
vanhees71 said:
The Lagrangian you wrote down is the Lagrangian for a particle that moves in a plane and is subject to the constant gravitational force (an approximation valid close to the surface of the earth) and a harmonic-oscillator potential.

That is certainly correct. However, according to http://en.wikipedia.org/wiki/Lagrangian_mechanics#Lagrange_equations_of_the_first_kind,
it is the way to incorporate the constraint [itex]x^2+y^2 = R^2[/itex] into the Lagrangian. However, I really don't see that the following two approaches are equivalent, in this example:

1. Use polar coordinates, and use the Lagrangian: [itex]1/2 m R^2 \dot{\theta}^2 - m g R sin(\theta)[/itex]
2. Use rectangular coordinates, and use the Lagrangian [itex]1/2 m (\dot{x}^2 + \dot{y}^2) - m g y - \lambda (x^2 + y^2)[/itex]

With the latter approach, [itex]\lambda[/itex] has to be chosen so that there is no motion in the radial direction.

As I said, it's not completely clear to me that these approaches give the same result.
 
I see. Then I was mistaken, because I've not seen that you want to solve a system with constraints. As you correctly say, you can solve this holonomous contraint
[tex]f(x,y)=0[/tex]
by introducing an auxiliary function in the sense of a Lagrange parameter. Varying the action wrt. this parameter should give the constraint. In our case the Lagrangian should then read
[tex]L=\frac{m}{2} (\dot{x}^2+\dot{y}^2) - m g y - \frac{\lambda}{2}(x^2+y^2-R^2).[/tex]
I introduced the additional factor 1/2 for convenience, but it's important to put the [itex]-R^2[/itex] term in.

Now the equations of motion are given by the Euler-Lagrange equations of the variational principle under independent variations of [itex]x[/itex], [itex]y[/itex], [itex]\lambda[/itex]:
[tex]m \ddot{x}=-\lambda x,[/tex]
[tex]m \ddot{y}=-\lambda y - mg,[/tex]
[tex]x^2+y^2-R^2=0.[/tex]
It's clear from this equation that the terms in the first two equation involving [itex]\lambda[/itex] provide the force centripetal necessary to fulfill the constraint, i.e., to keep the particle on a circle.

It's clear that it's way easier to solve the problem by introducing the angle. It's a bit more convenient to count it from the minimum of the potential, i.e.,
[tex]x=R \sin \varphi, \quad y=-R \cos \varphi.[/tex]
The Lagrangian then reads
[tex]L=\frac{m R^2}{2} \dot{\varphi}^2+m g R \cos \varphi.[/tex]
The term with the Lagrange parameter now is automatically eliminated, because the constraint is fulfilled by parametrizing via the introduction generalized coordinate.

The equation of motion then reads
[tex]m R^2 \ddot{\varphi}=-m g R \sin \varphi.[/tex]
This is the equation of a mathematical pendulum as it must be, and now also the animation quoted in the posting above makes sense!
 
  • #10
please lagrangian for a particle of mass m is connected between two spring of constants k1& k2
 

Similar threads

Replies
6
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 14 ·
Replies
14
Views
8K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 43 ·
2
Replies
43
Views
5K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
5
Views
2K