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 platinum 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.70, 7)
print(eta)


[1.   0.95 0.9  0.85 0.8  0.75 0.7 ]

In [6]:
dorogokupets2015_pt = eos.platinum.Dorogokupets2015()

In [7]:
help(eos.platinum.Dorogokupets2015)


Help on class Dorogokupets2015 in module pytheos.scales.platinum:

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=60.37930856339099)
 |      :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_pt.print_equations()


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

In [9]:
dorogokupets2015_pt.print_equations()


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

In [10]:
dorogokupets2015_pt.print_parameters()


Static:  OrderedDict([('v0', 60.37930856339099+/-0.001), ('k0', 275.0+/-0), ('k0p', 5.43+/-0)])
Thermal:  OrderedDict([('v0', 60.37930856339099+/-0.001), ('gamma0', 2.77+/-0), ('gamma_inf', 0.43+/-0), ('beta', 2.26+/-0), ('theta01', 184.0+/-0), ('m1', 1.5+/-0), ('theta02', 137.0+/-0), ('m2', 1.5+/-0)])
Anharmonic:  OrderedDict([('v0', 60.37930856339099+/-0.001), ('a0', 0.0+/-0), ('m', 0.0+/-0)])
Electronic:  OrderedDict([('v0', 60.37930856339099+/-0.001), ('e0', 7.9e-05+/-0), ('g', 0.26+/-0)])

In [11]:
v0 = 60.37930856339099

In [12]:
dorogokupets2015_pt.three_r


Out[12]:
24.943379399999998

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

In [14]:
p = dorogokupets2015_pt.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 =  3000.0
 1.000  20.72+/-0.00
 0.950  36.00+/-0.01
 0.900  57.33+/-0.01
 0.850  86.89+/-0.01
 0.800  127.75+/-0.01
 0.750  184.28+/-0.02
 0.700  262.84+/-0.02

The table is not given in this publication.


In [16]:
v = dorogokupets2015_pt.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 ]

In [ ]: