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

Click For Summary
A physics simulation has been developed to model a particle bouncing in a 2D container under the influence of gravity. The project aims to create a visual animation and eventually incorporate multiple particles and their collisions. The programmer has successfully established lists for the particle's coordinates, velocities, and time, and has generated accurate graphs using matplotlib. The current challenge is producing the animation itself. One suggested solution is to create a sequence of image files that can be converted into an animation using ImageJ.
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!
 
Technology news on Phys.org
If you can make a numbered sequence of image files, you can use ImageJ to convert it to an animation.
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
10
Views
5K
  • · Replies 6 ·
Replies
6
Views
5K
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
17K
  • · Replies 5 ·
Replies
5
Views
3K