Maxwell-Boltzmann Distribution Mathematica Based Practitioner’s Approach ()

Haiduke Sarafian^{}

The Pennsylvania State University, University College, York, USA.

**DOI: **10.4236/ajcm.2022.121006
PDF
HTML XML
161
Downloads
1,006
Views
Citations

The Pennsylvania State University, University College, York, USA.

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

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}_{MB}\left(m,T,v\right)=4\pi {\left(\frac{m}{2\pi kT}\right)}^{\frac{3}{2}}{v}^{2}{\text{e}}^{-\frac{m}{2kT}{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 *v _{RMS}*. Equation (1) if needed may be formatted in terms of the molar mass,

$\left\{{v}_{mp},\stackrel{\xaf}{v},{v}_{RMS}\right\}=\left\{\sqrt{2},\sqrt{\frac{8}{\pi}},\sqrt{3}\right\}\sqrt{\frac{kT}{m}}$, (2)

The common quantity listed in (2) is $\sqrt{kT/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 H_{2} 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 the*v _{mp}*. 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}_{mp}$ 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
$\lambda :=\frac{m}{KT}$. In terms of *λ* and *m* = *m*_{0} the mass of an H_{2} 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
$\frac{1}{\text{e}}{\left({f}_{MB}\right)}_{\mathrm{max}}={f}_{MB}$. Where
${\left({f}_{MB}\right)}_{\mathrm{max}}$ and
${f}_{MB}$ 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\mathrm{ln}v-\frac{\lambda}{2}{v}^{2}=\mathrm{ln}2-2-\mathrm{ln}\lambda $, (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, *m*_{0} 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 $\stackrel{\xaf}{v}$ and ${v}_{RMS}$, 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
$\stackrel{\xaf}{v}<{v}_{RMS}$ 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
$\stackrel{\xaf}{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 $\stackrel{\xaf}{v}$. The third code evaluates the speed at ${v}_{RMS}$. 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 $\stackrel{\xaf}{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 $\stackrel{\xaf}{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
$\stackrel{\xaf}{v}$, and the second within/to
${v}_{RMS}$. 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,

$\text{I1}=\sqrt{\frac{2}{\pi}}\sqrt{{\lambda}^{3}}\text{Integrate}\left[{v}^{2}{\text{e}}^{-\frac{1}{2}\lambda {v}^{2}},\left\{v,0,\sqrt{\frac{8}{\pi}}\frac{1}{\sqrt{\lambda}}\right\},\text{Assumptions}\to \lambda >0\right]//\text{Simplify}$

$\frac{{\text{e}}^{-4/\pi}\sqrt{{\lambda}^{3}}\left(-4+{\text{e}}^{4/\pi}\pi \text{Erf}\left[\frac{2}{\sqrt{\pi}}\right]\right)}{\pi {\lambda}^{3/2}}$

$\text{I2}=\sqrt{\frac{2}{\pi}}\sqrt{{\lambda}^{3}}\text{Integrate}\left[{v}^{2}{\text{e}}^{-\frac{1}{2}\lambda {v}^{2}},\left\{v,\sqrt{\frac{8}{\pi}}\frac{1}{\sqrt{\lambda}},\sqrt{3}\frac{1}{\sqrt{\lambda}}\right\},\text{Assumptions}\to \lambda >0\right]//\text{Simplify}$

$\frac{\sqrt{{\lambda}^{3}}\left(-\frac{2\sqrt{3}}{{\text{e}}^{3/2}}+4{\text{e}}^{-4/\pi}\sqrt{\frac{2}{\pi}}+\sqrt{2\pi}\left(\text{Erf}\left[\sqrt{\frac{3}{2}}\right]-\text{Erf}\left[\frac{2}{\sqrt{\pi}}\right]\right)\right)}{\sqrt{2\pi}{\lambda}^{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* = *m _{N}*

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.

[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. |

Journals Menu

Contact us

+1 323-425-8868 | |

customer@scirp.org | |

+86 18163351462(WhatsApp) | |

1655362766 | |

Paper Publishing WeChat |

Copyright © 2024 by authors and Scientific Research Publishing Inc.

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