IMP logo
IMP Reference Guide  develop.63b38c487d,2024/12/21
The Integrative Modeling Platform
atom/brownian_statistics.py

This example prints out various statistics about a prospective Brownian dynamics simulation. You can use the statistics to determine if the time step is likely to be sufficiently short given the forces and particle sizes involved.

1 ## \example atom/brownian_statistics.py
2 # This example prints out various statistics about a prospective Brownian
3 # dynamics simulation. You can use the statistics to determine if the time
4 # step is likely to be sufficiently short given the forces and particle
5 # sizes involved.
6 
7 import IMP.atom
8 import sys
9 
10 IMP.setup_from_argv(sys.argv, "brownian statistics")
11 
12 # fs
13 time_step = 1000
14 # angstrom
15 minimum_particle_radius = 10
16 # kCal/mol/A
17 maximum_spring_constant = 1
18 
19 maximum_diffusion_coefficient =\
20  IMP.atom.get_einstein_diffusion_coefficient(minimum_particle_radius)
21 expected_delta = IMP.atom.get_diffusion_length(maximum_diffusion_coefficient,
22  time_step)
23 
24 expected_rotational_delta =\
25  IMP.atom.get_diffusion_angle(maximum_diffusion_coefficient,
26  time_step) * minimum_particle_radius
27 
28 expected_spring_diffusion_length =\
29  IMP.atom.get_diffusion_length(maximum_diffusion_coefficient,
30  .5 * maximum_spring_constant *
31  4 * expected_delta ** 2, time_step)
32 
33 print("with a time step of", time_step, "fs")
34 print("an object of radius", minimum_particle_radius, "A will move",
35  expected_delta, "A and a point on its surface will move",
36  expected_rotational_delta, "A more")
37 print("the motion from fluctuations in the spring compression will be",
38  expected_spring_diffusion_length, "A")
39 print("and a compression of 10% of the radius will induce a motion of",
40  IMP.atom.get_diffusion_length(maximum_diffusion_coefficient,
41  .5 * maximum_spring_constant *
42  (.1 * minimum_particle_radius) ** 2,
43  time_step), "A")