pttools.models.analytic
Base class for analytical models
Classes
- class pttools.models.analytic.AnalyticModel(V_s=DEFAULT_V_S, V_b=None, a_s=None, a_b=None, g_s=None, g_b=None, T_min=None, T_max=None, T_crit_guess=None, name=None, label_latex=None, label_unicode=None, gen_critical=True, gen_cs2=True, gen_cs2_neg=True, allow_invalid=False, auto_potential=False, log_info=True)
Bases:
Model,ABCA generic analytical model, where the temperature dependence of \(g_\text{eff}\) is implemented directly in the equation of state.
You should specify either the relativistic degrees of freedom \(g_\text{eff}(\phi=s)\) and \(g_\text{eff}(\phi=b)\), or the prefactors \(a_s\) and \(a_b\). The convention for the latter is as in Hindmarsh et al., 2021 eq. 7.33. for the bag model, where
\[p_s = a_sT^4 - V_s,\]\[p_b = a_bT^4 - V_b.\]- Parameters:
V_s (float) – \(V_s = \epsilon_s\), the potential term of \(p\) in the symmetric phase
V_b (float) – \(V_b = \epsilon_b\), the potential term of \(p\) in the broken phase
a_s (float) – prefactor of \(p\) in the symmetric phase
a_b (float) – prefactor of \(p\) in the broken phase
g_s (float) – \(g_\text{eff}(\phi=s)\), degrees of freedom for \(p\) in the symmetric phase at T=T0
g_b (float) – \(g_\text{eff}(\phi=b)\), degrees of freedom for \(p\) in the broken phase at T=T0
name (str) – custom name for the model
auto_potential (bool) – set V_s and V_b so that T_c = 1 (bag model only)
T_min (float)
T_max (float)
T_crit_guess (float)
label_latex (str)
label_unicode (str)
gen_critical (bool)
gen_cs2 (bool)
gen_cs2_neg (bool)
allow_invalid (bool)
log_info (bool)
- DEFAULT_A_G_MULT = 1.1
- DEFAULT_V_S = 1
- static a_from_g(g)
Get the prefactor \(a\) from the relativistic degrees of freedom \(g\).
- alpha_n_bag(wn, error_on_invalid=True, nan_on_invalid=True, log_invalid=True)
Transition strength parameter at nucleation temperature, \(\alpha_n\), Hindmarsh et al., 2021, eq. 7.40.
\[\alpha_n = \frac{4}{3w_n}(V_s - V_b)\]- Parameters:
wn (float | float64 | ndarray) – \(w_n\), enthalpy of the symmetric phase at the nucleation temperature
error_on_invalid (bool) – raise error for invalid values
nan_on_invalid (bool) – return nan for invalid values
log_invalid (bool) – log negative values
- Return type:
float | float64 | ndarray
- classmethod alpha_n_min_find_params_a_g(a_s, a_b, g_s, g_b, alpha_n_min_target, V_s_default, V_b, default_mult=DEFAULT_A_G_MULT, safety_factor_alpha=Model.ALPHA_N_MIN_FIND_SAFETY_FACTOR_ALPHA)
- Parameters:
a_s (float)
a_b (float)
g_s (float)
g_b (float)
alpha_n_min_target (float)
V_s_default (float)
V_b (float)
default_mult (float)
- alpha_plus_bag(wp, wm, vp_tilde=None, sol_type=None, error_on_invalid=True, nan_on_invalid=True, log_invalid=True)
Transition strength parameter \(\alpha_+\), Hindmarsh et al., 2021, eq. 7.25.
\[\alpha_+ = \frac{4}{3w_+}(V_s - V_b)\]- Parameters:
wp (float | float64 | ndarray) – \(w_+\), enthalpy ahead of the wall
wm (float | float64 | ndarray) – \(w_-\), enthalpy behind the wall (not used)
error_on_invalid (bool) – raise error for invalid values
nan_on_invalid (bool) – return nan for invalid values
log_invalid (bool) – whether to log invalid values
vp_tilde (float)
sol_type (SolutionType)
- Return type:
float | float64 | ndarray
- export()
Export the model parameters to a dictionary. User-created model classes should extend this.
- Return type:
Dict[str, any]
- static g_from_a(a)
- ge_temp(temp, phase)
- classmethod get_a_g(a_s, a_b, g_s, g_b, default_mult=DEFAULT_A_G_MULT)
- Parameters:
a_s (float)
a_b (float)
g_s (float)
g_b (float)
default_mult (float)
- gp_temp(temp, phase)