This package allows one to calculate forces and torques from extended bodies due to a gravitational or Yukawa interaction. It does so in the most simple (although not necessarily most efficient) manner imaginable. We simply discretize our shapes with a 3-dimensional array of points. We can then compute the force or torque between each unique pair of points and sum up the total for the entire body. Gravity depends only linearly on the source masses, so many complicated shapes can be modeled by just concatenating lists of individual simple components.
We can also simply visualize the point mass arrays using a 3-d plot.
The python implementation of PointGravity is a nearly identical framework of the work of Dr. Charlie Hagedorn. For instance, to generate the figure shown above:
import numpy as np
import newt.glib as glb
import newt.glibShapes as gshp
# Create a cylinder
cyl = gshp.annulus(1, 0, 1, 1, 10, 10)
# Inner cylinders on radius of 1m
cyl1 = glb.translate_point_array(cyl, [5, 0, 0])
# Outer cylinders on radius of 5m
cyl2 = glb.translate_point_array(cyl, [20, 0, 0])
# Combination of three inner cylinders
m1 = np.concatenate([cyl1, glb.rotate_point_array(cyl1, 2*np.pi/3, [0, 0, 1]),
glb.rotate_point_array(cyl1, -2*np.pi/3, [0, 0, 1])])
# Combination of three outer cylinders
m2 = np.concatenate([cyl2, glb.rotate_point_array(cyl2, 2*np.pi/3, [0, 0, 1]),
glb.rotate_point_array(cyl2, -2*np.pi/3, [0, 0, 1])])
fig, ax = glb.display_points(m1, m2)
ax.set_zlim([-20, 20])
We have also implemented some shapes with grid-spacing and masses weighted according to a Gauss-Legendre quadrature. We retain the functionality of simple translations and rotations while potentially improving convergence rates.
However, the second portion of this package includes the implementation of a multipole analysis for the same calculations. It is well known that the gravitational potential can be decomposed into interactions of multipole moments allowing for accurate and fast calculations from only a relatively small number of low order moments. We can compute several low order moments of basic shapes (ref, ref) or estimate the moments from a point-mass array. We can rotate these moments to large orders (ref) and translate moments in several ways (ref, ref). This allows us to compute the interactions in an entirely different and often useful perspective. Not only that, but it's WAY FASTER! This portion is based largely on the private program, MULTIN, of Prof. Adelberger.
A list of shapes can be found here
Information on multipole methods can be found here
Example calculations are explained here
- https://github.com/4kbt/PointGravity
- A Sub-Millimeter Parallel-Plate Test of Gravity
- Translation of multipoles for a 1/r potential
- Interaction potential between extended bodies
- Recursive computation of spherical harmonic rotation coefficients of large degree
- Multipole calculation of gravitational forces
- Analytic expressions for gravitational inner multipole moments of elementary solids and for the force between two rectangular solids
- Closed form expressions for gravitational multipole moments of elementary solids
- Comparison of the Efficiency of Translation Operators Used in the Fast Multipole Method for the 3D Laplace Equation
- Recursions for the computation of multipole translation and rotation coefficients for the 3-D Helmholtz equation
Clone or download this repository from here, and navigate to the directory containing the setup.py file. Then simply install using pip.
pip install .
We ask that anyone using this package cite this reference for the multipole methods and this repository itself for the implementation. Thank you!
- Multipole rotations
- Multipole torques
- Multipole forces
- Multipole shapes
- Multipole shapes adelberger
- multipole shape comparisons
- Multipole translation
- Recursive translation matrices
- More tests
- Always more tests!
- pip package
- More Doc Strings
- Implement tests against MULTIN outputs
- Pull request to Charlie's Octave version → Collaborator
- Outer Multipoles from point-mass
- Example visualization
- Example calculations