# Lagrangian Dynamics: Potential Energy formulation with spring and gra

1. Sep 16, 2014

### swraman

Hi,

I have a conceptual question regarding Lagrangian dynamics. It has to do with the potential energy formulation. My instructor today mentioned something in class that does not make much sense to me.

Here is he most basic example that illustrates my confusion:

Take a simple 1dof system of a spring and a mass:
A mass M on top of a vertical massless spring (stiffness K), constrained to only move up and down (with and against gravity). I will call the mass's upward displacement from the neutral position +x.

Goal: determine the equations of motion using Hamiltonian or Lagrangian methods.

The kinetic energy is simple:
$$KE=.5m(v)^2$$

v being the time derivative of x.

The Potential energy is where Im confused. Would it be:

PE = $$.5Kx^2$$

OR

$$PE = .5Kx^2 + m*g*x$$

I would guess the latter, but apparently I am wrong.

This would depend on how you define the "neutral" position. The first choice would be that the neutral position is where the gravitational force exactly cancels that of the spring, i.e., the stable point of the system. The second choice would just correspond to a different choice of coordinates. The two choices are related by a coordinate transformation $x \to x + a$ along with an overall shift of the potential energy.
If $V = kx^2/2$ and we do the coordinate transformation, then
$$V \to k(x+a)^2/2 = kx^2/2 + kax + k a^2/2.$$
Subtracting the constant $ka^2/2$ and letting $a = mg/k$, we obtain the second option. This corresponds to a coordinate system where the spring is providing zero force at $x = 0$, i.e., the spring is in a position that would be the stationary point if gravity was not present.