示例#1
0
def backflow(a,r,rho,x):
    number_of_particles = x.shape[0]
    return \
        pysum(
            a*(x[i,0]*x[j,1]-x[i,1]*x[j,0])/rho(i)**2/r(i,j)**3/(1-a/r(i,j))
            for i in xrange(number_of_particles) for j in xrange(number_of_particles) if i != j
        )
示例#2
0
 def rho(i):
     return sqrt(pysum(x[i,0:2]**2))
示例#3
0
 def diff_log_trial(i,k):
     return pysum(a*(x[i,k]-x[j,k])/(r(i,j)**3 * (1-a/r(i,j))) for j in xrange(x.shape[0]) if j != i)
示例#4
0
 def r(i,j):
     return sqrt(pysum((x[i,:]-x[j,:])**2))