eos_had_apr.h
Go to the documentation of this file.
1 /*
2  -------------------------------------------------------------------
3 
4  Copyright (C) 2006-2017, Andrew W. Steiner
5 
6  This file is part of O2scl.
7 
8  O2scl is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 3 of the License, or
11  (at your option) any later version.
12 
13  O2scl is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with O2scl. If not, see <http://www.gnu.org/licenses/>.
20 
21  -------------------------------------------------------------------
22 */
23 /** \file eos_had_apr.h
24  \brief File defining \ref o2scl::eos_had_apr
25 */
26 #ifndef O2SCL_APR_EOS_H
27 #define O2SCL_APR_EOS_H
28 
29 #include <cmath>
30 #include <o2scl/constants.h>
31 #include <o2scl/eos_had_base.h>
32 #include <o2scl/fermion.h>
33 #include <o2scl/fermion_nonrel.h>
34 
35 #ifndef DOXYGEN_NO_O2NS
36 namespace o2scl {
37 #endif
38 
39  /** \brief EOS from Akmal, Pandharipande, and Ravenhall
40 
41  The EOS of Akmal, Pandharipande, and Ravenhall, from \ref
42  Akmal98eo (APR).
43 
44  The Hamiltonian is:
45  \f[
46  {\cal H}_{APR} = {\cal H}_{kin} + {\cal H}_{pot}
47  \f]
48 
49  \f[
50  {\cal H}_{kin} = \left\{ \frac{\hbar^2}{2 m} +
51  \left[ p_3 + \left( 1 - x \right)
52  p_5 \right] n e^{-p_4 n} \right\} \tau_n +
53  \left\{ \frac{\hbar^2}{2 m} + \left[ p_3 + x
54  p_5 \right] n e^{-p_4 n} \right\} \tau_p
55  \f]
56 
57  \f[
58  {\cal H}_{pot} =
59  g_1 \left[ 1 - \left( 1 - 2 x \right)^2 \right] +
60  g_2 \left( 1 - 2 x \right)^2
61  \f]
62 
63  The following are definitions for \f$ g_i \f$ in the low-density
64  phase (LDP) or the high-density phase (HDP):
65 
66  \f[
67  g_{1,LDP} = -n^2 \left[ p_1 + p_2 n + p_6 n^2 +
68  \left( p_{10} + p_{11} n \right) e^{-p_9^2 n^2} \right]
69  \f]
70 
71  \f[
72  g_{2,LDP} = -n^2 \left[ \frac{p_{12}}{n} + p_7 + p_8 n +
73  p_{13} e^{-p_9^2 n^2} \right]
74  \f]
75 
76  \f[
77  g_{1,HDP} = g_{1,LDP} -n^2 \left[ p_{17} \left( n - p_{19} \right)
78  + p_{21} \left( n - p_{19} \right)^2 e^{p_{18}
79  \left( n - p_{19} \right) }
80  \right]
81  \f]
82 
83  \f[
84  g_{2,HDP} = g_{2,LDP} -n^2 \left[ p_{15} \left( n - p_{20} \right)
85  + p_{14} \left( n - p_{20} \right)^2 e^{p_{16}
86  \left( n - p_{20} \right)} \right]
87  \f]
88 
89  \note APR seems to have been designed to be used with
90  non-relativistic neutrons and protons with equal masses of 939
91  MeV. This gives a saturation density very close to 0.16.
92 
93  The variables \f$ \nu_n\f$ and \f$ \nu_p\f$ contain the
94  expressions \f$ (-\mu_n+V_n)/T \f$ and \f$ (-\mu_p+V_p)/T \f$
95  respectively, where \f$ V \f$ is the potential part of the
96  single particle energy for particle i (i.e. the derivative of
97  the Hamiltonian w.r.t. density while energy density held
98  constant). Equivalently, \f$ \nu_n\f$ is just \f$ -k_{F_n}^2/ 2
99  m^{*} \f$.
100 
101  The selection between the LDP and HDP is controlled by the value
102  of \ref pion. The default is to use the LDP at densities below
103  0.16 \f$ \mathrm{fm}^{-3} \f$, and for larger densities to just
104  use whichever minimizes the energy.
105 
106  The finite temperature approximations from \ref Prakash97
107  are used in testing.
108 
109  \note Since this EOS uses the effective masses and chemical
110  potentials in the fermion class, the values of
111  part::non_interacting for neutrons and protons are set to false
112  in many of the functions.
113 
114  \note The parameter array is unit indexed, so that
115  <tt>par[0]</tt> is unused. This choice makes the connection
116  between the code and the paper a bit more transparent.
117 
118  \future There might be room to improve the testing
119  of the finite temperature \part a bit.
120  \future There is some repetition between calc_e() and calc_temp_e()
121  that possibly could be removed.
122  \future Include the analytic relations from Constantinou et al.
123  */
125 
126 #ifndef DOXYGEN_INTERNAL
127 
128  protected:
129 
130  /// Non-relativistic fermion thermodyanmics
132 
133  /// The variable indicating which parameter set is to be used
134  int choice;
135 
136  /// Storage for the parameters
137  double par[22];
138 
139  /// An integer to indicate which phase was used in calc_e()
140  int lp;
141 
142 #endif
143 
144  public:
145 
146  /** \brief Create an EOS object with the default parameter
147  set (\f$ A18 + \mathrm{UIX}^{*}+\delta v \f$).
148  */
149  eos_had_apr();
150 
151  virtual ~eos_had_apr();
152 
153  /// \name Choice of phase
154  //@{
155  /** \brief use LDP for densities less than 0.16 and for higher
156  densities, use the phase which minimizes energy (default)
157  */
158  static const int best=0;
159  /// LDP (no pion condensation)
160  static const int ldp=1;
161  /// HDP (pion condensation)
162  static const int hdp=2;
163  /// Choice of phase (default \ref best)
164  int pion;
165  /** \brief Return the phase of the most recent call to calc_e()
166 
167  This function always returns either \ref eos_had_apr::ldp or
168  \ref eos_had_apr::hdp .
169  */
170  int last_phase() { return lp; }
171  //@}
172 
173  /// \name Basic usage
174  //@{
175  /** \brief Equation of state as a function of density
176  */
177  virtual int calc_e(fermion &n, fermion &p, thermo &th);
178 
179  /// Equation of state as a function of densities
180  virtual int calc_temp_e(fermion &n, fermion &pr, double temper,
181  thermo &th);
182 
183  /** \brief Compute the compressibility
184 
185  See general notes at eos_had_base::fcomp(). This computes the
186  compressibility (at fixed proton fraction = 0.5) exactly,
187  unless \ref parent_method is true in which case the derivative
188  is taken numerically in eos_had_base::fcomp().
189  */
190  double fcomp(double nb);
191 
192  /** \brief Calculate symmetry energy of matter as energy of
193  neutron matter minus the energy of nuclear matter
194 
195  This function returns the energy per baryon of neutron matter
196  minus the energy per baryon of nuclear matter. This will
197  deviate significantly from the results from fesym() only if
198  the dependence of the symmetry energy on \f$ \delta \f$ is not
199  quadratic.
200  */
201  double fesym_diff(double nb);
202  //@}
203 
204  /// \name Model selection
205  //@{
206  /** \brief Select model
207 
208  Valid values for \c model_index are: \n
209  1 - A18+UIX*+deltav (preferred by Akmal, et. al. - this is
210  the default) \n
211  2 - A18+UIX* \n
212  3 - A18+deltav \n
213  4 - A18 \n
214 
215  If any other integer is given, the error handler is called.
216 
217  \note This cannot be virtual because it is called by the
218  constructor
219  */
220  void select(int model_index=1);
221  /// With three body forces and relativistic corrections
222  static const int a18_uix_deltav=1;
223  /// With three body forces
224  static const int a18_uix=2;
225  /// With relativistic corrections
226  static const int a18_deltav=3;
227  /// No three body forces or relativistic corrections
228  static const int a18=4;
229  /** \brief Get the value of one of the model parameters
230  */
231  double get_par(size_t n) {
232  if (n>=23 || n==0) {
233  O2SCL_ERR("Index out of range in eos_had_apr::set_par().",
234  exc_einval);
235  }
236  return par[n];
237  }
238 
239  /** \brief Set the value of one of the model parameters
240  */
241  void set_par(size_t n, double x) {
242  if (n>=23 || n==0) {
243  O2SCL_ERR("Index out of range in eos_had_apr::set_par().",
244  exc_einval);
245  }
246  par[n]=x;
247  return;
248  }
249  //@}
250 
251  /// \name Other functions
252  //@{
253  /** \brief Calculate Q's for semi-infinite nuclear matter
254 
255  For general discussion, see the documentation to eos_had_base::qs().
256 
257  For APR, we set \f$ x_1=x_2=0 \f$ so that \f$ Q_i=P_i/2 \f$ and then
258  \f{eqnarray*}
259  P_1 &=& \left(\frac{1}{2} p_3-p_5 \right) e^{-p_4 n}
260  \nonumber \\
261  P_2 &=& \left(\frac{1}{2} p_3+p_5 \right) e^{-p_4 n}
262  \f}
263 
264  This gives
265  \f{eqnarray*}
266  Q_{nn}&=&\frac{1}{4} e^{-p_4 \rho}
267  \left[ -6 p_5 - p_4 (p_3 - 2 p_5) (n_n + 2 n_p) \right]
268  \nonumber \\
269  Q_{np}&=&\frac{1}{8} e^{-p_4 \rho}
270  \left[ 4 (p_3 - 4 p_5) - 3 p_4 (p_3 - 2 p_5) (n_n + n_p)\right]
271  \nonumber \\
272  Q_{pp}&=&\frac{1}{4} e^{-p_4 \rho}
273  \left[ -6 p_5 - p_4 (p_3 - 2 p_5) (n_p + 2 n_n) \right]
274  \f}
275  */
276  int gradient_qij2(double nn, double np,
277  double &qnn, double &qnp, double &qpp,
278  double &dqnndnn, double &dqnndnp,
279  double &dqnpdnn, double &dqnpdnp,
280  double &dqppdnn, double &dqppdnp);
281 
282  /// Return string denoting type ("eos_had_apr")
283  virtual const char *type() { return "eos_had_apr"; }
284  //@}
285 
286  /** \brief If true, use the methods from eos_had_base for \ref
287  fcomp() and \ref fesym_diff() (default true)
288 
289  This can be set to true to check the difference in the
290  compressibility and symmety energy between the exact
291  expressions and the numerical values from class \ref
292  o2scl::eos_had_base.
293 
294  \future This variable is probably unnecessary, as the
295  syntax
296  \code
297  eos_had_apr apr;
298  ccout << apr.eos_had_base::fcomp(0.16) << endl;
299  \endcode
300  works just as well.
301  */
303 
304  };
305 
306 #ifndef DOXYGEN_NO_O2NS
307 }
308 #endif
309 
310 #endif
double get_par(size_t n)
Get the value of one of the model parameters.
Definition: eos_had_apr.h:231
static const int a18_deltav
With relativistic corrections.
Definition: eos_had_apr.h:226
static const int a18_uix
With three body forces.
Definition: eos_had_apr.h:224
double fcomp(double nb)
Compute the compressibility.
int last_phase()
Return the phase of the most recent call to calc_e()
Definition: eos_had_apr.h:170
double par[22]
Storage for the parameters.
Definition: eos_had_apr.h:137
double fesym_diff(double nb)
Calculate symmetry energy of matter as energy of neutron matter minus the energy of nuclear matter...
int pion
Choice of phase (default best)
Definition: eos_had_apr.h:164
exc_einval
int gradient_qij2(double nn, double np, double &qnn, double &qnp, double &qpp, double &dqnndnn, double &dqnndnp, double &dqnpdnn, double &dqnpdnp, double &dqppdnn, double &dqppdnp)
Calculate Q&#39;s for semi-infinite nuclear matter.
A hadronic EOS at finite temperature based on a function of the densities [abstract base]...
static const int best
use LDP for densities less than 0.16 and for higher densities, use the phase which minimizes energy (...
Definition: eos_had_apr.h:158
int lp
An integer to indicate which phase was used in calc_e()
Definition: eos_had_apr.h:140
bool parent_method
If true, use the methods from eos_had_base for fcomp() and fesym_diff() (default true) ...
Definition: eos_had_apr.h:302
virtual int calc_e(fermion &n, fermion &p, thermo &th)
Equation of state as a function of density.
virtual int calc_temp_e(fermion &n, fermion &pr, double temper, thermo &th)
Equation of state as a function of densities.
fermion_nonrel nrf
Non-relativistic fermion thermodyanmics.
Definition: eos_had_apr.h:131
void select(int model_index=1)
Select model.
virtual const char * type()
Return string denoting type ("eos_had_apr")
Definition: eos_had_apr.h:283
int choice
The variable indicating which parameter set is to be used.
Definition: eos_had_apr.h:134
#define O2SCL_ERR(d, n)
eos_had_apr()
Create an EOS object with the default parameter set ( ).
void set_par(size_t n, double x)
Set the value of one of the model parameters.
Definition: eos_had_apr.h:241
static const int ldp
LDP (no pion condensation)
Definition: eos_had_apr.h:160
static const int a18
No three body forces or relativistic corrections.
Definition: eos_had_apr.h:228
static const int hdp
HDP (pion condensation)
Definition: eos_had_apr.h:162
EOS from Akmal, Pandharipande, and Ravenhall.
Definition: eos_had_apr.h:124
static const int a18_uix_deltav
With three body forces and relativistic corrections.
Definition: eos_had_apr.h:222

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).