gradient

biff.scf.gradient(xyz, Snlm, Tnlm, G=1, M=1, r_s=1)

Compute the gradient of the gravitational potential of the basis function expansion at a set of positions given the expansion coefficients.

Parameters:

xyz : ndarray

A 2D array of positions where axis=0 are multiple positions and axis=1 are the coordinate dimensions (x, y, z).

Snlm : ndarray

A 3D array of expansion coefficients for the cosine terms of the expansion. This notation follows Lowing et al. (2011). The array should have shape (nmax+1,lmax+1,lmax+1) and any invalid terms (e.g., when m > l) will be ignored.

Tnlm : ndarray

A 3D array of expansion coefficients for the sine terms of the expansion. This notation follows Lowing et al. (2011). The array should have shape (nmax+1,lmax+1,lmax+1) and any invalid terms (e.g., when m > l) will be ignored.

G : numeric (optional)

Gravitational constant. Leave unset for dimensionless units.

M : numeric (optional)

Mass scale. Leave unset for dimensionless units.

r_s : numeric (optional)

Length scale. Leave unset for dimensionless units.

Returns:

grad : ndarray

A 2D array of the gradient of the potential at each input position. Will have the same shape as the input position array, xyz.