Watch N particles bounce in a 2D box. Adjust restitution coefficient, gravity, and temperature to observe energy conservation and Maxwell-Boltzmann speed distribution formation.
The core of this simulator is the conservation of linear momentum during a collision between two particles. For a 1D collision along the line connecting their centers, the final velocities are calculated from the initial ones.
$$ v_{1f}= \frac{m_1 - e m_2}{m_1 + m_2}v_{1i}+ \frac{(1+e)m_2}{m_1 + m_2}v_{2i}$$ $$ v_{2f}= \frac{(1+e)m_1}{m_1 + m_2}v_{1i}+ \frac{m_2 - e m_1}{m_1 + m_2}v_{2i}$$Here, $m$ is mass, $v_i$ is initial velocity, $v_f$ is final velocity, and $e$ is the coefficient of restitution (0 to 1). When $e=1$, these simplify to the classic elastic collision formulas.
For many particles, the system tends toward a Maxwell-Boltzmann speed distribution, which describes the probability of finding a particle with a certain speed at a given temperature.
$$ f(v) = 4\pi \left( \frac{m}{2\pi k_B T}\right)^{3/2}v^2 e^{-mv^2/(2k_B T)} $$$f(v)$ is the probability density function, $m$ is particle mass, $k_B$ is Boltzmann's constant, $T$ is absolute temperature, and $v$ is speed. This is why, when you increase the "temperature" in the simulator, you see a wider spread of particle speeds.
Granular Flow & Industrial Processing: Simulating the movement of grains, powders, or pills in hoppers, mixers, and conveyor belts relies on particle collision models with specific restitution and friction values. Engineers use this to prevent clogging and ensure consistent flow rates in pharmaceutical or food production.
Discrete Element Method (DEM) in CAE: This is a major CAE technique where engineers simulate the behavior of bulk materials composed of thousands of individual particles. It's used to analyze the stress in a gravel pile, the mixing efficiency in a cement drum, or the abrasion on mining equipment, all by modeling individual collisions.
Planetary Ring Dynamics: Astronomers use similar collision physics to model the spectacular rings around planets like Saturn. The restitution coefficient determines how much energy is lost when ring particles (ice and rock) collide, affecting the ring's thickness and stability over millions of years.
Fluidized Bed Reactors: In chemical engineering, gases are blown through a bed of solid catalyst particles to suspend them, creating a fluid-like mixture. Predicting reactor efficiency requires modeling the collisions between catalyst particles to understand heat and mass transfer.
First, be wary of the assumption that "more particles means more realistic." While increasing the particle count does make the simulation look livelier, the computational load explodes. For instance, increasing particles from 100 to 1000 makes the collision detection calculations about 100 times heavier! In practice, the golden rule is to start with the minimum number of particles needed to capture the essence of the phenomenon you're analyzing. Next is setting the coefficient of restitution, e. While e=1 means "perfectly elastic" and e=0 means "perfectly inelastic," "perfect" conditions are almost non-existent in the real world. Even for metal spheres, e is around 0.9, and for materials like clay, it can be 0.1 or lower. After grasping the textbook theory, it's crucial to adjust this value to be more realistic. Finally, the question, "Does enabling gravity lower the temperature?" When particles fall due to gravity and cluster at the bottom, the increased collision frequency might make it seem like kinetic energy is being "lost" as heat. However, this isn't a violation of energy conservation. The primary reasons are the conversion between potential and kinetic energy of the particles, and dissipation through collisions with the container walls (where the coefficient of restitution matters again!). Get into the habit of considering the overall energy balance of the system.
The core particle collision calculations in this simulator form the foundation of a numerical analysis method called DEM (Discrete Element Method). DEM is an essential tool in powder technology. For example, it's applied to predict the mixing uniformity of active ingredients and excipients in pharmaceutical factories, or to design hopper shapes in agriculture that allow grain to flow without clogging. Furthermore, the concepts connect to particle-based simulation methods like SPH (Smoothed Particle Hydrodynamics). SPH models fluid behavior not as a continuum but as a collection of particles, and it's used widely—from simulating water splashes and metal casting processes to modeling galaxy formation in astrophysics. It's also conceptually close to Molecular Dynamics (MD) Simulation. MD calculates interactions at the atomic/molecular level, but it too relies on Newton's equations of motion and force calculations based on pair potentials, similar to the collision calculations here. In other words, the "pairwise particle collision" you learn with this tool is a common language for all numerical simulations that describe phenomena using particles, from the micro to the macro scale.
As a recommended next step, try mathematically tracking the "conservation laws." In the simulator, turn ON the "velocity vector display," note the momentum (mass × velocity vector) of two specific particles before and after a collision, and verify if their vector sum is truly conserved. Furthermore, for an elastic collision (e=1), also calculate the sum of kinetic energies ($ \frac{1}{2}m_1v_1^2 + \frac{1}{2}m_2v_2^2 $). This will help you experience firsthand how equations connect to real motion. Building on that, moving on to an introduction to statistical mechanics will deepen your understanding. Why does the Maxwell-Boltzmann distribution have that specific shape ($ v^2 \exp(-v^2) $)? The keys are the "principle of equal a priori probabilities" and the "principle of maximum entropy." Please search for these keywords online. Finally, a practical next topic is "non-spherical particles" or "introducing friction and cohesive forces." Real powders aren't spherical; they rotate due to friction and agglomerate due to static electricity, etc. How to model these effects is a major theme in DEM. Once you've mastered the basics with this tool, exploring additional forces like "particle rotational motion" or "van der Waals forces" should greatly expand your simulation horizons.