2.7. Fitting Birch–Murnaghan equation of state¶
This module is one of the most important part of this package since it implements a robust
Birch–Murnaghan EoS fitting for grid_interpolation
module’s use.
-
qha.fitting.
polynomial_least_square_fitting
(xs, ys, new_xs, order=3)[source]¶ The algorithm is referenced from the Wolfram MathWorld.
- Parameters
xs – A vector of existing x-coordinates.
ys – A vector of y-coordinates correspond to the xs.
new_xs – A new vector of x-coordinates to be applied with the polynomial-fitting result.
order (
Optional
[int
]) – The order chose to fit the finite strain EoS, the default value is3
, which is, the third-order Birch–Murnaghan EoS.
- Returns
A tuple, the polynomial-fitting coefficients and the new vector of y-coordinates.
-
qha.fitting.
apply_finite_strain_fitting
(strains_sparse, free_energies, strains_dense, order=3)[source]¶ Calculate the free energies \(F(T, V)\) for some strains (strains_dense), with the free energies (free_energies) on some other strains (strains_sparse) known already. Do a polynomial curve-fitting the apply the fitted function to the strains_dense.
- Parameters
strains_sparse (array(float64, 1d, A)) – A vector of the Eulerian strains for a sparse set of volumes.
free_energies (array(float64, 2d, A)) – The free energies correspond to strains_sparse at several temperature.
strains_dense (array(float64, 1d, A)) – A vector of the Eulerian strains at a denser set of volumes.
order (
Optional
[int
]) – The order chose to fit the finite strain EoS, the default value is3
, which is, the third-order Birch–Murnaghan EoS.
- Returns
The free energies correspond to strains_dense at different temperature.