PourPy.pourbaix =============== .. py:module:: PourPy.pourbaix .. autoapi-nested-parse:: Created on Sun May 14 11:01:46 2023 @author: anjakorber Classes ------- .. autoapisummary:: PourPy.pourbaix.PourbaixDiagram Module Contents --------------- .. py:class:: PourbaixDiagram(reactive_system, line_inspection=False, HER=False, OER=False) Bases: :py:obj:`object` PourbaixDiagram class that defines and plots a Pourbaix diagram. :param reactive_system: The reactive system for which the diagram is constructed. :type reactive_system: ReactiveSystem :param HER: Hydrogen Evolution Reaction. :type HER: Reaction, optional :param OER: Oxygen Evolution Reaction. :type OER: Reaction, optional .. py:attribute:: system .. py:attribute:: inspectorMode :value: False .. py:attribute:: stable_regions .. py:method:: solve() Solve the Pourbaix diagram by computing the intersections of all Nernst equation reaction lines and the regions of stability enclosed between the lines. .. py:method:: show(backend='bokeh', plot_regions=False, labelling=True) Plots the Pourbaix diagram using the specified plotting backend. :param backend: The plotting backend to use (either 'bokeh' or 'matplotlib'). :type backend: str :raises RuntimeError: If the specified backend is invalid. .. py:method:: _get_unique_constitutents() Get a dictionary of unique constituents in the included in the reactive system. Species H+, e-, H2O(l), O2(g) and H2(g) are automatically excluded, as these species are unique constituents of the aqueous solvent bound by the HER and OER by default. :return: A dictionary of unique constituents. :rtype: dict .. py:method:: check_pH(pH_to_check) .. py:method:: _compute_intersections(unique_constituents: dict) Compute intersections between the reactions marking the stablity region of each unique constituent. :param unique_constituents: A dictionary of unique constituents. :type unique_constituents: dict .. py:method:: _compute_boundary_lines(system) :staticmethod: Compute the boundary lines that actually enclose the stability region of each unique constituent. :param system: The reactive system. :type system: ReactiveSystem .. py:method:: _construct_stability_regions() Construct stability regions on the Pourbaix diagram. This method calculates stability regions for different constituents on the Pourbaix diagram and adds corner points where the computed intersection points are on the boundary of the diagram. :return: None :rtype: None .. py:method:: _polar_angle(point, reference_point) Calculate the polar angle of a point relative to a reference intersection point. :param point: The point to calculate the angle for. :type point: tuple :param reference_point: The reference point with respect to which the angle is calculated. :type reference_point: tuple :return: The polar angle of the point relative to the reference point. :rtype: float .. py:method:: _average_values(i) .. py:method:: get_stable_phases() Get all stable phases within the created Pourbaix diagram. :return: A list of stable phases. :rtype: list .. py:method:: get_stable_phase_at(pH, potential) Get the stable phase at a specific pH, potential coordinate relative to the reference electrode. :param pH: The pH value. :type pH: float :param potential: The potential value. :type potential: float :return: The stable phase at the specified pH and potential. :rtype: str :raises: warnings.warn if the point does not exist within the calculated range. .. py:method:: _get_matplotlib_plot(plot_regions=False, labelling=True) Display the created Pourbaix diagram using Matplotlib. :return: None :rtype: None .. py:method:: _get_bokeh_plot(plot_regions=True, labelling=True) Display and return the created Pourbaix diagram using Bokeh. :return: Bokeh plot object. :rtype: Bokeh.plotting.figure