GROMACS version: 2018
GROMACS modification: Yes/No
I am trying to shifted the Lennard Jones interaction - this means: instead of U(r), I want an interaction of U(r-ro) where ro = 0.2 nm (for example).
I have a code in order to generate the tables according to the GROMACS documentation. The table contains x,f(x),f´(x),g(x),g´(x),h(x),h´(x).
For ro = 0 nm and ro = 0.1 nm, the simulation is working. However, when I tried to run the case of ro = 0.2 nm, the minimization is blowing up.
This is the error:
Energy minimization has stopped, but the forces have not converged to the
requested precision Fmax < 100 (which may not be possible for your system).
It stopped because the algorithm tried to make a new step whose size was too
small, or there was no change in the energy since last step. Either way, we
regard the minimization as converged to within the available machine
precision, given your starting configuration and EM parameters.
Double precision normally gives you higher accuracy, but this is often not
needed for preparing to run molecular dynamics.
You might need to increase your constraint accuracy, or turn
off constraints altogether (set constraints = none in mdp file)
writing lowest energy coordinates.
Steepest Descents converged to machine precision in 22158 steps,
but did not reach the requested Fmax < 100.
Potential Energy = 1.1675758e+11
Maximum force = 4.6688879e+10 on atom 16626
Norm of force = 5.9937074e+08
The Fortran code that I am using is:
*program gentable*
-
implicit none*
-
real, parameter :: delr=0.005, rcut=1.2, small_r_threshold=3.8e-2*
-
real :: r, term1, term2, term3, term4, term5, term6, term7*
-
integer :: nbins, j*
-
nbins = int( (rcut+1)/delr ) + 1*
-
*
-
open(10, file='table_2.xvg', status='replace')*
-
do j = 0, nbins*
-
r = delr * j*
-
if (r < small_r_threshold+0.2) then*
-
! If r is very small, set the terms to zero to avoid division by zero*
-
term1 = 0.0*
-
term2 = 0.0*
-
term3 = 0.0*
-
term4 = 0.0*
-
term5 = 0.0*
-
term6 = 0.0*
-
else*
-
! Normal calculation for larger r*
-
term1 = 1.0 / (r)*
-
term2 = 1.0 / ((r)**2)*
-
term3 = -1.0 / ((r-0.2)**6)*
-
term4 = -6.0 / ((r-0.2)**7)*
-
term5 = 1.0 / ((r-0.2)**12)*
-
term6 = 12.0 / ((r-0.2)**13)*
-
end if*
-
-
write(10,*) r, term1, term2, term3, term4, term5, term6*
-
end do*
-
end program*
Any suggestions? I don´t understand why is working for 0 nm and 0.1 nm but nor for 0.2 nm
Thanks!