Simple Double Mass Spring System

1. Nov 15, 2009

omegacore

1. The problem statement, all variables and given/known data
A mass m1 is held a length L above a second mass, m2, which rests on a table. There is a massless spring connecting the masses with spring constant K. You throw mass m1 upwards with velocity v0, determine the equations of position for each mass. Standard idealized conditions apply (Gravity does matter).

2. Relevant equations

y = y1 - y2
Ycm = m1 y1 + m2 y2
M= m1+m2

Derivable
y1 = Ycm + m2/M (y)
y2 = Ycm - m1/M (y)

3. The attempt at a solution

My first step was to confirm y1 and y2 as they stand. After understanding their origin, I attempted to derive the kinematic expression for the center of mass' motion. I found

Ycm = -(1/2)gt2 + (m1/M) v0 t + (m1/M) L

Next I attempted to find an expression for y (essentially the relative position vector for both masses). I did this by assuming I can fix myself in the intertial reference frame of m2 thus giving the expression for y as
y = y1 - 0

So then I said

m1 y1'' + k y1 = 0

Which gives me a solution of the form

y1 = y = A sin(wt) + B cos(wt)

With initial conditions

y = (v0/w) sin(wt) + L cos(wt)

When I use these two expressions to find the final equation my answer looks something like

y1 = -(1/2)gt2 + (m1/M)v0 t + (m1/M)L + (m2/M)[ (v0/w)sin(wt) + L cos(wt) ]

The answer in the back of the book is

y1 = -(1/2)gt2 + (m1/M)v0 t + L + (m2/M)[ (v0/w)sin(wt) ]

and

y2 = -(1/2)gt2 + (m1/M)v0 t - (m1/M)[ (v0/w)sin(wt)]

I am very close. I am just missing something stupid. If someone could point me in the right direction, or just point out something very obvious which is escaping me I am sure I can be on my way again soon enough.