11 m_Particle(particle), m_FieldPressure(FieldPressure)
18 m_Meff = m_Particle.Mass();
19 m_Pressure = m_Density = m_DensityScalar = m_EntropyDensity = m_Chi2 = 0.;
24 if (m_FieldPressure != NULL)
25 delete m_FieldPressure;
26 m_FieldPressure = NULL;
31 m_Particle(other.m_Particle), m_FieldPressure(NULL)
35 m_isSolved = other.m_isSolved;
36 m_isBEC = other.m_isBEC;
37 m_TBEC = other.m_TBEC;
38 m_Meff = other.m_Meff;
39 m_Pressure = other.m_Pressure;
40 m_Density = other.m_Density;
41 m_DensityScalar = other.m_DensityScalar;
42 m_EntropyDensity = other.m_EntropyDensity;
43 m_Chi2 = other.m_Chi2;
46 m_FieldPressure = other.m_FieldPressure->
clone();
52 if (m_Particle.Statistics() != -1 || Mu <= m_Particle.Mass())
55 if ((Mu - m_Particle.Mass()) < 1.e-9)
71 vector<double> vars(1, log(TBECinit / m_Particle.Mass()));
72 vars = broydn.
Solve(vars, &criterium);
74 double TBEC = m_Particle.Mass() * exp(vars[0]);
87 m_isBEC = (Mu > m_Particle.Mass());
89 else if (m_Particle.Statistics() == -1 && (m_T < 0. || Mu != m_Mu)) {
91 m_isBEC = (T <= m_TBEC);
94 if (T != m_T || Mu != m_Mu)
106 m_Meff = m_Particle.Mass();
116 if (std::isnan(meffinit))
117 meffinit = m_Particle.Mass();
120 if (m_Particle.Statistics() == -1 && m_Mu > m_Particle.Mass())
128 vector<double> vars(1, meffinit);
129 vars = broydn.
Solve(vars, &criterium);
131 if (m_Particle.Statistics() == -1 && m_Mu > m_Particle.Mass())
132 m_Meff = m_Mu * (1. + exp(vars[0]));
152 return m_FieldPressure->pf(m_Meff);
161 + m_FieldPressure->pf(m_Meff);
171 return m_FieldPressure->Dpf(m_Meff);
182 + m_FieldPressure->Dpf(m_Meff);
224 double dmu = 0.001 * m_Particle.Mass();
228 double ret = (n2 - n1) / dmu;
235 double dmu = 0.001 * m_Particle.Mass();
239 double ret = (np1 - 2.*n0 + nm1) / dmu / dmu;
247 double dmu = 0.001 * m_Particle.Mass();
253 double ret = (0.5 * np2 - np1 + nm1 - 0.5 * nm2) / dmu / dmu / dmu;
281 m_Particle.Statistics(), m_T, m_Mu, m_Meff, m_Particle.Degeneracy());
283 return dndT_fixedm + dndm *
DmeffDT();
289 m_Particle.Statistics(), m_T, m_Mu, m_Meff, m_Particle.Degeneracy());
291 double dT = 1.e-4 * m_T;
293 m_Particle.Statistics(), m_T + 0.5 * dT, m_Mu, m_Meff, m_Particle.Degeneracy());
295 m_Particle.Statistics(), m_T - 0.5 * dT, m_Mu, m_Meff, m_Particle.Degeneracy());
296 double drhosdT = (rhos_p - rhos_m) / dT;
297 return dndT_fixedm - drhosdT;
305 double dT = 1.e-4 * m_T;
310 return (dndT_p - dndT_m) / dT;
318 double dT = 1.e-4 * m_T;
323 return (e_p - e_m) / dT;
328 double dmu = 0.001 * m_Particle.Mass();
333 return (e_p - e_m) / dmu;
341 double dT = 1.e-4 * m_T;
346 return (chi2_p - chi2_m) / dT;
357 m_Particle.Statistics(), m_T, m_Mu, m_Meff, m_Particle.Degeneracy());
360 return dsdT_fixedm + dsdm *
DmeffDT();
367 throw std::runtime_error(
"**ERROR** EffectiveMassModel::Quantity(): Calculate " + std::to_string(
static_cast<int>(quantity)) +
" quantity is not implemented!");
387 double dT = 1.e-4 * m_T;
389 m_Particle.Statistics(), m_T + 0.5 * dT, m_Mu, m_Meff, m_Particle.Degeneracy());
391 m_Particle.Statistics(), m_T - 0.5 * dT, m_Mu, m_Meff, m_Particle.Degeneracy());
392 double drhosdT = (rhos_p - rhos_m) / dT;
397 double D2pf = m_FieldPressure->D2pf(m_Meff);
398 double denom = D2pf - drhosdm;
401 if (std::abs(denom) < 1.e-20)
404 return drhosdT / denom;
412 double dm = 1.e-4 * m_Meff;
417 m_Particle.Statistics(), m_T, m_Mu, m_Meff + 0.5 * dm, m_Particle.Degeneracy());
419 m_Particle.Statistics(), m_T, m_Mu, m_Meff - 0.5 * dm, m_Particle.Degeneracy());
421 return (Q_p - Q_m) / dm;
426 double TBEC = m_EMM->m_Particle.Mass() * exp(x[0]);
427 double ret = m_EMM->m_FieldPressure->Dpf(m_MuBEC) /
430 return std::vector<double>(1, ret);
435 double ret = m_EMM->m_FieldPressure->Dpf(x[0]) /
438 return std::vector<double>(1, ret);
443 double meff = m_EMM->m_Mu * (1. + exp(x[0]));
444 double ret = m_EMM->m_FieldPressure->Dpf(meff) /
447 return std::vector<double>(1, ret);
456 double n0 = m_FieldPressure->Dpf(m_Meff);
Header with effective mass model implementation, including the Bose-condensed phase.
map< string, double > params
Sub-class where it is determined whether the required accuracy is achieved in the Broyden's method.
Abstract class which defines the system of non-linear equations to be solved by the Broyden's method.
Class implementing the Broyden method to solve a system of non-linear equations.
virtual std::vector< double > Solve(const std::vector< double > &x0, BroydenSolutionCriterium *solcrit=NULL, int max_iterations=MAX_ITERS)
int MaxIterations() const
Base class implementing field pressure contribution function in the effective mass model....
virtual EMMFieldPressure * clone() const
Creates a clone of this EMMFieldPressure object.
Class implementing the effective mass model gap equation with constraints. Uses variable transformati...
std::vector< double > Equations(const std::vector< double > &x)
Implements the equations to be solved.
Class implementing the effective mass model gap equation. To be solved using Broyden's method.
std::vector< double > Equations(const std::vector< double > &x)
Implements the equations to be solved.
Class implementing the effective mass model equation to determine BEC onset. To be solved using Broyd...
std::vector< double > Equations(const std::vector< double > &x)
Implements the equations to be solved.
double ComputeTBEC(double Mu, double TBECinit=-1.) const
Calculates the temperature of BEC formation for a given chemical potential.
bool IsSolved() const
Checks if the EMM equations are solved.
void SetParameters(double T, double Mu)
Sets the temperature and chemical potential of the particle.
virtual bool IsBECPhase() const
Checks if the particle is in a Bose-Einstein condensed phase.
void SolveMeff(double meffinit=-1.)
Solves for the effective mass using the given parameters.
double Density() const
Calculates the number density in 1/fm^3.
double EnergyDensity() const
Calculates the energy density in GeV/fm^3.
double DmeffDT() const
Computes the temperature derivative of the effective mass dm_eff/dT at fixed mu.
EffectiveMassModel(const ThermalParticle &particle=ThermalParticle(true, "pi", 211, 1.0, -1, 0.135, 0, 0, 1), EMMFieldPressure *FieldPressure=NULL)
Constructor for the EffectiveMassModel class.
double Pressure() const
Calculates the pressure in GeV/fm^3.
double IdealGasQuantityMassDerivative(IdealGasFunctions::Quantity quantity) const
Computes the derivative of an ideal gas quantity with respect to mass, (dQ^id/dm)|_{T,...
virtual double Quantity(IdealGasFunctions::Quantity quantity, double T, double mu)
Calculates a thermodynamic quantity.
virtual double BECFraction() const
Calculates the fraction of particles in the BEC phase.
double EntropyDensity() const
Calculates the entropy density in 1/fm^3.
virtual ~EffectiveMassModel(void)
Destructor for the EffectiveMassModel class.
Class containing all information about a particle specie.
double IdealGasQuantity(Quantity quantity, QStatsCalculationType calctype, int statistics, double T, double mu, double m, double deg, int order=1, const IdealGasFunctionsExtraConfig &extraConfig=IdealGasFunctionsExtraConfig())
Calculation of a generic ideal gas function.
Quantity
Identifies the thermodynamic function.
constexpr double GeVtoifm3()
A constant to transform GeV into fm .
The main namespace where all classes and functions of the Thermal-FIST library reside.
Structure containing all thermal parameters of the model.