.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/solutions/activity/plot_02_guntelberg_extended_law.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_solutions_activity_plot_02_guntelberg_extended_law.py: Guntelberg's extended law: correcting Debye-Huckel for finite ion size ======================================================================== The limiting law treats ions as point charges and over-corrects above :math:`I \approx 0.01` mol/L. Guntelberg's extended form adds a finite-size denominator with a single universal size parameter, :math:`Ba \approx 1`, .. math:: \log_{10}\gamma = \frac{-A z^2 \sqrt{I}}{1 + \sqrt{I}}, implemented by :func:`~chemistrykit.solutions.systems.activity.activity_coefficient_debye_huckel_extended`. It coincides with the limiting law (:func:`~chemistrykit.solutions.systems.activity.activity_coefficient_debye_huckel_limiting`) at high dilution and stays much closer to reality an order of magnitude further in ionic strength. .. GENERATED FROM PYTHON SOURCE LINES 23-51 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from chemistrykit.solutions.systems.activity import ( activity_coefficient_debye_huckel_extended, activity_coefficient_debye_huckel_limiting, ) I_range = np.logspace(-4, -0.3, 100) fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 4.5)) for z, color in [(1, "steelblue"), (2, "darkorange"), (3, "seagreen")]: g_lim = np.array([activity_coefficient_debye_huckel_limiting(z, I) for I in I_range]) g_gun = np.array([activity_coefficient_debye_huckel_extended(z, I, Ba=1.0) for I in I_range]) ax1.semilogx(I_range, g_lim, linestyle="--", color=color, alpha=0.6, label=f"z={z}, limiting") ax1.semilogx(I_range, g_gun, color=color, label=f"z={z}, Guntelberg") ax2.semilogx(I_range, g_gun / g_lim, color=color, label=f"z={z}") ax1.set_xlabel("ionic strength I (mol/L)") ax1.set_ylabel(r"activity coefficient $\gamma$") ax1.set_title("Limiting law vs. Guntelberg's extended law") ax1.legend(fontsize=8) ax2.axvline(0.01, color="gray", linestyle=":", label="I = 0.01 M") ax2.set_xlabel("ionic strength I (mol/L)") ax2.set_ylabel(r"$\gamma_{\mathrm{Guntelberg}}/\gamma_{\mathrm{limiting}}$") ax2.set_title("Size of the finite-ion-size correction") ax2.legend(fontsize=8) fig.tight_layout() .. image-sg:: /api/gallery/solutions/activity/images/sphx_glr_plot_02_guntelberg_extended_law_001.png :alt: Limiting law vs. Guntelberg's extended law, Size of the finite-ion-size correction :srcset: /api/gallery/solutions/activity/images/sphx_glr_plot_02_guntelberg_extended_law_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 52-54 Effect of the ion-size parameter Ba for a singly charged ion at I = 0.1 M (Guntelberg's choice is Ba = 1): .. GENERATED FROM PYTHON SOURCE LINES 54-59 .. code-block:: Python for Ba in (0.0, 0.5, 1.0, 1.5, 2.0): print(f"Ba = {Ba:.1f}: gamma = {activity_coefficient_debye_huckel_extended(1, 0.1, Ba=Ba):.4f}") plt.show() .. rst-class:: sphx-glr-script-out .. code-block:: none Ba = 0.0: gamma = 0.6903 Ba = 0.5: gamma = 0.7261 Ba = 1.0: gamma = 0.7546 Ba = 1.5: gamma = 0.7777 Ba = 2.0: gamma = 0.7969 .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.118 seconds) .. _sphx_glr_download_api_gallery_solutions_activity_plot_02_guntelberg_extended_law.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_02_guntelberg_extended_law.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_02_guntelberg_extended_law.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_02_guntelberg_extended_law.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_