File: zno.py

package info (click to toggle)
python-ase 3.26.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,484 kB
  • sloc: python: 148,112; xml: 2,728; makefile: 110; javascript: 47
file content (17 lines) | stat: -rw-r--r-- 543 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# creates: zno.png
import numpy as np

from ase.phasediagram import solvated
from ase.pourbaix import Pourbaix

refs = solvated('Zn')
refs += [('Zn', 0.0), ('ZnO', -3.323), ('ZnO2(aq)', -2.921)]
pbx = Pourbaix('ZnO', dict(refs))
energy, phase = pbx.get_pourbaix_energy(1.0, 9.0, verbose=True)
print(type(phase))
print(phase.get_free_energy(1.0, 9.0))
pbx.get_pourbaix_energy(0.0, 10.0, verbose=True)

diagram = pbx.diagram(U=np.linspace(-2, 2, 100), pH=np.linspace(0, 14, 100))

diagram.plot(show=False, include_text=True, filename='zno.png')