Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add links ­— thermodynamics (1) #935

Merged
merged 2 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
**Conditions:**

#. The gas is ideal.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Kinetic_theory_of_gases#Temperature_and_kinetic_energy>`__.
"""

from sympy import Eq, solve, Rational, stats, Interval, S
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

#. The gas is in thermal equilibrium with the environment.
#. The gas particles are distributed according to Maxwell—Boltzmann statistics.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Maxwell%E2%80%93Boltzmann_distribution#Typical_speeds>`__.
"""

from sympy import Eq, sqrt, pi, S, stats, Interval
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

#. The gas is in thermal equilibrium with the environment.
#. The gas particles are distributed according to Maxwell—Boltzmann statistics.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Maxwell%E2%80%93Boltzmann_distribution#Typical_speeds>`__.
"""

from sympy import (Eq, solve, S, stats, Interval)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
**Conditions:**

#. :math:`E_i > \mu`.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Bose%E2%80%93Einstein_statistics#Bose%E2%80%93Einstein_distribution>`__.
"""

from sympy import Eq, exp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
with the environment, with a temperature T and whose volume and number of constituent particles remain
constant. For a classical discrete system the partition function is the sum of the Boltzmann factors
of all the possible energy states:

**Links:**

#. `Wikipedia, derivable from here <https://en.wikipedia.org/wiki/Partition_function_(statistical_mechanics)#Classical_discrete_system>`__.

..
NOTE replace `boltzmann_factor` with actual exponent?
"""

from typing import Sequence
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@

#. The gas is ideal.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Entropy#Entropy_change_formulas_for_simple_processes>`__.

..
TODO refactor `mass / molar_mass` into `amount_of_substance`
TODO find other link
"""

from sympy import Eq, solve, log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
Chemical potential of a thermodynamic system can be expressed as the Gibbs energy of the system
per particle. Therefore, chemical potential is an intensive physical quantity, whereas Gibbs energy
and particle count are extensive.

**Links:**

#. `Wikipedia, last formula in paragraph <https://en.wikipedia.org/wiki/Gibbs_free_energy#Definitions>`__.
"""

from sympy import Eq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
The chemical potential of the system is the amount of energy the system absorbs or releases
due to the introduction of a particle into the system, i.e. when the particle count increases
by one.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Chemical_potential#Thermodynamic_definition>`__.
"""

from sympy import Eq, Derivative, Point2D
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
The chemical potential of the system is the amount of energy the system absorbs or releases
due to the introduction of a particle into the system, i.e. when the particle count increases
by one.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Chemical_potential#Thermodynamic_definition>`__.
"""

from sympy import Eq, Derivative, Point2D
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
The chemical potential of the system is the amount of energy the system absorbs or releases
due to the introduction of a particle into the system, i.e. when the particle count increases
by one.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Chemical_potential#Thermodynamic_definition>`__.
"""

from sympy import Eq, Derivative, Point2D
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
The chemical potential of a system is the amount of energy the system absorbs or releases
due to the introduction of a particle into the system, i.e. when the particle count increases
by one.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Chemical_potential#Thermodynamic_definition>`__.
"""

from sympy import Eq, Derivative, Point2D
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
**Conditions:**

#. The gas is ideal.

**Links:**

#. Formula on p. 394 of "Statistical Mechanics" by Terrent L. Hill (1987)
"""

from sympy import Eq, log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
**Conditions:**

#. The temperature of the system is big enough to disregard quantum effects.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Dulong%E2%80%93Petit_law>`__.
"""

from sympy import Eq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

#. The virial expansion is done up to the second virial coefficient inclusively.

**Links:**

#. `Wikipedia, second formula <https://en.wikipedia.org/wiki/Compressibility_factor#Theoretical_models>`__.

..
TODO Simplify this law by reducing it to the formula of the second virial coefficient
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
#. The inertia of a Brownian particle can be neglected compared to the influence of friction forces.
#. Particles are spherical.
#. Low Reynolds number, i.e. non-turbulent flow.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Einstein_relation_(kinetic_theory)>`__.
"""

from sympy import Eq, solve, pi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
**Conditions:**

#. The mixture is ideal.

**Links:**

#. `Wikipedia, first formula <https://en.wikipedia.org/wiki/Fick%27s_laws_of_diffusion#Fick's_first_law>`__.
"""

from sympy import Eq, Derivative
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

Efficiency of a heat engine is the ratio of the useful energy to the total energy received
by the system.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Heat_engine#Efficiency>`__.
"""

from sympy import Eq, solve
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
**Conditions:**

#. Works for an infinitesimal quasi-static isothermal process.

**Links:**

#. `Wikipedia, see third table <https://en.wikipedia.org/wiki/Table_of_thermodynamic_equations#Maxwell's_relations>`__.
"""

from sympy import Eq, Derivative
Expand Down
4 changes: 4 additions & 0 deletions symplyphysics/laws/thermodynamics/enthalpy_differential.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

#. The system is in thermal equilibrium with its surroundings.
#. The system is composed of only one type of particles, i.e. the system is a pure substance.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Fundamental_thermodynamic_relation>`__.
"""

from sympy import Eq, Function as SymFunction, Symbol as SymSymbol, symbols as sympy_symbols
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
Enthalpy :math:`H` of a thermodynamic system is defined as the sum of its internal energy
:math:`U` and the product of its pressure :math:`p` and volume :math:`V`, which is sometimes
referred to as the pressure energy.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Enthalpy#Definition>`__.
"""

from sympy import Eq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

#. Particle count must be constant.
#. Pressure in the system must be constant.

**Links:**

#. `Wikipedia, equivalent concise form of this law <https://en.wikipedia.org/wiki/Gibbs%E2%80%93Helmholtz_equation>`__.
"""

from sympy import Eq, Derivative, Point2D, solve
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

#. Only applicable in the limits :math:`b \ll V_m` and :math:`a \ll p V_m^2`.
#. Inapplicable for high pressures.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Real_gas#Dieterici_model>`__.
"""

from sympy import Eq, solve, exp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
**Notation:**

#. :quantity_notation:`molar_gas_constant`.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Ideal_gas_law>`__.
"""

from sympy import (Eq, solve)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

Critical molar volume of a van der Waals fluid is proportional to the excluded volume
parameter :math:`b` of the van der Waals equation. See :ref:`vdw_critical_parameters_def`.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Van_der_Waals_equation#Critical_point_and_corresponding_states>`__.
"""

from sympy import Eq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

Critical pressure in a van der Waals fluid depends on the parameters :math:`a` and
:math:`b` of the van der Waals equation. See :ref:`vdw_critical_parameters_def`.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Van_der_Waals_equation#Critical_point_and_corresponding_states>`__.
"""

from sympy import Eq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
**Notation:**

#. :quantity_notation:`molar_gas_constant`.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Van_der_Waals_equation#Critical_point_and_corresponding_states>`__.
"""

from sympy import Eq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<vdw_reduced_units_def>`. One notable property of the dimensionless equation of state is that it
contains no substance-specific quantities, i.e. all van der Waals fluids will plot on the same
reduced pressure-volume curve at the same reduced temperature.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Van_der_Waals_equation#Critical_point_and_corresponding_states>`__.
"""

from sympy import Eq, Rational, solve
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
**Notation:**

#. :quantity_notation:`molar_gas_constant`.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Van_der_Waals_equation#>`__.
"""

from sympy import (Eq, solve)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
**Conditions:**

#. The fluid is homogeneous and in a single phase state.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Van_der_Waals_equation#Internal_energy_and_specific_heat_at_constant_volume>`__.
"""

from sympy import Eq, Integral
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
================

See :ref:`vdw_reduced_units_def`.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Van_der_Waals_equation#Critical_point_and_corresponding_states>`__.
"""

from sympy import Eq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
===================

See :ref:`vdw_reduced_units_def`.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Van_der_Waals_equation#Critical_point_and_corresponding_states>`__.
"""

from sympy import Eq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
**Note:**

#. Specific or molar volumes can be used in the right-hand side of the law.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Van_der_Waals_equation#Critical_point_and_corresponding_states>`__.
"""

from sympy import Eq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
**Conditions:**

#. The gas density is small enough within the context of perturbation theory.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Van_der_Waals_equation#Virial_expansion>`__.
"""

from sympy import Eq, solve, Symbol as SymSymbol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
the second and third virial coefficients. Moreover, the latter have been extensively studied and tabulated
for many fluids.
#. In this law the limit :math:`\rho \to 0` is assumed.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Virial_expansion>`__.
"""

from sympy import Eq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

#. This formula works for a single-component system. For a multi-component system replace the
product of chemical potential and particle count with a sum over each type of components.

**Links:**

#. `Wikipedia <https://en.wikipedia.org/wiki/Thermodynamic_potential#Euler_relations>`__.
"""

from sympy import Eq
Expand Down
Loading
Loading