1
- """
1
+ r """
2
2
The root-mean-square, average and most probable speeds of gas molecules are
3
3
derived from the Maxwell-Boltzmann distribution. The Maxwell-Boltzmann
4
4
distribution is a probability distribution that describes the distribution of
5
5
speeds of particles in an ideal gas.
6
6
7
7
The 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}}
12
9
13
10
where:
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
18
15
19
16
More information about the Maxwell-Boltzmann distribution can be found here:
20
17
https://en.wikipedia.org/wiki/Maxwell%E2%80%93Boltzmann_distribution
21
18
22
19
The average speed can be calculated by integrating the Maxwell-Boltzmann distribution
23
20
from 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}}
28
23
29
24
The most probable speed is the speed at which the Maxwell-Boltzmann distribution
30
25
is 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}}
36
29
37
30
The root-mean-square speed is another measure of the average speed
38
31
of the molecules in a gas. It is calculated by taking the square root
39
32
of 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}}
44
35
45
36
Here we have defined functions to calculate the average and
46
37
most probable speeds of molecules in a gas given the
@@ -57,6 +48,7 @@ def avg_speed_of_molecule(temperature: float, molar_mass: float) -> float:
57
48
and returns the average speed of a molecule in the gas (in m/s).
58
49
59
50
Examples:
51
+
60
52
>>> avg_speed_of_molecule(273, 0.028) # nitrogen at 273 K
61
53
454.3488755020387
62
54
>>> 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:
84
76
and returns the most probable speed of a molecule in the gas (in m/s).
85
77
86
78
Examples:
79
+
87
80
>>> mps_speed_of_molecule(273, 0.028) # nitrogen at 273 K
88
81
402.65620701908966
89
82
>>> mps_speed_of_molecule(300, 0.032) # oxygen at 300 K
0 commit comments