In [1]:
%cat 0Source_Citation.txt


Source and citation

- This notebook is a part of the `pytheos` package.
- Website: http://github.com/SHDShim/pytheos.
- How to cite: S.-H. Shim (2017) Pytheos - a python tool set for equations of state. DOI: 10.5281/zenodo.802392

In [2]:
%matplotlib inline
# %matplotlib notebook # for interactive

For high dpi displays.


In [3]:
%config InlineBackend.figure_format = 'retina'

0. General note

This example compares pressure calculated from pytheos and original publication for the gold scale by Dorogokupets 2015.

1. Global setup


In [4]:
import matplotlib.pyplot as plt
import numpy as np
from uncertainties import unumpy as unp
import pytheos as eos

3. Compare


In [5]:
eta = np.linspace(1., 0.65, 8)
print(eta)


[1.   0.95 0.9  0.85 0.8  0.75 0.7  0.65]

In [6]:
dorogokupets2015_au = eos.gold.Dorogokupets2015()

In [7]:
help(dorogokupets2015_au)


Help on Dorogokupets2015 in module pytheos.scales.gold object:

class Dorogokupets2015(pytheos.scales.objs.MGEOS)
 |  Dorogokupets et al. 2015. RGG 56, 172+
 |  
 |  Method resolution order:
 |      Dorogokupets2015
 |      pytheos.scales.objs.MGEOS
 |      builtins.object
 |  
 |  Methods defined here:
 |  
 |  __init__(self, v0=67.84742110765599)
 |      :param params_st: elastic parameters for static EOS in an OrderedDict
 |          [v0 in A^3, k0 in GPa, k0p]
 |      :param params_th: thermal parameters for thermal EOS in an OrderedDict.
 |          The component can differ depending on the equation used.
 |      :param params_anh: anharmonic parameters for anharmonic correction in
 |          an OrderedDict.  The component can differ depending on the
 |          equation used.
 |      :param params_el: electronic parameters for electronic correction in
 |          an OrderedDict. The component can differ depending on the
 |          equation used.
 |      :param eqn_st: equation type for the static EOS. 'bm3', 'vinet', or
 |          'kunc'
 |      :param eqn_th: equation type for the thermal EOS. 'constq', 'tange',
 |          'speziale', 'dorogokupets2007', 'dorogokupets2015', 'alphakt'
 |      :param eqn_anh: equation type for anharmonic correction. 'zharkov',
 |      :param eqn_el: equation type for electonic correction. 'zharkov',
 |          'tsuchiya'
 |      :param t_ref: reference temperature, 300 K
 |      :param three_r: 3 times gas constant.
 |          Jamieson modified this value to compensate for mismatches
 |      :param reference: reference for the EOS
 |  
 |  ----------------------------------------------------------------------
 |  Methods inherited from pytheos.scales.objs.MGEOS:
 |  
 |  cal_p(self, v, temp)
 |      calculate total pressure at given volume and temperature
 |      
 |      :param v: unit-cell volume in A^3
 |      :param temp: temperature in K
 |      :return: pressure in GPa
 |      :note: 2017/05/10 temp must be numpy array.  If not, such as list,
 |          create an error.
 |  
 |  cal_panh(self, v, temp)
 |      calculate pressure from anharmonic contributions
 |      
 |      :param v: unit-cell volume in A^3
 |      :param temp: temperature in K
 |      :return: pressure in GPa
 |  
 |  cal_pel(self, v, temp)
 |      calculate pressure from electronic contributions
 |      
 |      :param v: unit-cell volume in A^3
 |      :param temp: temperature in K
 |      :return: pressure in GPa
 |  
 |  cal_pst(self, v)
 |      calculate static pressure at 300 K.
 |      
 |      :param v: unit-cell volume in A^3
 |      :return: static pressure at t_ref (=300 K) in GPa
 |  
 |  cal_pth(self, v, temp)
 |      calculate thermal pressure
 |      
 |      :param v: unit-cell volume in A^3
 |      :param temp: temperature in K
 |      :return: thermal pressure in GPa
 |  
 |  cal_v(self, p, temp, min_strain=0.2, max_strain=1.0)
 |      calculate unit-cell volume at given pressure and temperature
 |      
 |      :param p: pressure in GPa
 |      :param temp: temperature in K
 |      :param min_strain: minimum strain searched for volume root
 |      :param max_strain: maximum strain searched for volume root
 |      :return: unit-cell volume in A^3
 |      :note: 2017/05/10 I found wrap function is not compatible with
 |          OrderedDict. So I convert unp array to np array.
 |  
 |  print_equations(self)
 |      show equations used for the EOS
 |  
 |  print_parameters(self)
 |      show thermoelastic parameters for the EOS
 |  
 |  print_reference(self)
 |      show reference for the EOS
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from pytheos.scales.objs.MGEOS:
 |  
 |  __dict__
 |      dictionary for instance variables (if defined)
 |  
 |  __weakref__
 |      list of weak references to the object (if defined)


In [8]:
dorogokupets2015_au.print_equations()


P_static:  vinet
P_thermal:  dorogokupets2015
P_anharmonic:  zharkov
P_electronic:  zharkov

In [9]:
dorogokupets2015_au.print_equations()


P_static:  vinet
P_thermal:  dorogokupets2015
P_anharmonic:  zharkov
P_electronic:  zharkov

In [10]:
dorogokupets2015_au.print_parameters()


Static:  OrderedDict([('v0', 67.84742110765599+/-0.001), ('k0', 167.0+/-0), ('k0p', 5.9+/-0)])
Thermal:  OrderedDict([('v0', 67.84742110765599+/-0.001), ('gamma0', 2.918+/-0), ('gamma_inf', 0.66+/-0), ('beta', 2.406+/-0), ('theta01', 178.0+/-0), ('m1', 1.5+/-0), ('theta02', 84.0+/-0), ('m2', 1.5+/-0)])
Anharmonic:  OrderedDict([('v0', 67.84742110765599+/-0.001), ('a0', 0.0+/-0), ('m', 0.0+/-0)])
Electronic:  OrderedDict([('v0', 67.84742110765599+/-0.001), ('e0', 6.1e-06+/-0), ('g', 0.66+/-0)])

In [11]:
v0 = 67.84742110765599

In [12]:
dorogokupets2015_au.three_r


Out[12]:
24.943379399999998

In [13]:
v = v0 * (eta) 
temp = 2500.

In [14]:
p = dorogokupets2015_au.cal_p(v, temp * np.ones_like(v))

In [15]:
print('for T = ', temp)
for eta_i, p_i in zip(eta, p):
    print("{0: .3f} {1: .2f}".format(eta_i, p_i))


for T =  2500.0
 1.000  15.67+/-0.00
 0.950  24.96+/-0.00
 0.900  38.28+/-0.00
 0.850  57.17+/-0.01
 0.800  83.82+/-0.01
 0.750  121.43+/-0.01
 0.700  174.70+/-0.01
 0.650  250.67+/-0.02

Table is not given for this publication.


In [16]:
v = dorogokupets2015_au.cal_v(p, temp * np.ones_like(p), min_strain=0.6)
print((v/v0))


[1.   0.95 0.9  0.85 0.8  0.75 0.7  0.65]