def VerletNextV(v_t,a_t,a_t_plus_h):
v_t_plus_h = [0.0, 0.0, 0.0]
#<-- find v_t_plus_h[0], v_t_plus_h[1], v_t_plus_h[2], here -->
for i in range(0,len(v_t_plus_h)):
v_t_plus_h[i] = v_t + .5*(a_t[i] + a_t_plus_h[i])
return v_t_plus_h
接下来我有这一行:
nV[i] = VerletNextV(V[i],A[i], a_t_h)
这给了我在标题中指定的错误:
ValueError: setting an array element with a sequence
这让我疯了 - 这里有什么问题? nV[i]
声明使用:
nV = numpy.zeros((N,3))