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 MgO scale by Jamieson 1983.

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(0., 0.26, 53)
print(eta)


[0.    0.005 0.01  0.015 0.02  0.025 0.03  0.035 0.04  0.045 0.05  0.055
 0.06  0.065 0.07  0.075 0.08  0.085 0.09  0.095 0.1   0.105 0.11  0.115
 0.12  0.125 0.13  0.135 0.14  0.145 0.15  0.155 0.16  0.165 0.17  0.175
 0.18  0.185 0.19  0.195 0.2   0.205 0.21  0.215 0.22  0.225 0.23  0.235
 0.24  0.245 0.25  0.255 0.26 ]

In [6]:
jamieson_mgo = eos.periclase.Jamieson1982()

In [7]:
jamieson_mgo.print_equations()


P_static: Jamieson
P_thermal: Constq
P_anharmonic: None
P_electronic: None

In [8]:
jamieson_mgo.print_parameters()


Static:  OrderedDict([('rho0', 3.585+/-0), ('c0', 6.597+/-0), ('s', 1.369+/-0)])
Thermal:  OrderedDict([('v0', 74.67451012663052+/-0.001), ('gamma0', 1.32+/-0), ('q', 1.0+/-0), ('theta0', 760.0+/-0)])
Anharmonic: None
Electronic: None

In [9]:
v0 = 74.67451012663052

In [10]:
jamieson_mgo.three_r


Out[10]:
24.939153588000003

In [11]:
v = v0 * (1.-eta) 
temp = 1500.

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


In [13]:
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 =  1500.0
 0.000  6.61+/-0.00
 0.005  7.39+/-0.00
 0.010  8.19+/-0.00
 0.015  9.01+/-0.00
 0.020  9.86+/-0.00
 0.025  10.73+/-0.00
 0.030  11.62+/-0.00
 0.035  12.54+/-0.00
 0.040  13.48+/-0.00
 0.045  14.45+/-0.00
 0.050  15.45+/-0.00
 0.055  16.48+/-0.00
 0.060  17.53+/-0.00
 0.065  18.62+/-0.00
 0.070  19.73+/-0.00
 0.075  20.88+/-0.00
 0.080  22.06+/-0.00
 0.085  23.28+/-0.00
 0.090  24.53+/-0.00
 0.095  25.81+/-0.00
 0.100  27.14+/-0.00
 0.105  28.50+/-0.00
 0.110  29.90+/-0.00
 0.115  31.34+/-0.00
 0.120  32.82+/-0.00
 0.125  34.35+/-0.00
 0.130  35.92+/-0.00
 0.135  37.53+/-0.00
 0.140  39.20+/-0.00
 0.145  40.91+/-0.00
 0.150  42.68+/-0.00
 0.155  44.49+/-0.00
 0.160  46.37+/-0.00
 0.165  48.29+/-0.00
 0.170  50.28+/-0.00
 0.175  52.33+/-0.00
 0.180  54.44+/-0.00
 0.185  56.61+/-0.00
 0.190  58.85+/-0.00
 0.195  61.16+/-0.00
 0.200  63.55+/-0.00
 0.205  66.00+/-0.00
 0.210  68.54+/-0.00
 0.215  71.15+/-0.00
 0.220  73.85+/-0.00
 0.225  76.64+/-0.00
 0.230  79.51+/-0.00
 0.235  82.48+/-0.00
 0.240  85.55+/-0.00
 0.245  88.71+/-0.00
 0.250  91.98+/-0.00
 0.255  95.36+/-0.00
 0.260  98.86+/-0.00

In [14]:
v = jamieson_mgo.cal_v(p, temp * np.ones_like(p))
print(1.-(v/v0))


[0.    0.005 0.01  0.015 0.02  0.025 0.03  0.035 0.04  0.045 0.05  0.055
 0.06  0.065 0.07  0.075 0.08  0.085 0.09  0.095 0.1   0.105 0.11  0.115
 0.12  0.125 0.13  0.135 0.14  0.145 0.15  0.155 0.16  0.165 0.17  0.175
 0.18  0.185 0.19  0.195 0.2   0.205 0.21  0.215 0.22  0.225 0.23  0.235
 0.24  0.245 0.25  0.255 0.26 ]