Langevin Dynamics Simulator
Langevin Dynamics Simulator models particle motion under friction and random forces, plotting position and computing MSD.
Formulas Used in Langevin Dynamics Simulator
The simulator models a particle’s motion using the Langevin equation:
Langevin Equation:
\\[ m \frac{d^2x}{dt^2} = -\gamma \frac{dx}{dt} + F_{\text{random}} \\]Random Force:
\\[ \langle F_{\text{random}}(t) \rangle = 0, \quad \langle F_{\text{random}}(t) F_{\text{random}}(t’) \rangle = 2 \gamma k_B T \delta(t – t’) \\]Mean-Squared Displacement (MSD):
\\[ \text{MSD} = \langle (x(t) – x(0))^2 \rangle \\]Average Kinetic Energy:
\\[ \langle E_k \rangle = \frac{1}{2} m \langle v^2 \rangle \\]Where:
- \\(m\\): Particle mass (kg)
- \\(\gamma\\): Friction coefficient (kg/s)
- \\(F_{\text{random}}\\): Random force (N)
- \\(k_B\\): Boltzmann constant (\\(1.380649 \times 10^{-23} \, \text{J/K}\\))
- \\(T\\): Temperature (K)
- \\(x\\): Position (m)
- \\(v\\): Velocity (m/s)
- \\(\Delta t\\): Time step (s)
- \\(t_{\text{max}}\\): Total simulation time (s)
Example Calculation
Example: \\(m = 1 \times 10^{-26} \, \text{kg}, \gamma = 1 \times 10^{-12} \, \text{kg/s}, T = 300 \, \text{K}, \Delta t = 0.001 \, \text{s}, t_{\text{max}} = 1 \, \text{s}\\)
Runs Euler-Maruyama integration to compute position, velocity, MSD, and average kinetic energy.