Eggeling-Lab-Microscope-Software / TRAIT2D

TRAIT2D is a cross-platform Python software package with compilable graphical user interfaces (GUIs) to support Single Particle Tracking experiments.
GNU General Public License v3.0
10 stars 10 forks source link

Change the free diffusion equation in the simulator #49

Closed joe-from-mtl closed 2 years ago

joe-from-mtl commented 2 years ago

Reviewer 1 comment :

A priori, the correct simulation of diffusion with coefficient D is to use displacements distributed as N(0,sqrt(2D dt)) (see e.g. SI of ref. 10 ). The authors use instead sqrt(D dt) N(0, 1), which appears different based on the linearity of normal distributions (aN(0,s) + b = N(b,|a|s)). Please clarify.

joe-from-mtl commented 2 years ago

numpy.random.randn returns a sample from the standard normal distribution N(0,1). To convert this to any normal distribution N(mu, sigma^2) => sigma * N(0,1) + mu. For mu=0 and var=sigma^2=2D dt, we indeed need to change the multiplicative factor in the free (Brownian) equation from sqrt(D dt) to sqrt(2 D dt).