Physics simulation of a collision in 1D

In summary, the conversation discusses a physics simulation that models two balls colliding, where the coefficient of restitution, initial velocities, and masses can be changed. The assignment requires varying at least three parameters, and the user has successfully created a working program. However, there was some confusion about the effect of changing the initial velocities on the collision point. The user explains that the final position at any time depends on the initial velocity, initial mass, and time. The code has been attached for review, but it turns out there was nothing wrong with it.
  • #1
stripes
266
0

Homework Statement



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.

Homework Equations



--

The Attempt at a Solution



See above
 

Attachments

  • Module_4.1_submission_final.nb
    38.4 KB · Views: 338
Physics news on Phys.org
  • #2
Never mind, the confusion has been settled. Nothing was wrong with the code.
 

1. What is a 1D collision?

A 1D collision is a type of collision that occurs between two objects moving in a single dimension, such as along a straight line. This means that the objects are only able to move forwards or backwards, and their motion is restricted to a single line.

2. How is a 1D collision simulated in physics?

A 1D collision is typically simulated in physics using Newton's laws of motion. These laws state that the total momentum and energy of a system remain constant during a collision, and can be used to calculate the final velocities of the objects involved.

3. What factors affect the outcome of a 1D collision?

The outcome of a 1D collision can be affected by several factors, such as the masses and velocities of the objects involved, the angle of collision, and the presence of external forces like friction or air resistance.

4. How is momentum conserved in a 1D collision?

In a 1D collision, momentum is conserved because the total momentum of the objects before and after the collision remains the same. This means that the sum of the objects' masses multiplied by their velocities is constant.

5. What is the difference between an elastic and inelastic collision in 1D?

In an elastic collision, both kinetic energy and momentum are conserved, meaning that the objects bounce off each other without any loss of energy. In an inelastic collision, some kinetic energy is lost as the objects stick together after the collision, and only momentum is conserved.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
3
Views
2K
Replies
14
Views
1K
  • Introductory Physics Homework Help
Replies
2
Views
1K
  • Mechanics
Replies
9
Views
1K
Replies
4
Views
599
  • Introductory Physics Homework Help
Replies
19
Views
951
  • Engineering and Comp Sci Homework Help
Replies
2
Views
947
  • Mechanics
Replies
9
Views
1K
Replies
17
Views
857
Back
Top