.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/electrochem/battery/plot_02_voltaic_pile.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_battery_plot_02_voltaic_pile.py: Volta's pile: stacking zinc-silver cells in series ==================================================== Volta's 1800 pile was a stack of identical zinc | brine | silver (or copper) pairs. Each pair contributes the difference between the two metals' reduction potentials -- the "contact" driving force Volta insisted on against Galvani's animal electricity -- and stacking pairs in series adds their voltages. This example computes the single-pair voltage with :func:`~chemistrykit.electrochem.systems.standard_potentials.cell_potential`, shows how the pile voltage grows linearly with the number of pairs, and compares Volta's zinc-silver pairing with zinc-copper and a frog-leg-free "same metal" pair that produces nothing at all. .. GENERATED FROM PYTHON SOURCE LINES 17-23 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from chemistrykit.electrochem.systems.standard_potentials import STANDARD_REDUCTION_POTENTIALS as T from chemistrykit.electrochem.systems.standard_potentials import cell_potential .. GENERATED FROM PYTHON SOURCE LINES 24-27 One pair: silver is the cathode (more positive reduction potential), zinc the anode. Two pieces of the *same* metal give exactly zero -- the dissimilarity of the metals is what matters. .. GENERATED FROM PYTHON SOURCE LINES 27-35 .. code-block:: Python pairs = { "Zn | Ag (Volta)": cell_potential(T["Ag+/Ag"], T["Zn2+/Zn"]), "Zn | Cu": cell_potential(T["Cu2+/Cu"], T["Zn2+/Zn"]), "Zn | Zn": cell_potential(T["Zn2+/Zn"], T["Zn2+/Zn"]), } for name, E in pairs.items(): print(f"{name:16s}: {E:.2f} V per pair") .. rst-class:: sphx-glr-script-out .. code-block:: none Zn | Ag (Volta) : 1.56 V per pair Zn | Cu : 1.10 V per pair Zn | Zn : 0.00 V per pair .. GENERATED FROM PYTHON SOURCE LINES 36-37 Stacking N identical pairs in series multiplies the voltage by N. .. GENERATED FROM PYTHON SOURCE LINES 37-47 .. code-block:: Python n_pairs = np.arange(1, 61) fig, ax = plt.subplots() for name, E in pairs.items(): ax.plot(n_pairs, n_pairs * E, label=name) ax.set_xlabel("Number of pairs in the pile") ax.set_ylabel("Open-circuit pile voltage (V)") ax.set_title("Volta's pile: series stacking of two-metal cells") ax.legend() fig.tight_layout() plt.show() .. image-sg:: /api/gallery/electrochem/battery/images/sphx_glr_plot_02_voltaic_pile_001.png :alt: Volta's pile: series stacking of two-metal cells :srcset: /api/gallery/electrochem/battery/images/sphx_glr_plot_02_voltaic_pile_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.038 seconds) .. _sphx_glr_download_api_gallery_electrochem_battery_plot_02_voltaic_pile.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_voltaic_pile.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_02_voltaic_pile.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_02_voltaic_pile.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_