Skip to content

Commit

Permalink
update LJ potential notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
dou-du committed Oct 12, 2021
1 parent f06d425 commit 214a19b
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 31 deletions.
97 changes: 68 additions & 29 deletions notebook/Lennard_Jones.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,71 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# **Lennard Jones Potential**"
"# **Lennard-Jones Potential**\n",
"\n",
"<i class=\"fa fa-home fa-2x\"></i><a href=\"./index.ipynb\" style=\"font-size: 20px\"> Go back to index</a>\n",
"\n",
"**Source code:** https://github.com/osscar-org/materials-science/blob/master/notebook/Lennard_Jones.ipynb\n",
"\n",
"<hr style=\"height:1px;border:none;color:#cccccc;background-color:#cccccc;\" />"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## **Goals**\n",
"\n",
"* We demonstrate the Lennard-Jones potential in this notebook.\n",
" * Understand the interactions between particles and concept of the potentials.\n",
" * Know the formula of the Lennard-Jones potential.\n",
" * Understand the application of the Lennard-Jones potential in molecular modelling.\n",
" * Know the insuffisance of the Lennard-Jones potential."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## **Background theory**\n",
"\n",
"In the molecular modelling, it is crucial to construct mathematical models for\n",
"the interactions of the simulated particles. Primarly, the simplest model should\n",
"be developed for two-body systems. The Lennard-Jones potential was proposed by\n",
"Sr Lennard Jones in 1931 \n",
"[[J E Lennard-Jones 1931 Proc. Phys. Soc. 43 461]](https://iopscience.iop.org/article/10.1088/0959-5309/43/5/301). The Lennard-Jones\n",
"potential is a simplifed and realistic model, which has proved successfully for \n",
"a varties of systems. Therefore, it is always used to be the first potential \n",
"model to teach students."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[Go back to index](./index.ipynb)"
"<details close>\n",
"<summary style=\"font-size: 20px\">Lennard-Jones potential</summary>\n",
"The mathematical formula of the Lennard-Jones potential is:\n",
" \n",
"$$\\large E(r)= \\epsilon \\left[\\frac{a}{r^{12}}-\\frac{b}{r^6}\\right]$$\n",
" \n",
"where, $r$ is the distance between two atoms. $a$ and $b$ are two parameters.\n",
"$\\epsilon$ is the dispersion energy, which controls the depth of the\n",
"well potential. For a two-body system like two nuclei, the particles repulse \n",
"each other at short distance. While particles shows attraction at long distance.\n",
"The interaction should trend to vanlish at infinite distance.\n",
"The Lennard-Jones potential fulfills all these three conditions.\n",
"</details>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<details close>\n",
"<summary style=\"font-size: 20px\">Molecular simulations with LJ potential</summary>\n",
"\n",
"</details>"
]
},
{
Expand All @@ -20,30 +77,8 @@
"source": [
"<hr style=\"height:1px;border:none;color:#cccccc;background-color:#cccccc;\" />\n",
"\n",
"<p style=\"text-align: justify;font-size:15px; width: 90%\"> \n",
"In this widget, it shows the Lennard-Jones potential. \n",
"The Lennard-Jones potential describes the interaction between atom, i.e. the energy depending on the distance. It is written as:\n",
"</p>\n",
"\n",
"<p style=\"text-align: justify;font-size:20px; width: 90%\"> \n",
"$E(r)= \\epsilon (\\frac{a}{r^12}-\\frac{b}{r^6})$\n",
"</p>\n",
"\n",
"<p style=\"text-align: justify;font-size:15px; width: 90%\">\n",
"where, $r$ is the distance between two atoms. $a$ and $b$ are two parameters. \n",
"It can be normalized by using $\\rho = \\frac{r_{min}}{r}$\n",
"The force can be written as:\n",
"</p>\n",
" \n",
"<p style=\"text-align: justify;font-size:20px; width: 90%\"> \n",
"$F(\\rho) = \\frac{d E}{d \\rho} = -12 \\rho(\\frac{1-\\rho^9}{\\rho^{14}})$\n",
"</p>\n",
" \n",
"<p style=\"text-align: justify;font-size:15px; width: 90%\"> \n",
"The Wikipedia link of the Lennard-Jones potential:\n",
"</p>\n",
"\n",
"[https://en.wikipedia.org/wiki/Lennard-Jones_potential](https://en.wikipedia.org/wiki/Lennard-Jones_potential)"
"## Interactive visualization\n",
"(be patient, it might take a few seconds to load)"
]
},
{
Expand Down Expand Up @@ -189,7 +224,11 @@
"p_dist2 = plt.scatter(x = [px2], y = [py2], colors =['orange'], stroke = 'black', default_size = 100)\n",
"#p2 = plt.scatter(x = [1.0,], y = [0.0], colors =['orange'], stroke = 'black', default_size = 100)\n",
"\n",
"display(VBox([HBox([fig1, fig2]), HBox([VBox([cb1, cb2]),VBox([cb3, cb4])]), a_slider, b_slider, HBox([dis, energy_button])]))"
"fig1.layout.min_width = \"400px\"\n",
"fig2.layout.min_width = \"400px\"\n",
"\n",
"display(HBox([VBox([fig1, cb1, cb2]), VBox([fig2, cb3, cb4])]))\n",
"display(a_slider, b_slider, HBox([dis, energy_button]))"
]
},
{
Expand All @@ -202,7 +241,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -216,7 +255,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.8"
"version": "3.8.8"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions notebook/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -39,7 +39,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.8"
"version": "3.8.8"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 214a19b

Please sign in to comment.