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!

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

  1. Jul 12, 2017 #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!!!!
  2. jcsd
  3. Jul 12, 2017 #2


    User Avatar
    Science Advisor
    Gold Member

    If you can make a numbered sequence of image files, you can use ImageJ to convert it to an animation.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted