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

Click For Summary
SUMMARY

The forum discussion centers on a Python-based physics simulation of a particle bouncing in a 2D box, incorporating gravity in the y-coordinates. The user has successfully implemented lists for x and y coordinates, velocities, and time, and has generated accurate graphs using Matplotlib. The current challenge is creating an animation of the simulation. A suggested solution is to generate a sequence of image files and utilize ImageJ for conversion into an animation.

PREREQUISITES
  • Proficiency in Python programming
  • Understanding of physics concepts related to motion and gravity
  • Familiarity with Matplotlib for data visualization
  • Knowledge of ImageJ for image processing and animation creation
NEXT STEPS
  • Explore the Matplotlib animation module for real-time animation creation
  • Learn how to generate and save image sequences in Python
  • Investigate advanced features of ImageJ for optimizing animations
  • Research collision detection algorithms for simulating multiple particles
USEFUL FOR

Physics simulation developers, Python programmers, data visualization enthusiasts, and anyone interested in creating animations of physical systems.

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.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · 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