LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands

### minimize command

Syntax:

    minimize tolerance maxiter maxeval

- tolerance = stopping tolerance
- maxiter = max iterations of minimizer
- maxeval = max number of total force/energy evaluations

Examples:

    minimize 1.0e-4 100 1000

Description:

Perform an energy minimization of the system, by adjusting each atom's atomic coordinates. The algorithm used is set by the min_style command. Minimize commands can be interspersed with run commands to alternate between relaxation and dynamics. The minimizers are implemented in a robust fashion that should allow for systems with highly overlapped atoms (large energies and forces) to still be minimized by pushing the atoms off of each other.

Alternate means of relaxing a system are to run dynamics with a small or limited timestep. Or dynamics can be run using fix viscous to impose a damping force that slowly drains all kinetic energy from the system. The pair_style soft potential can be used to un-overlap atoms while running dynamics.

Following the minimization a statistical summary is printed that includes the energy change and convergence criteria information.

A minimization involves an outer iteration loop which sets the search direction along which coordinates are changed. An inner iteration is then performed using a line search algorithm. The line search typically evaluates forces and energies several times to set new coordinates. The minimization stops if any of several criteria are met:

- the change in energy between outer iterations is less than the tolerance
- the number of outer iterations exceeds maxiter
- the number of force evaluations exceeds maxeval
- the 3N dimensional force vector goes (nearly) to zero

For the first criterion, the specified tolerance is unitless; it is met when the ratio of the energy delta to the energy magnitude is equal to the tolerance (e.g. one part in 10^4 in the example above).

During a minimization, the outer iteration count is treated as a timestep. Output is triggered by this timestep, e.g. thermodynamic output or dump and restart files.

For optimal convergence, a pair style that goes smoothly to 0.0 at the cutoff distance for both energy and force should typically be used though this is not required. Examples include pair/lj/charmm/coul/charmm and pair/lj/charmm/coul/long. If a soft potential is used the Astop value is used for the prefactor (no time dependence).

Only some fixes (typically those that apply force constraints) are invoked during minimization. See the doc pages for individual fix commands to see which ones are relevant.

IMPORTANT NOTE: Some fixes which are invoked during minimization have an associated potential energy. For that energy to be included in the total potential energy of the system (the quantity being minimized), you MUST enable the fix_modify energy option for that fix. The doc pages for individual fix commands specify if this should be done.

Restrictions:

Features that are not yet implemented are listed here, in case someone knows how they could be coded:

It is an error to use fix shake with minimization because it turns off bonds that should be included in the potential energy of the system. The effect of a fix shake can be approximated during a minimization by using stiff spring constants for the bonds and/or angles that would normally be constrained by the SHAKE algorithm.

Fix rigid is also not supported by minimization. It is not an error to have it defined, but the energy minimization will not keep the defined body(s) rigid during the minimization. Note that if bonds, angles, etc internal to a rigid body have been turned off (e.g. via neigh_modify exclude), they will not contribute to the potential energy which is probably not what is desired.

The volume of the simulation domain is not allowed to change during a minimzation. Ideally we would allow a fix such as npt to impose an external pressure that would be included in the minimization (i.e. allow the box dimensions to change), but this has not yet been implemented.

Pair potentials that produce torque on a particle (e.g. granular potentials or the GayBerne potential for ellipsoidal particles) are not relaxed by a minimization. More specifically, radial relaxations are induced, but no rotations are induced by a minimization, so such a system will not fully relax.

Related commands:

min_modify, min_style, run_style

Default: none