Skip to content

Commit

Permalink
starts with rdf
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddesancho committed Nov 17, 2024
1 parent 3e65069 commit 724b665
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 17 deletions.
7 changes: 6 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ sphinx:
extra_extensions:
- sphinx_exercise
- sphinx_togglebutton


parse:
myst_enable_extensions:
# don't forget to list any other extensions you want enabled,
# including those that are enabled by default!
- amsmath
# Information about where the book exists on the web
repository:
url: https://github.com/BioKT/statmecsim # Online location of your book
Expand Down
4 changes: 1 addition & 3 deletions _toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ format: jb-book
root: intro
chapters:
- file: contents/classicalmechanics
- file: markdown
- file: notebooks
- file: markdown-notebooks
- file: contents/propertiesofliquids
54 changes: 41 additions & 13 deletions contents/classicalmechanics.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,70 @@ We will start this course with a reminder of Newton's equations of motion,
formulated by English physicist and mathematitian Sir Isaac Newton in
the *Philosophiae Naturalis Principia Mathematica* in 1687. The laws
establish the following:
* In the absence of external forces, a body will either be at rest or
* In the absence of external forces, a particle $i$ will either be at rest or
continue its motion following a straight line with a constant velocity,
$\mathbf{v}_i$.
* An eternal force $\mathbf{f}_i$ on a body produces an acceleration equal
to the force divided by the mass of the body, or
\begin{equation}
```{math}
:label:
m_i\ddot{\mathbf{r}}_i=\mathbf{f}_i(\mathbf{r}_i)
\end{equation}
```
* If a body A exerts a force on another body, B, then body B exerts a force
in body A such that
\begin{equation}
```{math}
:label:
\bf{f}_{AB}=-\bf{f}_{BA}
\end{equation}
```
Here we are already introducing a certain amount of notation. For a particle $i$
its Cartesian coordinates are expressed using vector $\mathbf{r}_i$. Hence
for a system with $N$ particles we will denote the position vectors collectively
as $\mathbf{r}^N$. Also, we are using the force vector $\mathbf{f}_i$, corresponding
to the force acting on particle $i$. This force can be obtained as a partial
derivative of a potential $V$, specifying the interactions in the $N$ particle
system
\begin{equation}
```{math}
:label: eq-force
\mathbf{f}_i(\mathbf{r}^N)=-\frac{\partial V(\mathbf{r}^N)}{\partial \mathbf{r}_i}
\label{eq:force}
\end{equation}
```
For most of this course, the potential energy that we will be considering will be
due to molecular interactions that we will consider to be pair-wise additive
and dependent on the distance between particles. Hence,
\begin{equation}
```{math}
:label:
V(\mathbf{r}^N)=\sum_{i=1}^N\sum_{j=i+1}^Nv(r_{ij})
\end{equation}
```
where we are avoiding double-counting of interactions in the sums. We can
substitute in Equation \ref{eq:force} and see that the force acting on particle $i$
substitute in Equation {eq}`eq-force` and see that the force acting on particle $i$
is in fact a sum over pairwise forces
\begin{equation}
```{math}
:label:
\mathbf{f}_i=-\frac{\partial V(\mathbf{r}^N)}{\partial \mathbf{r}_i} =
-\sum_{i=1}^N\sum_{j=i+1}^N\frac{\partial v(r_{ij})}{\partial \mathbf{r}_i}
=\sum_{i\neq j}^N \mathbf{f}_{ij}
\end{equation}
```

## Energy conservation
One of the most fundamental properties of the mechanical systems that we will
consider in this course is energy conservation. In general, we can write
the hamiltonian of the system ($\mathcal{H}$) as the sum of the kinetic energy ($K$) and the potential
energy ($V$),
```{math}
:label:
H = K + V
```
where
```{math}
:label:
K=\sum_i^N\frac{1}{2}m_i\dot{\mathbf{r}}_i^2=\sum_i^N\frac{\mathbf{p}_i^2}{2m_i}
```
Because $H$ is a constant of motion, we have
```{math}
:label:
\frac{d\mathcal{H}}{dt}=0
```
which can be further expanded as
```{math}
:label:
\frac{d\mathcal{H}}{dt}=\frac{d}{dt}\bigg[\sum_i^N\frac{\mathbf{p}_i^2}{2m_i} + V\bigg]
```
53 changes: 53 additions & 0 deletions contents/propertiesofliquids.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
jupytext:
text_representation:
extension: .md
format_name: myst
---
# Static properties of liquids
## The radial distribution function
Liquids are homogeneous systems, characterized by a uniform
particle density $\rho=N/V$, where $N$ is the number of particles and
$V$ is the volume. With simulations, we can interrogate their internal
structure. One of the most important quantities that can be computed
from simulations is the *radial distribution function* (in short, RDF or
$g(r)$). Importantly,this quantity can also be accessed experimentally.

To calculate the rdf we simply need to histogram pairwise distances and
calculate
```{math}
:label:
g(r)=\frac{V}{4\pi r^2\Delta rN^2}\sum_i^Nn_i(r,\Delta r)
```
where $\Delta r$ is the bin width and we are averaging over
reference particles the number of times we find another
particles in a bin centered at a distance $r$, $n_i(r,\Delta r)$.
It is important to note that the RDF is dimensionless. At short
radii, the value of $g(r)$ tends to zero due to excluded volume
effects. At distances approaching the repulsive core diameter
($\sigma$) the RDF typically peaks, reflecting the high density
coordination shell of nearest neighbours. A second peak at longer
distances is also often found. As the distribution becomes
homogeneous at longer $r$ (greater than the correlation length $\xi$),
the density reaches that of the bulk and the value of the RDF plateaus
at 1.

When using a rigorous definition of the RDF, we can relate it to the
``effective pair potential'' or potential of mean force $v(r)$ as
```{math}
:label:
g(r)=\exp{(-\beta v(r))}
```
or equivalently
```{math}
:label:
-k_BT\ln g(r)=v(r)
```

## Useful properties related to the radial distribution function
The number of particles within a distance $r_c$ can be estimated
easily from the RDF as
```{math}
:label
n_c = 4\pi\rho\int_0^{r_c}drr^2g(r)
```

0 comments on commit 724b665

Please sign in to comment.