WallGo.freeEnergy
Class that does phase tracing, computes the effective potential in the minimum and interpolate it.
Classes
|
Describes properties of a local effective potential minimum. |
|
Data class containing the field value that minimizes the potential and the value of the potential in the minimum. |
- class FreeEnergy(effectivePotential, startingTemperature, startingPhaseLocationGuess, initialInterpolationPointCount=1000)[source]
Describes properties of a local effective potential minimum. This is used to keep track of a minimum with respect to the temperature. By definition, the free energy density of a phase equals the value of the effective potential in its local minimum.
Initialize a FreeEnergy object
- Parameters:
effectivePotential (EffectivePotential) – EffectivePotential object used to compute the free energy.
startingTemperature (float) – Temperature at which the interpolation of the effective potential starts.
startingPhaseLocationGuess (Fields) – Approximate position of the phase at startingTemperature.
initialInterpolationPointCount (int, optional) – Initial number of points sampled for the interpolation. The default is 1000.
- constructInterpolationFromArray(freeEnergyArrays, dT)[source]
Constructs the interpolation table directly from arrays of temperatures, field values, and potential values, bypassing the phase tracing process.
- Parameters:
freeEnergyArrays (FreeEnergyArrays) – Object containing arrays of the temperature, minimum and value of the free energy.
dT (float) – Small step in temperature used in derivatives, used here to ensure endpoints of temperature range not exceeded when taking derivatives later.
- Return type:
None
- derivative(x, order=1, bUseInterpolation=True)[source]
Override of
InterpolatableFunction.derivative()function. Specifies accuracy based on our internal variables and puts the results inFreeEnergyValueTypeformat. Otherwise similar to the parent function.- Parameters:
x (list[float] or np.ndarray) – Points where the free energy will be evaluated.
bUseInterpolatedValues (bool, optional) – Whether or not to use interpolation to evaluate the function. The default is True.
order (int)
bUseInterpolation (bool)
- Returns:
FreeEnergyValueType object containing the value of the free energy’s derivative and the field value that minimizes the potential.
- Return type:
- evaluate(x, bUseInterpolatedValues=True)[source]
Evaluate the free energy.
- Parameters:
x (list[float] or np.ndarray) – Points where the free energy will be evaluated.
bUseInterpolatedValues (bool, optional) – Whether or not to use interpolation to evaluate the function. The default is True.
- Returns:
FreeEnergyValueType object containing the value of the free energy and the field value that minimizes the potential.
- Return type:
- tracePhase(TMin, TMax, dT, rTol=1e-06, spinodal=True, paranoid=True, phaseTracerFirstStep=None, interpolationDegree=1)[source]
Traces minimum of potential
Finds the potential minimum for the range over which it exists. Takes a temperature derivative of the minimsation condition, and solves for \(\phi_i^\text{min}(T)\) as an initial value problem
\[\frac{\partial^2 V^\text{eff}}{\partial \phi_i \partial \phi_j}\bigg|_{\phi=\phi^\text{min}} \frac{\partial \phi^\text{min}_j}{\partial T} + \frac{\partial^2 V^\text{eff}}{\partial \phi_i \partial T}\bigg|_{\phi=\phi^\text{min}} = 0,\]starting from a solution at the starting temperature. It uses
scipy.integrate.solve_ivp()to solve the problem. Stops if a mass squared goes through zero.- Parameters:
TMin (float) – Minimal temperature at which the phase tracing will be done.
TMax (float) – Maximal temperature at which the phase tracing will be done.
dT (float) – Maximal temperature step size used by the phase tracer.
rTol (float, optional) – Relative tolerance of the phase tracing. The default is
1e-6.spinodal (bool, optional) – If True, stop tracing if a mass squared turns negative. The default is True.
paranoid (bool, optional) – If True, re-solve minimum after every step. The default is True.
phaseTracerFirstStep (float or None, optional) – If a float, this gives the starting step size in units of the maximum step size
dT. IfNonethen uses the initial step size algorithm ofscipy.integrate.solve_ivp. Default isNoneinterpolationDegree (int, optional) – Degree of the splines used in FreeEnergy to interpolate the potential and its derivatives. Default is 1.
- Return type:
None
- class FreeEnergyValueType(veffValue, fieldsAtMinimum)[source]
Data class containing the field value that minimizes the potential and the value of the potential in the minimum.
- Parameters:
veffValue (ndarray)
fieldsAtMinimum (Fields)