Name

NVTBerendsen — The MD method implementing Berendsen NVT dynamics.

Synopsis

Namespace: NanoLanguage
NVTBerendsen(
initial_velocity,
time_step,
reservoir_temperature,
thermal_coupling_constant
)

Description

Constructor for the molecular dynamics method implementing Berendsen NVT dynamics.

NVTBerendsen Arguments

initial_velocity

A class that implements a distribution of initial velocities for the particles in the MD simulation.

Type: An instance of a class that defines the initial momenta - e.g. MaxwellBoltzmannDistribution.

Default: MaxwellBoltzmannDistribution()
time_step

The time-step interval used in the MD simulation.

Type: A unit of type time.

Default: 1.0e-15 seconds (1 femtosecond)
reservoir_temperature

The reservoir temperature in the simulation.

Type: A physical quantity of temperature type - e.g. Units.Kelvin

Default: 300 * Units.Kelvin
thermal_coupling_constant

The time constant for Berendsen temperature coupling.

Type: A unit of type time.

Default: 500.0e-15 seconds (500 femtoseconds)

Usage Examples

Perform a canonical molecular dynamics run of 10 steps on a water molecule, using the NVT Berendsen MD method:

# Define elements
elements = [Oxygen, Hydrogen, Hydrogen]

# Define coordinates
cartesian_coordinates = [[  0.0,  -1.70000000e-05,   1.20198000e-01],
                         [  0.0,   7.59572000e-01,  -4.86714000e-01],
                         [  0.0,  -7.59606000e-01,  -4.86721000e-01]]*Angstrom

# Set up configuration
molecule_configuration = MoleculeConfiguration(
    elements=elements,
    cartesian_coordinates=cartesian_coordinates
    )

# Define a calculator
molecule_configuration.setCalculator(LCAOCalculator())

# Perform MD
md_configuration = MolecularDynamics(molecule_configuration,
                                     log_filename='nvtberendsen.nc',
                                     method=NVTBerendsen(),
                                     steps=10)

# Save the final configuration
nlsave('nvtberendsen.nc', md_configuration)

nvtberendsen.py

Notes

Uses the Verlet algorithm to perform a canonical classical molecular-dynamics simulation. i.e. the temperature and volume of the system is constant. Energy is exchanged with a reservoir using a Nose-Hoover thermostat. thermostat.