.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/electrochem/fuel_cell/plot_01_grove_gas_battery.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_fuel_cell_plot_01_grove_gas_battery.py: Grove's gas battery: the hydrogen-oxygen fuel cell ==================================================== In 1839-1842 William Grove ran electrolysis backwards: hydrogen and oxygen over platinum electrodes in dilute acid recombined to produce a current. This example computes the reversible voltage of that cell two ways -- from the standard potentials of the O2/H2O and H+/H2 couples and from :math:`\Delta G^\circ` via :func:`~chemistrykit.electrochem.systems.fuel_cell.reversible_cell_voltage` -- its temperature dependence (:func:`~chemistrykit.electrochem.systems.fuel_cell.reversible_cell_voltage_at_temperature`), and its thermodynamic efficiency limit :math:`\Delta G/\Delta H` (:func:`~chemistrykit.electrochem.systems.fuel_cell.fuel_cell_efficiency_limit`) compared with the Carnot limit of a heat engine. .. GENERATED FROM PYTHON SOURCE LINES 19-32 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from chemistrykit.electrochem.systems.fuel_cell import ( fuel_cell_efficiency_limit, reversible_cell_voltage, reversible_cell_voltage_at_temperature, ) from chemistrykit.electrochem.systems.standard_potentials import standard_cell_potential # H2 + 1/2 O2 -> H2O(l) at 298.15 K (standard thermochemical data). dG, dH, dS, n = -237.13e3, -285.83e3, -163.3, 2 .. GENERATED FROM PYTHON SOURCE LINES 33-38 .. code-block:: Python E_table = standard_cell_potential("O2/H2O", "H+/H2") E_gibbs = reversible_cell_voltage(dG, n) print(f"From standard potentials: {E_table:.3f} V; from Delta G: {E_gibbs:.3f} V") print(f"Maximum efficiency Delta G / Delta H = {fuel_cell_efficiency_limit(dG, dH):.1%}") .. rst-class:: sphx-glr-script-out .. code-block:: none From standard potentials: 1.230 V; from Delta G: 1.229 V Maximum efficiency Delta G / Delta H = 83.0% .. GENERATED FROM PYTHON SOURCE LINES 39-41 Reversible voltage and efficiency limit vs. temperature, compared with a Carnot engine rejecting heat at 298 K. .. GENERATED FROM PYTHON SOURCE LINES 41-59 .. code-block:: Python T = np.linspace(300.0, 1000.0, 100) E_T = reversible_cell_voltage_at_temperature(dH, dS, n, T) eff_fc = fuel_cell_efficiency_limit(dH - T * dS, dH) eff_carnot = 1.0 - 298.15 / T fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 4)) ax1.plot(T, E_T) ax1.set_xlabel("T (K)") ax1.set_ylabel("Reversible voltage (V)") ax1.set_title(r"$E(T) = -(\Delta H - T\Delta S)/nF$") ax2.plot(T, eff_fc * 100, label=r"fuel cell, $\Delta G/\Delta H$") ax2.plot(T, eff_carnot * 100, label="Carnot engine (cold side 298 K)") ax2.set_xlabel("T (K)") ax2.set_ylabel("Efficiency limit (%)") ax2.legend() fig.suptitle("Grove's hydrogen-oxygen cell") fig.tight_layout() plt.show() .. image-sg:: /api/gallery/electrochem/fuel_cell/images/sphx_glr_plot_01_grove_gas_battery_001.png :alt: Grove's hydrogen-oxygen cell, $E(T) = -(\Delta H - T\Delta S)/nF$ :srcset: /api/gallery/electrochem/fuel_cell/images/sphx_glr_plot_01_grove_gas_battery_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.059 seconds) .. _sphx_glr_download_api_gallery_electrochem_fuel_cell_plot_01_grove_gas_battery.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_01_grove_gas_battery.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_01_grove_gas_battery.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_01_grove_gas_battery.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_