pwtools.eos.EosFit¶
- class pwtools.eos.EosFit(volume, energy, func=<pwtools.eos.Vinet object>, splpoints=500)[source]¶
Bases:
Fit1D
E(V) fit class.
Examples
>>> from pwtools.eos import EosFit >>> from pwtools.constants import eV_by_Ang3_to_GPa >>> V = linspace(30, 50, 20) >>> E = (V-40)**2.0 / 50.0 + 30 + rand(len(V)) / 5.0 >>> plot(V, E, 'o') >>> f = EosFit(V, E) >>> vv = linspace(V.min(), V.max(), 200) >>> plot(vv, f(vv), 'r-') >>> v0 = f.params['v0'] >>> print("compare fit params and values obtained from methods:") >>> print("V0: %f Ang^3 (%f)" %(v0, f.get_min())) >>> print("B0: %f GPa (%f)" %(f.params['b0']*eV_by_Ang3_to_GPa, f.bulkmod(v0))) >>> print("B1: %f " %f.params['b1']) >>> print("E0: %f eV (%f)" %(f.params['e0'], f(v0))) >>> print("P0: %f GPa " %f.pressure(v0))
- __init__(volume, energy, func=<pwtools.eos.Vinet object>, splpoints=500)[source]¶
- Parameters:
volume (1d array) – volume per atom [Ang^3]
energy (1d array) – total energy per atom [eV]
func (EVFunction instance)
splpoints (int) – number of spline points for fallback derivative calculation
- __call__(volume, der=0)[source]¶
- Parameters:
volume (scalar, 1d array) – volume per atom [Ang^3]
der (int) – derivative order
Methods
bulkmod
(volume)B(V) [GPa]
fit
()Fit E(V) model, fill
self.params
.get_max
([x0, xab])Convenience method.
get_min
()V0 [Ang^3]
get_root
([x0, xab])Return x where y(x) = 0 by calculating the root of the fit function.
is_mono
()Return True if the curve described by the fit function f(x) is monotonic.
pressure
(volume)P(V) [GPa]
Attributes