Fix Langevin

Overview

FixLangevin applies stochastic forces to particles in the system via Langevin dynamics

\[{\bf f}_i = -\gamma {\bf v}_i+\sqrt{6k_{\rm B}T\gamma/\Delta t }{\bf W}_i\]

where \({\bf v}_i\) is velocity of particle \(i\), \(\Delta t\) is timestep size, \(T\) is temperature, \(\gamma\) is a drag parameter, and \({\bf W}_i\) is a Wiener vector.

Python Member Functions

Constructors

FixLangevin(state=..., handle=...,  groupHandle=...,  temp=...)
FixLangevin(state=..., handle=...,  groupHandle=...,  tempFunc=...)
FixLangevin(state=..., handle=...,  groupHandle=...,  intervals=... , temps=...)

Arguments

state
state object.
handle
A name for the fix.
group_handle
Group name to apply fix.
temp
Constant Temperature.

There are few options to change temperature dynamically:

tempFunc
Python function that returns a temperature at timestep.
intervals, temps
Python lists of temperatures and intevals for linear interpolation.

Setting parameters from within the Python environment is done with setParameters.

setParameters(seed=..., gamma=...)

Arguments

seed
seed for random number generator
gamma
\(\gamma\) drag parameter.

Examples

Adding the integrator

fixLangevin=FixLangevin(state, handle='Lang',groupHandle='all',temp=2.0)

Setting parameters in python

fixLangevin.setParameters(seed=1234,gamma=1.0)

Activating the fix

#Activate fix
state.activateFix(fixLangevin)

Table Of Contents

Previous topic

Berendsen Barostat

Next topic

Andersen Thermostat

This Page