# Motion equation for harmonic oscillator

1. Apr 11, 2012

### phys2

1. The problem statement, all variables and given/known data

A mass m is attached to a spring of stiffness k. The spring is attached to the ceiling and the mass hangs freely from the spring under the force of gravity.

(a) Derive the equation of motion for this system.
(b) Find an expression for the equilibrium position of the mass ( in terms of the equilibrium position in the absence of gravity).
(c) Show that the equation of motion is equivalent to the mass plus spring system in the absence of gravity.

2. Relevant equations

F = -kx, Euler Lagrange equation and L = T - V

3. The attempt at a solution

So for (a), I attempted to use the Lagrangian method. Taking the only degree of freedom as up and down (y direction), my velocity vector is v = dy/dx times the unit vector y hat.

So T (kinetic energy) = 0.5m (ydot)^2 where y dot = dy/dx

So now I need V and this is where I am confused, don't I have two potentials here; gravity and the spring potential? Which one should I take? I am guessing that I cannot take both?

2. Apr 11, 2012

If I understand the setup correctly, there is just a mass hanging from a spring. It shouldn't be necessary to go into the Lagrangian. You know the forces. There are only two of them on the spring. Set their sum equal to ma, and you have the equation of motion. What's the condition for equilibrium? That the forces are equal to each other. Write the equation for that and you will find the equilibrium position.

3. Apr 11, 2012

### vela

Staff Emeritus
You should be differentiating with respect to time, right?

You include both. Why wouldn't you?

4. Apr 11, 2012

### phys2

Oh yea, typo over there, it should be dy/dt.

Oh alright. I just sorta felt it might be wrong to have two potentials, no real reason.

So for V, I am just supposed to add both together? V = -1/2 kx^2 + mgx

5. Apr 11, 2012

### vela

Staff Emeritus
Yes, just add them together. Make sure you get the signs right, though. How are you defining your coordinates?

6. Apr 11, 2012

### phys2

I am taking downwards as my positive direction. It should really be V = -1/2 ky^2 + mgy since the oscillator is moving up and down the y-axis. Thanks for your help btw...

7. Apr 11, 2012

### phys2

So for part (a), I got my V = -0.5my^2 + mgy and so differentiating V with respect to y, I get dV/dy = -ky + mg

Now using the Euler Lagrange equation d/dt [dL/dydot) - dL/dy = 0, where dL/dydot = mydot and dL/dy = -ky + mg, d/dt [dL/dydot] = md2y/dt2

So now the equation of motion is md2y/dt2 - [-ky + mg] = 0 or md2y/dt2 + ky = mg. Would that be right? The thing is I have no idea whether my answers are right! Is there any way to do a check whether it actually makes sense or not?

Ok, now for (b), what I did was take the net forces (between gravity and the spring force) to be zero. So it would be -ky + mg = 0 and y = mg/k which is the equilibrium position of the mass? I don't get why they talk about the absence of gravity though? What exactly does that mean for the question?

Sorry for all the questions but I am really trying to get my head around harmonic oscillators...seems like the worst topic for me in physics.

8. Apr 12, 2012

### vela

Staff Emeritus
The correct potential is $V = \frac{1}{2} ky^2 - mgy$. You made other sign errors, which ended up canceling out, but you should go back and fix everything up.

Your equation of motion is $m\frac{d^2 y}{dt^2} = mg - ky$. Hopefully, you recognize that as Newton's 2nd law.

You might want to go back to your freshman physics book and review the harmonic oscillator.

Last edited: Apr 12, 2012
9. Apr 12, 2012

Careful, vela. You've got acceleration equal to force.

10. Apr 12, 2012

### vela

Staff Emeritus
Good catch. Fixed it. Thanks.

11. Apr 12, 2012

### phys2

Yea, I see what I have done wrong. Thanks again vela.