# Confusion on Time and Ensemble Averages of Classical Harmonic Oscillator

Assume we have a classical harmonic oscillator $$\ddot{x} = -k^2x.$$ Then the general solutions are of the form $x(t) = x_0cos(kt) + \frac{v_0}{k}sin(kt)$ where $x_0$ and $v_0$ are initial conditions. Lets assume that $x_0=0$. The time average of any quantity $f$ is given by $$\frac{1}{T}\int_0^Tf(\frac{v_0}{k}sin(kt))dt.$$ For instance average oscillation amplitude as $T\rightarrow \infty$ is $$<x^2>=\lim_{T\rightarrow \infty}\frac{1}{T}\int_0^Tv^2_0sin^2(kt)dt = \frac{v_0}{2k^2}.$$ However if you consider the ensemble average using Boltzmann density $e^{-\beta(\frac{1}{2}mv^2 + k^2x)}$ you get that the average value is $$<x^2>=\frac{1}{\beta k^2}.$$ Now this is a system near equilibrium (i.e the measure above is ergodic for this dynamics is what I am assuming) so shouldnt one get that the space average is equal to time average for all most all initial conditions.I could say that I am just choosing bad initial conditions but I can not see how one would generally produce a term like $\beta$ by choosing initial conditions correctly.

First, your Hamiltonian is wrong; you should be getting $(\beta~k)^{-1}$ for the force $k x$.

Second, your definitions of $k$ are going to be slightly off; the Hamiltonian $\frac12 m v^2 + \frac12 k x^2$ corresponds to the dynamics $\ddot x = -\omega^2 x$ only for $\omega^2 = k/m.$ Best then to write $\frac12 m (v^2 + \omega^2 x^2)$ with $\langle x^2\rangle = (\beta m \omega^2)^{-1}.$

Third, your interpretation is wrong; the Boltzmann factor comes from the canonical ensemble which is derived from the microcanonical ensemble in the limit where it is connected to a large thermodynamic system maintained at a constant temperature; your spring in the first case is not connected to any such system but rather is undergoing simple harmonic motion as if undisturbed by anything.

• Thanks for the corrections but the reason why I get $(\beta k^2)^{-1}$ is because my potential is $\frac{1}{2}k^2x^2$ instead of $\frac{1}{2}kx^2$. Can you explain a bit more on the physical meaning of appearance of $\beta=k_bT$? What do you mean by a thermodynamic system? For instance would a hot both suffice whose equations are given by $\ddot{x} = kx - \mu\dot{x} + R(t)$ where $R(t)$ is random force.? As far as I remember even if $\beta$ appears in the variance of $R(t)$, it does not appear for the average quantities. How would one produce the average (\beta k)^{-1} from some time average?
– Sina
Feb 20 '16 at 0:00
• How would one physically explain the fact that the two averages differ by a constant $k_bT$ Does thermodynamic enviroment mean replace $v_0$ by the average speed of all oscillators in the thermodynamic enviroment?
– Sina
Feb 20 '16 at 0:16
• @Sina: I have to confess, I'm not 100% sure! However, you're right that the introduction of $R(t)$ such that $\langle R(t)~R(t')\rangle = 2(\mu/\beta)\delta(t-t')$ should thermalize a harmonic oscillator. I don't think you're right about "it does not appear for the average quantities" in general; it seems like it probably disappears for first moments $\langle x \rangle$ but probably persists for second moments $\langle x^2 \rangle.$ Maybe I'm wrong about that, but it would mean that, e.g., the Brownian motion variance wouldn't increase with $T$ which seems crazy. Feb 21 '16 at 0:54
• Your answer has been quite helpful for me to understand the subtle difference. And you are right that it appears in the second moments. I found some nice text that does alot of examples including oscillator. Here it is: web.phys.ntnu.no/~ingves/Teaching/TFY4275/Downloads/kap6.pdf
– Sina
Feb 21 '16 at 0:56