1- """
1+ r """
22The root-mean-square, average and most probable speeds of gas molecules are
33derived from the Maxwell-Boltzmann distribution. The Maxwell-Boltzmann
44distribution is a probability distribution that describes the distribution of
55speeds of particles in an ideal gas.
66
77The distribution is given by the following equation:
8-
9- -------------------------------------------------
10- | f(v) = (M/2πRT)^(3/2) * 4πv^2 * e^(-Mv^2/2RT) |
11- -------------------------------------------------
8+ \.. math:: f(v) = \left(\frac{M}{2 \pi RT}\right)^{\frac{3}{2}} \cdot 4 \pi v^2 \cdot e^{-\frac{Mv^2}{2RT}}
129
1310where:
14- f(v) is the fraction of molecules with a speed v
15- M is the molar mass of the gas in kg/mol
16- R is the gas constant
17- T is the absolute temperature
11+ * :math:` f(v)` is the fraction of molecules with a speed :math:`v`
12+ * :math:`M` is the molar mass of the gas in kg/mol
13+ * :math:`R` is the gas constant
14+ * :math:`T` is the absolute temperature
1815
1916More information about the Maxwell-Boltzmann distribution can be found here:
2017https://en.wikipedia.org/wiki/Maxwell%E2%80%93Boltzmann_distribution
2118
2219The average speed can be calculated by integrating the Maxwell-Boltzmann distribution
2320from 0 to infinity and dividing by the total number of molecules. The result is:
24-
25- ---------------------
26- | vavg = √(8RT/πM) |
27- ---------------------
21+
22+ .. math:: v_{avg} = \sqrt{\frac{8RT}{\pi M}}
2823
2924The most probable speed is the speed at which the Maxwell-Boltzmann distribution
3025is at its maximum. This can be found by differentiating the Maxwell-Boltzmann
31- distribution with respect to v and setting the result equal to zero. The result is:
32-
33- ---------------------
34- | vmp = √(2RT/M) |
35- ---------------------
26+ distribution with respect to :math:`v` and setting the result equal to zero. The result is:
27+
28+ .. math:: v_{mp} = \sqrt{\frac{2RT}{M}}
3629
3730The root-mean-square speed is another measure of the average speed
3831of the molecules in a gas. It is calculated by taking the square root
3932of the average of the squares of the speeds of the molecules. The result is:
40-
41- ---------------------
42- | vrms = √(3RT/M) |
43- ---------------------
33+
34+ .. math:: v_{rms} = \sqrt{\frac{3RT}{M}}
4435
4536Here we have defined functions to calculate the average and
4637most probable speeds of molecules in a gas given the
@@ -57,6 +48,7 @@ def avg_speed_of_molecule(temperature: float, molar_mass: float) -> float:
5748 and returns the average speed of a molecule in the gas (in m/s).
5849
5950 Examples:
51+
6052 >>> avg_speed_of_molecule(273, 0.028) # nitrogen at 273 K
6153 454.3488755020387
6254 >>> avg_speed_of_molecule(300, 0.032) # oxygen at 300 K
@@ -84,6 +76,7 @@ def mps_speed_of_molecule(temperature: float, molar_mass: float) -> float:
8476 and returns the most probable speed of a molecule in the gas (in m/s).
8577
8678 Examples:
79+
8780 >>> mps_speed_of_molecule(273, 0.028) # nitrogen at 273 K
8881 402.65620701908966
8982 >>> mps_speed_of_molecule(300, 0.032) # oxygen at 300 K
0 commit comments