.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/solutions/acid_base/plot_07_van_slyke_buffer_capacity.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_acid_base_plot_07_van_slyke_buffer_capacity.py: Van Slyke's buffer capacity: how strongly a solution resists pH change ======================================================================== Donald Van Slyke defined the buffer value :math:`\beta = dC_b/d\mathrm{pH}`, the strong base per litre needed to raise the pH by one unit. For a weak acid/conjugate base pair of total concentration :math:`C` (:func:`~chemistrykit.solutions.systems.acid_base.buffer_capacity`): .. math:: \beta = \ln 10\left([H^+] + \frac{K_w}{[H^+]} + \frac{C K_a [H^+]}{(K_a+[H^+])^2}\right). The buffer term peaks at :math:`\mathrm{pH} = pK_a` with height :math:`\ln 10\,C/4`, while water alone buffers only at the extremes of the pH scale. .. GENERATED FROM PYTHON SOURCE LINES 20-40 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from chemistrykit.solutions.systems.acid_base import buffer_capacity pKa = 4.76 pH = np.linspace(1, 13, 600) fig, ax = plt.subplots(figsize=(7, 5)) for C, color in [(0.01, "seagreen"), (0.05, "darkorange"), (0.10, "steelblue")]: ax.plot(pH, buffer_capacity(pH, C=C, Ka=10**-pKa), color=color, label=f"acetate, C = {C} M") ax.plot(pH, buffer_capacity(pH, C=0.0, Ka=10**-pKa), color="gray", linestyle="--", label="water only (C = 0)") ax.axvline(pKa, color="gray", linestyle=":", linewidth=0.8) ax.set_ylim(0, 0.08) ax.set_xlabel("pH") ax.set_ylabel(r"buffer capacity $\beta$ (mol/L per pH unit)") ax.set_title("Van Slyke buffer capacity of acetate buffers") ax.legend(fontsize=8) fig.tight_layout() .. image-sg:: /api/gallery/solutions/acid_base/images/sphx_glr_plot_07_van_slyke_buffer_capacity_001.png :alt: Van Slyke buffer capacity of acetate buffers :srcset: /api/gallery/solutions/acid_base/images/sphx_glr_plot_07_van_slyke_buffer_capacity_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 41-42 Checking the peak against :math:`\ln 10\,C/4`: .. GENERATED FROM PYTHON SOURCE LINES 42-47 .. code-block:: Python for C in (0.01, 0.05, 0.10): print(f"C = {C:.2f} M: beta(pKa) = {float(buffer_capacity(pKa, C, 10**-pKa)):.5f}, ln10*C/4 = {np.log(10) * C / 4:.5f}") plt.show() .. rst-class:: sphx-glr-script-out .. code-block:: none C = 0.01 M: beta(pKa) = 0.00580, ln10*C/4 = 0.00576 C = 0.05 M: beta(pKa) = 0.02882, ln10*C/4 = 0.02878 C = 0.10 M: beta(pKa) = 0.05760, ln10*C/4 = 0.05756 .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.049 seconds) .. _sphx_glr_download_api_gallery_solutions_acid_base_plot_07_van_slyke_buffer_capacity.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_07_van_slyke_buffer_capacity.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_07_van_slyke_buffer_capacity.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_07_van_slyke_buffer_capacity.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_