Question 1: Polymer dimensions

Ideal polymer chains are often described as undergoing random walks on a lattice. Like ideal gases, the monomers in an ideal polymer chain do not interact with each other; that is, the segments of the chain do not exclude volume and can overlap. Consider a one-dimensional ideal polymer chain composed of N independent segments. One end of the chain is placed at the origin. A single chain conformation can then be generated by iteratively placing a single segment of the chain a distance b in either the positive or negative x dimension from the current chain end - i.e., the chain elongates by taking “steps” along the one-dimensional coordinate. The end-to-end distance of the chain, x, is the distance between the origin and the end of the last segment placed. Figure 1 shows an example for N = 8 in which the end-to-end distance is  − 2b after all 8 steps are taken.

Example 1D polymer configuration, with N = 8 and x =  − 2b.

(a) For a one-dimensional ideal chain with N segments and segment size b, calculate the probability, p(x), that the end-to-end distance of the polymer is equal to x. Assume that there is an equal likelihood of taking a step in either the positive or negative direction for each chain segment.

From the problem statement, the final position of the chain end, x, depends on the number of steps taken in each direction. We can write the number of steps in the positive direction as n, so that the number of steps in the negative direction is N − n. The probability of obtaining a particular value of n is then equal to the number of possible ways that n steps can be taken out of N total steps, divided by the total number of possible ways of taking steps. The number ways of taking n indistinguishable steps out of N total steps is given by:

$$\Omega(n) = \frac{N!}{n!(N-n!)}$$

The total number of ways of taking steps is 2N, since for each of the N steps there are two possible choices. Therefore, the probability of taking n steps in the positive direction is:

$$p(n)= \frac{1}{2^N}\frac{N!}{n!(N-n)!}$$

Substituting n = (N+x/b)/2 we obtain a probability distribution for x instead of n:

$$p(x) = \frac{1}{2^N}\frac{N!}{[(N+x/b)/2]![(N-x/b)/2]!}$$

(b) For the chain described in part a, show that in the large N limit the probability distribution p(x) can be approximated by:

$$p(x) = \frac{1}{\sqrt{2\pi Nb^2}} \exp \left ( -\frac{x^2}{2Nb^2}\right )$$

Hint: define the quantity x/Nb ≡ a, where a ≪ 1 in the large N limit, and write a series expansion for ln (1−a) when appropriate.

In the large N limit, we can simplify the result from part a by taking the logarithm of p(x) and using Stirling’s relation:

$$\begin{aligned} \ln p(x) &= -N\ln 2 + N \ln N - (N + x/b)/2 \ln (N + x/b)/2 - (N- x/b)/2 \ln(N-x/b)/2 \\ &= N \ln N - (N + x/b)/2 \ln (N + x/b) - (N- x/b)/2 \ln(N-x/b) \\ &= N \ln N - N(1 + x/Nb)/2 \ln N (1+x/Nb) - N(1-x/Nb)/2 \ln N(1-x/Nb) \end{aligned}$$

To simplify these expressions a bit we’ll define x/Nb ≡ a and collect terms:

$$\begin{aligned} \ln p(x) &= \frac{N}{2} \left [2 \ln N - (1+a) \ln N - (1+a) \ln (1+a) - (1-a) \ln N - (1-a) \ln (1-a) \right ] \\ &= -\frac{N}{2} \left [(1+a) \ln (1+a) + (1-a) \ln (1-a) \right ] \end{aligned}$$

Next, we can use the Taylor expansion $\ln (1-a) = -a - \frac{1}{2}a^2 \dots$ to simplify this expression. Since a ≪ 1, we will truncate the expansion at second order:

$$\begin{aligned} \ln p(x) &= -\frac{N}{2} \left [(1+a) \left ( a - \frac{1}{2} a^2 \right ) + (1-a) \left ( -a - \frac{1}{2} a^2 \right ) \right ] \\ &= -\frac{N}{2} \left [ a - \frac{1}{2} a^2 + a^2 - \frac{1}{2} a^3 - a -\frac{1}{2} a^2 + a^2 + \frac{1}{2} a^3 \right ] \\ &= -\frac{Na^2}{2} \\ &= -\frac{x^2}{2Nb^2}\\ \therefore p(x) &= C\exp \left ( -\frac{x^2}{2Nb^2}\right ) \end{aligned}$$

We leave the constant C to recognize that the probability distribution is not properly normalized, since Stirling’s approximation is inexact. To normalize this probability, we can use the relation that −∞p(x)dx = 1 and evaluate the Gaussian integral:

$$\begin{aligned} \int_{-\infty}^{\infty} C\exp \left ( -\frac{x^2}{2Nb^2}\right )dx &= 1 \\ C \sqrt{2\pi Nb^2} &= 1 \\ C &= \frac{1}{\sqrt{2\pi Nb^2}} \\ \therefore p(x) &= \frac{1}{\sqrt{2\pi Nb^2}} \exp \left ( -\frac{x^2}{2Nb^2}\right ) \end{aligned}$$

(c) Show that the entropy of an ideal one-dimensional chain in the large N limit is given by:

$$S(N, x) = -\frac{k_Bx^2}{2Nb^2} + S(N)$$

where S(N) is a constant that is not dependent on x.

As noted in part a, the probability of obtaining a final position x can be written as: $$p(x) = \frac{\Omega(N, x)}{\Omega(N)}$$

We can thus use this relation and our expression for p(x) in the large N limit to find the entropy:

$$\begin{aligned} S(N, x) &= k_B \ln \Omega(N, x) \\ &= k_B \ln \left [ p(x) \Omega(N)\right ] \\ &= k_B \ln \left [ \frac{1}{\sqrt{2\pi Nb^2}} \exp \left ( -\frac{x^2}{2Nb^2}\right ) \Omega(N) \right ]\\ &= k_B \ln \left [ \exp \left ( -\frac{x^2}{2Nb^2}\right ) \right ] + k_B \ln \left [ \frac{1}{\sqrt{2\pi Nb^2}} \Omega(N) \right ] \\ &= -\frac{k_B x^2}{2Nb^2} + S(N) \end{aligned}$$

In the last line we collect the terms that are not a function of x.

Question 2: Magnetization of a paramagnet

Consider a system of N distinguishable, non-interacting atoms with magnetic dipole moments (spins) in a magnetic field H at constant temperature. Each spin si has a magnetic moment μ and can be in one of two states: parallel to the field (si = 1) or anti-parallel to the field (si =  − 1). The energy of each microstate is due only to interactions between the spins and the magnetic field, and is given by:

$$E = -\sum_{i=1}^N s_i \mu H$$

The magnetization of the material is defined as:

$$\begin{aligned} M = \sum_i^N s_i \mu = -\frac{E}{H} \end{aligned}$$

This model is commonly used to describe paramagnetic materials. In this problem, we will derive an expression for the ensemble-average magnetization of a paramagnet in a magnetic field.

(a) Assuming that the paramagnet has a fixed energy E, write an expression for the entropy as a function of the number of spins aligned with the field, N+, and the total number of spins, N.

We can first define N+ as the number of spins for which si = 1, N is the number fo which si =  − 1, and N+ + N = N. Using these definitions we can then write for the energy:

$$\begin{aligned} E &= -\mu H \sum_i^N s_i\\ &= -\mu H [N_+ (1) + N_-(-1) ]\\ &= -\mu H (2N_+ - N) \end{aligned}$$

We can write the degeneracy of this particular energy level as:

$$\Omega(E) = \frac{N!}{N_+!(N-N_+)!}$$

Note that this expression assumes that spins are distinguishable but the order within each group of spins does not matter, which is a reasonable treatment of spins on a lattice since each lattice position is uniquely distinguishable but spins cannot interchange positions. Using the Boltzmann expression for the entropy:

$$\begin{aligned} S &= k_B \ln \Omega(E) \\ &= k_B \ln \left [ \frac{N!}{N_+!(N-N_+)!} \right ] \\ &= k_B \left [ N \ln N - N_+ \ln N_+ - (N-N_+)\ln(N-N_+) \right ] \end{aligned}$$

(b) Derive an expression for N+ as a function of the number of spins N, the magnetic field strength H, the magnetic moment μ, and the temperature T (or as a function of β ≡ 1/kBT).

To obtain a temperature dependence, we can relate the entropy to the energy via the relation $\left ( \frac{\partial S}{\partial E} \right )_{N, V} = 1/T$ to identify an expression for N+:

$$\begin{aligned} \frac{1}{T} &= \left ( \frac{\partial S}{\partial E} \right )_{N, V} \\ &= \left ( \frac{\partial S}{\partial E} \right )_{N, V} \\ &= \left ( \frac{\partial S}{\partial N_+} \right )_{N, V} \left ( \frac{\partial N_+}{\partial E} \right )_{N, V} \end{aligned}$$

We can obtain these derivatives from prior expressions:

$$\begin{aligned} E &= -\mu H (2N_+ - N) \\ \therefore \left ( \frac{\partial N_+}{\partial E} \right )_{N, V} &= -\frac{1}{2H\mu}\\ S &= k_B \left [ N \ln N - N_+ \ln N_+ - (N-N_+)\ln(N-N_+) \right ] \\ \therefore \left ( \frac{\partial S}{\partial N_+} \right )_{N, V} &= - k_B \ln \left ( \frac{N_+}{N-N_+} \right ) \end{aligned}$$

Combining these expressions with the expression for the temperature gives:

$$\begin{aligned} \frac{1}{T} &=k_B \ln \left ( \frac{N_+}{N-N_+} \right ) \frac{1}{2 H \mu} \\ 2\beta H\mu &= \ln \left ( \frac{N_+}{N-N_+} \right ) \\ -\ln \left ( \frac{1}{\frac{N}{N_+} - 1} \right ) &= -2\beta H \mu \\ \ln \left ( \frac{N}{N_+} - 1 \right ) &= -2\beta H \mu \\ \frac{N}{N_+} &= 1 + \exp(-2\beta H \mu) \\ N_+ &= \frac{N}{1+\exp(-2\beta H \mu)} \end{aligned}$$

(c) Show that the magnetization of a paramagnet is given by:

$$\begin{aligned} M = N\mu \tanh (\beta \mu H) \end{aligned}$$

We can write for the magnetization using the definition in the problem statement:

$$\begin{aligned} M &= -\frac{E}{H}\\ &= \mu(2N_+ - N) \end{aligned}$$

We can now substitute in our expression for N+ from the previous part:

$$\begin{aligned} M &= \mu \left ( \frac{2N}{1+\exp(-2\beta H \mu)} - N \right ) \\ &= \mu \left ( \frac{2N}{1+\exp(-2\beta H \mu)} - \frac{N[1+\exp(-2\beta H \mu)]}{1+\exp(-2\beta H \mu)} \right ) \\ &= \mu \left ( \frac{N - N \exp(-2\beta H \mu)}{1+\exp(-2\beta H \mu)} \right ) \\ &= N \mu \left ( \frac{1 - \exp(-2\beta H \mu)}{1+\exp(-2\beta H \mu)} \right )\\ &= N\mu \left ( \frac{\exp(\beta H \mu) - \exp(-\beta H \mu)}{\exp(\beta H \mu)+\exp(-\beta H \mu)} \right ) \\ &= N\mu \tanh (\beta \mu H) \end{aligned}$$

This agrees with the result in the problem statement. Hence, we have shown that we derive an expression for the magnetization of a paramagnet using the equations of the microcanonical ensemble.

Question 3: Mixing entropy

Consider two different ideal fluids containing N1 and N2 molecules, respectively, for a total of N molecules. All molecules exclude the same molar volume and are assumed to interact weakly with each other and with themselves, such that the potential energy of the system is negligible. The two fluids are initially completely demixed due to an impermeable partition; the partition is then removed and the fluids are allowed to mix at constant volume as illustrated in Figure 2. Assume also that the molecules of each fluid are indistinguishable from the molecules of the same fluid.

Diagram illustrating mixing of two initially demixed fluids.

(a) Assume that the two fluids occupy a fictitious lattice that spans the available volume. Each molecule occupies a single lattice site and all lattice sites are occupied; thus, there are are N1 lattice sites occupied by molecule 1 and N2 lattice sites occupied by molecule 2. Using this approximation, calculate Ω(N1,N2), which is defined as the number of microstates for the mixture of fluids.

Using this approximation, we recognize that there are a total of N = N1 + N2 sites on our fictitious lattice, identical arrangements of the fluids are indistinguishable (although the fluids themselves are distinguishable from each other), and thus the degeneracy is:

$$\Omega(N_1, N_2) = \frac{N!}{N_1!N_2!}$$

(b) Derive an expression for the entropy change associated with mixing the two ideal fluids in terms of the mole fractions, x1 = N1/N and x2 = N2/N, of the two components. That is, determine an expression for:

ΔSmix = Smixed − Sdemixed

We can calculate the entropy of the mixed state immediately by invoking Stirling’s approximation for the factorials above and using the Boltzmann expression for the entropy:

$$\begin{aligned} S_{\textrm{mixed}} &= k_B \ln \Omega(N_1, N_2) \\ &= k_B \left ( \ln N! - \ln N_1! - \ln N_2! \right ) \\ &= k_B \left ( N \ln N - N - N_1 \ln N_1 + N_1 - N_2 \ln N_2 + N_2 \right ) \\ &= k_B \left ( (N_1 + N_2) \ln N - N_1 \ln N_1 - N_2 \ln N_2 \right ) \\ &= -k_B \left ( N_1 \ln N_1/N + N_2 \ln N_2/N \right ) \\ &= -k_B N \left ( x_1 \ln x_1 + x_2 \ln x_2 \right ) \end{aligned}$$

The entropy change associated with mixing is defined as ΔSmix = Smixed − Sdemixed. However, in the initial configuration of the system, with both fluids completely separate, all configurations of each fluid are indistinguishable since the molecules in each of the fluids separately are indistinguishable. There is only a single unique configuration in the initial state and hence the entropy of the initial state is approximately 0. The entropy of mixing is thus:

$$\begin{aligned} \Delta S_{\textrm{mix}} &= S_{\textrm{mix}} \\ &= -k_B N \left ( x_1 \ln x_1 + x_2 \ln x_2 \right ) \end{aligned}$$

(c) Is the lattice model assumption reasonable for molecules occupying a continuous set of positions (rather than discrete points)? Why or why not?

The lattice model assumption transforms a continuous set of particle positions to a discrete set in order to estimate the degeneracy. This approximation is reasonable because we are effectively assuming that each molecule has some set of configurations accessible within each lattice point (i.e. within the space associated with a lattice), but this set of configurations is identical for every molecule and therefore will be the same in both the demixed and mixed state, such that taking the difference between these states (in part b) removes this large internal set of configurations from the expression for the degeneracy.

Question 4: Stirling’s approximation

Write a Python program that calculates the percent error of Stirling’s approximation as a function of N, where Stirling’s approximation is defined as:

ln N! ≈ Nln N − N

Include with your solution a copy of your Python code (including comments as necessary), a plot of ln N! and Stirling’s approximation as a function of N up to N = 100, and a plot of the error of Stirling’s approximation as a function of N up to N = 100. Your grade for this problem will be based in part on the readability of your code and plots in addition to the accuracy of the solution.

Note: this problem is intended to provide you with practice in Python programming prior to the assignment of the simulation project.

The two requested plots are provided below. Corresponding code is available on the Canvas website.

Comparison of Stirling’s approximation vs. ln N! as a function of N.
Relative error of Stirling’s approximation vs. N, which approaches zero as N exceeds  ≈ 50.