Home   Computer Graphics   Share This Page 
A threedimensional particle physics playground
— P. Lutus — Message Page —
Copyright © 2021, P. Lutus
Most recent update:
(doubleclick any word to see its definition)
Adjust:

Virtual 10 x 10 x 10 meter cube 
This is an experimental computer graphics application that allows you to explore the behavior of particles in a container. The container's properties may be adjusted — its walls may be perfectly elastic, losing no energy, or they may lose a specified amount of energy on each bounce, using the "Energy Restitution" entry.
The "Particle Count" entry selects the number of simulated particles. More than about 50 makes it difficult to figure out what's going on. Larger numbers won't hurt your computer (but maybe your eyes).
The "Particle Radius" entry chooses the particle size, from tiny to beachball size.
The "Maximum Velocity" entry chooses the highest velocity randomly assigned to each particle. When the simulator is restarted, a given particle's velocity is randomly generated to lie between +n and n using this entry's value, in each of the X, Y and Z dimensions.
As explained above, the "Energy Restitution" entry adjusts the elasticity of the container's walls. An entry of 1 makes the container perfectly elastic, meaning no particle energy is lost during a bounce. An entry of 0 causes the particle's energy to be entirely lost in the dimension perpendicular to the wall's orientation. Remember that there are three dimensions and three particle energies — X (left/right), Y (up/down) and Z (toward/away). Each of these dimensions has an independent energy.
More detail at this link: Wikipedia: Coefficient of Restitution
The "G Acceleration" entry can be adjusted to have Earth surface acceleration (9.8 m/s^{2}) or any other value including zero. The zeroG case simulates being in orbit or far away in space with no gravitational forces.
The "Frame Rate FPS" entry adjusts the display frame rate. This control's effectiveness relies on the computer's speed, but with a fast machine, frame rates above 120 FPS are possible.
The "Compute Cycles" entry is a bit more difficult to describe. The simulator numerically solves a differential equation by iteratively processing the usual suspects (position, velocity and acceleration) for a slice of simulator time called "deltat". The simulator's accuracy improves with smaller deltat values, so to improve the model's accuracy while keeping the display synchronized with wall time, the simulator repeats the differential solution "Compute cycles" times between outcomes that are displayed.
To maintain realism, the differential solver's time slice (deltat) is equal to 1/(framerate * computecycles), and the smaller the deltat value, the more accurate the result. So the most accurate simulation is produced by choosing a high frame rate as well as a high computecycles entry.
To test the simulator's accuracy, enter a restitution value of 1, normal Earth gravity (i.e. 9.8 m/s^{2}), and make relatively large frame rate and compute cycle entries. The simulation's accuracy is indicated by a consistent total energy with little variation over time.
Now for the best part of this application IMHO — the "Anaglyphic" checkbox. Click this box and grab some anaglyphic (red/cyan) glasses to see the particle box in 3D. Once you see this application in 3D, you won't want to return to boring, flat computerdisplay reality.
You can also click the particle box display directly to switch between 2D and 3D displays.
The "Total Energy" display shows the current sum of particle energy for all particles. If you choose an "Energy Restitution" value of 1, this number should not change significantly, because a perfectly elastic bounce loses no energy.
The "Restart" button reassigns velocities to all the configured particles and restarts the simulation, but without changing any settings.
The "Reset to Default Values" button resets the simulator to its initial default settings — it reverts any entries you may have made and restarts the simulator with its default values.
I hope you enjoy this application!
Home   Computer Graphics   Share This Page 