import pytheos as eos # # 2. Setup pressure scale and starting values # Setup dictionaries for pressure standard `(au_eos)` and equation to use `(fit_model)`. This allows for eos fits with a wide range of different pressure scales. # In[5]: au_eos = { 'Fei2007': eos.gold.Fei2007bm3(), 'Dorogokupets2007': eos.gold.Dorogokupets2007(), 'Yokoo2009': eos.gold.Yokoo2009(), 'Ye2017': eos.gold.Ye2017() } fit_model = { 'Fei2007': eos.BM3Model(), 'Dorogokupets2007': eos.VinetModel(), 'Yokoo2009': eos.BM3Model(), 'Ye2017': eos.VinetModel() } # Lundin et al. (2007) used the gold scale by Tsuchiya (2003). Since then many updates have been made by a few different authors. # In[6]: au_org = eos.gold.Tsuchiya2003() # Uncomment the following line to get some help. # In[7]:
# # 2. Setup fitting models # Using MgO, we create models for three equations for static EOS. Volume can be either in unit-cell volume or molar volume. But `v` and `v0` should be in the same unit. # In[5]: v0 = 11.244 k0 = 160. k0p = 4.0 # Three different equations for static EOS of MgO. # In[6]: exp_bm3 = eos.BM3Model() exp_vinet = eos.VinetModel() exp_kunc = eos.KuncModel(order=5) # this way I can handle order # Assign initial values to the parameters. # In[7]: params = exp_bm3.make_params(v0=v0, k0=k0, k0p=k0p) # # 3. Synthesize data # We make data with random noise. # In[8]:
# In[4]: import numpy as np from uncertainties import unumpy as unp import pytheos as eos # # 2. Setup pressure scale and starting values # Setup dictionaries for pressure standard `(au_eos)` and equation to use `(fit_model)`. This allows for eos fits with a wide range of different pressure scales. # In[5]: au_eos = {'Fei2007': eos.gold.Fei2007bm3(), 'Dorogokupets2007': eos.gold.Dorogokupets2007(), 'Yokoo2009': eos.gold.Yokoo2009(), 'Ye2017': eos.gold.Ye2017()} fit_model = {'Fei2007': eos.BM3Model(), 'Dorogokupets2007': eos.VinetModel(), 'Yokoo2009': eos.BM3Model(), 'Ye2017': eos.VinetModel()} # Lundin et al. (2007) used the gold scale by Tsuchiya (2003). Since then many updates have been made by a few different authors. # In[6]: au_org = eos.gold.Tsuchiya2003() # Uncomment the following line to get some help. # In[7]: #help(eos.gold.Yokoo2009)
# In[7]: v = eos.vinet_v(p, v0[standard], k0[standard], k0p[standard]) # In[8]: plt.plot(p, unp.nominal_values(v)) plt.xlabel('Pressure (GPa)') plt.ylabel('Unit-cell volume ($\mathrm{\AA}^3$)') # Fit the synthetic data to get $K_0'$ for BM equation. First, setup bm3 model. # In[9]: model_bm3 = eos.BM3Model() # Generate parameters # In[10]: params = model_bm3.make_params(v0=v0[standard], k0=k0[standard], k0p=k0p[standard].n) # Fix parameters # In[11]: params['v0'].vary = False params['k0'].vary = False