This is a classic introductory physics problem. Basically, you have a cart on a frictionless track (call this m 1) with a string that runs over a pulley to another mass hanging below (call this m 2).
I'm reading Randall Munroe's book How To: Absurd Scientific Advice for Common Real-World Problems. I probably don't have to tell you this, but it's awesome (as is everything from Randall Munroe, the ...