These exercises are not tied to a specific programming language. Example implementations are provided under the Code tab, but the Exercises can be implemented in whatever platform you wish to use (e.g., Excel, Python, MATLAB, etc.).
## Exercise 1: Predicting thermal equilibrium
In a thermal system, we have many atoms and molecules exchanging energy with each other via mutual interactions in order to reach equilibrium. To mimic such a system, let us play a thought money-swap game among $N$ people in the room. Everyone starts with 10 gold coins. The rules are: In each turn, we randomly select a person (say Amy) to give a coin to another randomly-selected person (say Bob). If Amy has coins in her possession, she gives one to Bob. If Amy has no coins, do nothing. Repeat the turns many times. What is the wealth distribution (number of coins each person has) in the end?
- A: equally distributed (everyone has roughly the same average 10 coins)
- B: rich-poor divide (a few rich people but many poor ones)
- C: bell-shaped curve (most people in the middle)
- D: not sure (random outcome)
Make a prediction, and write it down.
##Exercise 2: Exploring route to equilibrium
Run the simulation with the provided program in the animation mode. Note that the oscillators are displayed on a square grid for easy visualization. It should not be construed as the shape of the actual solid (such as in the 2D Ising model), so neighboring cells have no special significance because all oscillators interact with each other randomly. Each cell represents the amount of energy in that oscillator.
Describe the change in the distribution from the animation. Does your prediction agree with the simulation? Why does a random-selection rule not produce a uniform distribution? (hypothesis and speculations encouraged)
##Exercise 3: Analyzing the Boltzmann distribution
Again run the simulation, this time without animation (set `animate=False` if using `boltzmann.py`), producing a plot of the distribution as a function of energy. Note the data points scatter around a straight line of the analytic result Eq. \eqref{boltz} on a semilog scale for the $y$-axis.
- From the graph, estimate the slope of the line. What is the meaning of it?
- Modify the program to change the solid size $N$ to `30x30`, `40x40`, and average energy $\bar q$ to `20`, `30`, etc. Each time obtain the slope graphically, and compare them with Eq. \eqref{teps}. What does the slope depend on, $N$, $\bar q$, or both? Explain.
- Focusing on the data error bars, what makes them smaller, $N$ or $\bar q$? Test your hypothesis by changing $N$ and $\bar q$ as above.
##Exercise 4: Relating the Boltzmann distribution and entropy
You have seen above that random interactions leads deterministically to the exponential Boltzmann distribution. Is this an accident? Is there something deeper? To answer these questions, carry out the following study.
- Compute the multiplicity $\Omega$ from Eq. (\ref{omg}) and the scaled entropy $S/k$ from Eq. (\ref{entropy}). Plot $S/k$ for $N=400$ and $Q=0$ to 500.
- Add a method to the `EinsteinSolid` class to calculate scaled entropy $S/k$ from Eq. (\eqref{spn}), call it `entropy`. Check that the method works correctly.
- Now modify the latter part of the program (plotting part, see template `iterate.py`) to calculate the energy distribution and entropy (using the `entropy` method) as a function of iterations (i.e., time). Plot both the distribution and the entropy. Describe how the energy distributions converge to the Boltzmann distribution. Simultaneously, observe how the entropy approaches the maximum in equilibrium.
- Based on above observations, how does the maximum entropy compare with the results computed above? What conclusions can you draw from the fact about entropy reaching maximum and, simultaneously, the energy distribution reaching the Boltzmann distribution?