[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ESPResSo-users] non-bonded tabulated potential in epsresso-4.0.1

From: Rudolf Weeber
Subject: Re: [ESPResSo-users] non-bonded tabulated potential in epsresso-4.0.1
Date: Fri, 18 Jan 2019 21:46:48 +0100
User-agent: Mutt/1.9.4 (2018-02-28)

On Fri, Jan 18, 2019 at 05:56:24PM +0000, David Power wrote:
> 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.
Please post the code to setup the constraint.
One possibility that comes to mind is that the particle-constraint distance 
bcomes negative (depending on the direction parameter of the shape)
Without looking at the code I'm not sure wheterh the constraint force 
calculation routine would handle that gracefully.
According to the docs, the direction parameter of the shape should be 1.

Regards, Rudolf

reply via email to

[Prev in Thread] Current Thread [Next in Thread]