An example of calculating various thermodynamic quantities at fixed T and \(\mu_B\).
For each specified value of a \(T-\mu_B\) pair does the following.
#include <string.h>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <ctime>
#include <cstdio>
#include "ThermalFISTConfig.h"
#ifdef ThermalFIST_USENAMESPACE
#endif
int main(
int argc,
char *argv[])
{
int ModelType = 1;
if (argc > 1)
ModelType = atoi(argv[1]);
std::string prefix = "QvdW-HRG";
if (ModelType != 1)
prefix = "IdealHRG";
vector<double> Tvalues, muvalues;
Tvalues.push_back(0.100); muvalues.push_back(0.600);
Tvalues.push_back(0.130); muvalues.push_back(0.500);
Tvalues.push_back(0.160); muvalues.push_back(0.000);
if (ModelType == 1)
{
double a = 0.329;
double b = 3.42;
for (
int i1 = 0; i1 < model->
TPS()->
Particles().size(); ++i1) {
for (
int i2 = 0; i2 < model->
TPS()->
Particles().size(); ++i2) {
if (!(B1 * B2 > 0)) {
continue;
}
else {
}
}
}
}
else {
}
printf("%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s\n",
"T[GeV]", "muB[GeV]",
"P[GeV/fm3]", "e[GeV/fm3]", "s[fm-3]",
"<K+>", "<pi+>", "<K+>/<pi+>",
"w[K+]", "w[pi+]",
"<N->", "w[N-]",
"chi3B/chi2B", "chi4B/chi2B",
"chi3Q/chi2Q", "chi4Q/chi2Q",
"chi3S/chi2S", "chi4S/chi2S");
std::string filename = prefix + ".CalculationTmu.dat";
FILE *f = fopen(filename.c_str(), "w");
fprintf(f, "%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s\n",
"T[GeV]", "muB[GeV]",
"P[GeV/fm3]", "e[GeV/fm3]", "s[fm-3]",
"<K+>", "<pi+>", "<K+>/<pi+>",
"w[K+]", "w[pi+]",
"<N->", "w[N-]",
"chi3B/chi2B", "chi4B/chi2B",
"chi3Q/chi2Q", "chi4Q/chi2Q",
"chi3S/chi2S", "chi4S/chi2S");
for (int i = 0; i < Tvalues.size(); ++i) {
double T = Tvalues[i];
double muB = muvalues[i];
double yieldKplus = model->
GetDensity(321, Feeddown::StabilityFlag) * model->
Volume();
double yieldpiplus = model->
GetDensity(211, Feeddown::StabilityFlag) * model->
Volume();
vector<double> chchis;
for (
int i = 0; i < model->
TPS()->
Particles().size(); ++i) {
}
double chi2B = chchis[1];
double chi3B = chchis[2];
double chi4B = chchis[3];
for (
int i = 0; i < model->
TPS()->
Particles().size(); ++i) {
chargesQ[i] = model->
TPS()->
Particles()[i].ElectricCharge();
}
double chi2Q = chchis[1];
double chi3Q = chchis[2];
double chi4Q = chchis[3];
for (
int i = 0; i < model->
TPS()->
Particles().size(); ++i) {
}
double chi2S = chchis[1];
double chi3S = chchis[2];
double chi4S = chchis[3];
printf("%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf\n",
T,
muB,
p,
e,
s,
yieldKplus,
yieldpiplus,
yieldKplus/yieldpiplus,
wKplus,
wpiplus,
Nminus,
wNminus,
chi3B / chi2B,
chi4B / chi2B,
chi3Q / chi2Q,
chi4Q / chi2Q,
chi3S / chi2S,
chi4S / chi2S);
fprintf(f, "%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf\n",
T,
muB,
p,
e,
s,
yieldKplus,
yieldpiplus,
yieldKplus / yieldpiplus,
wKplus,
wpiplus,
Nminus,
wNminus,
chi3B / chi2B,
chi4B / chi2B,
chi3Q / chi2Q,
chi4Q / chi2Q,
chi3S / chi2S,
chi4S / chi2S);
}
fclose(f);
delete model;
return 0;
}