|
|
||
|
This tutorial visualizes entropy through a two-chamber particle simulation. Instead of the "disorder" cliché, we focus on statistical mechanics: the system has a macrostate (how many particles are on the left vs right) and many possible microstates (which specific particles are where). Entropy measures how many ways that macrostate can be realized.
Mathematical foundation1. Macrostate vs microstate Suppose N particles are distributed with nL on the left and nR = N − nL on the right. The number of microstates (distinguishable arrangements) for that distribution is W = N! / (nL! nR!). 2. Boltzmann entropy S = kB ln W, where kB is Boltzmann's constant. In the simulation we use natural units (kB = 1) and display ln W, which is proportional to S. Maximum entropy occurs when nL ≈ nR (even distribution), because that macrostate has the largest number of microstates. Minimum entropy occurs when all particles are on one side (W = 1, ln W = 0). 3. Spontaneous mixing When you "open" the barrier, particles mix. The system tends toward the most probable macrostate (even split), not because of a force, but because there are overwhelmingly more microstates for that outcome. The entropy graph rises over time toward the maximum. Two-Chamber Lab
1
Cyan: 100 L / 0 R Magenta: 0 L / 100 R Mixing ln(W): 0 W ≈ — State: Minimum entropy (ordered) Entropy S ∝ ln(W) over time
Cyan and Magenta = particle identity (fixed). Barrier is always open; click Run to see diffusion—both colors mix in both chambers (visual proof of increasing entropy).
UsageReset to Low Entropy: Puts all 200 particles in the lowest-entropy layout: 100 cyan in the first column (left), 100 magenta in the last column (right). ln(W) starts near its minimum; click Run to see diffusion and entropy rise. Heatmap / Grid: Heatmap: On draws a cyan density overlay (brighter = more particles per cell). Grid: On shows the 8×10 cell grid used for spatial entropy. Both help connect particle motion to the ln(W) value. Stats panel: Cyan L/R and Magenta L/R are counts on each side of the midline. ln(W) is computed from the 80-cell grid (multinomial). "Maximum entropy" when well mixed; "Minimum entropy" when ordered in few cells. History graph: Plots ln(W) over time. Use the Y auto-scale icon (top-right of the plot) to toggle fixed scale (0–max) or auto scale (fit to current data). Reverse Velocities (Time Flip): Flips every particle's velocity (Loschmidt's / reversibility paradox). Run until fully mixed (high entropy), then click Reverse—particles briefly un-mix toward the walls and the entropy graph dips (a "V" shape) before chaos from rounding takes over again. Lab ideas1. Reset to low entropy, then click Run. Watch the entropy curve rise and the state label switch to "Maximum entropy" when the split is roughly even (100–100). 2. With the simulation running, watch fluctuations: Cyan and Magenta L/R counts jitter; ln(W) stays near the maximum but wobbles slightly. 3. After mixing, the two sides stay mixed (you don't get "all left" again spontaneously)—consistent with the second law: entropy does not decrease in an isolated system. LabsStructured exercises using the simulation. Follow the steps and observe the stats and graph. Lab 1: Minimum entropy and expansion
Lab 2: Step-by-step entropy change
Lab 3: Density and macrostate
Lab 4: Y-axis scale on the history graph
Lab 5: Reversibility paradox (Loschmidt)
|
||