Changing the Reference Electrode
[1]:
import pyPourbaix as pb
In the previous tutorial, we generated a simple Pourbaix diagram featuring 2 potential- and pH-dependent reactions, the Hydrogen Evolution Reaction (HER) and the Oxygen Evolution Reaction (OER). It was apparent that the plotted standard potentials \(E_0\) versus the standard hydrogen electrode of both reactions yielded the desired values. This tutorial will showcase how the reference electrode can be changed. Recall, we define a generic System by defining its .temperature, .pressure, .pHs and .electrode_potentials:
[2]:
reference_system = pb.System()
reference_system.temperature = 298.15
reference_system.pressure = 1.00
reference_system.pHs = (0,10)
reference_system.electrode_potentials = (-1.5,1.5)
We have previously also specified the system reference electrode as:
[3]:
reference_system.reference_electrode = ("SHE",0.00)
Suppose we want to shift the reference potential of the reactive system by \(\Delta E = 0.241\) V, equivalent to the potential difference between the standard hydrogen and the copper sulfate electrode. This can be done by specifying the electrode_abbreviation as CSE and the potential_difference as 0.241:
[4]:
reference_system.reference_electrode = ("CSE",0.241)
We can also define the silver-chlorde elecrode as SCE, or, in fact, any other custom electrode with a new user-defined abbreviation:
[5]:
reference_system.reference_electrode = ("custom_RE",0.420)
To keep track of your reference system, the electrode abbreviation specified will automatically appear on the y-axis of your Pourbaix diagram.
Tip: You don’t have to specify the potential difference of the common reference electrodes SHE, CSE and SCE. As long as the abbrevation is matching, the designated potential difference is automatically retrieved.
Let’s breifly check whether we manage to shift the HER and OER introduced during the last tutorial by exactly \(1.23 \text{V}\), i.e. such that the HER vs. the new reference electrode is congruent with the OER vs. the SHE.
[9]:
species = ('H|+1|, state=aq, dGf=0, dHf=0, Sm=0',
'H2, state=g, dGf=0, dHf=0, Sm=0',
'e|-1|, state=e, dGf=0, dHf=0, Sm=0',
'H2O, state=l, dGf=-2.37140E+05, dHf=-2.85830E+05, Sm=69.95',
'O2, state=g, dGf=0, dHf=0, Sm=205.137')
db = pb.Database.from_default(species)
reactions = ('2H|+1| + 2e|-1| -> H2',
'O2 + 4H|+1| + 4e|-1| -> 2H2O')
reference_system.reference_electrode = ("custom_RE",1.23)
reference_system.add_elements(["O","H"])
reference_system.set_database(db)
reference_system.add_reactions(reactions)
reference_diagram = pb.PourbaixDiagram(reference_system,line_inspection=True)
reference_diagram.solve()
reference_diagram.show(backend='matplotlib')
It appreas that both reactions have been shifted and the HER is not in the place of the OER, measured vs. the SHE. Note that the y-axis label also changes, displaying the selected reference electrode abbreviation.