.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/thermo/mixtures/plot_03_osmotic_pressure.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_api_gallery_thermo_mixtures_plot_03_osmotic_pressure.py: van't Hoff's osmotic pressure law, Pi = iMRT ============================================ van't Hoff found that a dilute solution's osmotic pressure (:func:`~chemistrykit.thermo.systems.mixtures.osmotic_pressure`) equals the pressure the solute particles would exert as an ideal gas at the same concentration and temperature. The factor :math:`i` counts particles per formula unit: 1 for sucrose, about 2 for NaCl. The same factor multiplies the other colligative effects, freezing-point depression and boiling-point elevation (:func:`~chemistrykit.thermo.systems.mixtures.freezing_point_depression`, :func:`~chemistrykit.thermo.systems.mixtures.boiling_point_elevation`). .. GENERATED FROM PYTHON SOURCE LINES 17-52 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from chemistrykit.thermo.systems.equations_of_state import IdealGas from chemistrykit.thermo.systems.mixtures import ( CRYOSCOPIC_CONSTANTS, boiling_point_elevation, freezing_point_depression, osmotic_pressure, ) T = 298.15 c = np.linspace(0.0, 0.5, 100) # mol/L M = c * 1000.0 # mol/m^3 fig, axes = plt.subplots(1, 2, figsize=(12, 4.8)) axes[0].plot(c, osmotic_pressure(M, T, i=1.0) / 1e5, label="sucrose (i = 1)") axes[0].plot(c, osmotic_pressure(M, T, i=2.0) / 1e5, label="NaCl (i = 2)") Vm_gas = 1.0 / np.maximum(M, 1e-12) axes[0].plot(c[::10], IdealGas().pressure(Vm_gas[::10], T) / 1e5, "k.", label="ideal gas at same n/V") axes[0].set_xlabel("solute concentration (mol/L)") axes[0].set_ylabel(r"osmotic pressure $\Pi$ (bar)") axes[0].set_title("Solute particles behave like an ideal gas") axes[0].legend() water = CRYOSCOPIC_CONSTANTS["water"] b = c # dilute aqueous: molality close to molarity axes[1].plot(b, freezing_point_depression(water["Kf"], b, i=2.0), label="freezing-point depression") axes[1].plot(b, boiling_point_elevation(water["Kb"], b, i=2.0), label="boiling-point elevation") axes[1].set_xlabel("NaCl molality (mol/kg)") axes[1].set_ylabel(r"$\Delta T$ (K)") axes[1].set_title("Other colligative effects share the factor i = 2") axes[1].legend() fig.tight_layout() .. image-sg:: /api/gallery/thermo/mixtures/images/sphx_glr_plot_03_osmotic_pressure_001.png :alt: Solute particles behave like an ideal gas, Other colligative effects share the factor i = 2 :srcset: /api/gallery/thermo/mixtures/images/sphx_glr_plot_03_osmotic_pressure_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 53-57 .. code-block:: Python print(f"0.1 M sucrose at 25 degC: Pi = {osmotic_pressure(100.0, T) / 1e5:.3f} bar") print(f"Isotonic saline (0.154 M NaCl, i = 2) at 37 degC: Pi = {osmotic_pressure(154.0, 310.15, i=2.0) / 1e5:.2f} bar") plt.show() .. rst-class:: sphx-glr-script-out .. code-block:: none 0.1 M sucrose at 25 degC: Pi = 2.479 bar Isotonic saline (0.154 M NaCl, i = 2) at 37 degC: Pi = 7.94 bar .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.078 seconds) .. _sphx_glr_download_api_gallery_thermo_mixtures_plot_03_osmotic_pressure.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_03_osmotic_pressure.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_03_osmotic_pressure.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_03_osmotic_pressure.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_