Problem 6.23

ϵ =Quantity[0.00024, "Electronvolts"];

k = Quantity[1, "BoltzmannConstant"];
T = Quantity[300, "Kelvins"];

Let ‘x’ = the dimensionless quantity (ϵ/(k T)).  In this problem, it is quite small.

x = (ϵ/(k T))

(* Unnormalized probability function:  Include the degeneracy -- there are 2j + 1 states for each energy.*)Pu[x_, j_] := (2 j + 1) * Exp[-j (j + 1) * x]

Look at each of the first 30 terms in the partition function sum.  The first 25 or so are important, but after that they are negligible.

ListPlot[Table[{j, Pu[x, j]}, {j, 0, 30}] , AxesLabel -> {"j", "Contribution"}, LabelStyle->Larger, ImageSize->Scaled[0.8]]

Write a function to numerically approximate the partition function up to ‘jmax’ terms.

Z[x_, jmax_] := Sum[Pu[x, j], {j, 0, jmax}]

ListPlot[Table[{jmax, Z[x, jmax]}, {jmax, 1, 30}], AxesLabel -> {"jmax", "Z"}, LabelStyle->Larger, ImageSize->Scaled[0.8]]

The sum converges fairly well after about 25 terms.  Compare the actual sum to the approximate value 1/x = ((k T)/ϵ).

TableForm[Table[{jmax, Z[x, jmax]}, {jmax, 20, 30, 1}] , TableHeadings->{None, {"jmax", "Z"}}]

1/x (* Approximate high-temperature formula (x << 1)*)