Is there a function that could be used for calculation of the divergence of the vectorial field? (in matlab) I would expect it exists in numpy/scipy but I can not find it us
import numpy as np def divergence(field): "return the divergence of a n-D field" return np.sum(np.gradient(field),axis=0)