×
Maxwell Distribution Simulation
What is Maxwell Distribution?
The Maxwell-Boltzmann distribution describes the distribution of speeds of particles in a gas at thermal equilibrium. This simulation demonstrates how particle collisions lead to a statistical distribution of velocities, showing:
- Particle collisions: Particles repel each other when they get too close
- Velocity distribution: The histogram on the right shows how particle speeds are distributed
- Boundary interactions: Particles bounce off the walls of the container
- Gravity: Optional gravitational force can be applied
Controls:
- ⏯️ Playback: Reverse time direction, Pause/Resume, increase/decrease simulation speed (×2, ÷2)
- ⚙️ dt (Time Step): Adjust precision - Reset, ×2, ×10, ÷2, ÷10. Smaller dt = more accurate but slower
- ⚛️ Particles:
- Count: Number of particles (0-10000)
- Layout: Grid (ordered) or Random placement
- Radius: Particle size
- Zero velocity: Start particles with zero initial velocity
- 🌍 Gravity: Enable and set X/Y components (default Y=60 for downward gravity)
- ⚙️ Integration Method:
- Euler (Semi-Implicit): Fast, good for most cases, stable
- Runge-Kutta 4 (RK4): More accurate, better for complex dynamics, slower
- Verlet: Best energy conservation, ideal for long simulations, symplectic
- 💥 Collision Model:
- Elastic (Spring): Particles repel with spring-like forces, energy conserved (default)
- Inelastic (Damped): Damped spring forces, energy dissipates over time
- Hard Body: Instantaneous impulse-based collisions, perfect momentum transfer, no overlap
- 🔄 Actions: Restart simulation, Show Help
- 👋 HotHand: Click on canvas to create a particle manipulator. Click and drag to move particles, click again to release
Status Bar:
- Left side: Legend showing particle types (Normal, Under Force, HotHand)
- Right side: Real-time statistics:
- Particles: Current particle count
- Time Step: Current dt value
- Kinetic Energy: Total kinetic energy (0.5 × m × v²)
- Potential Energy: Total potential energy from particle compressions
- Total Energy: Sum of kinetic + potential energy
Histogram Panel:
- The right panel shows the Maxwell velocity distribution histogram with 20 bars
- Each bar represents a speed range (shown as "min-max") and its width indicates how many particles have speeds in that range
- Statistics below the histogram show kinetic energy, min/max speeds, mean speed, mean quadratic speed, temperature, and FPS
Tips:
- Start with default settings (256 particles, Euler, Elastic) to see the Maxwell distribution emerge
- Watch the histogram evolve as particles collide and exchange energy
- Enable gravity (Y=60) to see how it affects the velocity distribution
- Use HotHand to push particles around and observe how the distribution changes
- Try different integration methods: Euler for speed, RK4 for accuracy, Verlet for energy conservation
- Hard Body collisions work best with RK4 or Verlet integration - particles won't stick to boundaries
- Watch the energy statistics - in Elastic mode with Verlet, total energy should remain relatively constant
- Adjust dt for faster (larger dt, less accurate) or slower (smaller dt, more accurate) simulations
- Use "Zero velocity" checkbox to start particles at rest, then watch them accelerate due to collisions
- Increase particle count to see a smoother Maxwell distribution
(c) kusaku 2001 - Maxwell Distribution Simulation
No rights reserved - Modernized for modern browsers