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 2007.

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]:
dorogokupets2007_au = eos.gold.Dorogokupets2007()

In [7]:
help(dorogokupets2007_au)


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

class Dorogokupets2007(pytheos.scales.objs.MGEOS)
 |  Dorogokupets and Dewaele. 2007. HPR 27, 431+
 |  
 |  Method resolution order:
 |      Dorogokupets2007
 |      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]:
dorogokupets2007_au.print_equations()


P_static:  vinet
P_thermal:  dorogokupets2007
P_anharmonic:  zharkov
P_electronic:  zharkov

In [9]:
dorogokupets2007_au.print_equations()


P_static:  vinet
P_thermal:  dorogokupets2007
P_anharmonic:  zharkov
P_electronic:  zharkov

In [10]:
dorogokupets2007_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.89+/-0), ('gamma_inf', 1.54+/-0), ('beta', 4.36+/-0), ('theta0', 170.0+/-0)])
Anharmonic:  OrderedDict([('v0', 67.84742110765599+/-0.001), ('a0', 0.0+/-0), ('m', 0.0+/-0)])
Electronic:  OrderedDict([('v0', 67.84742110765599+/-0.001), ('e0', 0.0+/-0), ('g', 0.0+/-0)])

In [11]:
v0 = 67.84742110765599

In [12]:
dorogokupets2007_au.three_r


Out[12]:
24.943379399999998

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

In [14]:
p = dorogokupets2007_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.50+/-0.00 
 0.950  24.73+/-0.00 
 0.900  38.14+/-0.00 
 0.850  57.25+/-0.01 
 0.800  84.27+/-0.01 
 0.750  122.37+/-0.01 
 0.700  176.25+/-0.01 
 0.650  252.97+/-0.02 

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


[0.   0.05 0.1  0.15 0.2  0.25 0.3  0.35]