# Materials Science and Engineering/Equations/Thermodynamics
## Notation

Conjugate variables :
| p | Pressure | V | Volume |
| T | Temperature | S | Entropy |
| μ | Chemical potential | N | Particle number |
Thermodynamic potentials :
| U | Internal energy | A | Helmholtz free energy |
| H | Enthalpy | G | Gibbs free energy |
Material properties :
| ρ | Density |
| C$_V$ | Heat capacity (constant volume) |
| C$_p$ | Heat capacity (constant pressure) |
| $\beta _{T}$ | Isothermal compressibility |
| $\beta _{S}$ | Adiabatic compressibility |
| $\alpha$ | Coefficient of thermal expansion |
Other conventional variables :
| δw | infinitesimal amount of Mechanical Work |
| δq | infinitesimal amount of Heat |
Constants :
| k$_B$ | Boltzmann constant |
| R | Ideal gas constant |

## Equations
### Laws of Thermodynamics

First Law of Thermodynamics:
    $dU=\delta Q-\delta W\,$
Second Law of Thermodynamics:
    $\int {\frac {\delta Q}{T}}\geq 0$

### Fundamental Equations

The Fundamental Equation:
    $dU\leq TdS-pdV+\sum _{i=1}^{p}\mu _{i}dN_{i}$
The equation may be seen as a particular case of the chain rule:
       $dU=\left({\frac {\partial U}{\partial S}}\right)_{V,\{N_{i}\}}dS+\left({\frac {\partial U}{\partial V}}\right)_{S,\{N_{i}\}}dV+\sum _{i}\left({\frac {\partial U}{\partial N_{i}}}\right)_{S,V,\{N_{j\neq i}\}}dN_{i}$
from which the following identifications can be made:
       $\left({\frac {\partial U}{\partial S}}\right)_{V,\{N_{i}\}}=T$
       $\left({\frac {\partial U}{\partial V}}\right)_{S,\{N_{i}\}}=-p$
       $\left({\frac {\partial U}{\partial N_{i}}}\right)_{S,V,\{N_{j\neq i}\}}=\mu _{i}$
These equations are known as "equations of state" with respect to the internal energy.

### Thermodynamic Potentials

Thermodynamic Potentials:
    Name Formula Natural variables Internal energy $U\,$ $~~~~~S,V,\{N_{i}\}\,$ Helmholtz free energy $A=U-TS\,$ $~~~~~T,V,\{N_{i}\}\,$ Enthalpy $H=U+pV\,$ $~~~~~S,p,\{N_{i}\}\,$ Gibbs free energy $G=U+pV-TS\,$ $~~~~~T,p,\{N_{i}\}\,$
For the above four potentials, the fundamental equations are expressed as:
    $dU\left(S,V,{N_{i}}\right)=TdS-pdV+\sum _{i}\mu _{i}dN_{i}$
    $dA\left(T,V,N_{i}\right)=-SdT-pdV+\sum _{i}\mu _{i}dN_{i}$
    $dH\left(S,p,N_{i}\right)=TdS+Vdp+\sum _{i}\mu _{i}dN_{i}$
    $dG\left(T,p,N_{i}\right)=-SdT+Vdp+\sum _{i}\mu _{i}dN_{i}$
Euler Integrals:
Because all of natural variables of the internal energy U are extensive quantities, it follows from Euler's homogeneous function theorem that
    $U=TS-pV+\sum _{i}\mu _{i}N_{i}\,$
Substituting into the expressions for the other main potentials we have the following expressions for the thermodynamic potentials:
    $A=-pV+\sum _{i}\mu _{i}N_{i}\,$
    $H=TS+\sum _{i}\mu _{i}N_{i}\,$
    $G=\sum _{i}\mu _{i}N_{i}\,$
Note that the Euler integrals are sometimes also referred to as fundamental equations.
Gibbs Duhem Relationship:
Differentiating the Euler equation for the internal energy and combining with the fundamental equation for internal energy, it follows that:
    $0=SdT-Vdp+\sum _{i}N_{i}d\mu _{i}\,$
which is known as the Gibbs-Duhem relationship. The Gibbs-Duhem is a relationship among the intensive parameters of the system. It follows that for a simple system with r components, there will be r+1 independent parameters, or degrees of freedom. For example, a simple system with a single component will have two degrees of freedom, and may be specified by only two parameters, such as pressure and volume for example. The law is named after Josiah Gibbs and Pierre Duhem.

### Materials Properties

Compressibility: At constant temperature or constant entropy
    $~\beta _{T{\text{ or }}S}=-{1 \over V}\left({\partial V \over \partial p}\right)_{T,N{\text{ or }}S,N}$
Heat Capacity at Constant Pressure:
$~C_{p}=\left({\partial U \over \partial T}\right)_{p}+p\left({\partial V \over \partial T}\right)_{p}=\left({\partial H \over \partial T}\right)_{p}=T\left({\partial S \over \partial T}\right)_{p}~$
Heat Capacity at Constant Volume:
$~C_{V}=\left({\partial U \over \partial T}\right)_{V}=T\left({\partial S \over \partial T}\right)_{V}~$
Coefficient of Thermal Expansion:
    $\alpha _{p}={\frac {1}{V}}\left({\frac {\partial V}{\partial T}}\right)_{p}$
Maxwell Relations:
Maxwell relations are equalities involving the second derivatives of thermodynamic potentials with respect to their natural variables. They follow directly from the fact that the order of differentiation does not matter when taking the second derivative. The four most common Maxwell relations are:
    $~\left({\partial T \over \partial V}\right)_{S,N}=-\left({\partial p \over \partial S}\right)_{V,N}~$ $~\left({\partial T \over \partial p}\right)_{S,n}=\left({\partial V \over \partial S}\right)_{p,N}~$ $~\left({\partial T \over \partial V}\right)_{p,N}=-\left({\partial p \over \partial S}\right)_{T,N}~$ $~\left({\partial T \over \partial p}\right)_{V,N}=\left({\partial V \over \partial S}\right)_{T,N}~$

### Processes

Incremental Processes:
$~dU=T\,dS-p\,dV+\mu \,dN~$
$~dA=-S\,dT-p\,dV+\mu \,dN~$
$~dG=-S\,dT+V\,dp+\mu \,dN=\mu \,dN+N\,d\mu ~$
$~dH=T\,dS+V\,dp+\mu \,dN~$
Equation Table for an Ideal Gas ($PV^{m}=constant$):
| | Constant Pressure | Constant Volume | Isothermal | Adiabatic |
| Variable | $\Delta p=0\;$ | $\Delta V=0\;$ | $\Delta T=0\;$ | $q=0\;$ |
| $m\;$ | $0\;$ | $\infty \;$ | $1\;$ | $\gamma ={\frac {C_{p}}{C_{V}}}\;$ |
| Work ${\begin{matrix}w=-\int _{V_{1}}^{V_{2}}pdV\end{matrix}}$ | $-p\left(V_{2}-V_{1}\right)\;$ | $0\;$ | $-nRT\ln {\frac {V_{2}}{V_{1}}}\;$ | $C_{V}\left(T_{2}-T_{1}\right)\;$ |
| Heat Capacity, $C\;$ | $C_{p}=(5/2)nR\;$ | $C_{V}=(3/2)nR\;$ | $C_{p}\;$ or $C_{V}\;$ | $C_{p}\;$ or $C_{V}\;$ |
| Internal Energy, $\Delta U=3/2*nR\Delta T\;$ | $q+w\;$ $q_{p}+p\Delta V\;$ | $q\;$ $C_{V}\left(T_{2}-T_{1}\right)\;$ | $0\;$ $q=-w\;$ | $w\;$ $C_{V}\left(T_{2}-T_{1}\right)\;$ |
| Enthalpy, $\Delta H\;$ $H=U+pV\;$ | $C_{p}\left(T_{2}-T_{1}\right)\;$ | $q_{V}+V\Delta P\;$ | $0\;$ | $C_{p}\left(T_{2}-T_{1}\right)\;$ |
| Entropy ${\begin{matrix}\Delta S=-\int _{T_{1}}^{T_{2}}{\frac {C}{T}}dT\end{matrix}}$ | $C_{p}\ln {\frac {T_{2}}{T_{1}}}\;$ | $C_{V}\ln {\frac {T_{2}}{T_{1}}}\;$ | $nR\ln {\frac {V_{2}}{V_{1}}}\;$ ${\frac {q}{T}}\;$ | $0\;$ |