Physics simulation of a collision in 1D

Click For Summary
SUMMARY

The discussion centers on a physics simulation modeling the collision of two balls in one dimension, focusing on the coefficient of restitution, initial velocities, and masses. The user successfully implemented the simulation but faced confusion regarding the impact of initial velocities on the collision outcome. It was clarified that while changing initial velocities alters the collision point, it does not affect the final position calculations post-collision. The code provided by the user was confirmed to be functioning correctly.

PREREQUISITES
  • Understanding of classical mechanics, specifically collision theory.
  • Familiarity with programming concepts, particularly in a language suitable for simulations (e.g., Python, Java).
  • Knowledge of the coefficient of restitution and its role in elastic and inelastic collisions.
  • Basic grasp of kinematics, including velocity, mass, and time calculations.
NEXT STEPS
  • Explore advanced collision simulation techniques using physics engines like Unity or Box2D.
  • Learn about implementing different types of collisions, including elastic and inelastic, in simulations.
  • Investigate the mathematical modeling of collisions, focusing on momentum conservation and energy transfer.
  • Study the effects of varying parameters in simulations, such as friction and external forces, on collision outcomes.
USEFUL FOR

Physics students, simulation developers, and educators looking to enhance their understanding of collision dynamics and programming simulations in one-dimensional space.

stripes
Messages
262
Reaction score
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

Physics news on Phys.org
Never mind, the confusion has been settled. Nothing was wrong with the code.
 

Similar threads

  • · Replies 13 ·
Replies
13
Views
1K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
5
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K