{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## 1.1 The Weiner Process\n", "\n", "A [**Weiner process**](http://en.wikipedia.org/wiki/Wiener_process), $W(t)\\,$, is a continuos-time stocastic process. By definition, the value of the process at time $t$ is:\n", "\n", "$$W(t) \\sim \\mathcal{N}(0,t)$$\n", "\n", "where $\\mathcal{N}(0,t)$ is a Normally-distributed random variable (RV) with $\\mu$=0 and $\\sigma^2=t$. \n", "\n", "From the definition follows that $W(0)=0$.\n", "\n", "Also, for any time instant $t$ and time delay $\\tau$ >0 the following is true:\n", "\n", "$$W(t+\\tau)-W(t) \\sim \\mathcal{N}(0,\\tau)$$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1.2 Brownian Motion\n", "\n", "In **Brownian motion** of a freely diffusing particle, the mean squared displacement of a particle $\\langle|\\vec{r}(t)-\\vec{r}(t+\\tau)|^2\\rangle$ is proportional to the time interval $\\tau$ according to\n", "\n", "$$\\langle|\\vec{r}(t)-\\vec{r}(t+\\tau)|^2\\rangle = 2 D N \\tau$$\n", "\n", "- $\\vec{r}(t)$ position at time $t$\n", "- $N$ number of dimensions ($N$=3 for 3D simulations)\n", "- $D$ diffusion coefficient\n", "- $\\tau$ time interval." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1.3 Brownian Motion as a Weiner Process\n", "\n", "\n", "When using a Weiner process to describe a Brownian motion we must set a physical link between \n", "the variance of the Weineer process and the diffusion coefficient.\n", "\n", "Remembering that \n", "\n", "$$k \\mathcal{N}(\\mu,\\sigma^2) = \\mathcal{N}(\\mu,k\\sigma^2)$$\n", "\n", "if we build a process in which \"dispacements\" are normally distributed with variance equal to $2DN\\tau$:\n", "\n", "$$W(t+\\tau)-W(t) \\sim \\mathcal{N}(0,2DN\\tau)$$\n", "\n", "than we are describing the Brownian motion of a particle with diffusion coefficient $D$. To simulate this process we must choose the times at which to evauate the position. For example we can sample the time at uniform intervals with step = $\\Delta t$.\n", "\n", "### How to choose the simulation step $\\Delta t$\n", "The choice of the step depends on which properties we want to simulate. For example, let assume we want to simulate a colloidal particle diffusing through a confocal excitation volume of lateral dimension $S_{spot}$. In order to gather significant information we want to sample the particle position may times during the average diffusion time. The average diffusion time can be estimated setting the standard deviation of the displacement ($W(t+\\tau)-W(t)\\quad$) equal to $S_{spot}$ and solving for $\\tau$\n", "\n", "$$S_{spot} = \\sqrt{2DN\\tau_{spot}} \\quad \\rightarrow \\quad \\tau_{spot} = \\frac{S_{spot}^2}{2ND}$$\n", "\n", "so we want our simulation step to be $<< \\tau_{spot}$.\n", "\n", "Although $\\tau_{spot}$ can be derived theorically from $D$ and from the knowledge of the PSF, we know that for typical biomolecules of few nanometers, diffusing through a diffraction limited exciation spot (of visible light), the diffusion\n", "time is of the order of 1ms. Therefore we can safely set the simulation step to 0.5-1μs." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### The diffusion coefficient $D$\n", "The diffusion coefficient $D$ is given by:\n", "$$D = \\frac{k_B T}{3 \\pi \\eta d}$$\n", "\n", "- $k_B$ Boltzman constant\n", "- $T$ temperature in Kelvin\n", "- $\\eta$ viscosity (in SI units: Pa/s)\n", "- $d$ radius of the particle in meters\n", "\n", "> *See also [Theory - On Browniam motion and Diffusion coefficient](Theory - On Browniam motion and Diffusion coefficient.ipynb)*\n", "\n", "Note that the units of $D$ are $\\mathrm{m}^2/\\mathrm{s}\\;$. Using some reasonable number we obtain:\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import numpy as np" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "8.580361291970262e-11" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "d = 5e-9 # particle radius in meters\n", "eta = 1.0e-3 # viscosity of water in SI units (Pascal-seconds) at 293 K\n", "kB = 1.38e-23 # Boltzmann constant\n", "T = 293 # Temperature in degrees Kelvin\n", "\n", "D = kB*T/(3*np.pi*eta*d) # [m^2 / s]\n", "D" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Or expressing $D$ in $\\textrm{nm}^2 /\\mu s$" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "0.08580361291970262" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Du = D*(1e6)**2/(1e3) # [um^2 / ms]\n", "Du" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "85.80361291970262" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Du = D*(1e9)**2/(1e6) # [nm^2 / us]\n", "Du" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can also estimate $D$ experimentally from the knowledge of the PSF and the diffusion time $\\tau_{spot}$\n", "\n", "$$S_{spot} = \\sqrt{2DN\\tau_{spot}} \\quad \\rightarrow \\quad D = \\frac{S_{spot}^2}{2N\\tau_{spot}}$$\n", "\n", "Putting some reasonable number we obtain:\n", "\n" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "1.0666666666666665e-10" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "S_spot = 0.8e-6\n", "N = 3\n", "tau_spot = 1e-3\n", "\n", "D = S_spot**2 / (2*N*tau_spot) # [m^2 / s]\n", "D" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "0.10666666666666665" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Du = D*(1e6)**2/(1e3) # [um^2 / ms]\n", "Du" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "not very different from what we obtained before from the viscosity model." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Examples" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- *How far we travel in X seconds (hint standard deviation of displacement)?*" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Displacement (std_dev): 80.00 um\n" ] } ], "source": [ "time = 10. # seconds\n", "sigma = np.sqrt(2*D*3*time)\n", "print('Displacement (std_dev): %.2f um' % (sigma*1e6))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- *How long we need to diffuse an X distance?*" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Time for 1.0 um displacement: 0.002 s\n" ] } ], "source": [ "space = 1e-6 # m\n", "time = 1.*space**2/(2*D*3)\n", "print('Time for %.1f um displacement: %.1g s' % (space*1e6, time))" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.4.3" } }, "nbformat": 4, "nbformat_minor": 0 }