A vector field approach to calculating gravitational forces

Calculation of gravitational forces is essential for many fundamental measurements, such as determining the gravitational constant or investigating violations of the inverse square law. These calculations, even with modern computational power, are slow and tedious. Improved calculation efficiency allows an experimentalist to easily check the effect of possible systematic biases and to ease the process of instrument design. Many gravitational measurements are expanded in terms of multipole moments for efficient calculations, however for many experimental geometries these do not converge, leaving awkward sextuple integrals. In this work we introduce a modified approach to the calculation which reduces the force between a point mass and any arbitrary object to a sum of single integrals. The force between any two objects can then be calculated as a quadruple rather than a sextuple integral.


Introduction
Computing inverse square forces is one of the most fundamental calculations of classical physics. However, despite centuries of work on special cases [1-5] and multipole [6] or Green's function expansions [7] valid only under certain conditions. In the cases where these tricks are not applicable practical calculations are very computationally intensive to perform. The computational complexity often leads to the need to treat extended bodies as point masses after performing tedious case-by-case calculations to show that this assumption has negligible effect on the final result [8,9]. In this work, taking inspiration from the field of computer graphics [10], we derive a method to reduce the calculation of the force between a point mass and any arbitrary shape to a sum of one-dimensional integrals rather than a three-dimensional integral. This is particularly beneficial as fast, accurate, multi-dimensional numerical integration is not trivial for many shapes and is still an active topic for computer scientists [11,12]. The solution provided has been formulated in terms of Newtonian gravity but could easily be applied to other fields such as electrostatics.

Theory
The force in the x-direction (F x ) from an arbitrary object of constant density, ρ defined by the volume V, on a point mass of mass m (at the origin of our coordinate system) is However, therefore by applying divergence theorem we can reduce the order of the integration to a closed surface integral: where S is the bounding surface of the volume V with surface normaln. The surface can then be broken up into n surface elements x n S n n 2 2 2 n For efficient calculation we can consider that as the integral includesˆ·î n S d we can project each surface into the y-z plane. Any surface which obscures part of the same surface when projected must be broken up into multiple surfaces, or the inverse of the projection is not a single valued function. Also each surface with with no projection y-z plane can be ignored. As such we can write the integral over the n projected surfaces (S n yz ) as where the x-coordinate of the surface S n yz can be written as = ( ) x X y z , n . The full process described above is shown graphically in figure 1.
Any arbitrary object's surface can be broken down, either exactly or to a very high precision with triangular meshing, into one of three simple cases. For forces in the x-direction these are: a flat plane of any arbitrary orientation; a surface (flat or singly curved) whose normal meets the requirements = ȷ ·n 0 n or = ·n k 0; n or a surface (flat or singly curved) whose normal meets the requirement = ·n ı 0 n . Clearly in the third case equation (5) evaluates to zero and the other cases reduce to single integrals as solved below. For doubly curved surfaces we cannot reduce the surface integral to a single integral without triangular meshing.

Any flat surface
For a flat surface we can write = + + ( ) X y z ay bz c , , and then we note that as where As such, the x-direction force between a point mass and any object composed of n flat faces is simply where c n is the contour enclosing the surface S n yz .

2.2.
A surface with normal perpendicular to the y or z-axis In the case of surface whose normal is always perpendicular to the y or z-axis we can write the function ( ) X y z , as a function of either y or z. Considering the case where X is a function of y - Then by Stokes theorem we can write

Discussion and conclusion
The method derived above provides a simple framework for calculation of the gravitational forces between an arbitrary object and a point mass as a one-dimensional integral. There are multiple benefits to the reduction of a multi-dimensional integral to a one-dimensional integral. N-dimensional integrals scale as M N where M is the number of function evaluations for the integral to converge to the desired precision. Also the limits for N-dimensional integrals, except the most primitive shapes, are functions of -N 1 variables, thus to calculate such an integral one must invest significant time programming the limits on a case-by-case basis. One can also solve the triple integral by Monte-Carlo integration, but as Monte-Carlo converges asymptotically it is not suitable for high precision calculations [13]. For these reason reduction of N-dimensional integrals to a lower dimensionality is the suggested method where possible [13]. We note that a similar methodology has been applied to the calculation of gravitational potentials of a general polyhedra [14].
For the example of a polyhedron, such as in figure 1, the method presented is simple to compute. From three points defining each face of the polyhedron the function = + + ( ) X y z ay bz c , is simply calculated as a matrix inversion To demonstrate calculations for singly curved surfaces we note that the the force from a cylinder can be written down almost by inspection. If its axis parallel to the z-axis and its centre of mass at ( ) a, 0, 0 equation (11) where H and R are the height and radius of the cylinder respectively. We note that this can be shown to evaluate to the same value as calculations performed via more complex procedures such as the method of Chen and Cook [2]. We do note that for the particular case of a complete cylinder Chen and Cook's method is computationally more efficient by an order of magnitude as it reduces the problems to elliptical integrals, however it cannot be adapted to more complex shapes with singly curved surfaces. The methods presented have been compared in both compiled (C++ using the GNU Scientific Library) and interpreted (GNU Octave) languages. We note that as Octave uses compiled libraries for Gaussian quadrature and matrix inversion the computation time is not significantly different. Computation of simple geometries converges to a relative uncertainty of less than one part in 10 12 in ∼1 ms, two orders of magnitude faster than for 3D integration. To calculate the force between two extended bodies this result itself must be triple integrated over a second body, thus computation of extended bodies can often be reduced from minutes to seconds per calculation. For more complex polyhedra which are non-trivial to compute with triple integrals our method scales linearly with the number of faces, the results are in agreement with Monte-Carlo integration to within the statistical noise of repeated Monte-Carlo integrations. Even given tens of seconds Monte-Carlo integration does not produce results with errors below a part in 10 5 .
Core components of many gravitational experiments are primitive shapes allowing for fast analytical calculations of forces. The forces from many other complex experimental components cannot be solved analytically and thus require slower numerical integration techniques. Yet these components can easily be exported as triangular meshes from most computer aided design or finite element analysis software. We provide a method to calculate gravitational forces given this mesh using one-dimensional rather than three-dimensional integration. The result is simple to code and computationally efficient. While the method provided in this paper is for forces in the x-direction, for a point mass at the origin, any other direction or mass position can be calculated using a simple coordinate transformation. We are, as such, confident that this method will be of use for many practical calculations.