Search Blogs

Thursday, June 6, 2019

Ideal Solution Mixing: A-B Lattice


Here we will review the ideal solution mixing model for simple A-B lattice random mixing alloy system. The first step is to recall that for any system (e.g. state or phase) we can write the Gibbs free energy as:
$$ G = H-TS $$
where $H$ is the enthalpy, $T$ the temperature, and $S$ the entropy. We now propose that we have two isolated systems, lattice A and lattice B, and we want to find the change in Gibbs free energy when the two are combined to form a lattice with both A and B sites (randomly). An illustrative example would look something like below.


The next step is to write the change in Gibbs free energy as:
\begin{align}
\Delta G^{mix} & = G_{initial} - G_{final} \\
& = \Delta H^{mix} - T \Delta S^{mix} \\
\end{align}
Notice that we are using the label $mix$ to indicate that the change in Gibbs free energy is due to the mixing of the two lattices into one (i.e. Gibbs free energy of mixing).

In the ideal solution mixing model, we first approximate that $\Delta H^{mix}$  is negligible and taken to be zero. We can think of this as meaning that we assume no change in internal energy due to the chemical interactions between A and B. The next assumption is that the change in entropy is strictly due to configurational arrangement of A and B points on the combined lattice. This means that entropic effects due to lattice vibrations or magnetic ordering are not accounted for. Thus the Gibbs free energy has a simple relation to entropy:
$$ \Delta G^{mix} = - T \Delta S^{c} $$
The next step is to define the representation for the configurational entropy. To do this we will use to facts that each microstate is probabilistic and given by the combinatorics (i.e. possible configurations ). This is compactly represented by the famous equation:
$$ S^{c} = k_b \ln \omega^{c} $$
with $k_b$ being the Boltzmann constant and $\omega^{c}$ the configuration combinatorics. For the lattice AB this is going to be given by:
$$ \omega^{c} = \frac{N!}{N_{A}!N_{B}!}$$
where $N=N_{A}+N_{B}$ and $N_{A}$ and $N_{B}$ are the number of sites of a given type. At first glance calculating the configurational entropy may not seem daunting, however, logarithms of factorials can become demanding to calculate very quickly. Fortunately enough there is an approximation provided by mathematician James Stirling that allows one to approximate logarithms of factorials and is given by:
$$ \ln N! \approx N \ln N - N $$
Using this approximation we can determine $\omega^{c}$ and distill the expression of $S^{c}$ into something that is relative compact and meaningful. Apply the approximation we get:
\begin{align}
 \ln \omega^{c} &= N \ln N - N - \left[\ln\left(N_{A}!N_{B}!\right)\right] \\
&= N \ln N - N - \left[ N_{A} \ln N_{A} - N_{A} + N_{B} \ln N_{B} - N_{B}\right] \\
&= N \ln N - N_{A} \ln N_{A} - N_{B} \ln N_{B} - N + N_A + N_B \\
\end{align}
The last three terms cancel out, e.g., $N_A + N_B = N$ and we then rewrite the first term as:
\begin{align}
\ln \omega^{c} &= \left(N_A + N_B\right) \ln N  - N_{A}\ln N_A - N_{B}\ln N_B \\
&=-\left[N_A \ln \left(\frac{N_A}{N}\right) + N_{B}\ln\left( \frac{N_B}{N}\right) \right]
\end{align}
the ratio of $X_A = \frac{N_A}{N}$ or $X_B = \frac{N_B}{N}$  are the fraction of sites on the mixed lattice with A and B sites, respectively. Let us take one further step by multiplying the equation above by $\frac{N}{N}$ to get
$$ \ln \omega^{c} = -N \left[ X_A \ln X_A + X_B \ln X_B \right] $$
Now we can write $\Delta S^{mix}$ as,
$$ \Delta S^{mix} = -k_{b} N \left[ X_A \ln X_A + X_B \ln X_B \right] $$
if we assume that the total number of N sites on the alloy lattice is comparable to the number of particles in 1 mole, i.e., Avogadro's number $N_a = \text{6.022}\times \text{10}^{\text{23}}$, then we can write the Gibbs free energy of mixing in most familiar form as:
\begin{align}
 \Delta G^{mix} &= -T \Delta S^{mix} \\
&= -T \cdot -k_{b} N_{a} \left[ X_A \ln X_A + X_B \ln X_B \right]  \\
&= \boxed{RT \left[ X_A \ln X_A + X_B \ln X_B \right]}
\end{align}
where $R$ is the gas constant given by  $k_b N_a$. We can get a sense for how the Gibbs free energy of mixing changes with temperature as shown in the graph below,


From the graph we observe two features, 1.) the Gibbs free energy of mixing for an ideal solution is a symmetric function, 2.) as the temperature is increased $\Delta G^{mix} is decreases. Not that in the graph the line(s) do not extend to zero and one, this is because these would be given by the Gibbs free energy of the reference states of lattice A and B.

Ideal solution mixing is typically not suitable for real material alloy systems and thus other approximations such as the regular solution model are used. In the regular solution model we use the same $\Delta S^{mix}$ and include a non-zero expression for $\Delta H^{mix}$. The most accurate approach for calculating Gibbs free energy of mixing for real materials is to use CALPHAD methodologies.

For this blog postings quote we will get two quotes:

"Nothing in life is certain except death, taxes and the second law of thermodynamics."
-Seth Lloyd, MIT Professor 

"In this house, we obey the laws of thermodynamics!"
-Homer Simpson, response to Lisa's perpetual motion machine

References & Additional Reading

Reuse and Attribution

Thursday, April 11, 2019

Exact Differential Equations

The general form of a first-order differential equation is given by the following:

$$ M(x,y)dx + N(x,y)dy = 0$$

our differential equation is said to be exact if it satisfies the following exactness test:

$$\frac{\partial M\left(x,y\right)}{\partial y} = \frac{\partial N\left(x,y\right)}{\partial x}$$

The goal is to determine a function $f(x,y)$ that satisfies the following:

$$df = M(x,y)dx + N(x,y)dy$$
$$ \frac{\partial f\left(x,y\right)}{\partial x} = M\left(x,y\right)$$
$$ \frac{\partial f\left(x,y\right)}{\partial y} = N\left(x,y\right)$$

Let us look at the following example differential equation:

$$\left(y^{2}-2x\right)dx + \left(2xy+1\right)dy=0$$

Taking the partial derivatives of the functions corresponding to $M\left(x,y\right)$ and $N\left(x,y\right)$, we get:

$$ \frac{\partial M}{\partial y} = 2y $$
$$ \frac{\partial N}{\partial x} = 2y $$

So our differential equation is indeed exact and we now can find the total function, $f(x,y)$, whose derivative is equal to our differential equation. This is done by integrating  the functions $M\left(x,y\right)$ and $N\left(x,y\right)$,

$$M\left(x,y\right) = \frac{\partial f\left(x,y\right)}{\partial x}$$
$$f = \int{\left(y^{2}-2x\right) dx} = xy^{2}-x^{2} $$

similarly for $N\left(x,y\right)$,

$$N\left(x,y\right) = \frac{\partial f\left(x,y\right)}{\partial y}$$
$$f = \int{\left(2xy+1\right)dy} = xy^{2}+y $$

In both cases, we ignore the constant of integration. We now can identify unique terms and construct the function, $f(x,y)$, by summing these terms:

$$f\left(x,y\right) = xy^{2}-x^{2}+y=\text{constant}$$

So we have identified a function, $f\left(x,y\right)$, that is a solution to our exact differential equation.

Now for our quote:

I became an atheist because, as a graduate student studying quantum physics, life seemed to be reducible to second-order differential equations. It thus became apparent to me that mathematics, physics, and chemistry had it all and I didn't see any need to go beyond that.
-Attributed to Francis Collins but unconfirmed.


Reuse and Attribution

Thursday, March 14, 2019

Matrices


A matrix is an array of numbers arranged with $m$-rows and $n$-columns. When $m=n$ the matrix is termed square. The index of an element in a matrix is notated using the indices $i$ and $j$ for the rows and columns, respectively. For example:

$$\mathbf{B}=
\begin{bmatrix}
b_{11} & b_{12} \\
b_{21} & b_{22} \\
\end{bmatrix}.
$$

The algebra of matrices is straightforward, for example, addition occurs by adding same indexed elements:

$$\mathbf{B}+\mathbf{C} =
\begin{bmatrix}
b_{11}+c_{11} & b_{12}+c_{12} \\
b_{21}+c_{21} & b_{22}+c_{22} \\
\end{bmatrix}
.$$

We can write the addition operation in more compact form using implicit index notation, e.g., $\mathbf{B}+\mathbf{C}=b_{ij}+c_{ij}$. Keep in mind that the dimensions of the matrices must be the same for addition or subtraction operations.

Multiplication of matrices by a scalar quantity is simply, $S\cdot\mathbf{B}$. When multiplying two matrices, the inner dimensions must be the same, for example, if $\mathbf{B}$ is a $m \times n$ then $\mathbf{C}$ must be a $n \times p$. In other words, the number of columns in $\mathbf{B}$ must be equal to the number of rows in $\mathbf{C}$. The operation is written in compact as follows:

$$ c_{jk} = \sum_{i=1}^{n} a_{ji}b_{ik}.$$

Here are some examples, $c_{11} = a_{11}b_{11}+a_{12}b_{21}$ and $c_{12} = a_{11}b_{12} + a_{12}b_{22}$. An important operation/transformation of matrices is the transpose, which is the process of switching elements in the rows and columns. The transpose is indicated with a superscript capital "T", e.g., $\mathbf{B}^T$. For a square matrix, the diagonal components are commonly referred to as the principal terms and the sum of them is the trace of the matrix. For square matrices that have ones as diagonal terms and zeros as off-diagonal terms, we refer to them as unit of identify matrices, for example:

$$\mathbf{I}=\begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1 \\
\end{bmatrix}.$$

Identity matrices are commonly represented with $\mathbf{I}$. Another important property of square matrices is invertibility. A matrix is said to have an inverse if it satisfies the following condition:

$$\mathbf{A}\mathbf{B} = \mathbf{I},$$

we call $\mathbf{B}$ the inverse of $\mathbf{A}$. If a square matrix doesn't have an inverse it is referred to as singular. Matrices that have the inverse which satisfies the condition:

$$\mathbf{A}^{T}\mathbf{A}=\mathbf{I},$$

are orthogonal matrices. A determinant is a specific value that can be computed for square matrices and can be thought of as the scaling factor for linear transformations. The determinant is typically written as:

$$\text{det}\, \mathbf{B} = \Delta \mathbf{B} = |\mathbf{B}|,$$

For 2x2 matrices the determinant is determined by taking the product of the diagonals and subsequent difference between them, as shown below:

$$|\mathbf{B}| =
\begin{vmatrix}
b_{11} & b_{12} \\
b_{21} & b_{22} \\
\end{vmatrix} = b_{11}b_{22}-b_{21}b_{12}.$$

Another method for finding the determinant is using the Laplace expansion method. Determinants have the following commuting properties:

$$|\mathbf{A}\mathbf{B}| = |\mathbf{A}||\mathbf{B}|,$$
$$|\mathbf{A}| = |\mathbf{A}^{T}|.$$

A matrix that is singular will have a determinant that evaluates to zero, thus this is a good way for identifying if a matrix has an inverse.

Matrices and determinants are an important component to the field of  linear algebra, so having good command over them is a serious advantage. I know there are a lot of keywords presented in this post that were not given a formal mathematical description but I strongly suggest clicking the link and reading on to get a better sense of there use in linear algebra.

For this post we will provide a quote from a mathematician who did a lot of research in advance algebra and group theories.

"We [Kaplansky and Halmos] share a philosophy about linear algebra: we think basis-free, we write basis-free, but when the chips are down we close the office door and compute with matrices like fury."
-Irving Kaplansky, Paul Halmos: Celebrating 50 Years of Mathematics


References & Additional Reading

Reuse and Attribution