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

In summary, the conversation discussed a physics simulation project that involves a particle bouncing off the walls of a 2d container with gravity included. The project aims to create a visual animation and add more particles and collisions between them. The progress so far includes lists for coordinates and velocities, as well as two accurate graphs created using matplotlib. The person is now seeking ideas on how to produce the animation using ImageJ.
  • #1
Alex Cros
28
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
  • #2
If you can make a numbered sequence of image files, you can use ImageJ to convert it to an animation.
 

1. What is a 2D box?

A 2D box is a simplified model used in physics to represent a confined space in two dimensions. It is often used in quantum mechanics to study the behavior of particles within a limited area.

2. Why is Python used for modelling a particle in a 2D box?

Python is a popular programming language that is widely used in scientific research for its versatility and ease of use. It is particularly well-suited for modelling physical systems, such as a particle in a 2D box, due to its powerful libraries and modules.

3. How do I set up a Python model for a particle in a 2D box?

To set up a Python model for a particle in a 2D box, you will need to define the size and dimensions of the box, as well as the properties of the particle, such as its mass and initial position. You will also need to choose a suitable numerical method for solving the equations of motion.

4. What are the key parameters to consider in a 2D box model?

The key parameters to consider in a 2D box model include the size and dimensions of the box, the properties of the particle (such as mass and charge), the potential energy function, and the boundary conditions. It is also important to consider the time step and accuracy of the numerical method used for solving the equations of motion.

5. How can I interpret the results of a Python model for a particle in a 2D box?

The results of a Python model for a particle in a 2D box can be interpreted in terms of the position, velocity, and energy of the particle as it moves within the box. The model can also be used to study the effects of different parameters, such as the potential energy function or boundary conditions, on the behavior of the particle.

Similar threads

  • Programming and Computer Science
Replies
4
Views
1K
  • Programming and Computer Science
Replies
10
Views
3K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
3
Views
2K
  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
Replies
2
Views
16K
Replies
1
Views
794
  • Special and General Relativity
Replies
6
Views
1K
  • Programming and Computer Science
Replies
4
Views
6K
  • Advanced Physics Homework Help
Replies
7
Views
1K
Back
Top