%config InlineBackend.figure_format = 'retina'

"""
Explanation: For high dpi displays.
End of explanation
"""


import matplotlib.pyplot as plt
import numpy as np
from uncertainties import unumpy as unp
import pytheos as eos

"""
Explanation: 0. General note
This example compares pressure calculated from pytheos and original publication for the platinum scale by Dorogokupets 2007.
1. Global setup
End of explanation
"""


eta = np.linspace(1., 0.70, 7)
print(eta)

dorogokupets2007_pt = eos.platinum.Dorogokupets2007()

help(dorogokupets2007_pt)

dorogokupets2007_pt.print_equations()

dorogokupets2007_pt.print_equations()

dorogokupets2007_pt.print_parameters()

v0 = 60.37930856339099

dorogokupets2007_pt.three_r

v = v0 * (eta) 
temp = 3000.

p = dorogokupets2007_pt.cal_p(v, temp * np.ones_like(v))

"""
Explanation: 3. Compare
End of explanation
"""


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

v = dorogokupets2007_pt.cal_v(p, temp * np.ones_like(p), min_strain=0.6)
print(1.-(v/v0))

"""
Explanation: <img src='./tables/Dorogokupets2007_Pt.png'>
End of explanation
"""


