espressopp.integrator.MinimizeEnergy

This is a very simple approach to perform energy minimization of the system. The module uses a steepest descent method. The position of particles is updated following the equation:

\[p_{i+1} = p_i + min(\gamma F_i, d_{max})\]

where \(p_{i+}\) is a new position, \(p_i\) is a position at current step with corresponding force \(F_i\). The parameters \(\gamma\) and \(d_{max}\) are set by user and control the relaxation of the energy and the maximum update of the coordinates per step.

Additionaly, a variable \(\gamma\) step is also implemented. In this case, the position of particles is updated following the equation:

\[p_{i+1} = p_i + d_{max}/f_{max} F_i\]

where \(f_{max}\) is a maximum force in a single step of steepest descent method. \(\gamma=d_{max}/f_{max}\) is automatically adjusted to a force magnitude.

In both cases, the routine runs until the maximum force is bigger than \(f_{max}\) or for at most n steps.

Please note This module does not support any integrator extensions.

Example

>>> em = espressopp.integrator.MinimizeEnergy(system, gamma=0.001, ftol=0.01, max_displacement=0.0001)
>>> em.run(10000)

Example

>>> em = espressopp.integrator.MinimizeEnergy(system, gamma=0.01, ftol=0.01, max_displacement=0.01, variable_step_flag=True)
>>> em.run(10000)

API

espressopp.integrator.MinimizeEnergy(system, gamma, ftol, max_displacement, variable_step_flag)
Parameters:
  • system (espressopp.System) – The espressopp system object.
  • gamma (float) – The gamma value.
  • ftol (float) – The force tolerance
  • max_displacement (float) – The maximum displacement.
  • variable_step_flag (bool) – The flag of adjusting gamma to the force strength.
espressopp.integrator.MinimizeEnergy.run(max_steps, verbose)
Parameters:
  • max_steps (int) – The maximum number of steps to run.
  • verbose (bool) – If set to True then display information about maximum force during the iterations.
Returns:

The true if the maximum force in the system is lower than ftol otherwise false.

Return type:

bool

espressopp.integrator.MinimizeEnergy.f_max

The maximum force in the system.

espressopp.integrator.MinimizeEnergy.displacement

The maximum displacement used during the run of MinimizeEnergy

espressopp.integrator.MinimizeEnergy.step

The current iteration step.