1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Physics simulation of a collision in 1D

  1. Jun 25, 2013 #1
    1. The problem statement, all variables and given/known data

    I am designing a physics simulation that models two balls colliding along a straight line path. I can change the coefficient of restitution, the initial velocities, and their masses. THe assignment asks that we vary at least three parameters, so in my case, the three are the coefficient of rest., the masses, and the velocities.

    I have gotten the program working but my instructor keeps telling me that if the user changes the initial velocities of either ball, it only changes the point at which the collision occurs. I've made it so that the collision occurs at time zero, and yes, changing the initial velocity before time zero will change where the collision occurs, but I'm not worried about that. THe point is that I calculate the final position based on the initial velocity, initial mass, and the time. And this final position at any time will depend on whatever the initial velocity was.

    I've attached my code. If someone could let me know if there is anything wrong with it, I would appreciate it.

    2. Relevant equations


    3. The attempt at a solution

    See above

    Attached Files:

  2. jcsd
  3. Jun 25, 2013 #2
    Never mind, the confusion has been settled. Nothing was wrong with the code.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted