# Classical diffusive dynamics

#### Numerical experiments » Classical diffusive dynamics

Two scripts (download links at the end of the page):

*1. classical_diffusion_2D.py *

(requires numpy)

*Usage (4 parameters): classical_diffusion_2D.py typical_scattering_angle propagation_time number_of_paths system_size*

The script models a classical multiple scattering evolution in a 2D system, showing that it becomes diffusive at long time. Each trajectory is composed of straight segments interleaved with scattering events. The length of each segment is chosen following an exponential distribution, with a unit mean free path. The scattering angle is chosen with a Gaussian distribution around 0, with a sigma equal to the "typical_scattering_angle" parameter. The initial point is at the origin, the initial direction of propagation random. No seed in the random number generation, but this can be easily added (line is commented out). The script propagates "number_of_paths" trajectories during a time "propagation_time" (which is actually a number of scattering events).

The script outputs 4 files:

* trajectories.dat which contains the (x,y) coordinates of the first 10 trajectories.

* squared_displacement.dat, which contains <x^2+y^2> (averaged over all trajectories) vs. time.

* final_position_x_distribution.dat and final_position_y_distribution.dat which contain the distribution of final positions. This is an histogram covering the range [-"system_size"/2,-"system_size"/2]. There are 100 bins, so this makes sense only if there are much more trajectories.

The theoretical predictions for the squared_displacement and the final_position distributions are the following:

* <r^2(t)> = 2Dt with D=1/(1-exp(-0.5*typical_scattering_angle^2)). D=1 in the isotropic limit, 2/typical_scattering_angle^2 for very anistropic scattering.

* P(x) and P(y) are Gaussians with sigma=sqrt(Dt).

*2. classical_trajectories_2D.py*

(requires scipy)

*Usage (5 parameters): classical_trajectories_2D.py propagation_time density_of_scatterers system_size energy number_of_trajectories.*

The script computes the classical propagation of particles in a 2D random potential. Each trajectory is computed by numerically integrating the Newton equations. The initial point is at the origin, the initial direction of propagation random. The initial velocity is calculated using that the total energy is the same for all trajectories. The script propagates "number_of_trajectories" trajectories during a time "propagation_time". The disordered potential is created by superimposing elementary Gaussian potentials (with sigma=1) with maximum value randomly chosen in a normal distribution (sigma=1) located at random positions in a square of size "system_size" with density "density_of_scatterers". No seed in the random number generation, but this can be easily added (line is commented out, or not...).

The script outputs 5 files:

* potential.dat which is the potential computed on a square grid. It can be visualized using e.g. matplotlib. At low density_of_scatterers, it is a random distribution of wells and bumps.

* trajectories.dat which contains the (x,y) coordinates of the first 10 trajectories.

* squared_displacement.dat, which contains <x^2+y^2> (averaged over all trajectories) vs. time

* final_position_x_distribution.dat and final_position_y_distribution.dat which contain the distribution of final positions. This is an histogram covering the range [-"system_size"/2,-"system_size"/2]. There are 50 bins, so this makes sense only if there are much more trajectories.

The theoretical predictions for the squared_displacement and the final_position distributions are the following:

* <r^2(t)> = 2Dt where D depends on the density of scatterers and the energy.

* P(x) and P(y) are Gaussians with sigma=sqrt(Dt).

____________________________________

Download scripts below.** Warning:** For some stupid reason, the CMS of this Web site refuses files with the

*.py*extension. Thus, you have to manually rename the file, changing the final

*_py*to

*.py*

- classical_diffusion_2D_py,
*Classical 2D random walk* - classical_trajectories_2D_py,
*Classical propagation in a random 2D potential*