.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/electrochem/voltammetry/plot_03_randles_sevcik_cyclic_voltammetry.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_electrochem_voltammetry_plot_03_randles_sevcik_cyclic_voltammetry.py: The Randles-Ševčík equation: peak current in cyclic voltammetry ================================================================= Randles and Ševčík (1948) independently showed that the peak current of a reversible linear-sweep voltammogram grows with the square root of the scan rate, :math:`i_p = 0.4463\,nFAC\sqrt{nFvD/RT}`. This example evaluates :func:`~chemistrykit.electrochem.systems.voltammetry.randles_sevcik_peak_current` over a range of scan rates, and recovers the diffusion coefficient from the slope of the :math:`i_p` vs. :math:`\sqrt{v}` plot -- the standard diagnostic for a diffusion-controlled electrode reaction. .. GENERATED FROM PYTHON SOURCE LINES 16-29 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from chemistrykit.constants import FARADAY, STANDARD_TEMPERATURE, R from chemistrykit.electrochem.systems.voltammetry import randles_sevcik_peak_current n, A, C, D_true = 1, np.pi * (1.5e-3) ** 2, 1.0, 2.4e-9 # 3 mm disc, 1 mM ferrocene-like couple v = np.array([0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0]) rng = np.random.default_rng(1948) ip = randles_sevcik_peak_current(v, n, A, C, D_true) * (1 + rng.normal(0.0, 0.01, v.size)) for vi, ipi in zip(v, ip, strict=True): print(f"v = {vi * 1e3:6.0f} mV/s: i_p = {ipi * 1e6:6.2f} uA") .. rst-class:: sphx-glr-script-out .. code-block:: none v = 10 mV/s: i_p = 9.28 uA v = 25 mV/s: i_p = 14.79 uA v = 50 mV/s: i_p = 20.67 uA v = 100 mV/s: i_p = 28.77 uA v = 250 mV/s: i_p = 47.61 uA v = 500 mV/s: i_p = 66.40 uA v = 1000 mV/s: i_p = 92.80 uA .. GENERATED FROM PYTHON SOURCE LINES 30-31 Slope of i_p vs sqrt(v) through the origin gives D. .. GENERATED FROM PYTHON SOURCE LINES 31-45 .. code-block:: Python slope = np.sum(ip * np.sqrt(v)) / np.sum(v) D_fit = (slope / (0.4463 * n * FARADAY * A * C)) ** 2 * R * STANDARD_TEMPERATURE / (n * FARADAY) print(f"\nD true = {D_true:.2e} m^2/s, D from Randles-Sevcik plot = {D_fit:.2e} m^2/s") x = np.linspace(0.0, 1.0, 50) fig, ax = plt.subplots() ax.plot(np.sqrt(v), ip * 1e6, "o", label="peak currents") ax.plot(x, slope * x * 1e6, label=r"linear in $\sqrt{v}$") ax.set_xlabel(r"$\sqrt{v}$ (V/s)$^{1/2}$") ax.set_ylabel(r"$i_p$ ($\mu$A)") ax.set_title("Randles-Ševčík plot") ax.legend() fig.tight_layout() plt.show() .. image-sg:: /api/gallery/electrochem/voltammetry/images/sphx_glr_plot_03_randles_sevcik_cyclic_voltammetry_001.png :alt: Randles-Ševčík plot :srcset: /api/gallery/electrochem/voltammetry/images/sphx_glr_plot_03_randles_sevcik_cyclic_voltammetry_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none D true = 2.40e-09 m^2/s, D from Randles-Sevcik plot = 2.41e-09 m^2/s .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.034 seconds) .. _sphx_glr_download_api_gallery_electrochem_voltammetry_plot_03_randles_sevcik_cyclic_voltammetry.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_randles_sevcik_cyclic_voltammetry.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_03_randles_sevcik_cyclic_voltammetry.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_03_randles_sevcik_cyclic_voltammetry.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_