# [gmx-users] Forces vector problem

Erik Lindahl lindahl at cbr.su.se
Wed Nov 15 15:48:50 CET 2006

```On Nov 15, 2006, at 4:37 PM, Alexander Yakovenko wrote:

> Hi All.
> I have rather fundamental question that can be addressed to nearly
> all force field based energy minimization routines. Why do the
> minimizer can`t go down if the force vector exists? I can realize
> this problem due to machine precision, but some systems I have met
> consists of several tens of atoms only and have derivative vector
> that is incomparable with machine precision level. If we assume
> that the partial derivatives of elementary energy function are
> calculated correctly (with incomparable small machine errors) and
> their number is relatively small (machine_errors*function_number <<
> gradient_lenght), what would be the origin of the problem?
> Thank you a lot,

It depends on several things. First, if you are using tabulated
switch/shift/pme functions the force (=gradient) won't quite be
machine precision unless you manually change the table density (this
has improved in CVS, though). Second, some of the minimization
algorithms are very efficient at the actual minimization, but due to
the large amount of floating-point operations involved they can have
numerical problems well before the gradient has reached machine
precision. Third, if you work out the math around a local minimum in
energy it turns out that the smallest step resolution (along the
search gradient) is roughly sqrt(EPS) rather than EPS - with large
numbers of atoms involved this can easily mean the largest force on
an individual atom is significantly larger than EPS.

Finally, we've noticed numerical problems in a couple of the
algorithms when you get very close to the local minimum and are too
agressive; with L-BFGS this could lead to instabilities, so we prefer
to play it safe and be a bit more conservative (you can for instance
get situations where the gradient in the search direction is just
slightly positive, but if you take the smallest possible step you
will still go to a slightly lower energy, due to numerical limitations).

Cheers,

Erik

```