Maxwell-Boltzmann Distribution Mathematica Based Practitioner’s Approach

Abstract

Utilizing Mathematica this report shows how from a practitioner’s point of view useful quantities some known, and some unknown and fresh properties about the Maxwell-Boltzmann distribution are calculated. We shortcut circling the usage of antiquated incomplete tabulated error functions given in the textbooks and professional literature replacing them with efficient upgrades. And, utilizing the animation features of Mathematica displaying the temperature-dependence of the distribution function assists in visualizing the character of the distribution.

Share and Cite:

Sarafian, H. (2022) Maxwell-Boltzmann Distribution Mathematica Based Practitioner’s Approach. American Journal of Computational Mathematics, 12, 79-86. doi: 10.4236/ajcm.2022.121006.

1. Introduction

Reviewing a few popular undergraduate physics texts [1] [2] [3], and graduate physics texts [4] [5] as well as advanced general physics books [6] [7] reveals that sections devoted to the “Kinetic Theory of Gases” either are analyzed according to the principle of the Classical Mechanics developed by Clausius [4] or statistically via the Maxwell and Boltzmann (MB) [1]. For the latter, a normalized distribution is utilized to identify the frequencies of occurrence of the number of the non-interacting molecules of an ideal gas possessing certain speeds conducive to statistical moments such as average, root-mean-square, and the speed that the ensemble is populated the most. Plots of the MB distribution for a chosen gas at different temperatures show as intuitively expected the higher temperature is associated with the faster speeds resulting in the broadening of the distribution. The brief observations summarize the scope of the applications of the MB distribution.

In this investigating report, we show utilizing a CAS (Computer Algebra System) such as Mathematica [8], we can revisit the same mentioned facts but much more. A few of these facts are fresh that are not available in the literature. In the forthcoming procedure section, we present our findings.

2. Procedure

We begin with MB distribution,

f M B ( m , T , v ) = 4 π ( m 2 π k T ) 3 2 v 2 e m 2 k T v 2 , (1)

where m, T, and v are the mass, temperature, and the speed of an individual particle (molecule) of the gas, respectively. The k is the Boltzmann constant, k = 1.38 10−23 J/mol·K. Utilizing (1) a classic calculation yields the first and the second moments. Noting the latter is conducive to vRMS. Equation (1) if needed may be formatted in terms of the molar mass, mmol, and the universal ideal gas constant, R = 8.31 J/moll·K such that the ratio m/k can be replaced by the m m o l R . Applying (1) the mentioned quantities are,

{ v m p , v ¯ , v R M S } = { 2 , 8 π , 3 } k T m , (2)

The common quantity listed in (2) is k T / m . It is useful tabulating this for different values of m and temperature T. C.f. Table 1.

Table 1. The 4, 5 and 6 columns are the practical speed-related quantities given in (2). The rest of the columns are the selected temperatures and the molecular masses.

The usefulness of Table 1 is e.g., one develops a feel about the value of the speeds. Comparing these speeds to the legal speed of a car on highways ~25 m/s, these are fast! Furthermore, comparing e.g., rows 1, 6, and 11 shows the impact of the temperature on the speed-related quantities. Noting, as expected, the higher the temperature the faster the speeds. Similarly, comparing e.g., row 2, 7, and 12 gives the impact of the masses. Likewise, observations can be drawn by comparing other paired rows.

Another way to utilize Table 1 is by selecting a certain mass, e.g., the mass of a single H2 molecule displays the profile of the distribution at different temperatures. This is shown in Figure 1.

Figure 1 shows the sensitivity of the distribution as a function temperature. It confirms our intuition, meaning, the lower the temperature the sharper the distribution, i.e., the higher the concentrated molecules and vice versa. The sharpest distribution in aqua is used as a reference and it is displayed in all four cases. Curves are color-coded, the aqua is the coldest (T = 200 K), the red is the hottest (T = 900 K) and the rest are in between.

In addition to the observations, one is led to the question about the sensitivity of the ordinate of the maximum values of the distribution at its abscissa, at thevmp. And, ordinarily, when one works with a cusped function, such as Gaussian, the qualitative measure of the sharpness of the function is determined by the width of the function at 1/e-th of its maximum height. As such, noting the MB distribution

Figure 1. Headings of the plots are the temperatures in Kelvin. The common sharp aqua curve is the distribution at a low-temperature T = 200 K.

is not too far off from Gaussian, its width must be evaluated. This report quantitatively addresses these issues. The steps conducive to our goals are as follows.

2.1. Sensitivity of the Maximum Height of the MB-Distribution to Temperature

As discussed, at v = v m p the distribution given by (1) is at maximum. To form the needed function and to handle the calculation in the upcoming subsections we define an auxiliary function λ : = m K T . In terms of λ and m = m0 the mass of an H2 molecule, we evaluate the maximum height as a function of temperature. This is shown on the left panel of Figure 2.

2.2. Sensitivity of Width of the MB-Distribution to Temperature

To determine the width of the distribution and explore its temperature sensitivity we need to solve an equation that is conducive to speeds associated with the

intersections of a horizontal line 1 e ( f M B ) max = f M B . Where ( f M B ) max and f M B are subject to (2a) and (1), respectively. This algebraic equation is not easily solvable, applying Mathematica yields to a set of complicated roots that are to be sorted. A brief outline is given.

The simplified algebraic equation given to the formal equation in Sect. 2b is,

2 ln v λ 2 v 2 = ln 2 2 ln λ , (3)

where λ is defined in (2a). Solution of (3) for v yields six roots, some negative and some complex. By inspection, the acceptable positive roots with manipulation give the interested widths. For a chosen mass, m0 these widths are temperature dependent. Their variation vs temperature, T is shown on the right panel of Figure 2.

These features shown in Figure 2 are consistent with Figure 1; nothing, these are quantitative. The left panel shows the higher the temperature the lower the maximum height. Similarly, and consistent with the left panel it shows the width of the distribution increases vs the temperature. Noting, these displayed functions are not linear. An interested reader may apply the trend lines, FindFit in Mathematica to explore the format of the continuous curve. This is left as an exercise. These two fresh features are missed in the literature.

2.3. Identification of the Speeds Conducive to the Same Population in the MB Distribution

Displayed MB distributions for various scenarios shown in Figure 1 reveal that for a chosen temperature there are always two speeds that are associated with the same population. To clarify Figure 3 includes two paired sets of such speeds. The black and the red vertical lines on the right are the v ¯ and v R M S , respectively. There is another paired set of speeds, the red and the black on the left. Both these sets have the same heights, corresponding to the same populations. All the references cited have focused on the former! This observation holds for

Figure 2. The left and the right plates are the sensitivity of the maximum height and the width of the MB-distribution as a function temperature, respectively.

Figure 3. A plot of the MB distribution and a paired two sets of speeds corresponding to the same populations.

any speed. I.e., there are always paired speeds associated with the same population. It is noted that for the paired set on the right v ¯ < v R M S and for the left set this is reversed!

As shown in Figure 3 as an example two paired sets of speeds, the black and the red on the right do correspond to the red and black paired on the left corresponding to the same set of populations. Noting the order of speeds from left to right are reversed.

The goal is for instance to identify the speed that is less than v ¯ (the black marked abscissa on the right) that is conducive to the same population on the left. The procedure to achieving this goal is straight forward although not doable without utilizing a CAS, specifically Mathematica. After inspection only two out of four roots of the solved equation are meaningful. For readers familiar with Mathematica codes are given for reproduction, these are,

solv1=Solve[f[m,T,v]==Evaluate[f[m,T,v]/.v->sqrt(8/π) sqrt(kT/m)],v]//Simplify

{v/.solv1[1]/.values/.{m->m0,T->200.},v/.solv1[3]/.values/.{m->m0,T->200.},mean}

{1127.32,1450.61,1450.61}

{v/.solv2[3]/.values/.{m->m0,T->200.},v/.solv2[4]/.values/.{m->m0,T->200.},RMS}

{1016.96,1574.49,1574.49}

The first code solves the equation that sets the distribution equals the value of distribution at v ¯ . The third code evaluates the speed at v R M S . The output confirms the accuracy of the computations. The output of the second code is a list of the speeds. The last two numeric in the given list are the v ¯ . These two are the same though they have been evaluated differently. The middle one is one of the roots of the equation on hand, the third one is v ¯ using (2). The same explanation holds for the third code and its output. Note, for each output the value of the first element is less than the second element. The point of the set goal is well achieved.

2.4. Evaluation of the Number of Particles within a Chosen Speed Range

Customarily, in the general practice, the interest is to utilize a distribution e.g., the MB distribution and count the number the particles at a certain speed. In the case of MB distribution substituting the chosen speed in the distribution function yields the answer. However, counting the particles within a speed range naturally requires integration. The integration of the MB distribution with the integration limits specified by speed range is conducive to the error function. This lends itself to relying on the tabulated numeric values of the error function with severe limitations [9].

Here, by way of example utilizing Mathematica’s symbolic and then numeric capabilities, we bypass the antiquated usage of tabulated information.

We show two detailed cases. The first one does the integration within the range of zero to v ¯ , and the second within/to v R M S . The same approach may be applied to any desired speed range. To pursue these goals for the sake of simplicity (1) and (2) are reformulated in terms of the aforementioned λ.

Symbolic integration of both cases is,

I1 = 2 π λ 3 Integrate [ v 2 e 1 2 λ v 2 , { v , 0 , 8 π 1 λ } , Assumptions λ > 0 ] / / Simplify

e 4 / π λ 3 ( 4 + e 4 / π π Erf [ 2 π ] ) π λ 3 / 2

I2 = 2 π λ 3 Integrate [ v 2 e 1 2 λ v 2 , { v , 8 π 1 λ , 3 1 λ } , Assumptions λ > 0 ] / / Simplify

λ 3 ( 2 3 e 3 / 2 + 4 e 4 / π 2 π + 2 π ( Erf [ 3 2 ] Erf [ 2 π ] ) ) 2 π λ 3 / 2

As noted, the output is given in error functions. Mathematica uses Erf[] for the error function. As shown, specific error functions are needed. By specifying the value for the λ that calls for a certain temperature and molecular mass we for instance apply m = mN2 (nitrogen) at T = 200 K.

The numeric values of the above integrations are 0.53305 and 0.0753246. For instance, assuming the number of molecules is 5000 the population of the molecules is 2665, and 377, respectfully. These are meaningful numbers because the speed range of the first integration is much wider than the second accommodating much more molecules.

3. Conclusion

The main goal of crafting this investigating practical report is to show how by utilizing a Computer Algebra System, such as Mathematica many of the traditional quantities associated with Maxwell-Boltzmann distribution easily are calculated. As shown our approach explores issues affiliated with MB distribution that are fresh and not discussed in the published textbooks nor researched-based literature. Mathematica codes are provided so that the interested reader may practice the issues. The interested reader may find [10] [11] resourceful in making the embedded graphs.

Acknowledgements

The author acknowledges the John T. and Page S. Smith Professorship funds for completing and publishing this work.

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

References

[1] Halliday, D., Resnick, R. and Walker, J. (2021) Fundamentals of Physics. 11th Edition, John Wiley & Sons, Inc., New Jersey.
[2] Tipler, P. and Mosca, G. (2022) Physics for Scientists and Engineers. 6th Edition, McGraw Hills, Companies, Inc., NY.
[3] Wolfgang, B. and Westfall, G.D. (2011) University Physics with Modern Physics. McGraw Hill, Companies, Inc., New York.
[4] Pathria, R.K. (1972) Statistical Mechanics. Pergamon Press, New York.
[5] Hill, T.L. (1956) Statistical Mechanics. McGraw Hill, Book Company, Inc., New York.
[6] Longair, M.S. (1984) Theoretical Concepts in Physics. Cambridge University Press, New York.
[7] Jackson, A. (1968) Equilibrium Statistical Mechanics. Dover Publications, Inc., New York.
[8] (2022) Mathematica V13.
http://Wolfram.com
[9] Abramowitz, M. and Stegun, I. (1964) Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. National Bureau of Standards, Washington, DC.
[10] Wolfram, S. (2003) Mathematica Book. 5th Edition, Cambridge University Press, New York, NY.
[11] Sarafian, H. (2019) Mathematica Graphics Examples. 2nd Edition, Scientific Research Publishing, Wuhan.

Copyright © 2024 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.