All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
part_deriv.h
Go to the documentation of this file.
1 /*
2  -------------------------------------------------------------------
3 
4  Copyright (C) 2006-2014, 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 #ifndef O2SCL_PART_DERIV_H
24 #define O2SCL_PART_DERIV_H
25 
26 /** \file part_deriv.h
27  \brief File defining \ref o2scl::part_deriv
28 */
29 
30 #include <string>
31 #include <iostream>
32 #include <fstream>
33 #include <cmath>
34 #include <o2scl/part.h>
35 #include <o2scl/fermion.h>
36 
37 #ifndef DOXYGEN_NO_O2NS
38 namespace o2scl {
39 #endif
40 
41  /** \brief A particle data class with derivatives
42 
43  This class adds the derivatives \ref dndmu, \ref dndT, and
44  \ref dsdT, which correspond to
45  \f[
46  \left(\frac{d n}{d \mu}\right)_{T,V}, \quad
47  \left(\frac{d n}{d T}\right)_{\mu,V}, \quad \mathrm{and} \quad
48  \left(\frac{d s}{d T}\right)_{\mu,V}
49  \f]
50  respectively. All other first-order thermodynamic derivatives
51  can be expressed in terms of the first three derivatives. In the
52  case that the particle is interacting (i.e. \ref
53  part::non_interacting is \c false), then the derivatives which
54  are computed are
55  \f[
56  \left(\frac{d n}{d \nu}\right)_{T,V}, \quad
57  \left(\frac{d n}{d T}\right)_{\nu,V}, \quad
58  \left(\frac{d s}{d T}\right)_{\nu,V}, \quad \mathrm{and} \quad
59  \left(\frac{d n}{d m^{*}}\right)_{T,\nu,V},
60  \f]
61  If the particles are interacting, no derivative with respect to
62  the bare mass is given, since classes cannot know how to relate
63  the effective mass to the bare mass.
64 
65  \hline
66 
67  <b>Other derivatives with respect
68  to chemical potential and temperature:</b>
69 
70  There is a Maxwell relation
71  \f[
72  \left(\frac{d s}{d \mu}\right)_{T,V} =
73  \left(\frac{d n}{d T}\right)_{\mu,V}
74  \f]
75  The pressure derivatives are trivial
76  \f[
77  \left(\frac{d P}{d \mu}\right)_{T,V}=n, \quad
78  \left(\frac{d P}{d T}\right)_{\mu,V}=s
79  \f]
80  The energy density derivatives are related through the
81  thermodynamic identity:
82  \f[
83  \left(\frac{d \varepsilon}{d \mu}\right)_{T,V}=
84  \mu \left(\frac{d n}{d \mu}\right)_{T,V}+
85  T \left(\frac{d s}{d \mu}\right)_{T,V}
86  \f]
87  \f[
88  \left(\frac{d \varepsilon}{d T}\right)_{\mu,V}=
89  \mu \left(\frac{d n}{d T}\right)_{\mu,V}+
90  T \left(\frac{d s}{d T}\right)_{\mu,V}
91  \f]
92 
93  \hline
94 
95  <b>Other derivatives:</b>
96 
97  Note that the derivative of the entropy with respect to the
98  temperature above is not the specific heat per particle, \f$ c_V \f$.
99  The specific heat per particle is
100  \f[
101  c_V = \frac{T}{N} \left( \frac{\partial S}{\partial T} \right)_{V,N}
102  = \frac{T}{n} \left( \frac{\partial s}{\partial T} \right)_{V,n}
103  \f]
104  As noted in \ref part_section in the User's Guide for \o2p, we
105  work in units so that \f$ \hbar = c = k_B = 1 \f$. In this case,
106  \f$ c_V \f$ is unitless as defined here. To compute \f$ c_V \f$
107  in terms of the derivatives above, note that the
108  descendants of part_deriv provide all of the thermodynamic
109  functions in terms of \f$ \mu, V \f$ and \f$ T \f$, so we have
110  \f[
111  s=s(\mu,T,V) \quad \mathrm{and} \quad n=n(\mu,T,V) \, .
112  \f]
113  We can then construct a function
114  \f[
115  s=s[\mu(n,T,V),T,V]
116  \f]
117  and then write the required derivative directly
118  \f[
119  \left(\frac{\partial s}{\partial T}\right)_{n,V} =
120  \left(\frac{\partial s}{\partial \mu}\right)_{T,V}
121  \left(\frac{\partial \mu}{\partial T}\right)_{n,V} +
122  \left(\frac{\partial s}{\partial T}\right)_{\mu,V} \, .
123  \f]
124  Now we use the identity
125  \f[
126  \left(\frac{\partial \mu}{\partial T}\right)_{n,V} = -
127  \left(\frac{\partial n}{\partial T}\right)_{\mu,V}
128  \left(\frac{\partial n}{\partial \mu}\right)_{T,V}^{-1} \, ,
129  \f]
130  and the Maxwell relation above to give
131  \f[
132  C_V = \frac{T}{n}
133  \left[
134  \left(\frac{\partial s}{\partial T}\right)_{\mu,V}
135  -\left(\frac{\partial n}{\partial T}\right)_{\mu,V}^2
136  \left(\frac{\partial n}{\partial \mu}\right)_{T,V}^{-1}
137  \right]
138  \f]
139  which expresses the specific heat in terms of the three
140  derivatives which are given.
141 
142  For, \f$ c_P \f$, defined as
143  \f[
144  c_P = \frac{T}{N} \left( \frac{\partial S}{\partial T}
145  \right)_{N,P}
146  \f]
147  (which is also unitless) we can write functions
148  \f[
149  S=S(N,T,V) \qquad \mathrm{and} \qquad V=V(N,P,T)
150  \f]
151  which imply
152  \f[
153  \left( \frac{\partial S}{\partial T} \right)_{N,P} =
154  \left( \frac{\partial S}{\partial T} \right)_{N,V} +
155  \left( \frac{\partial S}{\partial V} \right)_{N,T}
156  \left( \frac{\partial V}{\partial T} \right)_{N,P} \, .
157  \f]
158  Thus we require the derivatives
159  \f[
160  \left( \frac{\partial S}{\partial T} \right)_{N,V} ,
161  \left( \frac{\partial S}{\partial V} \right)_{N,T} ,
162  \qquad\mathrm{and}\qquad
163  \left( \frac{\partial V}{\partial T} \right)_{N,P}
164  \, .
165  \f]
166 
167  To compute the new entropy derivatives, we can write
168  \f[
169  S=S(\mu(N,T,V),T,V)
170  \f]
171  to get
172  \f[
173  \left( \frac{\partial S}{\partial T} \right)_{N,V} =
174  \left( \frac{\partial S}{\partial \mu} \right)_{T,V}
175  \left( \frac{\partial \mu}{\partial T} \right)_{N,V} +
176  \left( \frac{\partial S}{\partial T} \right)_{\mu,V} \, ,
177  \f]
178  and
179  \f[
180  \left( \frac{\partial S}{\partial V} \right)_{N,T} =
181  \left( \frac{\partial S}{\partial \mu} \right)_{T,V}
182  \left( \frac{\partial \mu}{\partial V} \right)_{N,T} +
183  \left( \frac{\partial S}{\partial V} \right)_{\mu,T} \, .
184  \f]
185  These require the chemical potential derivatives which have
186  associated Maxwell relations
187  \f[
188  \left( \frac{\partial \mu}{\partial T} \right)_{N,V} =
189  -\left( \frac{\partial S}{\partial N} \right)_{T,V}
190  \qquad\mathrm{and}\qquad
191  \left( \frac{\partial \mu}{\partial V} \right)_{N,T} =
192  -\left( \frac{\partial P}{\partial N} \right)_{T,V} \, .
193  \f]
194  Finally, we can rewrite the derivatives on the right hand sides
195  in terms of derivatives of functions of \f$ \mu, V \f$ and
196  \f$ T \f$,
197  \f[
198  \left( \frac{\partial S}{\partial N} \right)_{T,V} =
199  \left( \frac{\partial S}{\partial \mu} \right)_{T,V}
200  \left( \frac{\partial N}{\partial \mu} \right)_{T,V}^{-1} \, ,
201  \f]
202  and
203  \f[
204  \left( \frac{\partial P}{\partial N} \right)_{T,V} =
205  \left( \frac{\partial P}{\partial \mu} \right)_{T,V}
206  \left( \frac{\partial N}{\partial \mu} \right)_{T,V}^{-1} \, .
207  \f]
208 
209  The volume derivative,
210  \f[
211  \left( \frac{\partial V}{\partial T} \right)_{N,P} \, ,
212  \f]
213  is related to the coefficient of thermal expansion, sometimes
214  called \f$ \alpha \f$,
215  \f[
216  \alpha \equiv \frac{1}{V}
217  \left( \frac{\partial V}{\partial T} \right)_{N,P} \, .
218  \f]
219  We can rewrite the derivative
220  \f[
221  \left( \frac{\partial V}{\partial T} \right)_{N,P} =
222  -\left( \frac{\partial P}{\partial T} \right)_{N,V}
223  \left( \frac{\partial P}{\partial V} \right)_{N,T}^{-1} \, .
224  \f]
225  The first term can be computed from the Maxwell relation
226  \f[
227  \left( \frac{\partial P}{\partial T} \right)_{N,V} =
228  \left( \frac{\partial S}{\partial V} \right)_{N,T} \, ,
229  \f]
230  where the entropy derivative was computed above. The second term
231  (related to the inverse of the isothermal compressibility, \f$
232  \kappa_T \equiv (-1/V) (\partial V/\partial P)_{T,N} \f$ can be
233  computed from the function \f$ P = P[\mu(N,V,T),V,T] \f$
234  \f[
235  \left( \frac{\partial P}{\partial V} \right)_{N,T} =
236  \left( \frac{\partial P}{\partial \mu} \right)_{T,V}
237  \left( \frac{\partial \mu}{\partial V} \right)_{N,T} +
238  \left( \frac{\partial P}{\partial V} \right)_{\mu,T}
239  \f]
240  where the chemical potential derivative was computed above.
241 
242  The results above can be collected to give
243  \f[
244  \left( \frac{\partial S}{\partial T} \right)_{N,P} =
245  \left( \frac{\partial S}{\partial T} \right)_{\mu,V} +
246  \frac{S^2}{N^2}
247  \left( \frac{\partial N}{\partial \mu} \right)_{T,V} -
248  \frac{2 S}{N}
249  \left( \frac{\partial N}{\partial T} \right)_{\mu,V} \, ,
250  \f]
251  which implies
252  \f[
253  c_P =
254  \frac{T}{n}
255  \left( \frac{\partial s}{\partial T} \right)_{\mu,V} +
256  \frac{s^2 T}{n^3}
257  \left( \frac{\partial n}{\partial \mu} \right)_{T,V} -
258  \frac{2 s T}{n^2}
259  \left( \frac{\partial n}{\partial T} \right)_{\mu,V} \, ,
260  \f]
261 
262  This derivation also gives the well-known relationship between
263  the specific heats at constant volume and constant pressure,
264  \f[
265  c_P = c_V + \frac{T \alpha^2}{n \kappa_T} \, .
266  \f]
267 
268  In the case where the particle is interacting, the
269  derivative of the density with respect to the effective mass is
270  \f[
271  \left(\frac{dn}{dm^{*}}\right)_{\mu,T} =
272  \left(\frac{3 n}{m^{*}}\right) -
273  \frac{T}{m^{*}} \left(\frac{dn}{dT}\right)_{m^{*},\mu} -
274  \frac{\nu}{m^{*}} \left(\frac{dn}{d\mu}\right)_{m^{*},T}
275  \f]
276  This relation holds whether or not the mass is included in the
277  chemical potential \f$ \nu \f$, as the rest mass is held
278  constant even though the effective mass is varying. This
279  relation also holds in the case where the particle is
280  non-interacting, so long as one does not allow the rest mass in
281  the chemical potential to vary. This derivative is useful, for
282  example, in models of quark matter where the quark mass is
283  dynamically generated.
284  */
285  class part_deriv : public part {
286 
287  public:
288 
289  /// Make a particle of mass \c mass and degeneracy \c dof.
290  part_deriv(double mass=0.0, double dof=0.0) : part(mass,dof) {
291  }
292 
293  /// Derivative of number density with respect to chemical potential
294  double dndmu;
295 
296  /// Derivative of number density with respect to temperature
297  double dndT;
298 
299  /// Derivative of entropy density with respect to temperature
300  double dsdT;
301 
302  };
303 
304  /** \brief A fermion with derivative information
305  */
306  class fermion_deriv : public part_deriv {
307 
308  public:
309 
310  /// Make a particle of mass \c mass and degeneracy \c dof.
311  fermion_deriv(double mass=0.0, double dof=0.0) : part_deriv(mass,dof) {
312  }
313 
314  /// Fermi momentum
315  double kf;
316 
317  };
318 
319  /** \brief Compute properties of a fermion including derivatives
320  [abstract base]
321 
322  \future Include explicit zero-temperature calculation, maybe
323  by making this a child of fermion_zerot or by making a
324  new fermion_deriv_zerot?
325  \comment
326  dn/dmu is just g*mu*kf/2/pi^2
327  \endcomment
328  \future There is also a closed form for the derivatives
329  of massless fermions with pairs at finite temperature
330  in Constantiou et al. 2014 which could be implemented here.
331  */
333 
334  public:
335 
336  virtual ~fermion_deriv_thermo() {
337  }
338 
339  /** \brief Calculate properties as function of chemical potential
340  */
341  virtual int calc_mu(fermion_deriv &f, double temper)=0;
342 
343  /** \brief Calculate properties as function of density
344  */
345  virtual int calc_density(fermion_deriv &f, double temper)=0;
346 
347  /** \brief Calculate properties with antiparticles as function of
348  chemical potential
349  */
350  virtual int pair_mu(fermion_deriv &f, double temper)=0;
351 
352  /** \brief Calculate properties with antiparticles as function of
353  density
354  */
355  virtual int pair_density(fermion_deriv &f, double temper)=0;
356 
357  /// Calculate effective chemical potential from density
358  virtual int nu_from_n(fermion_deriv &f, double temper)=0;
359 
360  /** \brief Calculate properties as a function of chemical
361  potential using a degenerate expansion
362  */
363  virtual bool calc_mu_deg(fermion_deriv &f, double temper,
364  double prec);
365 
366  };
367 
368 
369 #ifndef DOXYGEN_NO_O2NS
370 }
371 #endif
372 
373 #endif
double dsdT
Derivative of entropy density with respect to temperature.
Definition: part_deriv.h:300
double dndT
Derivative of number density with respect to temperature.
Definition: part_deriv.h:297
A particle data class with derivatives.
Definition: part_deriv.h:285
double dndmu
Derivative of number density with respect to chemical potential.
Definition: part_deriv.h:294
virtual int calc_mu(fermion_deriv &f, double temper)=0
Calculate properties as function of chemical potential.
virtual int pair_density(fermion_deriv &f, double temper)=0
Calculate properties with antiparticles as function of density.
virtual int calc_density(fermion_deriv &f, double temper)=0
Calculate properties as function of density.
virtual int nu_from_n(fermion_deriv &f, double temper)=0
Calculate effective chemical potential from density.
A fermion with derivative information.
Definition: part_deriv.h:306
Compute properties of a fermion including derivatives [abstract base].
Definition: part_deriv.h:332
fermion_deriv(double mass=0.0, double dof=0.0)
Make a particle of mass mass and degeneracy dof.
Definition: part_deriv.h:311
double kf
Fermi momentum.
Definition: part_deriv.h:315
virtual int pair_mu(fermion_deriv &f, double temper)=0
Calculate properties with antiparticles as function of chemical potential.
Particle base class.
Definition: part.h:71
virtual bool calc_mu_deg(fermion_deriv &f, double temper, double prec)
Calculate properties as a function of chemical potential using a degenerate expansion.
part_deriv(double mass=0.0, double dof=0.0)
Make a particle of mass mass and degeneracy dof.
Definition: part_deriv.h:290

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).
Hosted at Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads..