Recursive computation of gravitational field of a right

0 downloads 0 Views 1MB Size Report
ignorable is the horizontal variation within the prism not only of the density but also ...... of the evaluation point are fixed as non-trivial values as x = 1/4 and y = 3/5. ... errors are at the level of a few tenth of the double precision machine epsilon, ...... parameter (PI=3.1415926535897932384626433832795q0);integer NMAX ...
Noname manuscript No. (will be inserted by the editor)

Recursive computation of gravitational field of a right rectangular parallelepiped with density varying vertically by following an arbitrary degree polynomial and its application to study of gravitational field of exponentially damped prism Toshio Fukushima

Received: date / Accepted: date

Abstract We present a recursive formulation to compute the potential, the acceleration vector, and the force gradient tensor of the gravitational field of a right rectangular parallelepiped when its volume mass density varies vertically by following an arbitrary degree polynomial. First, the potential of the parallelepiped is expressed as the triple difference of an indefinite volume integral. Next, for the density described by an arbitrary degree polynomial of the vertical coordinate, the integral is expressed as a finite sum of several elementary functions and three groups of auxiliary functions, the latter of which are recursively computable. Then, the acceleration vector and the force gradient tensor are obtained by analytically differentiating the potential. As a result, all the field quantities turn out to be linear combinations of seven basic functions: three arc tangents, three logarithms, and a square root. Also, the employed recurrence formulae are as simple as of a leap-frog form. Thus, the execution of the new formulation is fast. Although the analytical expressions are accurate inside and near the parallelepiped, they suffer from the catastrophic cancellation in the far region caused by the triple difference. This tendency becomes more prominent when the degree of the polynomial increases. As an example, for a vertically inhomogeneous prism with an exponentially damped density profile, we obtained the gravitational field in its inside and near zone with the 34 digit accuracy. Thus, the new formulation will be beneficial in constructing the regional forward models of gravitation and of geomagnetism. Keywords gravitation, method: analytical, prism, recurrence formula

1 Introduction To find a precise and fast method to model the gravitational or geomagnetic field of a general object, such as the Earth and some major planets, the Moon and masT. Fukushima National Astronomical Observatory / SOKENDAI, Ohsawa, Mitaka, Tokyo 181-8588, Japan E-mail: [email protected]

2

Toshio Fukushima

sive natural satellites, or heavy nearly spherical asteroids, is an important issue in geodesy, geophysics, and planetary sciences (Heiskanen and Moritz, 1967; Stacey and Davis, 2008; de Pater and Lissauer, 2010). The need of such a method is enlarged by the recent availability of dense topographic data such as obtained for the Earth by the Shuttle Radar Topography Mission (SRTM) (Smith and Sandwell, 2003) and the Advanced Spacebourne Thermal Emission and Reflection Radiometer (ASTER) (Tachikawa et al., 2011). Indeed, both of them boast a fine spatial mesh size on the ground surface as small as 1 arcsecond. In principle, when the volume mass density distribution and the shape model of an object are provided, its gravitational quantities like the gravitational potential or the gravitational acceleration vector are expressed in terms of the Newton integrals (Laplace, 1799). The same is also true for the geomagnetic field when the magnetic charge density distribution is known (Durand, 1953). However, these integrals can be evaluated in a closed form only in special circumstances (Binney and Tremaine, 2008). Well-known cases are spherically symmetric objects (Chandrasekhar, 1995) and homogeneous ellipsoids (Chandrasekhar, 1969). Other examples are found in the literature (Kellogg, 1929; Lass, 1950). Thus, many researchers adopted an approach to decompose the given object into a sum of simple parts the gravitational field of which is analytically integrable (Heck and Seitz, 2007). Among such building blocks, a right rectangular parallelepiped or the so-called prism is mostly popular (Mollweide, 1813; Bessel, 1813). Other primitive objects preferred in geodesy are a polyhedron (Waldvogel, 1979) and a tesseroid (Anderson, 1976). Of course, the spherical tesseroid and its spheroidal extension are more suitable to model the field of nearly spherical or spheroidal objects like the Moon or the Earth. Nevertheless, the gravitational field of the spherical tesseroid is accurately determined only by a new type of the numerical integration (Fukushima, 2018). The developed method is powerful and precise. Having stated so, we must admit that it is time-consuming. In order to seek for a faster formulation, therefore, let us return to the decomposition methods using prism or polyhedrons (Wild-Pfeiffer, 2008). Certainly, there are numerous works along this direction (D’Urso, 2014; Conway, 2015). Most of them assumed the homogeneity of the object for simplicity. Nonetheless, this is far from the reality (Jiang et al., 2017). Thus, several studies tried to relax this restriction by assuming that the density varies by following a low degree polynomial (D’Urso and Trotta, 2017). One may question about the usefulness of the prism model when the more versatile polyhedron formulation is available. However, the answer is still positive mainly because the computational complexity is much less and the CPU time is significantly smaller (Benedek et al., 2017). This preference has been enhanced by the availability of dense rectangular grid data (Smith and Sandwell, 2003; Tachikawa et al., 2011). For example, the 20–30 m horizontal resolution on the Earth surface is so high that ignorable is the horizontal variation within the prism not only of the density but also of the heights of top and/or bottom surfaces. Also, most of the curvature effects in the regional model may be absorbed by adopting a global rectangular coordinate system and conducting the corresponding transformation of the topographic data. Refer to Fig. 1.

Recursive computation of gravitational field of vertically inhomogeneous prism

z

3

Regional Prism Model

x

Fig. 1 Regional prism model. Sketched is an example of the regional prism model. The key point is to adopt the global rectangular coordinates. Although it requries a sort of the re-interpretation of the topographic data, the resulting model well absorbes the curvature effect by using the local-to-global coordinate transformation.

On the other hand, rather large is the vertical size of the prisms to be considered in the terrain gravity modelling, say 10 km or so. This is the main reason why focused has been the effect of the vertical density contrast on the gravity of the prism (Rao, 1985). For instance, the analytical formulae of the prismatic gravitational field have been obtained when its density is varying linearly (Garcia-Abdeslem, 1992), quadratically (Rao et al., 1990), and cubically (Garcia-Abdeslem, 2005). Similar formulae for general polyhedra are available up to the third-order polynomials (D’Urso and Trotta, 2017).

4

Toshio Fukushima

Having said so, we notice that the observed vertical density profiles are more complicated. Indeed, some of them are well approximated by an exponential function (Chai and Hinze, 1988; Karcol, 2011) or a rational function (Rao et al., 1995; Chakravarthi et al., 2002). Jiang et al. (2017, Figs 2 and 3) illustrate clear examples where 7th- or 8th-order polynomials are needed to fit the observed density profiles. In such cases, high degree polynomials are demanded to model the vertical inhomogeneity precisely. Recently, Zhang and Jiang (2017) presented the analytical formulae of the three rectangular components of the gravitational acceleration vector for a prism with the density varying as an arbitrary degree polynomial. Their expressions consist of, apart from a few terms of elementary functions, the double series of the rectangular coordinates and a square root of their squared sum. Consequently, the actual computation procedure is so complicated that the achieved computational accuracy is as low as 5 digits or less. Also, their results are limited to the acceleration vector only. Therefore, in order to extend the solution coverage of the prismatic gravitational field to not only the acceleration vector but also the potential as well as the gravity gradient tensor, we developed a systematic formulation to compute them all by employing some recurrence formulae. As a result, both the computational precision and the computational speed are significantly improved as will be shown later. Below, we explain the new formulation in Sect. 2, describe the results of its numerical experiments in Sect. 3, and present the gravitational field of a test prism with an exponentially damped density profile in Sect. 4, respectively. Also, Appendices provide the detailed derivation of the recursive formulation to compute the gravitational potential and its partial derivatives, and a package of Fortran programs to execute the new formulation. Furthermore, the Electronic Supplementary Materials (ESM) contain the explicit expressions of three groups of auxiliary functions, the literal validation of the utilized analytical formulae by means of the Mathematica (Wolfram, 2003), and a number of figures illustrating the behavior of the prismatic gravitational fields. 2 Method 2.1 Analytical computation of gravitational potential of vertically inhomogeneous prism Let us denote by (x, y, z) the rectangular coordinates of an evaluation point in the three-dimensional space and by (x′ , y′ , z′ ) those of a mass element inside a prism, namely a right rectangular parallelepiped. To be more specific, we define the geometric domain of the prism as x1 ≤ x′ ≤ x2 , y1 ≤ y′ ≤ y2 , z1 ≤ z′ ≤ z2 .

(1)

Then, the negative gravitational potential of the prism at the evaluation point is expressed by a definite volume integral as V (x, y, z) ≡ G

∫ z2 ∫ y2 ∫ x2 z1

y1

x1



ρ (x′ , y′ , z′ ) dx′ dy′ dz′ (x′ − x)2 + (y′ − y)2 + (z′ − z)2

,

(2)

Recursive computation of gravitational field of vertically inhomogeneous prism

5

where G is Newton’s constant of universal attraction and ρ (x′ , y′ , z′ ) is the volume mass density of the prism. Assume that the density within the prism is described by a polynomial of the vertical coordinate as

ρ (x, y, z) =

N

∑ ρn z n .

(3)

n=0

Then, the resulting gravitational potential is similarly expanded as N

V (x, y, z) =

∑ Vn (x, y, z),

(4)

n=0

where Vn (x, y, z) is defined as  ∫ z2 ( ) ∫ ′ n Vn (x, y, z) ≡ Gρn z z1

y2 ∫ x2

y1

x1

dx′ dy′



 dz′ . (5) √ 2 2 2 (x′ − x) + (y′ − y) + (z′ − z)

By changing the integration variables from x′ , y′ , and z′ to X, Y , and Z defined as X ≡ x′ − x, Y ≡ y′ − y, Z ≡ z′ − z,

(6)

and expanding (z′ )n into a polynomial of Z as (z′ )n = (Z + z)n =

(

n



m=0

) n Z m zn−m , m

we rewrite Vn (x, y, z) formally into a degree n polynomial of z as n ( ) n Vn (x, y, z) = Gρn ∑ Wm (x, y, z)zn−m , m m=0

(7)

(8)

where Wn (x, y, z) is a weight function expressed as a definite volume integral and rewritten as a triple difference of an indefinite volume integral as ) ∫ Z2 (∫ Y2 ∫ X2 dXdY √ Wn (x, y, z) ≡ Zn dZ = ∆3Un , (9) Z1 Y1 X1 X 2 +Y 2 + Z 2 where Xi , Y j , and Zk are the shifted end points defined as Xi ≡ xi − x, Y j ≡ y j − y, Zk ≡ zk − z,

(10)

∆3 is the triple difference operator defined for an arbitrary function f (X,Y, Z) as Y =Y2 X=X2 2 2 2 Z=Z2 ∆3 f ≡ | f (X,Y, Z)|Z=Z = ∑ ∑ ∑ (−1)i+ j+k f (Xi ,Y j , Zk ) 1 Y =Y1 X=X 1

i=1 j=1 k=1

= f (X2 ,Y2 , Z2 ) − f (X2 ,Y2 , Z1 ) − f (X2 ,Y1 , Z2 ) + f (X2 ,Y1 , Z1 ) − f (X1 ,Y2 , Z2 ) + f (X1 ,Y2 , Z1 ) + f (X1 ,Y1 , Z2 ) − f (X1 ,Y1 , Z1 ) ,

(11)

6

Toshio Fukushima

and Un (X,Y, Z) is an indefinite volume integral defined as ) ∫ Z (∫ Y ∫ X dXdY √ Un (X,Y, Z) ≡ Zn dZ, X 2 +Y 2 + Z 2

(12)

which we name the potential function of degree n. By substituting the expression of Vn (x, y, z) into V (x, y, z), we obtain its rewriting in terms of Wn (x, y, z) as N

V (x, y, z) =

∑ cn (z)Wn (x, y, z),

(13)

n=0

where cn (z) is the n-th coefficient polynomial expressed as cn (z) ≡

N−n

∑ cnm zm ,

(14)

m=0

and cnm is its m-th coefficient defined as ( ) n+m cnm ≡ Gρn+m . n

(15)

Since cnm is calculated from ρn , which is already specified, and Wn (x, y, z) can be computed from Un (X,Y, Z), now the problem is reduced to the evaluation of the potential function, Un (X,Y, Z).

2.2 Analytical computation of acceleration vector and force gradient tensor Once the analytical expression of the potential is given, the associated acceleration vector and force gradient tensor are mechanically derived by its first and second order partial differentiation, respectively (Kellogg, 1929; Lass, 1950; Durand, 1953). Thus, the rectangular components of the gravitational acceleration vector, gx (x, y, z), gy (x, y, z), and gz (x, y, z), are explicitly given as N

gx (x, y, z) =

∑ cn (z)

(

n=0

∂ Wn ∂x

) ,

(

) ∂ Wn gy (x, y, z) = ∑ cn (z) , ∂y n=0 ( ) ] N [ ∂ Wn ′ gz (x, y, z) = ∑ cn (z) + cn (z)Wn . ∂z n=0 N

(16)

(17)

(18)

Also, those of the gravity gradient tensor, Γxx (x, y, z) through Γzz (x, y, z), are computed as ( 2 ) N ∂ Wn Γxx (x, y, z) = ∑ cn (z) , (19) ∂ x∂ x n=0

Recursive computation of gravitational field of vertically inhomogeneous prism

) ∂ 2Wn Γxy (x, y, z) = ∑ cn (z) , ∂ x∂ y n=0 ( 2 ) N ∂ Wn Γyy (x, y, z) = ∑ cn (z) , ∂ y∂ y n=0 ( )] ( 2 ) N [ ∂ Wn ∂ Wn ′ Γxz (x, y, z) = ∑ cn (z) + cn (z) , ∂ x∂ z ∂x n=0 ( 2 ) ( )] N [ ∂ Wn ∂ Wn ′ + cn (z) , Γyz (x, y, z) = ∑ cn (z) ∂ y∂ z ∂y n=0 ( 2 ) ( ) ] N [ ∂ Wn ∂ Wn ′ ′′ Γzz (x, y, z) = ∑ cn (z) + 2cn (z) + cn (z)Wn . ∂ z∂ z ∂z n=0

7

(

N

(20)

(21)

(22)

(23)

(24)

In the above, c′n (z) and c′′n (z) are the first and second order derivatives of cn (z) with respect to z expressed as c′n (z) ≡

dcn N−n−1 ′ m = ∑ cnm z , dz m=0

(25)

c′′n (z) ≡

d 2 cn N−n−2 ′′ m = ∑ cnm z , dz2 m=0

(26)

where c′nm and c′′nm are their coefficients written as ( ) n+m+1 c′nm ≡ (m + 1) Gρn+m+1 , n c′′nm

) n+m+2 ≡ (m + 2)(m + 1) Gρn+m+2 . n

(27)

(

(28)

Also, the first and second order partial derivatives of Wn (x, y, z) are expressed as triple differences of the corresponding partial derivatives of Un (X,Y, Z) as

∂ Wn ∂ Wn ∂ Wn = −∆3UnX , = −∆3UnY , = −∆3UnZ , ∂x ∂y ∂z ∂ 2Wn ∂ 2Wn ∂ 2Wn = ∆3UnXX , = ∆3UnXY , = ∆3UnXZ , ∂ x∂ x ∂ x∂ y ∂ x∂ z ∂ 2Wn ∂ 2Wn ∂ 2Wn = ∆3UnYY , = ∆3UnY Z , = ∆3UnZZ , ∂ y∂ y ∂ y∂ z ∂ z∂ z

(29)

where UnX (X,Y, Z) through UnZZ (X,Y, Z) are the partial derivatives of Un (X,Y, Z) defined as UnX (X,Y, Z) ≡

∂ Un ∂ Un ∂ Un , UnY (X,Y, Z) ≡ , UnZ (X,Y, Z) ≡ , ∂X ∂Y ∂Z

8

Toshio Fukushima

UnXX (X,Y, Z) ≡

∂ 2Un ∂ 2Un ∂ 2Un , UnXY (X,Y, Z) ≡ , UnXZ (X,Y, Z) ≡ , ∂ X∂ X ∂ X∂Y ∂ X∂ Z

∂ 2Un ∂ 2Un ∂ 2Un , UnY Z (X,Y, Z) ≡ , UnZZ (X,Y, Z) ≡ . (30) ∂Y ∂Y ∂Y ∂ Z ∂ Z∂ Z Notice the sign change in the first-order derivatives caused by the differential relation of the coordinates as UnYY (X,Y, Z) ≡

dX = −dx, dY = −dy, dZ = −dz.

(31)

In any case, the problem is reduced to the computation of the partial derivatives of the potential functions.

2.3 Special case: homogeneous prism Before going further, we quote the well-known result when n = 0, namely of the homogeneous prism (MacMillan, 1930, Sect. 43). Hereafter, we omit the argument dependence of the potential functions and their partial derivatives as well as other functions on X, Y , and Z for simplicity. Then, we express the formulae compactly as ( ) U0 = − X 2 A +Y 2 B + Z 2C /2 +Y ZD + ZXE + XY F, (32) U0X = −XA +Y F + ZE, U0Y = XF −Y B + ZD, U0Z = XE +Y D − ZC,

(33)

U0XX = −A, U0XY = F, U0XZ = E, U0YY = −B, U0Y Z = D, U0ZZ = −C,

(34)

where A through F are elementary functions defined as ( ) ( ) ( ) −1 ZX −1 XY −1 Y Z A ≡ tan , B ≡ tan , C ≡ tan , XR YR ZR D ≡ ln(X + R), E ≡ ln(Y + R), F ≡ ln(Z + R), and R stands for R≡

√ X 2 +Y 2 + Z 2 .

(35) (36) (37)

The ESM contains a graphic presentation of these functions.

2.4 Recursive computation of potential functions Let us consider an efficient way to compute Un and its partial derivatives, UnX through UnZZ , for a group of positive indices, n = 1, 2, . . ., and N. We begin with Un . As explained in Appendix A, its analytical expression is derived as Un = −

Z n+2C Z n+1 (Y D + XE) Y Dn+2 + XEn+2 + − . n+2 n+1 (n + 1)(n + 2)

(38)

Here Dn and En are the quantities computed recursively as Dn = −Y 2 Dn−2 − XRn−2 , (n = 3, 4, . . .),

(39)

Recursive computation of gravitational field of vertically inhomogeneous prism

En = −X 2 En−2 −Y Rn−2 , (n = 3, 4, . . .),

9

(40)

from their starting values prepared as D1 = D, D2 = Y B − XF,

(41)

E1 = E, E2 = XA −Y F.

(42)

Also, Rn are additional quantities computed recursively as [ ] Rn = Z n−1 R − (n − 1)SRn−2 /n, (n = 3, 4, . . .),

(43)

with the initial values computed as R1 = R, R2 = (ZR − SF)/2,

(44)

where S is the squared sum of the horizontal coordinates written as S ≡ X 2 +Y 2 .

(45)

The explicit expressions of Dn , En , and Rn for n = 3, 4, . . . , 14 are listed in the ESM. Also, we confirmed the correctness of Eq. (38) by examining its differential definition: ∂ 3Un Zn (46) = , ∂ X∂Y ∂ Z R as explained in the ESM. This recursive procedure to compute Un is entirely new. 2.5 Analytical computation of derivatives of Un Let us move on to the partial derivatives of Un for a positive integer n. As explained in Appendix B, they are explicitly computed from the quantities introduced in the previous subsections as ( ) UnX = Z n+1 E − En+2 /(n + 1), (47) ( ) UnY = Z n+1 D − Dn+2 /(n + 1), (48) UnZ = −Z n+1C + Z n (Y D + XE),

(49)

UnXX = XEn ,

(50)

UnXY = Rn ,

(51)

n

UnXZ = Z E,

(52)

UnYY = Y Dn ,

(53)

n

UnY Z = Z D, UnZZ = −(n + 1)Z C + nZ n

n−1

(54) (Y D + XE).

(55)

These expressions can be easily validated by examining their differential definitions: ( n) ∂ 3UnX ∂ Z −XZ n = , (56) ≡ ∂ X∂Y ∂ Z ∂ X R R3

10

Toshio Fukushima

( n) ∂ 3UnY ∂ Z −Y Z n = , (57) ≡ ∂ X∂Y ∂ Z ∂Y R R3 ] ( ) [ nS + (n − 1)Z 2 Z n−1 ∂ 3UnZ ∂ Zn ≡ = , (58) ∂ X∂Y ∂ Z ∂ Z R R3 ) ( n) ( 2 2X −Y 2 − Z 2 Z n ∂ 3UnXX ∂2 Z ≡ = , (59) ∂ X∂Y ∂ Z ∂ X∂ X R R5 ( n) ∂ 3UnXY ∂2 Z 3XY Z n = , (60) ≡ ∂ X∂Y ∂ Z ∂ X∂Y R R5 ] [ ( n) − nS + (n − 3)Z 2 XZ n−1 Z ∂ 3UnXZ ∂2 = , (61) ≡ ∂ X∂Y ∂ Z ∂ X∂ Z R R5 ) ( n) ( 2 −X + 2Y 2 − Z 2 Z n ∂ 3UnYY ∂2 Z ≡ = , (62) ∂ X∂Y ∂ Z ∂Y ∂Y R R5 [ ] ( n) − nS + (n − 3)Z 2 Y Z n−1 ∂ 3UnY Z ∂2 Z ≡ = , (63) ∂ X∂Y ∂ Z ∂Y ∂ Z R R5 ( n) ∂ 3UnZZ ∂2 Z ≡ ∂ X ∂ Y ∂ Z ∂ Z∂ Z R [ ( ) ] n(n − 1)S2 + 2n2 − 4n − 1 SZ 2 + (n − 2)(n − 1)Z 4 Z n−2 = , (64) R5 as provided in the ESM. These expressions of the partial derivatives are not found in the existing literature. It is noteworthy that no new functions are needed in the derivative computation since all of A through F as well as Dn , En , and Rn have already appeared in the procedure to compute Un as described in the previous subsection. Also, the derivative formulae, Eqs (47)–(55), are compact. As a result, their evaluation can be executed very efficiently, namely with a small amount of additional computational labor.

2.6 Hints for robust numerical evaluation Before closing the explanation of the new method, we make a remark on the singularities of V and its partial derivatives. The procedures described in the previous subsections guarantee that the final explicit expressions of Un through UnZZ are weighted linear sums of A through F and R with the coefficients written as polynomials of X, Y , and Z. Refer to the ESM for the examples for n up to 14. Consequently, the non-analytic feature of V and its partial derivatives are only those inherited from the seven basic functions, A through F and R. In other words, the issue of the singularity on the analytical expressions of the gravitational field of a vertically inhomogeneous prism is the same as that of the homogeneous prism (Nagy et al., 2000; Tsoulis and Petrovic, 2001).

Recursive computation of gravitational field of vertically inhomogeneous prism

11

In the actual numerical evaluation of Un through UnZZ , we compute A through F and R as A = atan3(X,Y, Z), B = atan3(Y, Z, X), C = atan3(Z, X,Y ),

(65)

D = logsum(X,Y, Z), E = logsum(Y, Z, X), F = logsum(Z, X,Y ), √ R = X 2 +Y 2 + Z 2 + ω ,

(66) (67)

where ω is a tiny positive constant defined as

ω ≡ 10−150 ,

(68)

and atan3(ξ , η , ζ ) and logsum(ξ , η , ζ ) are special functions defined conditionally as { [ )] ( √ tan−1 ηζ / ξ ξ 2 + η 2 + ζ 2 , (ξ ̸= 0), atan3(ξ , η , ζ ) ≡ (69) 0, (ξ = 0),    

( ) √ ln ξ + ξ 2 + η 2 + ζ 2 , (ξ > 0), ( 2 ) 2 (1/2) ln η +ζ +ω , logsum(ξ , η , ζ ) ≡ [( )] (ξ = 0), (70)  ) (√   ln η 2 + ζ 2 + ω / ξ 2 + η 2 + ζ 2 − ξ , (ξ < 0). The introduction of the switch structure in the logsum function is mainly so as to suppress the information loss in the argument computation of the logarithm. The other modifications are in order to avoid the computational troubles caused by the non-numerical values such as Infinity or NaN (IEEE, 2008). These answers are undesirable since they ruin the following computations. They are returned mainly because of the zero divisions, which may happen on the surfaces of, along the edges of, and/or at the vertices of the prism (Nagy et al., 2000). This does not happen if the above modifications are introduced. Anyhow, the introduction of this recipe is effective to treat these practical problems properly without degrading the computational accuracy significantly.

3 Numerical experiments 3.1 Self-consistency The correctness of the new formulation is analytically confirmed in Appendices A and B. Also, the ESM presents a literal validation of the analytical expressions and the recurrence formulae by means of some Mathematica command sequences up to a sufficiently high degree as n = 100. Therefore, let us focus on the numerical errors which will be faced when using the new formulation. For this purpose, we check the self-consistency of the analytically computed gravitational field. More closely speaking, we evaluate ρG (x, y, z), the

12

Toshio Fukushima

density recovered from Γxx (x, y, z), Γyy (x, y, z), and Γzz (x, y, z), the diagonal components of the computed gravity gradient tensor. Mathematically, the recovered density is defined as ( ) Γxx (x, y, z) + Γyy (x, y, z) + Γzz (x, y, z) ρG (x, y, z) ≡ − . (71) 4π G This is nothing but a rewriting of Poisson’s equation. Next, we measure its error as

δ ρ (x, y, z) ≡

ρG (x, y, z) − ρM (x, y, z) , maxρ

(72)

where maxρ is the maximum value of ρ (x, y, z). Here, the reference value, ρM (x, y, z), is a local mean value of ρ (x, y, z) defined as ( ) ∫ 3 ρM (x, y, z) ≡ lim ρ (x, y, z)dxdydz . (73) r→0 4π r 3 x2 +y2 +z2 ≤r2 Namely, it is a limit value of the average of the density over a small sphere centered at the evaluation point. Notice that this quantity is well-defined even when the original density ρ (x, y, z) has a finite discontinuity, and therefore indeterminate. In the case of prisms, the discontinuities occur at the vertices, along the edges, or on the surfaces of the prism. As a result, if a prism is appropriately rotated such that its edges are in parallel to the coordinate axes, the integral expression is compactly rewritten as

ρM (x, y, z) =

1 lim lim lim [ρ (x + ξ , y + η , z + ζ ) + ρ (x − ξ , y + η , z + ζ ) 8 ξ →0+0 η →0+0 ζ →0+0 +ρ (x + ξ , y − η , z + ζ ) + ρ (x − ξ , y − η , z + ζ ) +ρ (x + ξ , y + η , z − ζ ) + ρ (x − ξ , y + η , z − ζ ) +ρ (x + ξ , y − η , z − ζ ) + ρ (x − ξ , y − η , z − ζ )] ,

(74)

For example, if the prism is homogeneous and its nonzero density value is ρ0 , the modified density function is explicitly written as  ρ0 /8, (if at vertices),      ρ0 /4, (elseif along edges), ρM (x, y, z) = ρ0 /2, (elseif on surfaces), (75)   (elseif inside),  ρ0 ,   0, (otherwise). At any rate, the density recovery error should be zero since Poisson’s equation must hold. In other words, its deviation from the zero value indicates a sort of accumulated round-off error during the actual execution of the new formulation. Consider a cubic prism occupying the three-dimensional domain, 0 ≤ x ≤ 1, 0 ≤ y ≤ 1, and 0 ≤ z ≤ 1. Then, for this prism, Fig. 2 illustrates δ ρ obtained in the quadruple precision computation as a function of the vertical coordinate in a log-log manner. Here ρ was set as a degree n monomial of z as ρ (z) = ρ0 zn for some values of

Recursive computation of gravitational field of vertically inhomogeneous prism

13

Density Recovery Error 0

n=10

6 5

4

n=3

n=2

-5

log10|δρ|

-10 -15 n=1

-20 -25 -30

n=0

-35 -3

0

3

6 log10z

9

12

15

Fig. 2 Density recovery error of prismatic gravitational field. Illustrated are δ ρ , the scaled density recovery[{errors of the gravitational field of an} inhomogeneous prism. ] The errors are measured as δ ρ (x, y, z) ≡ − Γxx (x, y, z) + Γyy (x, y, z) + Γzz (x, y, z) /(4π G) + ρM (x, y, z) /ρ0 where Γ is the gravity gradient tensor, ρM (x, y, z) is the modified density function defined in the main text, and ρ0 is a nominal constant. We assume that the density of the prism follows a degree n monomial of z. The errors are plotted as a function of z in a log-log manner for a wide range of z as 10−3 ≤ z ≤ 1015 . Here x and y are fixed as non-trivial values as x = 1/4 and y = 3/5, respectively. The curves show the results for several values of n as n = 0, 1, . . . , 10. They are drawn by solid lines for even degrees are by broken lines otherwise. Evidently, the errors remain almost constant within the prism but increase in proportion to zn outside.

n as n = 0, 1, . . . , and 10. Thus, the maximum density value becomes max ρ = ρ0 . The evaluation is done inside and above the prism in a wide range as 10−3 ≤ z ≤ 1015 , and along a vertical straight line passing through the prism where the x- and y-coordinates of the evaluation point are fixed as non-trivial values as x = 1/4 and y = 3/5. Evidently, the errors remain at the level of the quadruple precision machine epsilon, εQ ≡ 2−113 ≈ 9.63 × 10−35 , when the distance from the coordinate origin, namely |z| in this specific case, is sufficiently small and/or n = 0. On the other hand, they drastically grow when the distance increases. Without doubt, this error growth is due to the round-off errors in a certain process in the new formulation to compute Γxx , Γyy , and/or Γzz because the correctness of their expressions is analytically confirmed.

14

Toshio Fukushima

Round-Off Error of Potential Function 6 4

1016δUn

2 0 -2 -4 -6 -4

-2

0

2

4

6 8 log10Z

10 12 14 16

Fig. 3 Round-off error of potential functions. Same as Fig. 2 but shown are the scaled round-off ) of the degree n potential function defined as δ Un ≡ (errors of the double )precision ( computation Un,double −Un,quadruple /max 1, Un,quadruple . The errors are plotted as a function of Z in the range 10−4 ≤ Z ≤ 1016 when X and Y are fixed to be non-trivial values as X = 1/2 and Y = 3/5, respectively. Obviously, the errors are at the level of a few tenth of the double precision machine epsilon, εD ≡ 2−53 ≈ 1.11 × 10−16 , if Z < 1. Otherwise, their magnitude increased by factor 10 or so. Nevertheless, it is still sufficiently small. It is noteworthy that both of the randomness of the error distribution and the constancy of the error magnitude are dependent neither on the vertical coordinate, Z, nor on the degree of monomial, n.

3.2 Round-off errors In order to locate the origin of the round-off errors observed in the previous subsection, we first examine the round-off errors of the computed values of the degree n potential function, Un . More concretely speaking, we compute Un for a set of evaluation points, (X,Y, Z), in the double and quadruple precision environments, respectively. Then, we regard the scaled differences in the obtained values as the round-off errors of the double precision computation as

δ Un (X,Y, Z) ≡

Un, double (X,Y, Z) −Un, quadruple (X,Y, Z) ( ) . max 1,Un, quadruple (X,Y, Z)

(76)

Recursive computation of gravitational field of vertically inhomogeneous prism

15

Round-Off Error of Prism Potential 0

n=10 9 8 7 6 5 4

-2

n=3

log10|δV|

-4

n=2 n=1

-6 -8

n=0

-10 -12 -14 -16 -1 -0.5

0

0.5

1

1.5 2 log10z

2.5

3

3.5

4

Fig. 4 Round-off error of prism potential. Same as Fig. 2 but plotted are the relative round-off errors of the double precision computation of the gravitational potential of the vertically inhomogeneous prisms defined as δ V ≡ Vdouble /Vquadruple − 1. They are displayed for a narrower range of z as 0.1 ≤ z ≤ 104 . Clearly, the errors increase in proportion to zn+2 when z > 0.5. The increase of the power index by 2 is due to the double integration in obtaining V from its second-order partial derivatives, Γzz .

Fig. 3 presents the vertical variation of thus-determined round-off errors in a wide range of Z as 10−4 ≤ Z ≤ 1016 . Clearly, the figure indicates that the magnitude of the errors is much less than the double precision machine epsilon, εD ≡ 2−53 ≈ 1.11 × 10−16 , if Z is small, say when Z < 1. On the other hand, the error magnitude increases by a factor 10 or more when Z is large. Nevertheless, the increased error magnitude remains almost constant, say at the level of 5 double precision machine epsilons. At any rate, the errors are randomly distributed with almost zero mean values. This fact indicates that the errors observed here are caused by a fixed amount of rounding off during the process of the recursive computation. Meanwhile, Fig. 4 show the corresponding curves of δ V defined as

δ V (x, y, z) ≡

Vdouble (x, y, z) −Vquadruple (x, y, z) . Vquadruple (x, y, z)

(77)

In this case, the errors significantly increase outside the prism. They are roughly in proportion to zn+2 . From the comparison of these two kind of round-off errors, we

16

Toshio Fukushima

conclude that the errors are mainly caused by the catastrophic cancellation of the potential functions, Un , during the process of their triple difference to result V . Of course, we have shown only the vertical dependence of the errors in the above. However, we confirmed a similar feature in the horizontal variation. Also, we notice that the situation is mostly independent on the components of the gravitational quantities. In other words, similar cancellations degrade the computational precision for not only V but also all of its derivatives, gx through Γzz . Indeed, this is reflected in the density recovery error, which is based on Γxx , Γyy , and Γzz , as displayed in Fig. 2. This severe growth of round-off errors in the far region was already reported for the case of a prism with the linearly varying density (Holstein and Ketteridge, 1996; Pohanka, 1998; Hansen, 1999). Refer to Holstein (2003) for the further discussion and a few trials to remedy this phenomenon. Unfortunately, the proposed cure is not applicable to the present general case. 3.3 Computational time Let us move to the aspect of the computational time. More concretely speaking, we measured the CPU time to prepare a number of the numerical values of the gravitational field of an inhomogeneous prism by using the new formulation. Actually, we evaluated ten millions of V , gx , gy , gz , and/or Γxx through Γzz inside and near a test prism set as a unit cube occupying the domain, 0 ≤ x ≤ 1, 0 ≤ y ≤ 1, and 0 ≤ z ≤ 1, with the vertical density profiles consisting of monomials of z for the maximum degree, N = 0, 1, . . . , 20. All the computer programs are written in Fortran 90, compiled by the Intel Visual Fortran Composer XE2011 update 8, i.e. the so-called ifort12.1, with the compiler flags to enable the maximum optimization as /O3 /Qparallel /Qpar-threshold:10 /Qvec-threshold:10 /Qopt-prefetch=3 /assume:buffered_io /Qipo /Qopt-matmul /check:bounds /libs:static /threads /c and executed at a consumer PC with the Intel Core i7-4600U running at 2.10 GHz clock. Fig. 5 illustrates the averaged CPU times in the unit of µ s as a function of N for three cases: (i) the computation of V only, (ii) the computation of V , gx , gy , and gz simultaneously, and (iii) the computation of the full set of V , gx through gz , and Γxx through Γzz . We experimentally learn that the averaged CPU time for one execution of the elementary functions such as the logarithm or the arc tangent functions is 24 ns if employing the machine codes provided by the standard Intel mathematical function library. Since these functions are called (3 + 3) × 8 = 48 times in a naive implementation of the homogeneous prism potential computation, we judge that the measured CPU time of around 1 µ s when N = 0 is not so large. On the other hand, the figure clearly indicates that the averaged CPU time increases slowly when N increases. This is because the new formulation utilizes the recursive computation such that the number of the transcendental function calls is independent on N. Rather, the observed slow increase of the CPU time is due to the increase of the number of recursions where only the arithmetic operations are needed.

Recursive computation of gravitational field of vertically inhomogeneous prism

17

CPU Time of Prism Gravity Field Computation 9 8 CPU Time (µs)

7

V+g+Γ

6 5

V+g

4

V

3 2 1 0 0

2

4

6

8

10 12 14 16 18 20 N

Fig. 5 Averaged CPU time of gravity field computation. Shown are the averaged CPU time requried to compute the gravitational quantities of a prism by the new formulation as a function of N, the maximum degree of the vertical density polynomial. The CPU time was measured at a consumer PC with the Intel Core i7-4600 U CPU running at 2.10 GHz clock. Comapred are the three cases: (i) the computation of V only, (ii) the computation of V , gx , gy , and gz simultaneously, and (iii) the computation of the full set of V , gx , gy , gz , and Γxx through Γzz . We experimentally find that 24 ns is the averaged CPU time at the same PC for one execution of the elementary functions like the natural logarithm or the arc tangent function.

Also, the total CPU time increases only slightly when the number of the gravitational quantities to be computed increases from 1 when only V is computed, to 4 when gx through gz are additionally required, and to 10 when the full set of V , gx , gy , gz , and Γxx through Γzz are obtained. This is thanks to the simplicity of the derivative formulae of Un which require no time-consuming operation additionally.

18

Toshio Fukushima

4 Gravitatioanl field of exponentially damped prism As a practical example, we present below some sketches describing the gravitational field of a vertically inhomogeneous prism with an exponentially damped density profile. Again, the prism was chosen as a unit cube occupying the three-dimensional volume defined as 0 ≤ x ≤ 1, 0 ≤ y ≤ 1, and 0 ≤ z ≤ 1. Meanwhile, the density profile was set as a polynomial obtained by truncating the Maclaurin series of an exponential function as N (−z)n ≈ ρ0 exp(−z), ρ (z) ≡ ρ0 ∑ (78) n=0 n! where N = 18 and N = 31 in the double and quadruple precision computation, respectively. The relative approximation errors of this truncated series are less than the corresponding machine epsilon in the region 0 ≤ z ≤ 1 since 1/(19!) ≈ 8.22 × 10−18 < εD and 1/(32!) ≈ 3.80 × 10−36 < εQ . As a result, there remains no practical difference between the usage of the polynomial approximation and the direct computation of the exponential function. Before going further, let us examine the effective region of the polynomial approximation. Fig 6 illustrates the vertical variation of the density recovery error of the new formulation conducted in the double and quadruple precision environments. The graph clearly shows the limit of the adopted polynomial approximations. Namely, if the 5 digit accuracy is demanded, one may use the double precision computation as long as |z| < 20. This limit value is extended to 50 when the quadruple precision computation is employed. Obviously, the difference in the error growth comes from the difference in the maximum degree of the polynomial, 18 and 31, respectively. This experimental result may indicate that, unless the error growth is suppressed by a sort of trick, one should rather use lower order approximations in a piecewise manner. At any rate, let us investigate the behavior of the gravitational field of this exponentially damped prism in its internal and near region. Figs 7–16 illustrate the bird’s-eye view and the associated contour map of V , gx , gy , gz , Γxx , Γyy , Γzz , Γxy , Γxz , and Γyz on the x-y plane when z = 0, which coincides with the bottom surface of the prism at its central region. In a sense, these feature resemble the gravitational effects of the local air mass on the flat ground surface. The observed horizontal variation looks like a mixture of the homogeneous and the linearly varying profiles given in the ESM. On the other hand, Figs 17–23 provide the bird’s-eye view and the contour map of V , gx , gz , Γxx , Γyy , Γzz , and Γxz on the x-z plane when y = 1/2, which exactly halves the prism in a symmetric manner. Since the density distribution is symmetric with respect to the plane, the gravity contributions in the y-direction from the upper and lower half parts of the prism exactly cancel with each other on this plane. As a result, gy , Γxy , and Γyz completely vanish there. This is the reason why we omit their view and map. Anyhow, the observed feature is significantly different from that of the homogeneous prism, especially in gz and Γzz .

Recursive computation of gravitational field of vertically inhomogeneous prism

19

Density Recovery Error of Exponential Prism 0

x1 = y1 = z1 = 0, x2 = y2 = z2 = 1 x = 1/4, y = 3/5 ρ = ρ0 exp(−z)

-5

log10|δρ|

-10 -15

double precision

-20 -25

quadruple precision

-30 -35 0

0.5

1 log10z

1.5

Fig. 6 Density recovery error of exponentially damped prism. Same as Fig. 2 but for the case when the density damps exponentially as ρ (z) = ρ0 exp(−z). Plotted are the results of the double and quadruple precision approximation using the degree 18 and 31 polynomials obtained by truncating the Maclaurin series of the exponential function.

2

20

Toshio Fukushima

x-y Plot of Exponential Prism Field: V z=0

V/V0 1.4 1.2 1 0.8 0.6 0.4 0.2

2 1

-1

0

0 y

1

x

2 -1

Fig. 7 Bird’s-eye view of gravitational potential of exponentially damped prism: x-y plane, z=0. Presented are the bird’s-eye view and the associated contour map of V of a vertically inhomogeneous prism with an exponentially damped density profile. The prism was chosen as a unit cube occupying the threedimensional volume defined as 0 ≤ x ≤ 1, 0 ≤ y ≤ 1, and 0 ≤ z ≤ 1. The density profile was set as ρ (z) = ρ0 exp(−z). The view and map are shown on the x-y plane when z is fixed as z = 0. Although the surface view looks smooth, it is not analytic on the edges of the prism, namely when x = 0 and 0 ≤ y ≤ 1, when x = 1 and 0 ≤ y ≤ 1, when y = 0 and 0 ≤ x ≤ 1, or when y = 1 and 0 ≤ x ≤ 1. This feature is vaguely seen from somewhat dense contours near the edges.

Recursive computation of gravitational field of vertically inhomogeneous prism

21

x-y Plot of Exponential Prism Field: gx z=0 gx/g0 1.5 1 0.5 0 -0.5 -1 -1.5 2

-1 0 y

1

0

1 x

2 -1

Fig. 8 Bird’s-eye view of x-component of gravitational acceleration vector of exponentially damped prism: x-y plane, z=0. Same as Fig. 7 but for gx . Obviously, the surface view exhibits kinks along the x-edges of the prism, namely when x = 0 and 0 ≤ y ≤ 1 and when x = 1 and 0 ≤ y ≤ 1.

22

Toshio Fukushima

x-y Plot of Exponential Prism Field: gy gy/g0

z=0

1.5 1 0.5 0 -0.5 -1 -1.5

2 1

-1

0

0 y

1

x

2 -1

Fig. 9 Bird’s-eye view of y-component of gravitational acceleration vector of exponentially damped prism: x-y plane, z=0. Same as Fig. 7 but for gy . The view and map here are exactly the same as those in Fig. 8 after the 90 degree rotation.

Recursive computation of gravitational field of vertically inhomogeneous prism

23

x-y Plot of Exponential Prism Field: gz gz/g0

z=0

2 1.5 1 0.5 0

2 1

-1

0

0 y

1

x

2 -1

Fig. 10 Bird’s-eye view of vertical component of gravitational acceleration vector of exponentially damped prism: x-y plane, z=0. Same as Fig. 7 but for gz . This time, the contours near the edges resemble a squared feature while those inside or outside the prism look circular.

24

Toshio Fukushima

x-y Plot of Exponential Prism Field: Γxx z=0

Γxx/Γ0 3 2 1 0 -1 -2 -3 -4

2 1

-1

0

0 y

1

x

2 -1

Fig. 11 Bird’s-eye view of x-x component of gravity gradient tensor of exponentially damped prism: x-y plane, z=0. Same as Fig. 7 but for Γxx . This time, it is clear that Γxx has a finite discontinuity along the x-edges of the prism.

Recursive computation of gravitational field of vertically inhomogeneous prism

25

x-y Plot of Exponential Prism Field: Γyy z=0

Γyy/Γ0 3 2 1 0 -1 -2 -3 -4

2 1

-1

0

0 y

1

x

2 -1

Fig. 12 Bird’s-eye view of y-y component of gravity gradient tensor of exponentially damped prism: x-y plane, z=0. Same as Fig. 7 but for Γyy .

26

Toshio Fukushima

x-y Plot of Exponential Prism Field: Γzz z=0 Γzz/Γ0 0 -0.5 -1 -1.5 -2 -2.5

2 1

-1

0

0 y

1

x

2 -1

Fig. 13 Bird’s-eye view of vertical-vertical component of gravity gradient tensor of exponentially damped prism: x-y plane, z=0. Same as Fig. 7 but for Γzz . This time, the sign has changed but the feature is almost the same.

Recursive computation of gravitational field of vertically inhomogeneous prism

27

x-y Plot of Exponential Prism Field: Γxy Γxy/Γ0

z=0

4 2 0 -2 -4

2 1

-1

0

0 y

1

x

2 -1

Fig. 14 Bird’s-eye view of x-y component of gravity gradient tensor of exponentially damped prism: xy plane, z=0. Same as Fig. 7 but for Γxy . Prominent are the logarithmically lowing-up singularities with alternative signs at the four corners of the prism, namely when (i) x = y = z = 0, (ii) x = z = 0 and y = 1, (iii) y = z = 0 and x = 1, and (iv) z = 0 and x = y = 1.

28

Toshio Fukushima

x-y Plot of Exponential Prism Field: Γxz Γxz/Γ0

z=0

4 2 0 -2 -4 2

-1 0 y

1

0

1 x

2 -1

Fig. 15 Bird’s-eye view of x-z component of gravity gradient tensor of exponentially damped prism: x-y plane, z=0. Same as Fig. 7 but for Γxz . Notice the logarithmically blowing-up singularities located along the x-edges of the prism, namely when (i) x = 1, z = 0, and 0 ≤ y ≤ 1 or (ii) x = z = 0 and 0 ≤ y ≤ 1.

Recursive computation of gravitational field of vertically inhomogeneous prism

29

x-y Plot of Exponential Prism Field: Γyz Γyz/Γ0

z=0

4 2 0 -2 -4

2 1

-1

0

0 y

1

x

2 -1

Fig. 16 Bird’s-eye view of y-z component of gravity gradient tensor of exponentially damped prism: x-y plane, z=0. Same as Fig. 7 but for Γyz . The logarithmically blowing-up singularities are located along the y-edges of the prism, namely when (i) y = 1, z = 0, and 0 ≤ x ≤ 1 or (ii) y = z = 0 and 0 ≤ x ≤ 1.

30

Toshio Fukushima

x-z Plot of Exponential Prism Field: V y=1/2

V/V0 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2

2 1

-1

0

0 z

1

x

2 -1

Fig. 17 Bird’s-eye view of gravitational potential of exponentially damped prism: x-z plane, y=1/2. Same as Fig. 7 but on the x-z plane when y = 1/2. Notice the asymmetry of the surface view with respect to z.

Recursive computation of gravitational field of vertically inhomogeneous prism

31

x-z Plot of Exponential Prism Field: gx y=1/2 gx/g0 2 1 0 -1 -2 2

-1 0 z

1

0

1 x

2 -1

Fig. 18 Bird’s-eye view of x-component of gravitational acceleration vector of exponentially damped prism: x-z plane, y=1/2. Same as Fig. 17 but for gx .

32

Toshio Fukushima

x-z Plot of Exponential Prism Field: gz y=1/2 g /g z 0

2 1 0 -1 -2

2 1

-1

0

0 z

1

x

2 -1

Fig. 19 Bird’s-eye view of vertical component of gravitational acceleration vector of exponentially damped prism: x-z plane, y=1/2. Same as Fig. 17 but for gz .

Recursive computation of gravitational field of vertically inhomogeneous prism

33

x-z Plot of Exponential Prism Field: Γxx Γxx/Γ0

y=1/2

6 4 2 0 -2 -4 -6

2 1

-1

0

0 z

1

x

2 -1

Fig. 20 Bird’s-eye view of x-x component of gravity gradient tensor of exponentially damped prism: x-z plane, z=0. Same as Fig. 17 but for Γxx .

34

Toshio Fukushima

x-z Plot of Exponential Prism Field: Γyy y=1/2 Γyy/Γ0 0 -1 -2 -3

2 1

-1

0

0 z

1

x

2 -1

Fig. 21 Bird’s-eye view of y-y component of gravity gradient tensor of exponentially damped prism: x-z plane, z=0. Same as Fig. 17 but for Γyy .

Recursive computation of gravitational field of vertically inhomogeneous prism

35

x-z Plot of Exponential Prism Field: Γzz Γzz/Γ0

y=1/2

4 2 0 -2 -4 -6 -8

2 1

-1

0

0 z

1

x

2 -1

Fig. 22 Bird’s-eye view of vertical-vertical component of gravity gradient tensor of exponentially damped prism: x-z plane, y=1/2. Same as Fig. 17 but for Γzz .

36

Toshio Fukushima

x-z Plot of Exponential Prism Field: Γxz Γxz/Γ0 y=1/2 4 2 0 -2 -4 2 1 x 0 -1 0 1 2 -1 z

Fig. 23 Bird’s-eye view of x-z component of gravity gradient tensor of exponentially damped prism: x-z plane, z=0. Same as Fig. 17 but for Γxz .

Recursive computation of gravitational field of vertically inhomogeneous prism

37

x-z Plot of Recovered Density: n=0 y=1/2 ρG/ρ0 1 0.5 0 -0.5

2 1

-1

0

0 z

1

x

2 -1

Fig. 24 Bird’s-eye view of recovered density profile of exponentially damped prism: x-z plane, y=1/2. Same as Fig. 17 but for the density recovered from the computed gravity gradient tensor, ρG ≡ − (Γxx + Γyy + Γzz ) /(4π G).

Finally, we prepared Fig. 24 presenting the view and map of ρG , the densify profile recovered from the computed gravity gradient tensor. Also, we created 25 plotting δ ρ , its scaled error, obtained by the quadruple precision computation of the new formulation. Evidently, the recovered density profile faithfully reproduces the given density profile.

38

Toshio Fukushima

Density Recovery Error of Exponential Prism y=1/2

34

10 δρ 15 10 5 0 -5 -10

2 1

-1

0

0 z

1

x

2 -1

Fig. 25 Bird’s-eye view of density recovery error of exponentially damped prism: x-z plane, y=1/2. Same as Fig. 24 but for δ ρ , the density recovery error, obtained in the quadruple precision computation.

5 Conclusion In order to describe the regional gravitational field in a more realistic manner, we considered a vertically inhomogeneous prism with the density profile being an arbitrary degree polynomial of the vertical coordinate. We developed a systematic method to compute the gravitational potential of the prism and its first- and second-order partial

Recursive computation of gravitational field of vertically inhomogeneous prism

39

derivatives with respect to the rectangular coordinates. The method is purely analytic and utilizes the recurrence formulae to evaluate three groups of auxiliary functions, Dn , En , and Rn , all of which turned out to be complicated elementary functions. Since the analytic expressions of the gravitational acceleration vector and the gravity gradient tensor are some sort of simplifications of that of the gravitational potential, the total computational labor to obtain all these three kind of quantities is merely the twice of that to compute the potential only despite the fact that the number of the gravitational quantities increases by a factor 10. As a result, the CPU time of the new formulation becomes fairly small and only slowly increases according as the maximum degree of the polynomial used in describing the density profile, say 4 times for the degree 9 polynomial. Numerical experiments show that the computational errors of the gravitational field evaluated numerically by using the new formulation remain at the machine epsilon level if the evaluation point is inside or near the prism. However, they significantly increase in the far region. This unwelcome situation is caused by the round-off errors in the process of the triple difference. Of course, the effective region of the analytical procedure can be extended significantly if the quadruple precision computation is employed, say around 1000 times the prism size for the degree 9 polynomial density variation if the 6 digits precision is required. Nevertheless, this effective region significantly diminishes when higher degree polynomials are demanded such as in the case of an exponentially damped profile. Consequently, for the further improvement, we need a definitive solution to remove or suppress this type of the accumulation of round-off errors as Holstein (2003) partially succeeded. Indeed, it is an issue worthwhile to be tackled in the future.

Appendices A Derivation of recursive procedure to evaluate Un A.1 Basic integral formulae Let us derive the recursive procedure to compute Un given in the main text. Before going further, we show some integral formulae: ∫ X dX = ln(X + R), (79) R ( ) ( ) ∫ Y Y XY ln(X + R)dY = Z tan−1 −Y − Z tan−1 + X ln(Y + R) +Y ln(X + R), (80) Z ZR ( ) ( 2) ( ) ( 2) ( ) ( 2) ( ) ∫ Z XY X YZ Y XZ Z XY Z tan−1 dZ = − tan−1 − tan−1 + tan−1 ZR 2 XR 2 YR 2 ZR +XY ln(Z + R), where R is an abbreviation as R≡

√ X 2 +Y 2 + Z 2 .

(81) (82)

The correctness of all these integral formulae is confirmed by their direct partial differentiation. Refer to the ESM.

40

Toshio Fukushima

A.2 Line integral representation of Un By using the formulae shown in the previous subsection, we rewrite Wn as ∫ Wn = ∫ =

[ Z ∫ Y

[ Z ∫ Y

(∫

X

dX R

)

X=X2 Y =Y2 Z=Z2 dY Z dZ X=X1 ]

n

Y =Y1 Z=Z 1

X=X2 Y =Y2 Z=Z2 ln(X + R)dY Z dZ X=X1 ]

n

Y =Y1 Z=Z 1

∫ =

} ) ( [ { ( ) Z XY Y −Y − Z n+1 tan−1 Z n Z tan−1 Z ZR Y =Y2 Z=Z2 X=X +Z n X ln(Y + R) + Z nY ln(X + R)] dZ|X=X21 . Y =Y1 Z=Z 1

(83)

{ } The first term of the last integrand, Z n Z tan−1 (Y /Z) −Y , is independent on X. Thus, its integral will disappear in the difference with respect to X. Therefore, we omit it before the integration. Let us call this operation ‘reduction’. As a result, we arrive at the reduced line integral representation of Un as (∫

Z

Un =

) ] )∗ [ ( XY + XZ n ln(Y + R) +Y Z n ln(X + R) dZ , −Z n+1 tan−1 ZR

(84)

where the parentheses with an asterisk means the result after the reduction.

A.3 Analytical expression of Un The derivatives of the second multiplier of each term of the last integrand in Eq. (84) are written as ) [ ( )] ( ∂ XY 1 XY 1 tan−1 + , =− ∂Z ZR X 2 + Z2 Y 2 + Z2 R

(85)

∂ ln(X + R) Z ∂ ln(Y + R) Z = , = , ∂Z (X + R)R ∂Z (Y + R)R

(86)

as verified in the ESM. Using these, we rewrite Un by the integration by part as (∫

Z

Un =

[ { ( n+2 )} ( ) { ( n+1 )} ] )∗ Z Z ∂ XY ∂ {X ln(Y + R) +Y ln(X + R)} dZ − tan−1 + ∂Z n+2 ZR ∂Z n+1

[ ( n+2 ) ( ) ( n+1 ) ] Z (∫ Z )∗ Z XY Z X Y Z n+2 dZ {X ln(Y + R) +Y ln(X + R)} − = − tan−1 + 2 2 n+2 ZR n+1 n+2 (X + Z ) R (∫ Z n+2 )∗ (∫ Z )∗ (∫ Z n+2 )∗ n+2 X Z dZ Y XZ dZ Y Z dZ − − − . (87) n+1 (Y + R)R n+2 (Y 2 + Z 2 ) R n+1 (X + R)R Except the difference in their signs, the last two reduced integrals are the same with each other because (∫

Z

XZ n+2 dZ (Y 2 + Z 2 ) R

)∗

(∫ =

(∫ +

Z

Z

Z n+2 dZ (X + R)R

(∫

)∗ =

Z

)∗ [ ( )] X(X + R) + Y 2 + Z 2 Z n+2 dZ (Y 2 + Z 2 ) (X + R)R

)∗ (∫ ( 2 ) R + XR Z n+2 dZ = (Y 2 + Z 2 ) (R2 + XR)

Z

Z n+2 dZ Y 2 + Z2

)∗ = 0,

(88)

Recursive computation of gravitational field of vertically inhomogeneous prism

41

since the integrand of the last expression is independent on X. Similar equivalence is shown for the second last pair of the reduced integrals. Based on these observations, let us introduce a pair of new reduced integrals, Dn and En , defined as (∫ Z )∗ (∫ Z )∗ Z n dZ Z n dZ Dn ≡ , En ≡ . (89) (X + R)R (Y + R)R Then, by using these new integrals, we rewrite Un as ( ) ) ( n+2 ) ( Z XY Z n+1 XEn+2 +Y Dn+2 tan−1 + . Un = − [X ln(Y + R) +Y ln(X + R)] − n+2 ZR n+1 (n + 1)(n + 2)

(90)

This is the same as Eq. (38) in the main text.

A.4 Recursive computation of Dn and En Let us find the recurrence formulae to evaluate Dn and En for positive integer indices, n. First of all, their analytical expressions for n = 1 and 2 are explicitly obtained by their direct integration as D1 = ln(X + R), E1 = ln(Y + R), (91) ) ( ) ZX YZ D2 = Y tan−1 − X ln(Z + R), E2 = X tan−1 −Y ln(Z + R), (92) YR XR where we omitted the reducible contributions. The correctness of these formulae is confirmed by their direct partial differentiation with respect to Z as (

∂ Dn ∂ En Zn Zn = , = . ∂Z (X + R)R ∂ Z (Y + R)R

(93)

Refer to the ESM. Next, noting the identity relation, 1−

X 2 + Z2 (Y + R)R − X 2 − Z 2 Y R + R2 − X 2 − Z 2 Y R +Y 2 Y (Y + R) Y = = = = = , (Y + R)R (Y + R)R (Y + R)R (Y + R)R (Y + R)R R

we rewrite a linear combination of En as (∫ ( ) )∗ ( ∫ Z Z n−2 X 2 + Z 2 2 X En−2 + En = dZ = (Y + R)R

Z

[ ] )∗ Z n−2Y Z n−2 − dZ = −Y Rn−2 , R

(94)

(95)

where Rn is another reduced integral defined as Rn ≡

(∫

Z

Z n dZ R

)∗ .

(96)

In the above rewriting, we used the identity relation (∫ Z )∗ Z n−2 dZ = 0,

(97)

since the integral is independent on X and Y . A similar relation holds on Dn as Y 2 Dn−2 + Dn = −XRn−2 .

(98)

Thus, we translate these results into recurrence relations of Dn and En as Dn = −Y 2 Dn−2 − XRn−2 , En = −X 2 En−2 −Y Rn−2 ,

(99)

where their initial values when n = 1 and 2 are already given in Eqs (91) and (92), respectively. Thus, the problem is reduced to the computation of Rn .

42

Toshio Fukushima

A.5 Recursive computation of Rn Let us consider the computation of Rn when n is a positive integer. Recalling a differential formula

∂R Z = , ∂Z R

(100)

we rewrite Rn by the integration by part as (∫ Z [ ] )∗ (∫ Z [ ] )∗ (∫ Z )∗ Z Z ∂R Rn = Z n−1 dZ = Z n−1 dZ = Z n−1 R − (n − 1)Z n−2 RdZ R ∂Z (∫ Z 2 n−2 )∗ (∫ Z n−2 )∗ (∫ Z n )∗ R Z Z dZ Z dZ dZ = Z n−1 R − (n − 1)S − (n − 1) = Z n−1 R − (n − 1) R R R = Z n−1 R − (n − 1)SRn−2 − (n − 1)Rn ,

(101)

where S is the square sum of the horizontal coordinates defined as S ≡ X 2 +Y 2 ,

(102)

R2 = S + Z 2 .

(103)

and we used the identity relation, In any case, Eq. (101) is further rewritten into a recurrence relation of Rn as nRn = Z n−1 R − (n − 1)SRn−2 .

(104)

On the other hand, the special values when n = 0 and 1 are obtained by the direct analytical integration as (∫ Z ) (∫ Z ) dZ ∗ ZdZ ∗ R0 = = ln(Z + R), R1 = = R. (105) R R Thus, utilizing the recurrence formula, we obtain the case n = 2 as R2 =

ZR − SR0 ZR − S ln(Z + R) = . 2 2

(106)

The correctness of this procedure is confirmed by the differential form of the defining integral with respect to Z as ∂ Rn Zn = . (107) ∂Z R Refer to the ESM. At any rate, this has closed the recursive procedure to evaluate Rn .

A.6 Recursive computation of Un Now that a recurrence relation of Rn is known, the recursive formulations to evaluate Dn and En are closed, and therefore the analytical procedure to evaluate Un is completed. By introducing the abbreviations ( ) ( ) ( ) ZX XY YZ A ≡ tan−1 , B ≡ tan−1 , C ≡ tan−1 , (108) XR YR ZR D ≡ ln(X + R), E ≡ ln(Y + R), F ≡ ln(Z + R),

(109)

we summarize the recurrence formulae compactly as [ ] R1 = R, R2 = (ZR − SF)/2. Rn = Z n−1 R − (n − 1)SRn−2 /n,

(110)

D1 = D, D2 = Y B − XF, Dn = −Y 2 Dn−2 − XRn−2 ,

(111)

E1 = E, E2 = XA −Y F, En = −X 2 En−2 −Y Rn−2 ,

(112)

Z n+2C Z n+1 (Y D + XE) Y Dn+2 + XEn+2 Un = − + − . n+2 n+1 (n + 1)(n + 2) These expressions are the same as those given in the main text.

(113)

Recursive computation of gravitational field of vertically inhomogeneous prism

43

B Derivation of analytical expression of partial derivatives of Un B.1 Z-derivatives Let us derive the derivative expressions of Un . We begin with the Z-derivatives, namely UnZ , UnXZ , UnY Z , and UnZZ . The line integral expression of Un , Eq. (84), is of the form of an indefinite integral with respect to Z. Therefore, it immediately results the reduced expression of its partial derivative with respect to Z as ( UnZ ≡

∂ Un ∂Z

)∗

= −Z n+1 tan−1

(

XY ZR

) + XZ n ln (Y + R) +Y Z n ln (X + R) ,

(114)

which is the same as Eq. (49) in the main text. Also, by using the integral formula, Eq. (80), in the differential form, we obtain the Y -derivative of UnZ as ( UnY Z ≡ ( =

∂ ∂Y

{

−Z n+1 tan−1

(

XY ZR

)

∂ 2Un ∂Y ∂ Z

)∗

( =

(

∂ ∂Y

∂ Un ∂Z

)∗ )∗

})∗ + XZ n ln(Y + R) +Y Z n ln(X + R) = Z n ln (X + R) ,

(115)

which is the same as Eq. (54). Since UnZ is symmetric with respect to X and Y , we similarly obtain the X-derivative of UnZ as )∗ ( 2 ∂ Un = Z n ln (Y + R) , (116) UnXZ ≡ ∂ X∂ Z which is also the same as Eq. (52). Finally, we focus on UnZZ . First of all, U0ZZ is evaluated by the direct partial differentiation of U0Z with respect to Z as ( U0ZZ =

∂ U0Z ∂Z (

=

)∗

( =

{

∂ ∂Z

−Z tan−1

(

XZ YZ + − tan−1 X 2 + Z2 Y 2 + Z2

XY ZR (

)

XY ZR

})∗ + X ln(Y + R) +Y ln(X + R) ))∗

= − tan−1

(

XY ZR

) ,

(117)

where the first two terms in the last parentheses with an asterisk are omitted because they are independent on either Y or X, and therefore will disappear in the triple difference. Next, we regard UnZ as a product of U0Z and Z n as ) ] [ ( XY + X ln (Y + R) +Y ln (X + R) = Z nU0Z . UnZ = Z n −Z tan−1 ZR

(118)

Thus, its reduced derivative with respect to Z is computed as ( UnZZ ≡

∂ UnZ ∂Z

)∗

= Z nU0ZZ + nZ n−1U0Z

[ ( )] [ ( ) ] XY XY = Z n − tan−1 + nZ n−1 −Z tan−1 + X ln(Y + R) +Y ln(X + R) ZR ZR = −(n + 1)Z n tan−1

(

XY ZR

)

This expression of UnZZ is nothing but Eq. (55).

+ nZ n−1 [X ln(Y + R) +Y ln(X + R)] .

(119)

44

Toshio Fukushima

B.2 Other derivatives Let us move on to the other derivatives, namely UnX , UnY , UnXX , UnXY , and UnYY . For this purpose, we consider another line integral expression of Un by exchanging the order of three integrations as (∫

X

[∫

(∫

Y

Z

Un =

Z n dZ R

)

] )∗ (∫ dY dX =

X

[∫

Y

] )∗ Rn dY dX ,

(120)

where we used the definition of Rn , Eq. (96). This integral expression of Un immediately leads to the expression of UnXY as )∗ ( 2 ∂ Un UnXY = = Rn , (121) ∂ X∂Y which is the same as Eq. (51) in the main text. Next, in order to obtain the expression of UnX , we select yet another line integral expression of Un as (∫

X

[∫

Z

(∫

Y

Un =

dY R

)

] )∗ (∫ Z n dZ dX =

X

[∫

Z

] )∗ Z n ln(Y + R)dZ dX ,

(122)

where we used the integral formula, Eq. (79). This integral expression of Un results a line integral expression of UnX as ( ) (∫ Z )∗ ∂ Un ∗ = Z n ln(Y + R)dZ . (123) UnX = ∂X This integral has already appeared as the second term in the first line integral expression of Un , Eq. (84). Repeating the rewriting procedure by using the integration by part, we obtain its rewriting as (∫

Z

{

UnX =

∂ ∂Z

(

Z n+1 n+1

)}

)∗ ln(Y + R)dZ ( =

[( =

) ] Z (∫ Z n+1 1 ln(Y + R) − n+1 n+1

Z

Z n+2 dZ (Y + R)R

) Z n+1 En+2 (X,Y, Z) . ln(Y + R) − n+1 n+1

)∗

(124)

This is equivalent with Eq. (47) in the main text. Thirdly, noting the differential formula written as

∂ X [ln(Y + R)] = , ∂X (Y + R)R

(125)

we obtain an expression of UnXX by partially differentiating the integral expression of UnX , Eq. (123), as ( UnXX =

∂ UnX ∂X

)∗

(∫

Z

=

[ Zn

] )∗ (∫ ∂ {ln(Y + R)} dZ = ∂X

Z

XZ n dZ (Y + R)R

)∗ = XEn ,

(126)

where we used the integral definition of En given in Eq. (89). This expression of UnXX is the same as Eq. (50) in the main text. Finally, thanks to the symmetry of Un with respect to X and Y , we obtain UnY and UnYY from UnX and UnXX by interchanging X and En with Y and Dn as ( UnY =

) Z n+1 Dn+2 ln(X + R) − , UnYY = Y Dn , n+1 n+1

(127)

which are nothing but Eqs (48) and (53) in the main text, respectively.

C Fortran programs Here we present a group of Fortran programs to implement and test the algorithms presented in the main text. They are designed to be executed in the quadruple precision environment. One may obtain the double precision version by translating the quadruple precision constants into the corresponding double precision ones.

Recursive computation of gravitational field of vertically inhomogeneous prism Table 1 Fortran 90 program to test qrecv in the quadruple precision environment. program xqrecv implicit integer (i-n);implicit real*16 (a-h,o-z) parameter (PI=3.1415926535897932384626433832795q0);integer NMAX;parameter (NMAX=42) real*16 p(0:NMAX),c0(0:NMAX,0:NMAX),c1(0:NMAX,0:NMAX),c2(0:NMAX,0:NMAX) real*16 xt(10),yt(10) nn=31;p(0)=1.q0 do n=1,nn p(n)=-p(n-1)/qext(n) enddo call qpoly2c(nn,p,c0,c1,c2) x1=0.q0;x2=1.q0;y1=0.q0;y2=1.q0;z1=0.q0;z2=1.q0 xt(1)=0.25q0;yt(1)=0.6q0;xt(2)=x1;yt(2)=0.6q0;xt(3)=x2;yt(3)=0.6q0;xt(4)=0.25q0;yt(4)=y1 xt(5)=0.25q0;yt(5)=y2;xt(6)=x1;yt(6)=y1;xt(7)=x2;yt(7)=y1;xt(8)=x1;yt(8)=y2 xt(9)=x2;yt(9)=y2;xt(10)=1.5q0;yt(10)=2.q0;mend=6;z0=-1.q0;zn=2.q0;dz=(zn-z0)/qext(mend) do j=1,10 x=xt(j);y=yt(j) write (*,”(1p2e10.2)”) x,y do m=0,mend z=z0+qext(m)*dz call qrecv(nn,c0,c1,c2,x,y,z,x1,x2,y1,y2,z1,z2,v,gx,gy,gz,gxx,gyy,gzz,gxy,gxz,gyz) rho=-(gxx+gyy+gzz)/(4.q0*PI) if(x.lt.x1.or.x.gt.x2.or.y.lt.y1.or.y.gt.y2.or.z.lt.z1.or.z.gt.z2) then rho0=0.q0 else rho0=p(nn) do n=nn-1,0,-1 rho0=z*rho0+p(n) enddo if(x.eq.x1.or.x.eq.x2) then rho0=rho0*0.5q0 endif if(y.eq.y1.or.y.eq.y2) then rho0=rho0*0.5q0 endif if(z.eq.z1.or.z.eq.z2) then rho0=rho0*0.5q0 endif endif drho=rho-rho0 write (*,”(1p2e10.2)”) z,drho write (*,”(10x,1p2e42.34)”) v,gx write (*,”(10x,1p2e42.34)”) gy,gz write (*,”(10x,1p2e42.34)”) gxx,gxy write (*,”(10x,1p2e42.34)”) gxz,gyy write (*,”(10x,1p2e42.34)”) gyz,gzz enddo enddo stop end program xqrecv

45

46

Toshio Fukushima

Table 2 Sample values of gravitational quantities of an exponentially damped prism. Listed are a few sets of 35 digit numerical values of V through Γzz of a test cubic prism with the exponentially damped density profile, ρ (z) = exp(−z). The prism was located such that 0 ≤ x ≤ 1, 0 ≤ y ≤ 1, and 0 ≤ z ≤ 1. The values were computed by the program xqrecv when x = 1/4 and y = 3/5 and listed for a few values of z. z −0.5

0.5

1.5

quantity V gx gy gz Γxx Γxy Γxz Γyy Γyz Γzz V gx gy gz Γxx Γxy Γxz Γyy Γyz Γzz V gx gy gz Γxx Γxy Γxz Γyy Γyz Γzz

value +6.4916918757303878277585228080384722E−01 +1.4886938018603041579034061110593123E−01 −5.8804333327602655611072500822870862E−02 +6.2278916090142356238710883102127847E−01 −5.3058455444016566720185177694312266E−01 −3.1850367987199566052949906438991651E−02 +3.7269749162300175390685278950647717E−01 −5.7858270972591848145973191649888174E−01 −1.4337510355074039311936586325445953E−01 +1.1091672641660841486615836934420048E+00 +1.3963295849049128321457881428726551E+00 +6.8507661931768153885169101342291148E−01 −2.4053259128816168057919973055629797E−01 −4.4460295753052473828910231136450606E−01 −3.0512729298025545853371725654738694E+00 −1.9442920158463976122906900348807090E−01 −3.4184531403873605391149341011204211E−01 −2.4519624920636615059227822372120044E+00 +1.0731770708036020826412645973287012E−01 −2.1186536370545036563189692569126106E+00 +5.6397807542128029105535793378151563E−01 +1.0482948865122467651394932372483196E−01 −4.1571382761049266889747173154879042E−02 −4.8273151640938904975743897937500562E−01 −3.7691325292293133046668660910341019E−01 −1.9832693427050391010568510245771080E−02 −2.4636451323896293412437183918312322E−01 −4.0936671327708573019400836997317238E−01 +9.5821588885387681975199915126558495E−02 +7.8627996620001706066069497907658281E−01

Table 1 shows the main program to test the new formulation by evaluating all the gravitational quantities of an exponentially damped prism. In the double precision version, one should change nn as 18. This program prints out the 35 digits of the computed values of V , gx , gy , gz , Γxx , Γyy , Γzz , Γxy , Γxz , and Γyz along 10 vertical lines, namely (i) one line passing inside the prism, (ii) four lines including the vertical edges in their central parts, (iii) another four lines located on the side surfaces but not along the edges, and (iv) one line running outside the prism entirely. Also, the program outputs the density recovery error, drho, which are of the order of the quadruple precision machine epsilon. Table 2 presents a part of its outputs. The main program calls qpoly2c to transform the truncated Maclaurin series coefficients of the normalized density profile, ρ (z) = exp(−z) by using qpoly2c, a subroutine given in Table 3. The actual computation of V through Γzz is executed by qrecv listed in Tale 4. It is a subroutine to compute them by a weighted linear sum of Wn , the intermediate functions, and their partial derivatives, Wnx through Wnzz . The coefficients of the linear sum are prepared by qcpoly shown in Table 5. Also, Table 6 provides qrecw, a Fortran subroutine to compute Wn through Wnzz simultaneously by evaluating the triple difference of the potential functions Un , and their partial derivatives, UnX through UnZZ . On the other hand, all of Un through UnZZ are recursively calculated by qrecu presented in Table 7. It employs qarctan and qlogsum, a pair of Fortran functions to calculate atan3 and logsum listed in Tables 8 and 9, respectively. Notice that they are slightly modified in order to enhance the computational efficiency.

Recursive computation of gravitational field of vertically inhomogeneous prism

47

Table 3 Fortran 90 subroutine to transform ρn , the coefficients of the density polynomial, into cnm , c′nm , and c′′nm , the coefficient matrices. subroutine qpoly2c(nn,p,c0,c1,c2) implicit integer (i-n);implicit real*16 (a-h,o-z) parameter (NMAX=42);integer*8 ib(0:NMAX,0:NMAX) real*16 p(0:NMAX);c0(0:NMAX,0:NMAX),c1(0:NMAX,0:NMAX),c2(0:NMAX,0:NMAX) ib(0,0)=1;ib(1,0)=1;ib(1,1)=1 do n=2,NMAX ib(n,0)=1;ib(n,n)=1 do m=1,n-1 ib(n,m)=ib(n-1,m-1)+ib(n-1,m) enddo enddo do n=0,nn do m=0,nn-n c0(n,m)=qext(ib(n+m,n))*p(n+m) enddo do m=0,nn-n-1 c1(n,m)=qext(m+1)*qext(ib(n+m+1,n))*p(n+m+1) enddo do m=0,nn-n-2 c2(n,m)=qext((m+2)*(m+1))*qext(ib(n+m+2,n))*p(n+m+2) enddo enddo return;end

Table 4 Quadruple precision Fortran 90 subroutine to compute V by the recursive formulation. subroutine qrecv(nn,c0,c1,c2,x,y,z,x1,x2,y1,y2,z1,z2,v,gx,gy,gz,gxx,gyy,gzz,gxy,gxz,gyz) implicit integer (i-n); implicit real*16 (a-h,o-z); integer NMAX; parameter (NMAX=42) real*16 c0(0:NMAX,0:NMAX),c1(0:NMAX,0:NMAX),c2(0:NMAX,0:NMAX) real*16 cn(0:NMAX),cn1(0:NMAX),cn2(0:NMAX),wn(0:NMAX) real*16 wnx(0:NMAX),wny(0:NMAX),wnz(0:NMAX),wnxx(0:NMAX),wnyy(0:NMAX) real*16 wnzz(0:NMAX),wnxy(0:NMAX),wnxz(0:NMAX),wnyz(0:NMAX) call qcpoly(nn,c0,z,cn); call qcpoly(nn-1,c1,z,cn1); call qcpoly(nn-2,c2,z,cn2) call qrecw(nn,x,y,z,x1,x2,y1,y2,z1,z2,wn,wnx,wny,wnz,wnxx,wnyy,wnzz,wnxy,wnxz,wnyz) v=0.q0;gx=0.q0;gy=0.q0;gz=0.q0;gxx=0.q0;gxy=0.q0;gxz=0.q0;gyy=0.q0;gyz=0.q0;gzz=0.q0 do n=0,nn v=v+cn(n)*wn(n);gx=gx+cn(n)*wnx(n);gy=gy+cn(n)*wny(n) gz=gz+cn(n)*wnz(n)+cn1(n)*wn(n);gxx=gxx+cn(n)*wnxx(n);gxy=gxy+cn(n)*wnxy(n) gyy=gyy+cn(n)*wnyy(n);gxz=gxz+cn(n)*wnxz(n)+cn1(n)*wnx(n) gyz=gyz+cn(n)*wnyz(n)+cn1(n)*wny(n) gzz=gzz+cn(n)*wnzz(n)+2.q0*cn1(n)*wnz(n)+cn2(n)*wn(n) enddo return;end

References Anderson EG (1976) The effect of topography on solutions of Stokes’ problem. Unisurv S-14 Report, School of Surveying. University of New South Wales, Kensington Benedek J, Papp G, Kalmar J (2017) Generalization techniques to reduce the number of volume elements for terrain effect calculations in fully analytical gravitational modelling. J Geod DOI 10.1007/s00190017-1067-1 Bessel FW (1813) Auszug aus einen Schreien des Herrn Prof. Bessel. Monatl Corresp Bef Erd- und Himmels-Kunde, XXVII:80–85

48

Toshio Fukushima

Table 5 Fortran 90 subroutine to evaluate the coefficient polynomials, cn (z), c′n (z), or c′′n (z) from the corresponding coefficient polynomials, cnm , c′nm , or c′′nm . subroutine qcpoly(nn,c0,z,c) implicit integer (i-n);implicit real*16 (a-h,o-z) parameter (NMAX=42);real*16 c(0:NMAX);real*16 c0(0:NMAX,0:NMAX) do n=0,nn cn=0.d0 do m=nn-n,0,-1 cn=z*cn+c0(n,m) enddo c(n)=cn enddo return;end

Binney J, Tremaine S (2008) Galactic Dynamics, 2nd edn. Princeton Univ Press, Princeton, NJ Chai Y, Hinze WJ (1988) Gravity inversion of an interface above which the density contrast varies exponentially with depth. Geophys 53:837–845 Chakravarthi V, Raghuram HM, Singh SB (2002) 3-D forward gravity modeling of basement interfaces above which the density contrast varies continuously with depth. Comp Geosci 28:53–57 Chandrasekhar S (1969) Ellipsoidal Figures of Equilibrium. Yale Univ Press, Boston (reprinted 1987, Dover, New York) Chandrasekhar S (1995) Newton’s Principia for the Common Reader. Oxford Univ. Press, Oxford Conway JT (2015) Analytical solutions from vector potentials for the gravitational field of a general polyhedron. Celest Mech Dyn Astron 121:17–38 de Pater I, Lissauer JJ (2010) Planetary Sciences, 2nd edn. Cambridge Univ. Press, London Durand E (1953) Electrostatique et Magnetostatique. Masson et Cie, Paris D’Urso MG (2014) Analytical computation of gravity effects for polyhedral bodies. J Geod 88:13–29 D’Urso MG, Trotta S (2017) Gravity anomaly of polyhedral bodies having a polynomial density contrast. Surv Geophys 38:781–832 Fukushima T (2018) Accurate computation of gravitational field of a tesseroid. J Geod revised Garcia-Abdeslem J (1992) Gravitational attraction of a rectangular prism with depth-dependent density. Geophys 57:470–473 Garcia-Abdeslem J (2005) Gravitational attraction of a rectangular prism with density varying with depth following a cubic polynomial. Geophys 70:J39-J42 Hansen RO (1999) An analytical expression for the gravity field of a polyhedral body with linearly varying density. Geophys 64:75–77 Heck B, Seitz K (2007) A comparison of the tesseroid, prism and point-mass approaches for mass reductions in gravity field modelling. J Geod 81:121–136 Heiskanen WA, Moritz H (1967) Physical Geodesy. Freeman, San Francisco Holstein H (2003) Gravimagnetic anomaly formulas for polyhedra of spatially linear media. Geophys 68:157–167 Holstein H, Ketterridge B (1996) Gravimagnetic analysis of uniform polyhedral. Geophys 61:357–364 IEEE Comp Soc (2008) IEEE Standard for Floating-Point Arithmetic (IEEE Std 754-2008). IEEE, New York Jiang L, Zhang JZ, Feng ZB (2017) A versatile solution for the gravity anomaly of 3D prism-meshed bodies with depth-dependent density contrast. Geophys 82:G77–G86 Karcol R (2011) Gravitational attraction and potential of spherical shell with radially dependent density. Stud Geophys Geod 55:21–34 Kellogg OD (1929) Foundations of Potential Theory. Springer, Berlin Laplace PS (1799) Trait´e de M´ecanique C´eleste, Tome 1. Chez JBM Duprat, Paris Lass H (1950) Vector and Tensor Analysis. McGraw-Hill, New York MacMillan WD (1930) The theory of the potential. McGraw-Hill, New York Mollweide KB (1813) Aufl¨osung einiger die Anziehing von Linien Fl¨achen und K¨opern betreffenden Aufgaben unter denen auch die in der Monatl Corresp Bd XXIV. S. 522. vorgelegte sich findet. Monatl Corresp Bef Erd- und Himmels-Kunde, XXVII:26–38

Recursive computation of gravitational field of vertically inhomogeneous prism Table 6 Fortran 90 subroutine to compute Wn in the quadruple precision environment. subroutine qrecw(nn,x,y,z,x1,x2,y1,y2,z1,z2,wn,wnx,wny,wnz,wnxx,wnyy,wnzz,wnxy,wnxz,wnyz) implicit integer (i-n); implicit real*16 (a-h,o-z);real*16 wn(0:*),wnx(0:*),wny(0:*),wnz(0:*) real*16 wnxx(0:*),wnyy(0:*),wnzz(0:*),wnxy(0:*),wnxz(0:*),wnyz(0:*);parameter (NMAX=42) real*16 un(0:NMAX),unx(0:NMAX),uny(0:NMAX),unz(0:NMAX),unxx(0:NMAX) real*16 unyy(0:NMAX),unzz(0:NMAX);unxy(0:NMAX),unxz(0:NMAX),unyz(0:NMAX) call qrecu(nn,x2-x,y2-y,z2-z,wn,wnx,wny,wnz,wnxx,wnyy,wnzz,wnxy,wnxz,wnyz) call qrecu(nn,x2-x,y2-y,z1-z,un,unx,uny,unz,unxx,unyy,unzz,unxy,unxz,unyz) do n=0,nn wn(n)=wn(n)-un(n);wnx(n)=wnx(n)-unx(n);wny(n)=wny(n)-uny(n);wnz(n)=wnz(n)-unz(n) wnxx(n)=wnxx(n)-unxx(n);wnxy(n)=wnxy(n)-unxy(n);wnxz(n)=wnxz(n)-unxz(n) wnyy(n)=wnyy(n)-unyy(n);wnyz(n)=wnyz(n)-unyz(n);wnzz(n)=wnzz(n)-unzz(n) enddo call qrecu(nn,x2-x,y1-y,z2-z,un,unx,uny,unz,unxx,unyy,unzz,unxy,unxz,unyz) do n=0,nn wn(n)=wn(n)-un(n);wnx(n)=wnx(n)-unx(n);wny(n)=wny(n)-uny(n);wnz(n)=wnz(n)-unz(n) wnxx(n)=wnxx(n)-unxx(n);wnxy(n)=wnxy(n)-unxy(n);wnxz(n)=wnxz(n)-unxz(n) wnyy(n)=wnyy(n)-unyy(n);wnyz(n)=wnyz(n)-unyz(n);wnzz(n)=wnzz(n)-unzz(n) enddo call qrecu(nn,x2-x,y1-y,z1-z,un,unx,uny,unz,unxx,unyy,unzz,unxy,unxz,unyz) do n=0,nn wn(n)=wn(n)+un(n);wnx(n)=wnx(n)+unx(n);wny(n)=wny(n)+uny(n);wnz(n)=wnz(n)+unz(n) wnxx(n)=wnxx(n)+unxx(n);wnxy(n)=wnxy(n)+unxy(n);wnxz(n)=wnxz(n)+unxz(n) wnyy(n)=wnyy(n)+unyy(n);wnyz(n)=wnyz(n)+unyz(n);wnzz(n)=wnzz(n)+unzz(n) enddo call qrecu(nn,x1-x,y2-y,z2-z,un,unx,uny,unz,unxx,unyy,unzz,unxy,unxz,unyz) do n=0,nn wn(n)=wn(n)-un(n);wnx(n)=wnx(n)-unx(n);wny(n)=wny(n)-uny(n);wnz(n)=wnz(n)-unz(n) wnxx(n)=wnxx(n)-unxx(n);wnxy(n)=wnxy(n)-unxy(n);wnxz(n)=wnxz(n)-unxz(n) wnyy(n)=wnyy(n)-unyy(n);wnyz(n)=wnyz(n)-unyz(n);wnzz(n)=wnzz(n)-unzz(n) enddo call qrecu(nn,x1-x,y2-y,z1-z,un,unx,uny,unz,unxx,unyy,unzz,unxy,unxz,unyz) do n=0,nn wn(n)=wn(n)+un(n);wnx(n)=wnx(n)+unx(n);wny(n)=wny(n)+uny(n);wnz(n)=wnz(n)+unz(n) wnxx(n)=wnxx(n)+unxx(n);wnxy(n)=wnxy(n)+unxy(n);wnxz(n)=wnxz(n)+unxz(n) wnyy(n)=wnyy(n)+unyy(n);wnyz(n)=wnyz(n)+unyz(n);wnzz(n)=wnzz(n)+unzz(n) enddo call qrecu(nn,x1-x,y1-y,z2-z,un,unx,uny,unz,unxx,unyy,unzz,unxy,unxz,unyz) do n=0,nn wn(n)=wn(n)+un(n);wnx(n)=wnx(n)+unx(n);wny(n)=wny(n)+uny(n);wnz(n)=wnz(n)+unz(n) wnxx(n)=wnxx(n)+unxx(n);wnxy(n)=wnxy(n)+unxy(n);wnxz(n)=wnxz(n)+unxz(n) wnyy(n)=wnyy(n)+unyy(n);wnyz(n)=wnyz(n)+unyz(n);wnzz(n)=wnzz(n)+unzz(n) enddo call qrecu(nn,x1-x,y1-y,z1-z,un,unx,uny,unz,unxx,unyy,unzz,unxy,unxz,unyz) do n=0,nn wn(n)=wn(n)-un(n);wnx(n)=wnx(n)-unx(n);wny(n)=wny(n)-uny(n);wnz(n)=wnz(n)-unz(n) wnxx(n)=wnxx(n)-unxx(n);wnxy(n)=wnxy(n)-unxy(n);wnxz(n)=wnxz(n)-unxz(n) wnyy(n)=wnyy(n)-unyy(n);wnyz(n)=wnyz(n)-unyz(n);wnzz(n)=wnzz(n)-unzz(n) enddo do n=0,nn wnx(n)=-wnx(n);wny(n)=-wny(n);wnz(n)=-wnz(n) enddo return;end

49

50

Toshio Fukushima

Table 7 Fortran 90 subroutine to compute Un in the quadruple precision environment. subroutine qrecu(nn,x,y,z,un,unx,uny,unz,unxx,unyy,unzz,unxy,unxz,unyz) implicit integer (i-n); implicit real*16 (a-h,o-z) real*16 TINY; parameter (TINY=1.q-150); integer NMAX; parameter (NMAX=42) real*16 zn(0:NMAX),dn(NMAX),en(NMAX),rn(NMAX),un(0:*),unx(0:*),uny(0:*),unz(0:*) real*16 unxx(0:*),unyy(0:*),unzz(0:*),unxy(0:*),unxz(0:*),unyz(0:*) xsq=x*x;ysq=y*y;s=xsq+ysq;zsq=z*z;r=sqrt(s+zsq+TINY) a=qarctan(x,y,z,r);b=qarctan(y,z,x,r);c=qarctan(z,x,y,r) d=qlogsum(x,y,z,r);e=qlogsum(y,z,x,r);f=qlogsum(z,x,y,r) h=y*d+x*e;zn(0)=1.q0;zn(1)=z;rn(1)=r;dn(1)=d;en(1)=e zn(2)=zsq;rn(2)=(z*r-s*f)*0.5q0;dn(2)=y*b-x*f;en(2)=x*a-y*f un(0)=-0.5q0*(xsq*a+ysq*b+zsq*c)+z*h+x*y*f;unx(0)=z*e-en(2);uny(0)=z*d-dn(2);unz(0)=-z*c+h unxx(0)=-a;unyy(0)=-b;unzz(0)=-c;unxy(0)=f;unxz(0)=e;unyz(0)=d fn=1.q0;fn1=2.q0;fn1inv=0.5q0 do n=1,nn fn2=qext(n+2);fn2inv=1.q0/fn2 zn(n+2)=zn(n+1)*z;rn(n+2)=(zn(n+1)*r-fn1*s*rn(n))*fn2inv dn(n+2)=-ysq*dn(n)-x*rn(n);en(n+2)=-xsq*en(n)-y*rn(n) un(n)=-zn(n+2)*fn2inv*c+zn(n+1)*fn1inv*h-(x*en(n+2)+y*dn(n+2))*(fn1inv*fn2inv) unx(n)=(zn(n+1)*e-en(n+2))*fn1inv;uny(n)=(zn(n+1)*d-dn(n+2))*fn1inv unz(n)=-zn(n+1)*c+zn(n)*h;unxx(n)=x*en(n);unyy(n)=y*dn(n) unzz(n)=-fn1*zn(n)*c+fn*zn(n-1)*h;unxy(n)=rn(n);unxz(n)=zn(n)*e;unyz(n)=zn(n)*d fn=fn1;fn1=fn2;fn1inv=fn2inv enddo return;end Table 8 Quadruple precision Fortran 90 function to return the special arctangent function, atan3(x, y, z). In √ order to reduce the number of the square root evaluations, we modify the function to use r ≡ x2 + y2 + z2 as an additional input argument. real*16 function qarctan(x,y,z,r) real*16 x,y,z,r if(abs(x*r).gt.0.q0) then qarctan=atan(y*z/(x*r)) else qarctan=0.q0 endif return;end Table 9 Quadruple precision Fortran 90 function to return the special √logarithm function, logsum(x, y, z). Again, in order to reduce the square root computations, we added r ≡ x2 + y2 + z2 to the input arguments. real*16 function qlogsum(x,y,z,r) real*16 x,y,z,r,TINY; parameter (TINY=1.q-150) if(x.gt.0.q0) then qlogsum=log(x+r) elseif(x.lt.0.q0) then qlogsum=log((y*y+z*z+TINY)/(-x+r)) else qlogsum=0.5q0*log(y*y+z*z+TINY) endif return;end

Recursive computation of gravitational field of vertically inhomogeneous prism

51

Nagy D, Papp G, Benedek J (2000) The gravitational potential and its derivatives for the prism. J Geod 74:552–560 Pohanka V (1998) Optimum expression for computation of the gravity field of a polyhedral body with linearly varying density. Geophys Prosp 46:391–404 Rao CV, Raju ML, Chakravarthi V (1995) Gravity modeling of an interface above which the density contrast decreases hyperbolically with depth. J Appl Geophys 34:63–67 Rao DB (1985) Analysis of gravity anomalies over an inclined fault with quadratic density function. Pure Appl Geophys 123:250–260 Rao DB, Prakash MJ, Babu NR (1990) 3D and 2.5D modelling of gravity anomalies with variable density contrast. Geophys Prosp 38:411–422 Ren ZY, Chen CJ, Pan K, Kalscheuer T, Maurer H, Tang JT (2017) Gravity anomalies of arbitrary 3D polyhedral bodies with horizontal and vertical mass contrasts. Surv Geophys 38:479–502 Smith B, Sandwell D (2003) Accuracy and resolution of shuttle radar topography mission data. Geophys Res Lett 32:L21S01 Stacey FD, Davis PM (2008) Physics of the Earth, 4th ed. Cambridge Univ Press, Cambridge Tachikawa T, Hato M, Kaku M, Iwasaki A (2011) Characteristics of ASTER GDEM version 2. Proc IEEE Intl Geosci Remote Sensing Symp 2011:3657–3660 Tsoulis D, Petrovic S (2001) On the singularities of the gravity field of a homogeneous polyhedral body. Geophys 66:535–539 Waldvogel J (1979) The Newtonian potential of uniform polyhedra. Zeitschr Angew Math Physik (ZAMP) 30:388–398 Wild-Pfeiffer F (2008) A comparison of different mass elements for use in gravity gradiometry. J Geod 82:637–653 Wolfram S (2003) The Mathematica Book, 5th ed., Wolfram Research Inc/Cambridge Univ Press, Cambridge Zhang JZ, Jiang L (2017) Analytical expressions for the gravitational vector field of a 3-D rectangular prism with density varying as an arbitrary-order polynomial function. Geophys J Int 210:1176–1190

Suggest Documents