# Lagrangian of two equal masses attached by a spring

• DanielA
In summary, two particles of equal masses m are connected by a spring with potential energy ##U = 1/2kx^2## and are confined to move along the x-axis. The Lagrangian for the system in terms of the positions and velocities of the individual particles is ##L = \frac{1}{2}m\dot x_1^2 + \frac{1}{2}m\dot x_2^2 - \frac{1}{2}k(x_1-x_2-l)^2##. By introducing the new variables X = ##1/2(x_1 + x_2)## and x = x1 - x2 - l, the Lagrangian can be
DanielA
(note: I'm going to represent the lagrangian as simply L because I don't know how to do script L in latex.)

## Homework Statement

Two particles of equal masses m are confined to move along the x-axis and are connected by a spring with potential energy ##U = \frac{1}/{2}kx^2## (here x is the extension of the spring, ##x = (x_1-x_2-l)## where l is the unstretched length of the spring. Mass 1 remains to the right of mass 2 at all times

a) Write the lagrangian for the system in terms of the positions and velocities of the individual particles.
b)Rewrite L in terms of the new variables X = ##\frac{1}{2}(x_1 + x_2)## (the center of mass position) and x, the extension of the spring from before.
c) Solve for X(t) and x(t) and describe the motion in terms of these variables

## Homework Equations

L = T - U
Lagrange Equations:
##\frac{\partial L}{\partial X} = \frac{d}{dt}(\frac{\partial L}{\partial \dot X})##
and
##\frac{\partial L}{\partial x} = \frac{d}{dt}(\frac{\partial L}{\partial \dot x})##

## The Attempt at a Solution

I think I messed up my Lagrangian.
I said T = ##\frac{1}{2}M\dot X^2## because I can't really imagine how a variable for the stretching of a spring would have kinetic energy. After all, no mass is associated with that. Maybe I could represent KE with an "initial potential" variable ##U_i## and say ##T = U_i - U_{spring}##, but that doesn't really change anything since I would still not have a ##\dot x## dependence.
U = ##\frac{1}{2}kx^2## because the CM has no concern for the internal configuration so the CM has no potential energy term.

L = T-U = ##\frac{1}{2}M\dot X^2 - \frac{1}{2}kx^2##

Doing the Legrange equation for the X variable, I get, with M being the total mass of the system, ##M\dot x = constant## or ##x = \frac{C}{M}t## This result simply means that the center of mass will move in the x direction at a constant velocity "C/M" where C is a unknown constant. This is expected and shows that the velocity of the CM is unaffected by the orientation of the masses.

Doing the same for the x variable, I get
-kx = 0
or
x = 0.
This result surprised me, and makes me think I created the lagrangian incorrectly because the masses should be able to oscillate based off of initial conditions. After all, if it starts compressed or stretched, then it'll just oscillate back and forth and the x variable should represent that.

Last edited:
DanielA said:
(note: I'm going to represent the lagrangian as simply L because I don't know how to do script L in latex.)

## Homework Statement

Two particles of equal masses m are confined to move along the x-axis and are connected by a spring with potential energy ##U = 1/2kx^2## (here x is the extension of the spring, x = (x1-x2-l) where l is the unstretched length of the spring. Mass 1 remains to the right of mass 2 at all times

a) Write the lagrangian for the system in terms of the positions and velocities of the individual particles.
b)Rewrite L in terms of the new variables X = ##1/2(x_1 + x_2)## (the center of mass position) and x, the extension of the spring from before.
c) Solve for X(t) and x(t) and describe the motion in terms of these variables

## Homework Equations

L = T - U
Lagrange Equations:
##\frac{\partial L}{\partial X} = \frac{d}{dt}(\frac{\partial L}{\partial \dot X})##
and
##\frac{\partial L}{\partial x} = \frac{d}{dt}(\frac{\partial L}{\partial \dot x})##

## The Attempt at a Solution

I think I messed up my Lagrangian.
I said T = ##\frac{1}{2}M\dot X^2## because I can't really imagine how a variable for the stretching of a spring would have kinetic energy. .After all, no mass is associated with that.
This is not true. The centre of mass can have velocity, and kinetic energy associated with it, and the masses have velocities with respect to the centre of mass, and kinetic energy in the centre - of - mass system.
Write out the Lagrangian in terms of x1, x2, and the velocities ##\dot {x_1}## and ##\dot {x_2}## first. Then introduce the new variables X and x .
DanielA said:
Maybe I could represent KE with an "initial potential" variable ##U_i## and say ##T = U_i - U_{spring}##, but that doesn't really change anything since I would still not have a ##\dot x## dependence.
U = ##\frac{1}{2}kx^2## because the CM has no concern for the internal configuration so the CM has no potential energy term.

L = T-U = ##\frac{1}{2}M\dot X^2 - \frac{1}{2}kx^2##

Doing the Legrange equation for the X variable, I get, with M being the total mass of the system, ##M\dot x = constant## or ##x = \frac{C}{M}t## This result simply means that the center of mass will move in the x direction at a constant velocity "C/M" where C is a unknown constant. This is expected and shows that the velocity of the CM is unaffected by the orientation of the masses.

Doing the same for the x variable, I get
-kx = 0
or
x = 0.
This result surprised me, and makes me think I created the lagrangian incorrectly because the masses should be able to oscillate based off of initial conditions. After all, if it starts compressed or stretched, then it'll just oscillate back and forth and the x variable should represent that.

ehild said:
This is not true. The centre of mass can have velocity, and kinetic energy associated with it, and the masses have velocities with respect to the centre of mass, and kinetic energy in the centre - of - mass system.
Write out the Lagrangian in terms of x1, x2, and the velocities ##\dot {x_1}## and ##\dot {x_2}## first. Then introduce the new variables X and x .
Did you type that wrong? I did say the centre of mass can have velocity and kinetic energy associated with it.
Anyway, I put my laziness aside and solved the equations I needed to substitute X and x into my Lagrangian (basically I tried to short cut it, confused myself, and created extra work. Lesson learned.) ##L = \frac{1}{2}m(\dot x_1^2 + \dot x_2^2) - \frac{1}{2}k(x_1-x_2-l)^2##
I got a new Lagrangian as ##L = \frac{1}{2}(2\dot X^2 + \frac{1}{2}\dot x^2) -\frac{1}{2}kx^2## with substitutions ##x_1 = X + \frac{1}{2}x + \frac{1}{2}l, x_2 = X - \frac{1}{2}x-\frac{1}{2}l, \dot x_1 = \dot X + \dot x, \dot x_2 = \dot X - \frac{1}{2}\dot x##

My X solution did not change (since 2m = M) and my x solution did change to the oscillation I expected.
##x(t) = A\cos(\sqrt 2 \omega t - \delta)## Where, of course, A and ##\delta## are related to initial conditions. The interesting difference is the ##\sqrt 2## term. Would that make the oscillation quasiperiodic? Or does that only occur with 1 mass with different springs that have an irrational ratio between their angular frequencies?

In the end, I was right about the CM having no potential term since the substitution canceled out everything but the x as expected so that's something at least.

Last edited:
DanielA said:
Did you type that wrong? I did say the centre of mass can have velocity and kinetic energy associated with it.
No, I said that kinetic energy is associated both to the motion of the CoM and to the relative motion with respect to it. You only took the KE of the CoM into account

ehild said:
No, I said that kinetic energy is associated both to the motion of the CoM and to the relative motion with respect to it. You only took the KE of the CoM into account
I guess I misread it. Does the math seem correct though? Or at least the result seems physically sound? It seems like it is to me. Maybe I made a minor math error somewhere, but I think the forms and physical interpretations of the equations are correct now.

DanielA said:
I guess I misread it. Does the math seem correct though? Or at least the result seems physically sound? It seems like it is to me. Maybe I made a minor math error somewhere, but I think the forms and physical interpretations of the equations are correct now.
The Lagrangian is correct except of the missing mass m.
The results are also correct, the CoM moves with constant velocity and the relative displacement x=x1-x2-l performs SHM with angular frequency ##ω=\sqrt {\frac{k}{2m}}##
Why did you think the motion quasiperiodic? There is only one angular frequency, and it can be any real number. Your ω would be the angular frequency of a single mass attached to the same spring, but you have two masses, and the same force moves both of them.

ehild said:
The Lagrangian is correct except of the missing mass m.
The results are also correct, the CoM moves with constant velocity and the relative displacement x=x1-x2-l performs SHM with angular frequency ##ω=\sqrt {\frac{k}{2m}}##
Why did you think the motion quasiperiodic? There is only one angular frequency, and it can be any real number. Your ω would be the angular frequency of a single mass attached to the same spring, but you have two masses, and the same force moves both of them.

I missed that when typing it. I had the mass on my paper. I didn't really think it would be quasiperiodic, as in my study that case was only mentioned for two or more springs. I just haven't encountered a frequency like that and there were no examples of two masses coupled by a spring. I don't really have the ability to graph the motion for myself here either or I'd have checked it.

See t
DanielA said:
I missed that when typing it. I had the mass on my paper. I didn't really think it would be quasiperiodic, as in my study that case was only mentioned for two or more springs. I just haven't encountered a frequency like that and there were no examples of two masses coupled by a spring. I don't really have the ability to graph the motion for myself here either or I'd have checked it.
See the video

First, the two carts move together with the centre of mass. Next, the centre of mass is stationary, and both carts move in opposite directions, performing SHM. That means, their distantance changes periodically. In your case, the CoM moves with constant velocity, and the masses perform SHM in opposite directions with respect to it.It depends on the initial conditions.

## 1. What is the Lagrangian of two equal masses attached by a spring?

The Lagrangian of two equal masses attached by a spring is a mathematical expression that describes the energy of the system. It takes into account the kinetic and potential energies of the masses and the spring.

## 2. How is the Lagrangian derived for this system?

The Lagrangian is derived using the Lagrangian mechanics approach, which is based on the principle of least action. This principle states that the motion of a system is determined by the path that minimizes the action, which is the integral of the Lagrangian over time.

## 3. What are the variables included in the Lagrangian for this system?

The Lagrangian for two equal masses attached by a spring includes the position and velocity of each mass, as well as the spring constant and the equilibrium length of the spring. It may also include any external forces acting on the masses.

## 4. How does the Lagrangian describe the motion of the masses?

The Lagrangian provides a set of equations, known as the Lagrange equations, which describe the motion of the masses as a function of time. These equations take into account the forces acting on the masses and their initial conditions.

## 5. What are the benefits of using the Lagrangian approach for this system?

The Lagrangian approach allows for a more systematic and elegant way of describing the motion of the masses than traditional Newtonian mechanics. It also provides a general framework that can be applied to more complex systems, making it a useful tool in theoretical physics and engineering.

• Introductory Physics Homework Help
Replies
8
Views
380
• Introductory Physics Homework Help
Replies
11
Views
210
• Introductory Physics Homework Help
Replies
15
Views
370
• Introductory Physics Homework Help
Replies
9
Views
1K
• Introductory Physics Homework Help
Replies
15
Views
395
• Introductory Physics Homework Help
Replies
7
Views
278
• Introductory Physics Homework Help
Replies
3
Views
437
• Introductory Physics Homework Help
Replies
5
Views
115
• Introductory Physics Homework Help
Replies
13
Views
286
• Introductory Physics Homework Help
Replies
3
Views
219