59 string listpath = string(ThermalFIST_INPUT_FOLDER) +
"/list/PDG2020/list.dat";
64 double r_meson = 0.15;
65 double r_baryon = 0.4;
68 double a_meson = 0.05;
69 double a_baryon = 0.3;
72 vector<vector<double>> bij(N, vector<double>(N, 0.));
73 vector<vector<double>> aij(N, vector<double>(N, 0.));
75 for (
int i = 0; i < N; ++i) {
76 int Bi = TPS.
Particles()[i].BaryonCharge();
77 double ri = (Bi == 0) ? r_meson : r_baryon;
78 double ai_coeff = (Bi == 0) ? a_meson : a_baryon;
79 for (
int j = 0; j < N; ++j) {
80 int Bj = TPS.
Particles()[j].BaryonCharge();
81 double rj = (Bj == 0) ? r_meson : r_baryon;
82 double aj_coeff = (Bj == 0) ? a_meson : a_baryon;
84 aij[i][j] = sqrt(ai_coeff * aj_coeff);
89 auto runTest = [&](
double T,
double muB,
double muQ,
double muS,
bool useEMM,
const string& label) {
90 cout <<
"=== " << label <<
" ===" << endl;
91 cout <<
"T = " << T <<
" GeV, muB = " << muB <<
" GeV, muQ = " << muQ <<
" GeV, muS = " << muS <<
" GeV" << endl;
92 cout <<
"EMM on pions: " << (useEMM ?
"YES" :
"NO") << endl;
96 setupModel(model, TPScopy, bij, aij, useEMM, T, muB, muQ, muS);
101 int pdgs[] = {211, 111, -211};
102 const char* names[] = {
"pi+",
"pi0",
"pi-"};
103 for (
int ip = 0; ip < 3; ++ip) {
104 int idx = TPScopy.PdgToId(pdgs[ip]);
105 auto* gd = TPScopy.Particles()[idx].GetGeneralizedDensity();
108 <<
" m*=" << gd->EffectiveMass() <<
" BEC=" << gd->IsBECPhase() << endl;
118 double sum_mu_n = 0.;
119 for (
int i = 0; i < model.TPS()->Particles().size(); ++i) {
121 double n_i = model.Densities()[i];
122 sum_mu_n += mu_i * n_i;
126 double rhs = T * s + sum_mu_n;
127 double rel_identity = (lhs != 0.) ? std::abs(lhs - rhs) / std::abs(lhs) : std::abs(lhs - rhs);
128 cout << fixed << setprecision(8);
129 cout <<
" e + P = " << lhs << endl;
130 cout <<
" T*s + sum(mu*n) = " << rhs << endl;
131 cout <<
" Rel. diff = " << scientific << rel_identity << endl;
139 double dT = 1.e-4 * T;
144 setupModel(model_p, TPSp, bij, aij, useEMM, T + 0.5 * dT, muB, muQ, muS);
152 setupModel(model_m, TPSm, bij, aij, useEMM, T - 0.5 * dT, muB, muQ, muS);
157 double dsdT_fd = (s_p - s_m) / dT;
158 double dedT_fd = (e_p - e_m) / dT;
160 double rel_dsdT = (dsdT_fd != 0.) ? std::abs(dsdT_model - dsdT_fd) / std::abs(dsdT_fd) : std::abs(dsdT_model - dsdT_fd);
161 double rel_dedT = (dedT_fd != 0.) ? std::abs(dedT_model - dedT_fd) / std::abs(dedT_fd) : std::abs(dedT_model - dedT_fd);
163 cout << fixed << setprecision(8);
164 cout <<
" ds/dT (model) = " << dsdT_model <<
" (FD) = " << dsdT_fd
165 <<
" rel.diff = " << scientific << rel_dsdT << endl;
166 cout <<
" de/dT (model) = " << fixed << dedT_model <<
" (FD) = " << dedT_fd
167 <<
" rel.diff = " << scientific << rel_dedT << endl;
170 double nB_model = model.CalculateBaryonDensity();
171 double nQ_model = model.CalculateChargeDensity();
173 double dmu = 1.e-4 * T;
179 setupModel(m_Bp, TPS_Bp, bij, aij, useEMM, T, muB + 0.5 * dmu, muQ, muS);
180 setupModel(m_Bm, TPS_Bm, bij, aij, useEMM, T, muB - 0.5 * dmu, muQ, muS);
181 m_Bp.CalculateDensities();
184 double rel_nB = (std::abs(nB_model) > 1.e-20) ?
185 std::abs(nB_model - dPdmuB_fd) / std::abs(nB_model) : std::abs(nB_model - dPdmuB_fd);
186 cout << fixed << setprecision(8);
187 cout <<
" nB (model) = " << nB_model <<
" dP/dmuB (FD) = " << dPdmuB_fd
188 <<
" rel.diff = " << scientific << rel_nB << endl;
195 setupModel(m_Qp, TPS_Qp, bij, aij, useEMM, T, muB, muQ + 0.5 * dmu, muS);
196 setupModel(m_Qm, TPS_Qm, bij, aij, useEMM, T, muB, muQ - 0.5 * dmu, muS);
197 m_Qp.CalculateDensities();
200 double rel_nQ = (std::abs(nQ_model) > 1.e-20) ?
201 std::abs(nQ_model - dPdmuQ_fd) / std::abs(nQ_model) : std::abs(nQ_model - dPdmuQ_fd);
202 cout << fixed << setprecision(8);
203 cout <<
" nQ (model) = " << nQ_model <<
" dP/dmuQ (FD) = " << dPdmuQ_fd
204 <<
" rel.diff = " << scientific << rel_nQ << endl;
210 cout <<
"====================================================" << endl;
211 cout <<
" EMM T-derivative test with differentiated EV/MF" << endl;
212 cout <<
" r_meson = " << r_meson <<
" fm, r_baryon = " << r_baryon <<
" fm" << endl;
213 cout <<
" a_meson = " << a_meson <<
", a_baryon = " << a_baryon <<
" GeV fm^3" << endl;
214 cout <<
"====================================================" << endl << endl;
217 runTest(0.150, 0.0, 0.0, 0.0,
false,
"T=150 MeV, muB=0, no EMM");
218 runTest(0.150, 0.0, 0.0, 0.0,
true,
"T=150 MeV, muB=0, with EMM");
219 runTest(0.150, 0.300, 0.0, 0.0,
false,
"T=150 MeV, muB=300 MeV, no EMM");
220 runTest(0.150, 0.300, 0.0, 0.0,
true,
"T=150 MeV, muB=300 MeV, with EMM");
221 runTest(0.120, 0.0, 0.0, 0.0,
false,
"T=120 MeV, muB=0, no EMM");
222 runTest(0.120, 0.0, 0.0, 0.0,
true,
"T=120 MeV, muB=0, with EMM");
223 runTest(0.120, 0.200, 0.0, 0.0,
true,
"T=120 MeV, muB=200 MeV, with EMM");
226 runTest(0.100, 0.0, 0.200, 0.0,
true,
"T=100 MeV, muQ=200 MeV, with EMM (BEC)");
227 runTest(0.080, 0.0, 0.200, 0.0,
true,
"T=80 MeV, muQ=200 MeV, with EMM (BEC)");
228 runTest(0.120, 0.0, 0.150, 0.0,
true,
"T=120 MeV, muQ=150 MeV, with EMM (near BEC)");
229 runTest(0.100, 0.300, 0.200, 0.0,
true,
"T=100 MeV, muB=300, muQ=200 MeV, with EMM (BEC)");