{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Molecular Dynamics" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The following tutorial runs two molecular dynamics (MD) simulations with BigDFT and analyses its outputs. We investigated the dynamics of a water environment with NVE ensamble at DFT level and the motion of a 38 atoms Lennard-Jones cluster with fixed NVT." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from BigDFT import Logfiles as lf\n", "from BigDFT import Calculators as calc\n", "from BigDFT import Inputfiles as I\n", "import matplotlib.pyplot as plt " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## A water environment" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To study and reproduce bulk water, we simulate the motion of four water molecules placed in a periodic cubic cell. The cubic unit cell side has been chosen to adjust the effective\n", "density of water to its ambient density." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Box size: 4.932703172202558 [AA]\n" ] } ], "source": [ "n = 4 # number of water molecules\n", "m = 18.01528 # [g/mol] molar mass\n", "NA = 6.02214076e23 # [1/mol] Avogadro number\n", "rho = 997e-27 # [g/AA^3] water density at room temperature\n", "\n", "volume = ( n * m / NA ) / rho\n", "box_size = volume ** (1.0/3.0)\n", "print('Box size: {} [AA]'.format(box_size))" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "from io import StringIO\n", "input_file = StringIO(\"\"\"HETATM 1 H HOH 0 2.924 3.219 1.550 1.00 0.00 H \n", "HETATM 2 H HOH 0 4.098 2.445 0.948 1.00 0.00 H \n", "HETATM 3 O HOH 0 3.850 2.984 1.714 1.00 0.00 O \n", "HETATM 4 H HOH 1 1.432 4.761 0.988 1.00 0.00 H \n", "HETATM 5 H HOH 1 0.066 4.168 0.637 1.00 0.00 H \n", "HETATM 6 O HOH 1 0.884 3.972 1.119 1.00 0.00 O \n", "HETATM 7 H HOH 2 2.280 0.928 1.171 1.00 0.00 H \n", "HETATM 8 H HOH 2 0.907 1.567 1.386 1.00 0.00 H \n", "HETATM 9 O HOH 2 1.335 0.779 1.019 1.00 0.00 O \n", "HETATM 10 H HOH 3 4.694 4.067 3.659 1.00 0.00 H \n", "HETATM 11 H HOH 3 3.377 4.728 4.071 1.00 0.00 H \n", "HETATM 12 O HOH 3 3.945 4.569 3.303 1.00 0.00 O \"\"\")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "from BigDFT.Atoms import AU_to_A\n", "from BigDFT.IO import read_pdb\n", "from BigDFT.UnitCells import UnitCell\n", "\n", "sys = read_pdb(input_file)\n", "sys.cell = UnitCell([box_size, box_size, box_size], units=\"angstroem\")" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "application/3dmoljs_load.v0": "
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n",
" jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n",
" jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n",
" jupyter labextension install jupyterlab_3dmol