Skip to content

Commit ce036db

Browse files
Fix sphinx/build_docs warnings for physics/speeds_of_gas_molecules (#12471)
* Fix sphinx/build_docs warnings for physics/speeds_of_gas_molecules * Fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix * Fix review issue * Fix * Fix * Fix --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent bfb0447 commit ce036db

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

Diff for: physics/speeds_of_gas_molecules.py

+19-17
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,43 @@
44
distribution is a probability distribution that describes the distribution of
55
speeds of particles in an ideal gas.
66
7-
The distribution is given by the following equation:
7+
The distribution is given by the following equation::
88
99
-------------------------------------------------
1010
| f(v) = (M/2πRT)^(3/2) * 4πv^2 * e^(-Mv^2/2RT) |
1111
-------------------------------------------------
1212
1313
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
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
1818
1919
More information about the Maxwell-Boltzmann distribution can be found here:
2020
https://en.wikipedia.org/wiki/Maxwell%E2%80%93Boltzmann_distribution
2121
2222
The average speed can be calculated by integrating the Maxwell-Boltzmann distribution
23-
from 0 to infinity and dividing by the total number of molecules. The result is:
23+
from 0 to infinity and dividing by the total number of molecules. The result is::
2424
25-
---------------------
26-
| vavg = √(8RT/πM) |
27-
---------------------
25+
----------------------
26+
| v_avg = √(8RT/πM) |
27+
----------------------
2828
2929
The most probable speed is the speed at which the Maxwell-Boltzmann distribution
3030
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:
31+
distribution with respect to ``v`` and setting the result equal to zero. The result is::
3232
33-
---------------------
34-
| vmp = √(2RT/M) |
35-
---------------------
33+
----------------------
34+
| v_mp = √(2RT/M) |
35+
----------------------
3636
3737
The root-mean-square speed is another measure of the average speed
3838
of the molecules in a gas. It is calculated by taking the square root
39-
of the average of the squares of the speeds of the molecules. The result is:
39+
of the average of the squares of the speeds of the molecules. The result is::
4040
41-
---------------------
42-
| vrms = √(3RT/M) |
43-
---------------------
41+
----------------------
42+
| v_rms = √(3RT/M) |
43+
----------------------
4444
4545
Here we have defined functions to calculate the average and
4646
most probable speeds of molecules in a gas given the
@@ -57,6 +57,7 @@ def avg_speed_of_molecule(temperature: float, molar_mass: float) -> float:
5757
and returns the average speed of a molecule in the gas (in m/s).
5858
5959
Examples:
60+
6061
>>> avg_speed_of_molecule(273, 0.028) # nitrogen at 273 K
6162
454.3488755020387
6263
>>> avg_speed_of_molecule(300, 0.032) # oxygen at 300 K
@@ -84,6 +85,7 @@ def mps_speed_of_molecule(temperature: float, molar_mass: float) -> float:
8485
and returns the most probable speed of a molecule in the gas (in m/s).
8586
8687
Examples:
88+
8789
>>> mps_speed_of_molecule(273, 0.028) # nitrogen at 273 K
8890
402.65620701908966
8991
>>> mps_speed_of_molecule(300, 0.032) # oxygen at 300 K

0 commit comments

Comments
 (0)