a FloatingPointError

Automatic force field optimization. Given a force field and a set of reference data (e.g. energies and forces from QM calculations, experimental measurements), we tune the force field parameters such that it accurately reproduces the reference data.
POST REPLY
User avatar
cf xu
Posts: 2
Joined: Sat Jun 14, 2014 6:28 am

a FloatingPointError

Post by cf xu » Sat Jun 14, 2014 6:50 am

Hi,

Recently, I tried to use Forcebalance to optimize some parameters. But I got an error information:

File "/***/python/python2.7/lib/python2.7/site-packages/forcebalance/abinitio.py", line 949, in get_energy_force
Ci = 1. / C
FloatingPointError: divide by zero encountered in divide

I have same "0.0" force data in the target file, but it seems that the error does not caused by these zeros. I am not sure how to fix it. Could you help me?

Thanks!

Xu CF

User avatar
Lee-Ping Wang
Posts: 102
Joined: Sun Jun 19, 2011 5:14 pm

Re: a FloatingPointError

Post by Lee-Ping Wang » Wed Jul 02, 2014 11:53 am

I'm so sorry that I missed this message!

What's happening is that you are encountering a zero stdev for the reference forces, and ForceBalance is attempting to use this to normalize your force errors (to obtain a fractional error).

Are you actually trying to fit your parameters to zero forces, or are you zeroing them out because you're not doing force matching? Or is it something else?

User avatar
cf xu
Posts: 2
Joined: Sat Jun 14, 2014 6:28 am

Re: a FloatingPointError

Post by cf xu » Fri Jul 25, 2014 4:14 am

Thanks so much!
Although still do not know what caused the problem, I have run ForceBalance successfully.
Now there is another problem.
I wanna optimize some van der Waals parameters, but some optimized VDWTs (the epsilon item) of some atoms are 0.0e+00. I have changed some complexes of the system which I wanna studied, but the zero result always exists.
Is it normal?
I have read the manual and followed the tutorial example. It seems that no related problem is discussed.

Thanks a lot!

XU

User avatar
Lee-Ping Wang
Posts: 102
Joined: Sun Jun 19, 2011 5:14 pm

Re: a FloatingPointError

Post by Lee-Ping Wang » Fri Jul 25, 2014 6:06 am

Hi there,

It's fairly common for VDWT to become zero because the force field is attempting to fit some highly repulsive structure. For example, imagine a repulsion interaction of +30 kcal/mol (from the QM calculation); the MM calculation would typically be much higher, at perhaps +3000 kcal/mol (from the LJ interaction). In this case the optimization would attempt to make epsilon negative, but since that would result in a crash it instead sets the value to zero.

This is definitely a problem and not one with a perfect solution. I would suggest filtering your QM data so that nothing above a limit - say 20 or 30 kcal/mol above the minimum - is fitted. The way to do this in the $target section is:

attenuate
energy_denom 20
energy_upper 20

This is an advanced feature that I'm still developing, so please check out the latest code from GitHub before you do it, and let me know if it works.

Thanks,

- Lee-Ping

POST REPLY