Thermal-FIST  1.3
Package for hadron resonance gas model applications
ThermalModelEVDiagonal.cpp
Go to the documentation of this file.
1 /*
2  * Thermal-FIST package
3  *
4  * Copyright (c) 2014-2019 Volodymyr Vovchenko
5  *
6  * GNU General Public License (GPLv3 or later)
7  */
9 
10 #ifdef USE_OPENMP
11 #include <omp.h>
12 #endif
13 
14 #include <vector>
15 #include <cmath>
16 #include <iostream>
17 #include <iomanip>
18 #include <fstream>
19 #include <sstream>
20 
21 #include "HRGBase/xMath.h"
23 
24 #include <Eigen/Dense>
25 
26 using namespace Eigen;
27 
28 using namespace std;
29 
30 namespace thermalfist {
31 
32  ThermalModelEVDiagonal::ThermalModelEVDiagonal(ThermalParticleSystem *TPS, const ThermalModelParameters& params) :
33  ThermalModelBase(TPS, params)
34  {
35  m_densitiesid.resize(m_TPS->Particles().size());
36  m_v.resize(m_TPS->Particles().size());
37  m_Volume = params.V;
38  m_TAG = "ThermalModelEVDiagonal";
39 
40  m_Ensemble = GCE;
42  }
43 
44 
46  {
47  }
48 
49 
51  if (m_v.size() != m_TPS->Particles().size())
52  m_v.resize(m_TPS->Particles().size());
53  for (int i = 0; i < m_TPS->ComponentsNumber(); ++i) {
54  m_v[i] = CuteHRGHelper::vr(rad);
55  }
56  }
57 
58  void ThermalModelEVDiagonal::FillVirial(const std::vector<double>& ri)
59  {
60  if (ri.size() != m_TPS->Particles().size()) {
61  printf("**WARNING** %s::FillVirial(const std::vector<double> & ri): size of ri does not match number of hadrons in the list", m_TAG.c_str());
62  return;
63  }
64  m_v.resize(m_TPS->Particles().size());
65  for (int i = 0; i < m_TPS->ComponentsNumber(); ++i)
66  m_v[i] = CuteHRGHelper::vr(ri[i]);
67  }
68 
69  void ThermalModelEVDiagonal::FillVirialEV(const std::vector<double>& vi)
70  {
71  if (vi.size() != m_TPS->Particles().size()) {
72  printf("**WARNING** %s::FillVirialEV(const std::vector<double> & vi): size of vi does not match number of hadrons in the list", m_TAG.c_str());
73  return;
74  }
75  m_v = vi;
76  }
77 
78  void ThermalModelEVDiagonal::ReadInteractionParameters(const std::string & filename)
79  {
80  m_v = std::vector<double>(m_TPS->Particles().size(), 0.);
81 
82  ifstream fin(filename.c_str());
83  char cc[2000];
84  while (!fin.eof()) {
85  fin.getline(cc, 2000);
86  string tmp = string(cc);
87  vector<string> elems = CuteHRGHelper::split(tmp, '#');
88  if (elems.size() < 1)
89  continue;
90  istringstream iss(elems[0]);
91  int pdgid;
92  double b;
93  if (iss >> pdgid >> b) {
94  int ind = m_TPS->PdgToId(pdgid);
95  if (ind != -1)
96  m_v[ind] = b;
97  }
98  }
99  fin.close();
100  }
101 
102  void ThermalModelEVDiagonal::WriteInteractionParameters(const std::string & filename)
103  {
104  ofstream fout(filename.c_str());
105  fout << "# List of eigenvolume parameters to be used in the Diagonal excluded-volume HRG model"
106  << std::endl;
107  fout << "# Only particles with a non-zero eigenvolume parameter are listed here"
108  << std::endl;
109  fout << "#" << std::setw(14) << "pdg"
110  << std::setw(15) << "v_i[fm^3]"
111  << std::endl;
112  for (int i = 0; i < m_TPS->ComponentsNumber(); ++i) {
113  if (m_v[i] != 0.) {
114  fout << std::setw(15) << m_TPS->Particle(i).PdgId();
115  fout << std::setw(15) << m_v[i];
116  fout << std::endl;
117  }
118  }
119  fout.close();
120  }
121 
123  {
124  if (i < 0 || i >= static_cast<int>(m_v.size()))
125  return 0.;
126  return m_v[i];
127  }
128 
129 
132  m_densitiesid.resize(m_TPS->Particles().size());
133  }
134 
135 
137  double dMu = -m_v[i] * Pressure;
138 
140  }
141 
143  double dMu = -m_v[i] * Pressure;
144 
145  return m_TPS->Particles()[i].Density(m_Parameters, IdealGasFunctions::Pressure, m_UseWidth, m_Chem[i] + dMu);
146  }
147 
149  double dMu = -m_v[i] * Pressure;
150 
151  return m_TPS->Particles()[i].ScaledVariance(m_Parameters, m_UseWidth, m_Chem[i] + dMu);
152  }
153 
155  double ret = 0.;
156 
157  for (int i = 0; i < m_TPS->ComponentsNumber(); ++i) {
158  double dMu = -m_v[i] * P;
159  ret += m_TPS->Particles()[i].Density(m_Parameters, IdealGasFunctions::Pressure, m_UseWidth, m_Chem[i] + dMu);
160  }
161 
162  return ret;
163  }
164 
166  BroydenEquationsDEV eqs(this);
167  BroydenJacobianDEV jac(this);
168  Broyden broydn(&eqs, &jac);
169  BroydenSolutionCriteriumDEV crit(this, 1.0E-8);
170 
171  m_Pressure = Pressure(0.);
172  double mnc = pow(m_Parameters.T, 4.) * pow(xMath::GeVtoifm(), 3.);
173  eqs.SetMnc(mnc);
174  jac.SetMnc(mnc);
175  double x0 = log(m_Pressure / mnc);
176  std::vector<double> x(1, x0);
177 
178  x = broydn.Solve(x, &crit);
179 
180 
181 
182  double PressureNew = mnc * exp(x[0]);
183 
184  // UPDATE: Currently not used
185  //double current_precision = Broyden::TOL;
187  //while (abs(PressureNew) < current_precision && current_precision > 1.e-50 && abs(PressureNew /m_Pressure) < 1.e-5) {
188  // current_precision *= 1.e-10;
189  // x = broydn.Solve(x, &Broyden::BroydenSolutionCriterium(current_precision));
190  // PressureNew = mnc * exp(x[0]);
191  //}
192 
193  m_Pressure = PressureNew;
194 
195  if (broydn.Iterations() == broydn.MaxIterations())
197  else m_LastCalculationSuccessFlag = true;
198 
199  m_MaxDiff = broydn.MaxDifference();
200  }
201 
203  m_FluctuationsCalculated = false;
204 
205  SolvePressure();
206 
207  m_wnSum = 0.;
208  m_Densityid = 0.;
209  m_TotalDensity = 0.;
210  m_Suppression = 0.;
211  double densityid = 0., suppression = 0.;
212 
214 
215 #pragma omp parallel for reduction(+:densityid) reduction(+:suppression) if(useOpenMP)
216  for (int i = 0; i < m_TPS->ComponentsNumber(); ++i) {
217  double dMu = -m_v[i] * m_Pressure;
219  densityid += m_densitiesid[i];
220  suppression += m_v[i] * m_densitiesid[i];
221 
223  }
224 
225  m_Densityid = densityid;
226  m_Suppression = suppression;
227 
228  m_Suppression = 1. / (1. + m_Suppression);
229 
230  for (int i = 0; i < m_TPS->ComponentsNumber(); ++i) {
233  m_wnSum += m_densities[i] * m_TPS->Particles()[i].ScaledVariance(m_Parameters, m_UseWidth, m_Chem[i] - m_v[i] * m_Pressure);
234  }
235 
237 
238  m_Calculated = true;
240  }
241 
243  int NN = m_densities.size();
244  vector<double> tN(NN), tW(NN);
245  for (int i = 0; i < NN; ++i) tN[i] = DensityId(i, m_Pressure);
246  for (int i = 0; i < NN; ++i) tW[i] = ScaledVarianceId(i, m_Pressure);
247 
248  m_PrimCorrel.resize(NN);
249  for (int i = 0; i < NN; ++i) m_PrimCorrel[i].resize(NN);
251 
252  for (int i = 0; i < NN; ++i)
253  for (int j = 0; j < NN; ++j) {
254  m_PrimCorrel[i][j] = 0.;
255  if (i == j) m_PrimCorrel[i][j] += m_densities[i] * tW[i];
256  m_PrimCorrel[i][j] += -m_v[i] * m_densities[i] * m_densities[j] * tW[i];
257  m_PrimCorrel[i][j] += -m_v[j] * m_densities[i] * m_densities[j] * tW[j];
258  double tmp = 0.;
259  for (size_t k = 0; k < m_densities.size(); ++k)
260  tmp += m_v[k] * m_v[k] * tW[k] * m_densities[k];
261  m_PrimCorrel[i][j] += m_densities[i] * m_densities[j] * tmp;
262  m_PrimCorrel[i][j] /= m_Parameters.T;
263  }
264 
265  for (int i = 0; i < NN; ++i) {
266  m_wprim[i] = m_PrimCorrel[i][i];
267  if (m_densities[i] > 0.) m_wprim[i] *= m_Parameters.T / m_densities[i];
268  else m_wprim[i] = 1.;
269  }
270 
271  }
272 
273  // TODO include correlations
280 
282 
283  for (size_t i = 0; i < m_wprim.size(); ++i) {
286  }
287 
288  for (size_t i = 0; i < m_wprim.size(); ++i) {
289  m_skewtot[i] = 1.;
290  m_kurttot[i] = 1.;
291  }
292  }
293 
294 
295  std::vector<double> ThermalModelEVDiagonal::CalculateChargeFluctuations(const std::vector<double>& chgs, int order)
296  {
297  vector<double> ret(order + 1, 0.);
298 
299  // chi1
300  for (size_t i = 0; i < m_densities.size(); ++i)
301  ret[0] += chgs[i] * m_densities[i];
302 
303  ret[0] /= pow(m_Parameters.T * xMath::GeVtoifm(), 3);
304 
305  if (order < 2) return ret;
306 
307 
308 
309  // Preparing matrix for system of linear equations
310  int NN = m_densities.size();
311 
312  vector<double> MuStar(NN, 0.);
313  for (int i = 0; i < NN; ++i) {
314  MuStar[i] = m_Chem[i] + MuShift(i);
315  }
316 
317 
318  MatrixXd densMatrix(2 * NN, 2 * NN);
319  VectorXd solVector(2 * NN), xVector(2 * NN);
320 
321  vector<double> DensitiesId(m_densities.size()), chi2id(m_densities.size());
322  for (int i = 0; i < NN; ++i) {
323  DensitiesId[i] = m_TPS->Particles()[i].Density(m_Parameters, IdealGasFunctions::ParticleDensity, m_UseWidth, MuStar[i]);
324  chi2id[i] = m_TPS->Particles()[i].chi(2, m_Parameters, m_UseWidth, MuStar[i]);
325  }
326 
327  for (int i = 0; i < NN; ++i)
328  for (int j = 0; j < NN; ++j) {
329  densMatrix(i, j) = m_v[j] * DensitiesId[i];
330  if (i == j) densMatrix(i, j) += 1.;
331  }
332 
333  for (int i = 0; i < NN; ++i)
334  for (int j = 0; j < NN; ++j)
335  densMatrix(i, NN + j) = 0.;
336 
337  for (int i = 0; i < NN; ++i) {
338  densMatrix(i, NN + i) = 0.;
339  for (int k = 0; k < NN; ++k) {
340  densMatrix(i, NN + i) += m_v[k] * m_densities[k];
341  }
342  densMatrix(i, NN + i) = (densMatrix(i, NN + i) - 1.) * chi2id[i] * pow(xMath::GeVtoifm(), 3) * m_Parameters.T * m_Parameters.T;
343  }
344 
345  for (int i = 0; i < NN; ++i)
346  for (int j = 0; j < NN; ++j) {
347  densMatrix(NN + i, NN + j) = m_v[i] * DensitiesId[j];
348  if (i == j) densMatrix(NN + i, NN + j) += 1.;
349  }
350 
351 
352  PartialPivLU<MatrixXd> decomp(densMatrix);
353 
354  // chi2
355  vector<double> dni(NN, 0.), dmus(NN, 0.);
356 
357  for (int i = 0; i < NN; ++i) {
358  xVector[i] = 0.;
359  xVector[NN + i] = chgs[i];
360  }
361 
362  solVector = decomp.solve(xVector);
363 
364  for (int i = 0; i < NN; ++i) {
365  dni[i] = solVector[i];
366  dmus[i] = solVector[NN + i];
367  }
368 
369  for (int i = 0; i < NN; ++i)
370  ret[1] += chgs[i] * dni[i];
371 
372  ret[1] /= pow(m_Parameters.T, 2) * pow(xMath::GeVtoifm(), 3);
373 
374  if (order < 3) return ret;
375  // chi3
376  vector<double> d2ni(NN, 0.), d2mus(NN, 0.);
377 
378  vector<double> chi3id(m_densities.size());
379  for (int i = 0; i < NN; ++i)
380  chi3id[i] = m_TPS->Particles()[i].chi(3, m_Parameters, m_UseWidth, MuStar[i]);
381 
382  for (int i = 0; i < NN; ++i) {
383  xVector[i] = 0.;
384 
385  double tmp = 0.;
386  for (int j = 0; j < NN; ++j) tmp += m_v[j] * dni[j];
387  tmp = -2. * tmp * chi2id[i] * pow(xMath::GeVtoifm(), 3) * m_Parameters.T * m_Parameters.T * dmus[i];
388  xVector[i] += tmp;
389 
390  tmp = 0.;
391  for (int j = 0; j < NN; ++j) tmp += m_v[j] * m_densities[j];
392  tmp = -(tmp - 1.) * chi3id[i] * pow(xMath::GeVtoifm(), 3) * m_Parameters.T * dmus[i] * dmus[i];
393  xVector[i] += tmp;
394  }
395  for (int i = 0; i < NN; ++i) {
396  xVector[NN + i] = 0.;
397 
398  double tmp = 0.;
399  for (int j = 0; j < NN; ++j) tmp += -m_v[i] * dmus[j] * chi2id[j] * pow(xMath::GeVtoifm(), 3) * m_Parameters.T * m_Parameters.T * dmus[j];
400 
401  xVector[NN + i] = tmp;
402  }
403 
404  solVector = decomp.solve(xVector);
405 
406  for (int i = 0; i < NN; ++i) {
407  d2ni[i] = solVector[i];
408  d2mus[i] = solVector[NN + i];
409  }
410 
411  for (int i = 0; i < NN; ++i)
412  ret[2] += chgs[i] * d2ni[i];
413 
414  ret[2] /= m_Parameters.T * pow(xMath::GeVtoifm(), 3);
415 
416 
417  if (order < 4) return ret;
418 
419  // chi4
420  vector<double> d3ni(NN, 0.), d3mus(NN, 0.);
421 
422  vector<double> chi4id(m_densities.size());
423  for (int i = 0; i < NN; ++i)
424  chi4id[i] = m_TPS->Particles()[i].chi(4, m_Parameters, m_UseWidth, MuStar[i]);
425 
426  vector<double> dnis(NN, 0.);
427  for (int i = 0; i < NN; ++i) {
428  dnis[i] = chi2id[i] * pow(xMath::GeVtoifm(), 3) * m_Parameters.T * m_Parameters.T * dmus[i];
429  }
430 
431  vector<double> d2nis(NN, 0.);
432  for (int i = 0; i < NN; ++i) {
433  d2nis[i] = chi3id[i] * pow(xMath::GeVtoifm(), 3) * m_Parameters.T * dmus[i] * dmus[i] +
434  chi2id[i] * pow(xMath::GeVtoifm(), 3) * m_Parameters.T * m_Parameters.T * d2mus[i];
435  }
436 
437  for (int i = 0; i < NN; ++i) {
438  xVector[i] = 0.;
439 
440  double tmp = 0.;
441  for (int j = 0; j < NN; ++j) tmp += m_v[j] * dni[j];
442  tmp = -3. * tmp * d2nis[i];
443  xVector[i] += tmp;
444 
445  tmp = 0.;
446  for (int j = 0; j < NN; ++j) tmp += m_v[j] * d2ni[j];
447  tmp = -3. * tmp * dnis[i];
448  xVector[i] += tmp;
449 
450  double tmps = 0.;
451  for (int j = 0; j < NN; ++j) tmps += m_v[j] * m_densities[j];
452 
453  tmp = -(tmps - 1.) * chi3id[i] * pow(xMath::GeVtoifm(), 3) * m_Parameters.T * d2mus[i] * 3. * dmus[i];
454  xVector[i] += tmp;
455 
456  tmp = -(tmps - 1.) * chi4id[i] * pow(xMath::GeVtoifm(), 3) * dmus[i] * dmus[i] * dmus[i];
457  xVector[i] += tmp;
458  }
459  for (int i = 0; i < NN; ++i) {
460  xVector[NN + i] = 0.;
461 
462  double tmp = 0.;
463  for (int j = 0; j < NN; ++j) tmp += -2. * m_v[i] * d2mus[j] * dnis[j];
464  xVector[NN + i] += tmp;
465 
466  tmp = 0.;
467  for (int j = 0; j < NN; ++j) tmp += -m_v[i] * dmus[j] * d2nis[j];
468  xVector[NN + i] += tmp;
469  }
470 
471  solVector = decomp.solve(xVector);
472 
473  for (int i = 0; i < NN; ++i) {
474  d3ni[i] = solVector[i];
475  d3mus[i] = solVector[NN + i];
476  }
477 
478  for (int i = 0; i < NN; ++i)
479  ret[3] += chgs[i] * d3ni[i];
480 
481  ret[3] /= pow(xMath::GeVtoifm(), 3);
482 
483  return ret;
484  }
485 
486 
489  double ret = 0.;
490  double dMu = 0.;
491  for (int i = 0; i < m_TPS->ComponentsNumber(); ++i) {
492  dMu = -m_v[i] * m_Pressure;
494  }
495  return ret * m_Suppression;
496  }
497 
500  double ret = 0.;
501  double dMu = 0.;
502  for (int i = 0; i < m_TPS->ComponentsNumber(); ++i) {
503  dMu = -m_v[i] * m_Pressure;
505  }
506  return ret * m_Suppression;
507  }
508 
511  return m_Pressure;
512  }
513 
516 
517  double dMu = -m_v[part] * m_Pressure;
518  double ret = m_TPS->Particles()[part].Density(m_Parameters, IdealGasFunctions::ScalarDensity, m_UseWidth, m_Chem[part] + dMu);
519  return ret * m_Suppression;
520  }
521 
523  {
524  if (!m_Calculated)
526  return m_Suppression;
527  }
528 
529  double ThermalModelEVDiagonal::MuShift(int id) const
530  {
531  if (id >= 0. && id < static_cast<int>(m_v.size()))
532  return -m_v[id] * m_Pressure;
533  else
534  return 0.0;
535  }
536 
538  double tEV = 0.;
539  for (int i = 0; i < m_TPS->ComponentsNumber(); ++i) {
540  tEV += m_v[i] * m_densities[i] / 4.;
541  }
542  return tEV;
543  }
544 
545  void ThermalModelEVDiagonal::SetRadius(int i, double rad)
546  {
547  if (i >= 0 && i < static_cast<int>(m_v.size()))
548  m_v[i] = CuteHRGHelper::vr(rad);
549  }
550 
551  double ThermalModelEVDiagonal::VirialCoefficient(int i, int /*j*/) const
552  {
553  return m_v[i];
554  }
555 
556  void ThermalModelEVDiagonal::SetVirial(int i, int j, double b)
557  {
558  if (i == j)
559  m_v[i] = b;
560  }
561 
562  std::vector<double> ThermalModelEVDiagonal::BroydenEquationsDEV::Equations(const std::vector<double>& x)
563  {
564  std::vector<double> ret(1);
565  double pressure = m_mnc * exp(x[0]);
566 
567  ret[0] = pressure - m_THM->Pressure(pressure);
568 
569  return ret;
570  }
571 
572  std::vector<double> ThermalModelEVDiagonal::BroydenJacobianDEV::Jacobian(const std::vector<double>& x)
573  {
574  double pressure = m_mnc * exp(x[0]);
575 
576  double ret = 0.;
577  for (size_t i = 0; i < m_THM->Densities().size(); ++i)
578  ret += m_THM->VirialCoefficient(i, i) * m_THM->DensityId(i, pressure);
579  ret += 1.;
580  ret *= pressure;
581 
582  return std::vector<double>(1, ret);
583  }
584 
585  std::vector<double> ThermalModelEVDiagonal::BroydenEquationsDEVOrig::Equations(const std::vector<double>& x)
586  {
587  std::vector<double> ret(1);
588  ret[0] = x[0] - m_THM->Pressure(x[0]);
589  return ret;
590  }
591 
592  std::vector<double> ThermalModelEVDiagonal::BroydenJacobianDEVOrig::Jacobian(const std::vector<double>& x)
593  {
594  const double &pressure = x[0];
595 
596  double ret = 0.;
597  for (size_t i = 0; i < m_THM->Densities().size(); ++i)
598  ret += m_THM->VirialCoefficient(i, i) * m_THM->DensityId(i, pressure);
599  ret += 1.;
600 
601  return std::vector<double>(1, ret);
602  }
603 
604  bool ThermalModelEVDiagonal::BroydenSolutionCriteriumDEV::IsSolved(const std::vector<double>& x, const std::vector<double>& f, const std::vector<double>& /*xdelta*/) const
605  {
606  double maxdiff = 0.;
607  for (size_t i = 0; i < x.size(); ++i) {
608  maxdiff = std::max(maxdiff, fabs(f[i]) / m_THM->m_Pressure);
609  }
610  return (maxdiff < m_MaximumError);
611  }
612 } // namespace thermalfist
virtual double CalculatePressure()
Implementation of the equation of state functions.
Abstract base class for an HRG model implementation.
virtual void CalculateTwoParticleFluctuationsDecays()
Computes particle number correlations and fluctuations for all final-state particles which are marked...
std::vector< std::string > split(const std::string &s, char delim)
std::vector< double > m_Chem
double CommonSuppressionFactor()
The density suppression factor , common for all species.
Class implementing the Broyden method to solve a system of non-linear equations.
Definition: Broyden.h:131
double GeVtoifm()
A constant to transform GeV into fm .
Definition: xMath.h:27
std::vector< double > m_kurttot
std::vector< double > m_wprim
const ThermalParticle & Particle(int id) const
ThermalParticle object corresponding to particle species with a provided 0-based index.
std::vector< double > m_skewprim
void FillVirialEV(const std::vector< double > &vi=std::vector< double >(0))
Same as FillVirial() but uses the diagonal excluded-volume coefficients as input instead of radii...
int PdgToId(long long pdgid)
Transforms PDG ID to a 0-based particle id number.
long long PdgId() const
Particle&#39;s Particle Data Group (PDG) ID number.
Class containing the particle list.
Grand canonical ensemble.
ThermalModelParameters m_Parameters
Structure containing all thermal parameters of the model.
int ComponentsNumber() const
Number of different particle species in the list.
virtual void CalculateFluctuations()
Computes the fluctuation observables.
double ScaledVarianceId(int i, double Pressure)
Calculate the ideal gas scaled variance of particle species i number fluctuations for the given press...
virtual void CalculateTwoParticleCorrelations()
Computes the fluctuations and correlations of the primordial particle numbers.
void FillVirial(const std::vector< double > &ri=std::vector< double >(0))
Fills the vector of particle eigenvolume parameters.
double VirialCoefficient(int i, int j) const
Return the eigenvolume parameter of particle species i.
virtual void CalculateSusceptibilityMatrix()
Calculates the conserved charges susceptibility matrix.
Contains some extra mathematical functions used in the code.
ThermalParticleSystem * m_TPS
virtual ~ThermalModelEVDiagonal(void)
Destroy the ThermalModelEVDiagonal object.
virtual void CalculatePrimordialDensities()
Calculates the primordial densities of all species.
int MaxIterations() const
Definition: Broyden.h:234
virtual void CalculateProxySusceptibilityMatrix()
Calculates the susceptibility matrix of conserved charges proxies.
virtual std::vector< double > Solve(const std::vector< double > &x0, BroydenSolutionCriterium *solcrit=NULL, int max_iterations=MAX_ITERS)
Definition: Broyden.cpp:77
std::vector< double > m_kurtprim
const std::vector< ThermalParticle > & Particles() const
Returns the vector of all particle species.
std::vector< std::vector< double > > m_TotalCorrel
ThermalModelInteraction m_InteractionModel
virtual void ValidateCalculation()
Checks whether issues have occured during the calculation of particle densities in the CalculateDensi...
virtual void WriteInteractionParameters(const std::string &filename)
Write the set of eigenvolume parameters for all particles to an external file.
Contains some functions do deal with excluded volumes.
void SetVirial(int i, int j, double b)
Sets the eigenvolume parameter of particle species i.
double MaxDifference() const
Definition: Broyden.h:239
virtual double ParticleKurtosis(int)
Kurtosis of primordial particle number fluctuations for species i.
virtual double MuShift(int i) const
The shift in the chemical potential of particle species i due to the excluded volume interactions...
double ExcludedVolume(int i) const
The excluded volume parameter of particle species i.
virtual void CalculateDensities()
Calculates the primordial and total (after decays) densities of all species.
virtual void SolvePressure()
Solves the transcdental equation for the pressure.
Diagonal excluded volume model.
std::vector< double > m_densities
virtual std::vector< double > CalculateChargeFluctuations(const std::vector< double > &chgs, int order=4)
Calculates fluctuations (diagonal susceptibilities) of an arbitrary "conserved" charge.
virtual void ChangeTPS(ThermalParticleSystem *TPS)
Change the particle list.
std::vector< std::vector< double > > m_PrimCorrel
ThermalModelEnsemble m_Ensemble
virtual void CalculateFeeddown()
Calculates the total densities which include feeddown contributions.
std::vector< double > m_skewtot
virtual void CalculateParticleChargeCorrelationMatrix()
Calculates the matrix of correlators between primordial (and also final) particle numbers and conserv...
double DensityId(int i, double Pressure)
Calculate the ideal gas density of particle species i for the given pressure value.
virtual void ChangeTPS(ThermalParticleSystem *TPS)
Change the particle list.
double PressureId(int i, double Pressure)
Calculate the ideal gas pressure of particle species i for the given pressure value.
double vr(double r)
Computes the excluded volume parameter from a given radius parameter value.
double Pressure()
System pressure (GeV fm )
The main namespace where all classes and functions of the Thermal-FIST library reside.
void SetRadius(double rad)
Set the same excluded volume radius parameter for all species.
virtual double ParticleScalarDensity(int part)
The scalar density of the particle species i.
virtual double ParticleSkewness(int)
Skewness of primordial particle number fluctuations for species i.
virtual void ReadInteractionParameters(const std::string &filename)
Read the set of eigenvolume parameters for all particles from an external file.
ThermalParticleSystem * TPS()
int Iterations() const
Definition: Broyden.h:229