Skip to content

Commit bacd9d1

Browse files
committed
Fix sphinx/build_docs warnings for physics/speeds_of_gas_molecules
1 parent 04fbfd6 commit bacd9d1

File tree

1 file changed

+15
-22
lines changed

1 file changed

+15
-22
lines changed

physics/speeds_of_gas_molecules.py

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,37 @@
1-
"""
1+
r"""
22
The root-mean-square, average and most probable speeds of gas molecules are
33
derived from the Maxwell-Boltzmann distribution. The Maxwell-Boltzmann
44
distribution is a probability distribution that describes the distribution of
55
speeds of particles in an ideal gas.
66
77
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}}
129
1310
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
1815
1916
More information about the Maxwell-Boltzmann distribution can be found here:
2017
https://en.wikipedia.org/wiki/Maxwell%E2%80%93Boltzmann_distribution
2118
2219
The average speed can be calculated by integrating the Maxwell-Boltzmann distribution
2320
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}}
2823
2924
The most probable speed is the speed at which the Maxwell-Boltzmann distribution
3025
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}}
3629
3730
The root-mean-square speed is another measure of the average speed
3831
of the molecules in a gas. It is calculated by taking the square root
3932
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}}
4435
4536
Here we have defined functions to calculate the average and
4637
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:
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

Comments
 (0)