Help with Python modelling of a particle in a 2D box

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 replies · 3K views
Alex Cros
Messages
28
Reaction score
1
Hello guys, I programmed a physics simulation where a particle with some initial conditions bounces off the walls of a 2d container. The simulation also includes gravity in the y-coordinates. The aim of the project is to produce a visual animation and further on include more particles and collitions between them. So far, I have managed to create a list for each coordinate (x and y) and their velocities plus another list for time. In addition, I have plotted with the aid of matplotlib two graphs, a y-time graph and a "y velocity"-time graph. Both graphs seem to be correct and very accurate. Now I am stuck with how to produce the animation... Any ideas :P ?

-Thanks in advance!
 
on Phys.org