It would be very handy, if one cut set up tabulated interactions sympy expressions.
Using Sympy, it is also possible to obtain the force automatically.
import sympy as sp
r = sp.Symbol('r)
h_energy = \
epsilon *sp.Piecewise(((1-r/sigma)**(5/2),r<sig"),(0,True))
bond = espressomd.interactions.tabulated_from_sympy(
type="distance", var=r, energy=h_energy,min=0,max=10,steps=1000)
Implementation
use sp.diff() w.r.t var to obtain force from energy
use sp.lambdify() to generate a callable function
use np.linspace to generate the distances between min and max
It would be very handy, if one cut set up tabulated interactions sympy expressions. Using Sympy, it is also possible to obtain the force automatically.
Implementation
var
to obtain force from energysp.lambdify()
to generate a callable functionnp.linspace
to generate the distances between min and maxExample implementation