Closed ashtonmv closed 1 year ago
@kristinpersson Maybe get one of your folks working on the Pourbaix stuff to look into this?
@ashtonmv Hey Michael, using the pymatgen.analysis.pourbaix.plotter functions you can enable the labeling of all the entries in a Pourbaix domain. I think the problem in this specific case is due to the way the Pourbaix entries are generated for doing the Pourbaix analysis. In this example I can only find “Pourbaix Entry”.
However, for more than 1 non H and O elements considered for the Pourbaix analysis, the pymatgen.analysis.pourbaix.maker creates multi-entries, or “Multiple Pourbaix Entry”, which are combination of the “Pourbaix Entry”. These multi-entries can have # of Pourbaix Entry < = # of non H and O elements considered in your Pourbaix analysis. This is based on the Gibbs phase rule. You can see an example of this for the case of a ternary Ag, Te, N system in the pymatgen.analysis.pourbaix.tests.test_analyzer. Please use the latest version since we added the ternary test recently.
Hi Arunima,
Thanks so much! I am surprised the solution was so simple- I just needed to add a comp_dict
as an argument when I created the PourbaixGiagram object (I also had a few bugs in the above code).
As far as I can tell, the actual values in comp_dict
do not affect the Pourbaix diagram, so maybe comp_dict
can just be automatically generated based on the entries used and should not need to be specified as an argument? Have I misunderstood that?
@ashtonmv, Hi Michael, It is great that you were able to generate the PourbaixDiagram object for multi-element systems. Since only those multi-entries which have the ratio of elements same as in the comp_dict are retained in the Pourbaix diagram, the Pourbaix diagrams should be affected quite a bit by the comp dict. Note that the individual entries in the multi-entries have weights. These weights are not available through the MP website Pourbaix app, but are easy to get from pymatgen.
For example, for the V: Co Pourbaix diagram you will see that the Pourbaix stable domain at potential < -2 V changes when a {‘V’: 0.8,’Co’: 0.2} comp_dict is used instead of the default {‘V’: 0.5, ‘Co’: 0.5}. In both cases though, the Pourbaix stable entries satisfy the comp_dict with certain weights for each entry in the “Multi Entry”. It is possible that for the cases you examined the Pourbaix diagram does not change since the comp_dict is satisfied by the same set of multi-entries in the entire composition range. However, the weights of the entries in each multi-entry should be changing as you change the comp_dict.
Ah okay, that makes a lot of sense. I was not seeing the weights for each entry. Thanks!
Summary
Example code
Suggested solution (if any)
Files (if any)