I'm using tabulated potentials in espresso-4.0.1 and have a questions about the order this function expects the data arrays. I have:
system.non_bonded_inter[0, t].tabulated.set_params(
min = distances[0],
max = distances[-1],
energy = energy,
force = -np.gradient(energy)
)
where distances and energy are equal length arrays. distance goes from 0 (distance[0]) to 20.0 (distance[-1]). energy goes from some high value (energy[0]) to 0.0 (energy[-1]). I have this potential attached to a sphere constraint. I am trying to make a (non linear) repulsive wall.
This is the order the arrays would be in if I wanted to plot them with something like pyplot.
However, when I run this, all my particles get squished into a thin sheet at the surface of the sphere instead of being repelled like I would have expected.
Playing around, I set min to 20.0 and max to 0.0. Now I am seeing the behavior I expected!
I was just wondering if you could clarify the order of the energy and force arrays, and the order of max and min in tabulated potentials.
Thanks,
David