Compressibility factor via intermolecular force potential ========================================================= The virial equation describes the deviation of a real gas from ideal gas behaviour. The virial coefficients in the virial expansion account for interactions between successively larger groups of molecules. Since interactions between large numbers of molecules are rare, the virial equation is usually truncated at the third term onwards. Under the assumption that only pair interactions are present, the compressibility factor can be linked to the intermolecular force potential. **Notation:** #. :math:`k_\text{B}` (:code:`k_B`) is :attr:`~symplyphysics.quantities.boltzmann_constant`. **Conditions:** #. The virial expansion is done up to the second virial coefficient inclusively. **Links:** #. `Wikipedia, second formula `__. .. TODO Simplify this law by reducing it to the formula of the second virial coefficient .. py:currentmodule:: symplyphysics.laws.thermodynamics.compressibility_factor_via_intermolecular_force_potential .. py:data:: compressibility_factor :attr:`~symplyphysics.symbols.thermodynamics.compressibility_factor` of the gas. Also see :doc:`Compressibility factor `. Symbol: :code:`Z` Latex: :math:`Z` Dimension: :code:`dimensionless` .. py:data:: particle_count :attr:`~symplyphysics.symbols.basic.particle_count` of the system. Symbol: :code:`N` Latex: :math:`N` Dimension: :code:`dimensionless` .. py:data:: volume :attr:`~symplyphysics.symbols.classical_mechanics.volume` of the system. Symbol: :code:`V` Latex: :math:`V` Dimension: :code:`volume` .. py:data:: intermolecular_distance :attr:`~symplyphysics.symbols.classical_mechanics.euclidean_distance` between gas molecules. Symbol: :code:`r` Latex: :math:`r` Dimension: :code:`length` .. py:data:: intermolecular_force_potential Intermolecular force potential as a function of :attr:`~intermolecular_distance`. See :attr:`~symplyphysics.symbols.classical_mechanics.potential_energy`. Symbol: :code:`U(r)` Latex: :math:`U{\left(r \right)}` Dimension: :code:`energy` .. py:data:: temperature :attr:`~symplyphysics.symbols.thermodynamics.temperature` of the system. Symbol: :code:`T` Latex: :math:`T` Dimension: :code:`temperature` .. py:data:: law :code:`Z = 1 + 2 * pi * N / V * Integral((1 - exp(-U(r) / (k_B * T))) * r^2, (r, 0, oo))` Latex: .. math:: Z = 1 + \frac{2 \pi N}{V} \int\limits_{0}^{\infty} \left(1 - \exp{\left(- \frac{U{\left(r \right)}}{k_\text{B} T} \right)}\right) r^{2}\, dr