---
title: Problem set 11
heading: "Problem set 11: computing thermal physics"
eyebrow: B11 · Problem set 11
type: problems
---

::: hook
These problems use the course's labs: counting and ensembles (5), radiation and noise (13), quantum gases (25), transport (45) and the thermal lab (49). Each asks what a computation needs or what it should give: stability limits, iteration counts, series truncations, sample sizes, and the exact values a program is checked against.
:::

::: pool
pick: 12

::: check
kind: parts
given: D = 1 | 10; x = 0.01 | 0.05; t = 1 | 10

## An explicit finite-difference diffusion run uses D = {D} and spacing {x}, to reach time {t} (consistent units).

::: part
answer: 0.5*x^2/D
tolerance: 0.5%

### What's the largest stable time step?

::: misses
- [x^2/D] Stability needs $r = \frac{D\Delta t}{\Delta x^2} \le \frac12$.
- [any] $\Delta t = \frac{\Delta x^2}{2D}$.
:::
:::

::: part
answer: t/(0.4*x^2/D)
tolerance: 0.5%

### How many steps does it take with r = 0.4?

::: misses
- [any] $\frac{t}{\Delta t}$ with $\Delta t = \frac{0.4\Delta x^2}{D}$.
:::
:::
:::

::: check
kind: parts
given: d = 1 | 2 | 3

## An explicit diffusion solver in {d} dimensions has its grid spacing halved.

::: part
answer: 2^d
tolerance: 0.5%

### By what factor does the number of grid points grow?

::: misses
- [any] Twice as many points along each of d axes.
:::
:::

::: part
answer: 2^(d + 2)
tolerance: 0.5%

### By what factor does the total work grow?

::: misses
- [2^d] The stable time step also shrinks fourfold.
- [any] Points times steps: $2^d \times 4$.
:::
:::
:::

::: check
kind: parts
given: N = 10 | 30 | 100

## N = {N} spins, half of them up.

::: part
answer: N*ln(2) - 0.5*ln(pi*N/2)
tolerance: 0.5%

### What's $\ln\binom{N}{N/2}$, from Stirling's formula?

::: misses
- [N*ln(2)] That's the log of all $2^N$ states; the half-up macrostate has a fraction $\sqrt{2/\pi N}$ of them.
- [any] $N\ln2 - \frac12\ln\frac{\pi N}{2}$.
:::
:::

::: part
answer: (N*ln(2) - 0.5*ln(pi*N/2))/ln(10)
tolerance: 0.5%

### How many decimal digits does that multiplicity have, roughly (its log₁₀)?

::: misses
- [any] Divide the natural log by ln 10.
:::
:::
:::

::: check
kind: parts
given: e = 0.001 | 0.000001 | 0.000000001

## A maximum is bracketed in an interval of width 1, and must be found to {e}.

::: part
answer: ln(e)/ln(0.618034)
tolerance: 0.5%

### How many golden-section steps does that take?

::: misses
- [any] Each step shrinks the bracket by 0.618.
:::
:::

::: part
answer: ln(1/e)/ln(2)
tolerance: 0.5%

### How many bisection steps would a root of the same precision take?

::: misses
- [any] Bisection halves the bracket each step.
:::
:::
:::

::: check
given: x = 4 | 4.5 | 6
answer: x - (5*(1 - exp(-x)) - x)/(5*exp(-x) - 1)
tolerance: 0.1%

## Newton's method solves $5(1 - e^{-x}) = x$ for Wien's constant. Starting from x = {x}, where does the first step land?

::: right
Right. One step already lands within a few thousandths of 4.9651.
:::

::: misses
- [any] $x - \frac{f(x)}{f'(x)}$ with $f = 5(1 - e^{-x}) - x$.
:::
:::

::: check
kind: parts
given: x = 2 | 3.5 | 5

## The series for the fraction of blackbody power above $x = \frac{hc}{\lambda kT}$ has terms $e^{-nx}\left(\frac{x^3}{n} + \frac{3x^2}{n^2} + \frac{6x}{n^3} + \frac{6}{n^4}\right)$, at x = {x}.

::: part
answer: exp(-x)*(x^3/2 + 3*x^2/4 + 6*x/8 + 6/16)/(x^3 + 3*x^2 + 6*x + 6)
tolerance: 0.5%

### How large is the second term relative to the first?

::: misses
- [exp(-x)] The polynomial part changes too.
- [any] Divide the n = 2 term by the n = 1 term.
:::
:::

::: part
answer: 15/pi^4*(exp(-x)*(x^3 + 3*x^2 + 6*x + 6) + exp(-2*x)*(x^3/2 + 3*x^2/4 + 6*x/8 + 6/16) + exp(-3*x)*(x^3/3 + 3*x^2/9 + 6*x/27 + 6/81))
tolerance: 0.5%

### What fraction of the power lies at shorter wavelengths, to three terms?

::: misses
- [any] $\frac{15}{\pi^4}$ times the sum.
:::
:::
:::

::: check
kind: parts
given: a = 0.02 | 0.1 | 0.5; R = 1 | 100; t = 0.01 | 1

## A simulation drives a discrete RC filter, $v \leftarrow v + \alpha(e - v)$ with α = {a}, with white noise from a {R} kΩ resistor at 300 K sampled every {t} µs.

::: part
answer: 2*1.380649e-23*300*R*1e3/(t*1e-6)*1e12
unit: µV²
tolerance: 0.5%

### What variance must each noise sample have?

::: misses
- [4*1.380649e-23*300*R*1e3/(t*1e-6)*1e12] The one-sided density 4kTR spread up to $\frac{1}{2\Delta t}$ gives $\frac{2kTR}{\Delta t}$.
- [any] $\frac{2kTR}{\Delta t}$.
:::
:::

::: part
answer: 2/(2 - a)
tolerance: 0.5%

### By what factor does the discrete filter's output variance exceed kT/C?

::: misses
- [any] The discrete filter gives $\sigma^2\frac{\alpha}{2 - \alpha}$ against the continuous $\sigma^2\frac{\alpha}{2}$.
:::
:::
:::

::: check
kind: parts
given: N = 10000 | 1000000; s = 0.5 | 2

## A Monte Carlo average uses {N} independent samples whose spread is {s} times their mean.

::: part
answer: s/sqrt(N)*100
unit: %
tolerance: 0.5%

### What's the relative standard error of the average?

::: misses
- [s/N*100] Errors shrink as $1/\sqrt N$.
- [any] $\frac{\sigma}{\mu\sqrt N}$.
:::
:::

::: part
answer: (s/0.001)^2
tolerance: 0.5%

### How many samples would bring it to 0.1%?

::: misses
- [any] $N = \left(\frac{\sigma/\mu}{0.001}\right)^2$.
:::
:::
:::

::: check
kind: parts
given: E = 100 | 1000; t = 0.1 | 0.3; m = 0.067 | 0.26

## A Monte Carlo of free flights (exponential lengths, mean {t} ps) for carriers of mass {m}$m_e$ in {E} V/cm.

::: part
answer: 1.602176634e-19*E*100*t*1e-12/(m*9.1093837e-31)/1000
unit: km/s
tolerance: 0.5%

### What drift velocity should it converge to?

::: misses
- [0.5*1.602176634e-19*E*100*t*1e-12/(m*9.1093837e-31)/1000] The time-weighted average flight is 2τ, which cancels the ½.
- [any] $\frac{q\tau E}{m^*}$.
:::
:::

::: part
answer: 2*t^2
unit: ps²
tolerance: 0.5%

### What's the mean square flight time, $\langle s^2\rangle$?

::: misses
- [t^2] For an exponential distribution $\langle s^2\rangle = 2\tau^2$.
- [any] $2\tau^2$.
:::
:::
:::

::: check
given: t = 0.1 | 0.2 | 0.3
answer: 1 - pi^2/12*t^2 - pi^4/80*t^4
tolerance: 0.01%

## Through second order, what does the Sommerfeld expansion give for a free Fermi gas's $\mu/E_F$ at kT = {t}$E_F$?

::: right
Right. $1 - \frac{\pi^2}{12}t^2 - \frac{\pi^4}{80}t^4$, which a bisection program should match closely for t up to about 0.2.
:::

::: misses
- [1 - pi^2/12*t^2] Include the $t^4$ term.
- [any] $1 - \frac{\pi^2}{12}t^2 - \frac{\pi^4}{80}t^4$.
:::
:::

::: check
kind: parts
given: z = 0.1 | 0.3 | 0.5

## An ideal Bose gas has fugacity z = {z}.

::: part
answer: z + z^2/2^1.5 + z^3/3^1.5
tolerance: 1%

### What's $g_{3/2}(z)$, to three terms?

::: misses
- [z] At this fugacity the next terms matter.
- [any] $z + \frac{z^2}{2^{3/2}} + \frac{z^3}{3^{3/2}}$.
:::
:::

::: part
answer: (2.6124/(z + z^2/2^1.5 + z^3/3^1.5))^(2/3)
tolerance: 1%

### At what multiple of its condensation temperature is it?

::: misses
- [any] $\frac{T}{T_E} = \left(\frac{2.612}{g_{3/2}(z)}\right)^{2/3}$.
:::
:::
:::

::: check
kind: parts
given: K = 0.2 | 0.44 | 1

## A Metropolis simulation of the 2D Ising model runs at J/kT = {K}.

::: part
answer: exp(-8*K)
tolerance: 0.5%

### What's the chance of accepting a flip of a spin whose four neighbors all agree with it?

::: misses
- [exp(-4*K)] Flipping it breaks four bonds, each costing 2J: ΔE = 8J.
- [any] $e^{-\Delta E/kT}$ with ΔE = 8J.
:::
:::

::: part
answer: exp(-4*K)
tolerance: 0.5%

### And a spin with three neighbors agreeing and one opposed?

::: misses
- [any] ΔE = 2J(3 − 1) = 4J.
:::
:::
:::

::: check
kind: parts
given: J = 1 | 5 | 20

## A 2D Ising magnet has coupling J = {J} meV.

::: part
answer: 2/ln(1 + sqrt(2))*J/0.086173
unit: K
tolerance: 0.5%

### What's its exact (Onsager) critical temperature?

::: misses
- [any] $kT_c = \frac{2J}{\ln(1 + \sqrt2)} = 2.269J$.
:::
:::

::: part
answer: 4*J/0.086173
unit: K
tolerance: 0.5%

### What does mean-field theory predict, $kT_c = zJ$ with z = 4?

::: misses
- [any] $4J/k$; mean field overestimates by ignoring fluctuations.
:::
:::
:::

::: check
kind: parts
given: N = 10000000000000000 | 100000000000000000; T = 30 | 50

## Silicon with {N} phosphorus donors per cm³ (45 meV deep) is in deep freeze-out at {T} K. $N_c$ = 3.2 × 10¹⁹ cm⁻³ at 300 K.

::: part
answer: 3.2e19*(T/300)^1.5
unit: cm⁻³
tolerance: 0.5%

### What's $N_c$ at {T} K?

::: misses
- [any] $N_c \propto T^{3/2}$.
:::
:::

::: part
answer: sqrt(3.2e19*(T/300)^1.5*N/2)*exp(-45/(2*0.086173*T))
unit: cm⁻³
tolerance: 1%

### What's the electron density, $\sqrt{N_cN_D/2}\,e^{-E_d/2kT}$?

::: misses
- [sqrt(3.2e19*(T/300)^1.5*N/2)*exp(-45/(0.086173*T))] In deep freeze-out the exponent is halved.
- [any] $\sqrt{\frac{N_cN_D}{2}}e^{-E_d/2kT}$.
:::
:::
:::
:::
