# Energy in a vertical spring mass system

## Homework Statement

I am doing a lab in which we are to show that the energy in a spring mass system is constant throughout the oscillations.

## Homework Equations

I set y initial = 0 to be the point where the spring was in equilibrium when the mass was attached to it. At any given point the I believe the energy should be
$$E_t=\frac{1}{2}Mv^2 + \frac{1}{2}ky^2 + Mgy$$
Where y is the displacement from the equilibrium position and y+ isup

## The Attempt at a Solution

The problem I'm having is that at the top of its oscillation all 3 of the energies are positive.
On the bottom both kinetic and potential energy should be the same since both the values are square keeping them positive. However the potential energy is negative at the bottom since the displacement in negative.
So I get
$$E_{top}=\frac{1}{2}Mv^2 + \frac{1}{2}ky^2 + Mgy$$
$$E_{bottom}=\frac{1}{2}Mv^2 + \frac{1}{2}ky^2 - Mgy$$
Which makes it seem that energy is not conserved since $$E_{top}\ne E_{bottom}$$

Can anyone point me to what I am missing here?

Thanks

Last edited: