Numerical integration of gravitational field for general

0 downloads 0 Views 2MB Size Report
Sep 8, 2016 - Key words: celestial mechanics – galaxies: spiral – gravitation – methods: numerical – protoplanetary ... a fundamental problem in astronomy from the days of Newton. (Chandrasekhar ...... the central ellipse (Danby 1988).
MNRAS 000, 1–23 (2016)

Preprint 8 September 2016

Compiled using MNRAS LATEX style file v3.0

Numerical integration of gravitational field for general infinitely thin objects on flat plane Toshio Fukushima1⋆ 1

National Astronomical Observatory of Japan, Ohsawa, Mitaka, Tokyo 181-8588, Japan

Accepted. Received; in original form

ABSTRACT

We developed a method to integrate the gravitational field for general infinitely thin objects on a flat plane. By adopting the planar polar coordinates centered at the foot of the evaluation point on the plane as the integration variables, we numerically evaluate the surface integral representation of the gravitational potential and of the associated acceleration vector by the double exponential quadrature rule. When the object is finitely bounded, effective are (i) counting the angular variable from the boundary point, (ii) rewriting the small divisors into a cancellation-free form, and (iii) splitting the radial integral at the point when the angular integral does not cover the whole period, [0, 2π]. If the object is homogenous, the angular integral can be analytically evaluated, and therefore, the whole integration process reduces to be one-dimensional. Comparison with the exact solutions confirmed the 11–15 digit accuracy of the potential and acceleration integration for (i) the finite uniform circular disc, (ii) the infinitely flattened homoeoidal shell, (iii) the Maclaurin disc, (iv) the so-called D2 disc, and (v) the Kuzmin disc. As a practical example, we present the gravitational field of an elliptic annular disc resembling the protoplanetary disc around HD 142527. Prominent are not only the acceleration component across the central ellipse but also those along it toward the figure center. Key words: celestial mechanics – galaxies: spiral – gravitation – methods: numerical – protoplanetary discs

1 INTRODUCTION The computation of the gravitational field of a general object is a fundamental problem in astronomy from the days of Newton (Chandrasekhar 1995). Recently, we developed a definitive method to evaluate the gravitational potential and the associated gravitational acceleration vector of a general three-dimensional object at an arbitrary point whether located inside or outside the object (Fukushima 2016e). It employs the numerical quadrature of the volume integral expressions of the potential and acceleration vector by adopting the spherical polar coordinates centered at the evaluation point as the integration variables. However, we must admit that the volume integration is a timeconsuming process (Fukushima 2016e, table 1). If a surface integration is sufficient instead, such as in the study of infinitely thin objects, the gravitational field computation would be significantly accelerated. Ironically, it is not possible to apply the above method for general three-dimensional objects to infinitely thin objects directly. This is because the method is constructed under the assumption that the object has a finite thickness. Meanwhile, the gravitational field computation of infinitely thin objects itself has been a difficult problem (Fukushima 2016b, ⋆

E-mail: [email protected]

© 2016 The Authors

section 1). As for the axisymmetric case, an efficient numerical method was developed (i) by utilizing a superposition of the ring potential expressions and (ii) by numerically differentiating the numerically integrated potential (Fukushima 2016a). It was recently extended to the three-dimensional objects with axial symmetry (Fukushima 2016d). A similar method is also developed for the electrostatic and the magnetostatic field for general three-dimensional axisymmetric distribution of electric charge and/or electric current (Fukushima 2016f). Nevertheless, these methods have no power for treating general infinitely thin objects like an asymmetric protoplanetary disc observed at HD 142527 (Fukagawa et al. 2013). As for asymmetric and infinitely thin objects, once a mosaic tile model was developed to compute the gravitational field approximately (Fukushima 2016b). However, it is a quick and low-precision device suitable to a special case when the surface mass density is given as a set of grid data. It lacks the rigors and is not applicable to infinitely extended objects. Therefore, we newly developed a variation of the method for general three-dimensional objects (Fukushima 2016e) so as to be applied to general two-dimensional objects on a flat plane. Refer to Figs 1 and 2 showing the normalized errors of the gravitational potential and the associated acceleration vector of the Kuzmin disc (Kuzmin 1956) obtained by the new method. The analytical solutions of the surface mass density, the gravitational

2

T. Fukushima

Integration Error of Φ: Kuzmin Disc

Integration Error of F: Kuzmin Disc

-14.5

-15 a=1, δ=10-15

a=1, δ=10-15

log10 |δF|

log10 |δΦ|

-15

-15.5

-15.5

-16 -16

-16.5

-16.5 0

1

2

3

4

5

6

7

8

9

10

r Figure 1. Integration error of gravitational potential of Kuzmin disc. Displayed are the normalized integration errors of the gravitational potential of the Kuzmin disc (Kuzmin 1956) of the unit scale radius, namely when a = 1, for the range 0 ≤ r ≤ 10. The integration was conducted in the IEEE 754 double precision environment by the double exponential quadrature rule (Takahashi and Mori 1973) with a relative error tolerance as tiny as δ = 10−15 . The errors are measured as the difference from the quadruple precision computation of the exact analytical solution described in Appendix A and normalized by the maximum potential value, Φmax , which is realized at the disc center. Overlapped are the errors when the evaluation points are moved√along two different directions: (i) on the object plane where x = y =√r / 2 and z = 0, and (ii) off the object plane where x = y = z = r / 3. The former results are marked by filled circles while the latter ones are indicated by x-marks. They are illustrated simultaneously since there are no significant differences between their distributions.

potential, and the gravitational acceleration of the disc are provided in Appendix A. The accuracy of the integrated potential and acceleration amounts to 15 digits in this specific case. They are far more enough than necessary for the purposes of the gravitational studies of infinitely thin objects such as the thin disc components of lenticular and spiral galaxies as well as the protoplanetary discs. In this article, we (i) explain the new method in Section 2, (ii) examine its computational accuracy and cost in Section 3, and (iii) present a practical example in Section 4.

2 METHOD Below, we describe the main part of the new method to integrate the gravitational potential and the associated acceleration vector of general two-dimensional objects on a flat plane. Refer to Appendices B and C for (i) the further discussion on the integration of the acceleration vector on the object plane, and (ii) the practical hints on the computational procedures, respectively.

2.1

Integration of gravitational potential

Consider the Newtonian gravitational field of a general twodimensional object located on a flat plane. Adopt a rectangular coordinate system such that the flat plane becomes the x-y plane. Without losing the generality, we may assume that the object is

0

1

2

3

4

5

6

7

8

9

10

r Figure 2. Integration error of gravitational acceleration of Kuzmin disc. Same as Fig. 1 but for the components of the gravitational acceleration vector. This time, the errors are normalized by the maximum magnitude of the acceleration, Fmax . Different marks are used in displaying the components: (i) x-marks for the radial components off the object plane, F x and Fy when z > 0, (ii) open circles for the vertical components off the object plane, Fz when z > 0, and (iii) filled circles for the radial components on the object plane, F x or Fy when z = 0. The normalized errors are below the IEEE 754 double precision machine epsilon level if the distance is sufficiently large, say when r > 4a.

infinitely extended on the plane by including the case of the zero value of its surface mass density distribution. More specifically speaking, we pose that (i-a) the object is infinitely extended so as to cover the whole x-y plane, or (i-b) it is semi-infinitely extended or finitely bounded with an open or a closed boundary curve being countably piecewise continuous, namely being continuous with a finite number of non-analytic points on the curve, (ii) the surface mass density is analytic inside the object, and (iii) the object is simply connected. The last two conditions are not so restrictive as they appear. This is because, if the object contains a non-analytic or discontinuous internal boundaries, or if the object is multiply connected, then one may split the object into multiple layers each of which satisfy the above conditions. Denote (i) by P an arbitrary point in the three-dimensional space, and by (x, y, z) its three-dimensional position vector, (ii) by H the foot of P on the x–y plane such that (x, y) becomes its twodimensional position vector, (iii) by Q an arbitrary point on the ( ) plane, and by x ′, y ′ its two-dimensional position vector, and (iv) ( ′ ′) by Σ x , y the surface mass density of the object at Q including ( ) the possibilities that Σ x ′, y ′ = 0. Then, the standard integral expression of Φ(x, y, z), the gravitational potential of the object evaluated at P, is written (Kellogg 1929) as ∫ ∫ ( ) Σ x ′, y ′ Φ(x, y, z) = −G ( ′ ′ ) dx ′ dy ′, (1) q x , y ; x, y, z where G is Newton’s constant of universal attraction and ( ) q x ′, y ′ ; x, y, z is the mutual distance between P and Q defined as √ ( ) ( ) q x ′, y ′ ; x, y, z ≡ (x ′ − x) 2 + y ′ − y 2 + z 2 . (2) By (i) noting the assumption that the surface mass density is analytic MNRAS 000, 1–23 (2016)

Gravitational field of infinitely thin object ( ) inside the object where Σ x ′, y ′ > 0, and (ii) following the recipe in the three-dimensional case (Fukushima 2016e), we transform ( ) the integration variables from x ′, y ′ to (p, θ), the planar polar coordinates centered at H, the foot of P on the object plane, so as to satisfy the relations as x ′ = x + p cos θ, y ′ = y + p sin θ.

(3)

Then, the integral expression of Φ(x, y, z) is rewritten as ∫ ∞ ( ) Φ x, y, z = −2πG SA (p; x, y)(p/q)dp,

(4)

where q is now rewritten as √ q = p2 + z 2,

(5)

0

and SA (p; x, y) is defined as ∫ 2π 1 SA (p; x, y) ≡ Σ(x + p cos θ, y + p sin θ)dθ. 2π 0

(6)

It is nothing but the averaged surface mass density along a circle of radius p centered at H. Notice that Σ(x + p cos θ, y + p sin θ) may vanish at some segments in the integration interval, [0, 2π]. Therefore, lim p→0 SA (p; x, y) is not equal to Σ(x, y) in general. At any rate, if z = 0, then the expression of Φ is simplified as ∫ ∞ ( ) ( ) Φ∗ x, y ≡ Φ x, y, 0 = −2πG SA (p; x, y)dp. (7) 0

Now, except the singularities of Σ(x, y) itself, there are no singularity in the integrand of these integrals, equations (4), (6), and (7). The integrable singularities caused by Σ(x, y) can be, even if they are blowing up, properly handled by appropriate integration methods like the double exponential (DE) quadrature rules (Takahashi and Mori 1973) plus some devices described in Appendix C. Therefore, the quadrature of these integrals faces no numerical difficulty as will be confirmed in Section 3 later. 2.2

where SC (p; x, y) and SS (p; x, y) are defined as ∫ 2π 1 SC (p; x, y) ≡ Σ(x + p cos θ, y + p sin θ) cos θdθ, 2π 0

SS (p; x, y) ≡

1 2π

∫ 2π 0

Σ(x + p cos θ, y + p sin θ) sin θdθ.

3

(14)

(15)

while q and SA (p; x, y) are already introduced in equations (5) and (6), respectively. Notice that SC (p; x, y) and SS (p; x, y) are the lowest order coefficients of the Fourier expansion of the surface mass density along the circle of radius p centered at H. Neither SC (p; x, y) nor SS (p; x, y) is assured to vanish when p → 0 because of the possible discontinuities of Σ(x, y). As long as z , 0, the divisor q3 remains to be finite. Thus, except the singularities originated from the surface mass density itself, nonsingular is the integrand of the newly derived integral forms, equations (11)–(15). Again, the integrable singularities due to Σ(x, y) may be properly handled by the DE quadrature rule or other appropriate integration methods. Therefore, we anticipate that these integrals can be numerically integrated without difficulties. On the other hand, when z = 0, we need additional conditions to guarantee that the integrals in equations (11)–(13) are correctly computable. Refer to Appendix B for the detailed discussion. Summarizing these considerations, we arrive at the following conclusion: (i) if z , 0, then Fx (x, y, z), Fy (x, y, z), and Fz (x, y, z) are numerically computable without difficulties by evaluating their integral forms written in equations (11)–(13), respectively, (ii) else if the evaluation point, (x, y, 0), is not exactly on the boundary curve of the object, then Fx∗ (x, y) ≡ limz→0 Fx (x, y, z) and Fy∗ (x, y) ≡ limz→0 Fy (x, y, z) are similarly computable by numerically integrating their expressions given in equations (B19) and (B20) in Appendix B, respectively, while Fz∗ (x, y) ≡ limz→0±0 Fz (x, y, z) becomes indeterminate and (iii) else all of Fx∗ (x, y), Fy∗ (x, y), and Fz∗ (x, y) are indefinite on the boundary curve of the object.

Integration of acceleration vector

We move to the associated gravitational acceleration vector, ( )T F(x, y, z) ≡ Fx (x, y, z), Fy (x, y, z), Fz (x, y, z) . Its original integral expressions (Kellogg 1929) are written as ∫ ∫ ( )( ) Σ x ′, y ′ x ′ − x ′ ′ Fx (x, y, z) ≡ −G (8) [ ( ′ ′ ) ] dx dy , q x , y ; x, y, z 3 ∫ ∫

( )( ) Σ x ′, y ′ y ′ − y ′ ′ [ ( ′ ′ ) ] dx dy , q x , y ; x, y, z 3

Fy (x, y, z) ≡ −G ∫ ∫

( ) Σ x ′, y ′ z ′ ′ [ ( ′ ′ )] dx dy , q x , y ; x, y, z 3

Fz (x, y, z) ≡ G

(9)

(10)

( ) where q x ′, y ′ ; x, y, z is already defined in equation (5). Assuming the same conditions posed in the previous subsection, we obtained a similar rewriting of these expressions as ∫ ∞ ( ) ( ) Fx x, y, z = −2πG SC (p; x, y) p2 /q3 dp, (11) 0

( ) Fy x, y, z = −2πG (

)

Fz x, y, z = 2πG

∫ ∞ 0

∫ ∞ 0

MNRAS 000, 1–23 (2016)

) ( SS (p; x, y) p2 /q3 dp,

( ) SA (p; x, y) zp/q3 dp,

(12)

(13)

3 NUMERICAL EXPERIMENTS Let us examine the computational accuracy and cost of the new method. We begin with measuring the computational errors of the new method by comparing its results with the reference analytical solutions. As such reference solutions, we selected those of the following five axisymmetric circular discs of different radial density distributions: (i) the finite uniform disc (Durand 1953), { ΣC (R < a) ΣU (R) ≡ (16) 0 (R ≥ a) (ii) the infinitely flattened homoeoidal shell (Cuddeford 1993), which we simply call the homoeoid disc, √ { ΣC / 1 − (R/a) 2 (R < a) ΣH (R) ≡ (17) 0 (R ≥ a) (iii) the Maclaurin disc (Kalnajs 1972), √ { ΣC 1 − (R/a) 2 (R < a) ΣM (R) ≡ 0 (R ≥ a) (iv) the so-called D2 disc (Schulz 2009), (√ )   ΣC 1 − (R/a) 2 3 (R < a) ΣD (R) ≡   0 (R ≥ a) 

(18)

(19)

4

T. Fukushima

Radial Density Profile of Test Objects

Radial Acceleration Profile of Test Objects: z=0 2

1.4 Homoeoid

Homoeoid

1.2 FR(R,0)/|F0|

Σ(R)/Σc

Maclaurin

0.8 0.6

-4

0.4

Maclaurin

-6

D2

D2 Kuzmin

-2

Uniform

1

Homoeoid

0

Uniform

-8 Kuzmin

0.2

-10

0

-12 0

0.2 0.4 0.6 0.8

1

1.2 1.4 1.6 1.8

2

0

0.2 0.4 0.6 0.8

R

2

Vertical Acceleration Profile of Test Objects: x = y = z 1 0 Fz(x,y,z)/|F0|

Radial Potential Profile of Test Objects: z=0 0 -2 -4

1.2 1.4 1.6 1.8

Figure 5. Radial acceleration profile of test objects on object plane. Same as Fig. 3 but for the normalized radial component of the gravitational acceleration. Again, the curves of the finite discs are not analytic at the disc edge, namely when R = 1. In fact, those of the uniform and homoeoid discs are blowing up there.

Maclaurin

-1 -2 -3 -4

Homoeoid Uniform

-6

Maclaurin

Kuzmin

D2

-5

Kuzmin

D2

1 R

Figure 3. Radial density profile of test objects. Shown are the normalized surface mass density of five test objects: (i) the uniform disc of the unit radius, (ii) the infinitely flattened homoeoid disc of the unit radius, (iii) the Maclaurin disc of the unit radius, (iv) the so-called D2 disc of the unit radius, and (v) the Kuzmin disc of the unit scale radius. They are plotted √ as functions of R ≡ x 2 + y 2 , the distance from the axisymmetric axis. The thick solid curves show those of the uniform and D 2 discs, the broken one displays the Kuzmin disc, and the thin solid ones indicate those of the homoeoid and Maclaurin discs, respectively. The surface mass density of the first four objects (i) vanish outside the discs, namely when R > 1, and (ii) are not analytic at the edge of the discs, R = 1. Indeed, that of the uniform disc is discontinuous at its edge. Also, the homoeoid disc has a blow-up but integrable singularity at its edge.

Φ(R,0)/|Φ0|

Homoeoid

-7 -6

0

Uniform

0.2 0.4 0.6 0.8

1

1.2 1.4 1.6 1.8

2

r -8 Homoeoid

-10 -12 0

0.2 0.4 0.6 0.8

1

1.2 1.4 1.6 1.8

2

Figure 6. Vertical acceleration profile of test objects off object plane. Same as Fig. 5 but for the normalized vertical√component of the gravitational acceleration in the case x = y = z = r / 3. Although hardly seen at this scale, the curves of the finite discs are√not analytic above the disc edge, namely when R = 1, and therefore r = 3/2 ≈ 1.22.

R Figure 4. Radial potential profile of test objects on object plane. Same as Fig. 3 but for the normalized gravitational potential evaluated on the object plane. Notice that the curves of the finite discs are not analytic at the disc edge, namely when R = 1.

and (v) the Kuzmin disc (Kuzmin 1956), ΣC ΣK (R) ≡ (√ )3 . 1 + (R/a) 2

(20)

Refer to Appendix A for the analytical expression of the gravitational potential and the associated acceleration vector of these objects. The first four objects are finite, namely of the radius a. Meanwhile, the last example is infinitely extended but the total mass remains to be finite. Refer to Figs 3–6 comparing, for these five MNRAS 000, 1–23 (2016)

Gravitational field of infinitely thin object

Integration Error of Φ: Uniform Disc -15

Integration Error of Φ: Maclaurin Disc -13

-15

a=1, δ=10

a=1, δ=10-15

-13.5 -14

-15.5

log10 |δΦ|

log10 |δΦ|

5

-16

-14.5 -15 -15.5 -16

-16.5

-16.5 0

0.2 0.4 0.6 0.8

1

1.2 1.4 1.6 1.8

2

0

0.2 0.4 0.6 0.8

r

1

Figure 7. Integration error of gravitational potential of uniform disc. Same as Fig. 1 but for the uniform disc of the unit radius (Durand 1953) plotted in the range 0 ≤ r ≤ 2.

Integration Error of Φ: D2 Disc -13.5

a=1, δ=10

-13 a=1, δ=10

-15

-15

-14 log10 |δΦ|

-14 log10 |δΦ|

2

Figure 9. Integration error of gravitational potential of uniform disc. Same as Fig. 7 but for the Maclaurin disc of the unit radius (Kalnajs 1972).

Integration Error of Φ: Homoeoid Disc

-13.5

1.2 1.4 1.6 1.8

r

-14.5 -15

-14.5 -15 -15.5

-15.5

-16

-16 -16.5 0

-16.5 0

0.2 0.4 0.6 0.8

1

1.2 1.4 1.6 1.8

2

0.2 0.4 0.6 0.8

1

1.2 1.4 1.6 1.8

2

r

r Figure 8. Integration error of gravitational potential of homoeoid disc. Same as Fig. 7 but for the homoeoid disc of the unit radius (Cuddeford 1993).

test objects, (i) the radial profile of the surface mass density, (ii) the radial profile of the gravitational potential on the object plane, (iii) the radial profile of the radial component of the gravitational acceleration vector on the object plane, and (iv) the profile of the vertical component of the gravitational acceleration vector off the object plane, respectively.

MNRAS 000, 1–23 (2016)

Figure 10. Integration error of gravitational potential of D 2 disc. Same as Fig. 7 but for the so-called D 2 disc of the unit radius (Schulz 2009).

6

T. Fukushima

Integration Error of F: Uniform Disc

Integration Error of F: Homoeoid Disc, z > 0

-14

-13.5 a=1, δ=10

-14 log10 |δF|

-14.5 log10 |δF|

a=1, δ=10-15

-15

-15 -15.5

-14.5 -15 -15.5

-16

-16

-16.5

-16.5 0

0.2 0.4 0.6 0.8

1

1.2 1.4 1.6 1.8

2

0

0.2 0.4 0.6 0.8

r

1

1.2 1.4 1.6 1.8

2

r

Figure 11. Integration error of gravitational acceleration of uniform disc. Same as Fig. 2 but for the uniform disc of the unit radius plotted in the range, 0 ≤ r ≤ 2. This time, the errors are normalized by the larger value of (i) the acceleration magnitude, F ≡ |F |, at the disc center, and (ii) F at the evaluation point. This is because F on the disc blows up infinity when approaching to the disc edge.

Figure 13. Integration error of gravitational acceleration vector components of homoeoid disc, z > 0. Same as Fig. 12 but when z > 0.

Integration Error of F: Maclaurin Disc -14 a=1, δ=10-15 -14.5

log10 |δF|

-11 -11.5 -12 -12.5 -13 -13.5 -14 -14.5 -15 -15.5 -16 -16.5

log10 |δF|

Integration Error of F: Homoeoid Disc, z = 0 a=1, δ=10-15

-15 -15.5 -16 -16.5 0

0.2 0.4 0.6 0.8

1

1.2 1.4 1.6 1.8

2

r

0

0.2 0.4 0.6 0.8

1

1.2 1.4 1.6 1.8

2

Figure 14. Integration error of gravitational acceleration of Maclaurin disc. Same as Fig. 11 but for the Maclaurin disc.

r Figure 12. Integration error of radial gravitational acceleration vector component of homoeoid disc, z = 0. Same as Fig. 11 but for the homoeoid disc when z = 0.

For these test objects, we integrated the gravitational potential and the associated acceleration vector numerically, and compared them with the analytical solutions. The results for the Kuzmin disc are already shown in Figs 1 and 2. Refer to Figs 7–10 illustrating δΦ(x, y, z), the normalized errors of the integrated gravitational potential, of the four finite test objects, respectively. Also, Figs 11–15 show δFx (x, y, z), δFy (x, y, z), and/or δFz (x, y, z), the normalized errors of the acceleration vector components of the four finite ob-

jects. Here the errors are defined as ( ) δΦ(x, y, z) ≡ Φintegrated (x, y, z) − Φexact (x, y, z) /Φ0,

(21)

( ) δFx (x, y, z) ≡ Fx,integrated (x, y, z) − Fx,exact (x, y, z) /F0,

(22)

( ) δFy (x, y, z) ≡ Fy,integrated (x, y, z) − Fy,exact (x, y, z) /F0,

(23)

( ) δFz (x, y, z) ≡ Fz,integrated (x, y, z) − Fz,exact (x, y, z) /F0,

(24)

where Φ0 and F0 are the nominal values of Φ(x, y, z) and |F(x, y, z)|, respectively. We set the nominal values as the maximum values MNRAS 000, 1–23 (2016)

Gravitational field of infinitely thin object

Integration Cost: Φ, z > 0

Integration Error of F: D2 Disc -14.5 a=1, δ=10-15

log10 Neval

log10 |δF|

-15

-15.5

-16

-16.5 0

0.2 0.4 0.6 0.8

1

1.2 1.4 1.6 1.8

2

r Figure 15. Integration error of gravitational acceleration of D2 disc. Same as Fig. 11 but for the D 2 disc.

if they exist. However, the magnitude of the radial acceleration components of the uniform and homoeoid discs on the disc plane brows up infinitely when approaching to the edge of the disc. Thus, in these cases, we chose as F0 the larger value of either (i) 2πGΣC or (ii) |F(x, y, z)|. At any rate, in measuring the integration errors, we moved the test evaluation point, (x, y, z), along two non-trivial √ directions (i)√ x = y = z = r/ 3 when off the x-y plane, and (ii) x = √y = r/ 2 and z = 0 when on the x-y plane, while changing

x2 + y2 + z2 . The errors depicted in Figs 1 and 2 have already illustrated that the new method is of the 15 digits accuracy if the surface mass density of the object is sufficiently smooth. On the other hand, for the finite objects other than the homoeoid disc, the accuracy of the new method mainly ranges from 14 to 15 digits as seen in Figs 7, 9–11, 14, and 15. As for the homoeoid disc, however, the accuracy of the gravitational potential and the acceleration vector off the disc plane becomes 13 digits near the disc center as shown in Figs 8 and 13. Also, Fig. 12 indicates that the errors of the radial acceleration components on the disc plane increase when approaching to the disc edge from the inside such that the accuracy degrades down to 11 digits. Let us move to the aspect of the computational cost. Fig. 16 plots Neval , the total number of the integrand evaluations needed in integrating the gravitational potential, when z > 0. The figure compares the computational labor of the five test objects as well as the elliptic annular disc, which will be introduced in the next section. Depending on the complexity of the surface mass density profile, the averaged value of Neval roughly spans from 100 to 106 . We omit the results for the acceleration computation because we observed that Neval per component is mostly independent whether the integral is for the potential or any component of the acceleration vector. Namely, a rough estimate of Neval of the acceleration vector is obtained by multiplying the factor of 2 or 3 depending on the number of non-zero components. For example, the preparation of all three components of the acceleration vector off the plane of the elliptic annular disc demands 3 × 105.8 ≈ 2 × 106 evaluations of the integrand at each point of the evaluation if required is an ultimate computational precision, say the 15 digits accuracy.

r≡

MNRAS 000, 1–23 (2016)

7

6.5 6 5.5 5 4.5 4 3.5 3 2.5 2 1.5

δ = 10-15

Elliptic Annular Homoeoid

D2 Kuzmin

Maclaurin

Uniform

0

0.2 0.4 0.6 0.8

1

1.2 1.4 1.6 1.8

2

r Figure 16. Computational cost of numerical integration of gravitational potential off object plane. Displayed are Neval , the total number of integrand calls in the numerical quadrature programs. The numbers are logarithmically plotted as a function of r when z , 0 while the relative error tolerance of the numerical integration was set as δ = 10−15 .

One may think that the illustrated values of Neval is fairly large. Nevertheless, this is the cost we must pay when an ultimate computing precision is required by setting the relative error tolerance as tiny as δ = 10−15 . In practical applications, however, a lower precision may be sufficient. Therefore, in order to see the adaptiveness of the new method for such lower precision requirements, we prepared Fig. 17 showing, for the case of the gravitational potential integration, the relation between the achieved relative accuracy, |δΦ|, and the requested relative error tolerance, δ. Obviously, the new method is faithful in the sense that the achieved accuracy is always higher than requested. Thus, one only has to set δ as the precision one requires. For example, the 6–8 digit accuracy of the gravitational potential will be guaranteed by setting δ = 10−6 . Then, how much will be the computational labor one must spend in obtaining such lower precision computation? In order to answer this question, we depicted Fig. 18 illustrating the relation between the achieved accuracy of the potential integration on the object plane and the computational amount required in the integration by the new method. We omit the figures for the case off the plane and/or for the acceleration vector computation because they are all similar to the presented graphs. The errors of all the objects decrease rapidly when Neval increases. The thin straight line in the graph indicates that, except the case of the uniform disc, the obtained errors are in proportion to the 8th power of Neval . Since the executed integration is twodimensional, this fact means that, if the new method is likened to a finite difference method of fixed mesh size, its order becomes as high as 8 × 2 = 16. Namely, if Neval ( is) increased four times, then the accuracy is increased by log10 48 = 16 log10 2 ≈ 4.8 digits. A similar thing can be said to the case of the uniform disc where the integration reduces to be one-dimensional. The thick straight line in the figure shows that the errors of the uniform disc decreases in proportion to the 16th power of Neval . Since the integration is one-dimensional in this case, this implies that, if the new method is

8

T. Fukushima

Fidelity of Numerical Quadrature: Φ, z = 0 0

0

R/a=1/2

Kuzmin

-2

Cost Performance of Numerical Quadrature: Φ, z = 0

D2

-4 |δΦ|=δ

-6

log10 |δΦ|

log10 |δΦ|

-4

R/a=1/2

Uniform

-2

D2

-8 -10

Uniform Homoeoid

-12

-8 -10 Homoeoid

-12

Maclaurin

-14

Kuzmin

-6

-14

-16

-16 0

2

4

6

8 10 -log10 δ

12

14

16

Figure 17. Fidelity of numerical integration of gravitational potential. Shown are the integration errors of the gravitational potential for various values of δ, the relative error tolerance, inputted to the numerical quadrature programs. Displayed are the results at R = a/2 and z = 0 for (i) the uniform disc by open squares, (ii) the homoeoid disc by x-marks, (iii) the Maclaurin disc by open circles, (iv) the D 2 disc by open triangles, and (v) the Kuzmin disc by filled circles. The straight line indicates the case of the complete coincidence of δ and |δΦ|, which means the 100 per cent fidelity.

Table 1. Averaged CPU time of potential computation on object plane. Shown are the averaged CPU time to compute a single point value of the gravitational potential of some two-dimensional objects by the new method. They are (i) the five test objects examined in Section 3, and (ii) the elliptic annular toroid illustrated in Section 4. Listed are the results for several values of δ, the input relative error tolerance given to the DE quadrature rules, as 5 δ = 10−6 , 10−9 , 10−12 , and 10−15 √ . The average is taken over 10 sampling points along the line x = y = r / 2 and z = 0, where r is evenly distributed in the range 0 < r ≤ 2. The unit of the CPU time is millisecond at a PC with an Intel Core i7-4600U CPU running at 2.10 GHz clock. The results are listed in the increasing order of the CPU time for δ = 10−9 .

1.5

2

2.5

3

3.5 4 log10 Neval

4.5

5

5.5

Figure 18. Cost performance of numerical integration of gravitational potential. Same as Fig. 17 but plotted as functions of Neval , the total number of integrand calls in the numerical quadrature programs. This time, thin and thick straight lines show the model curves being in inverse proportion to the 8th and 16th power of Neval .

objects for various values of δ as δ = 10−6 , 10−9 , 10−12 , and 10−15 . The table shows that, except the case of the uniform disc, the CPU time of several milliseconds at an ordinary PC is sufficient to realize the 9-digit computation of the gravitational potential. This CPU time becomes around 100 times smaller for the uniform disc. For example, the preparation of Figs 21 and 22, the bird’s-eye view and the associated contour map of the gravitational potential of the elliptic annular disc shown later, requires 65 × 129 = 8385 points of the evaluation, and therefore costs 8385 × 0.005772 ≈ 48 seconds. This is a reasonably small amount of time.

4 EXAMPLE object uniform disc Kuzmin disc homoeoid disc Maclaurin disc D 2 disc elliptic annular disc

δ = 10−6 0.006 0.215 0.248 0.501 0.543 2.699

CPU Time (ms) 10−9 10−12 0.025 0.496 0.668 1.047 3.322 5.772

0.012 0.923 4.900 4.988 2.870 30.966

10−15 0.016 2.231 5.792 2.445 5.399 129.527

likened to a finite difference method of fixed mesh size, its order is as high as 16, the same order as observed for other discs. At any rate, one may obtain a practical estimate of the computational labor to realize the demanded precision of the gravitational field computation. For example, the 6 digit accuracy of the gravitational potential of the Kuzmin disc, or of other similar objects extended infinitely, will be realized by around a few thousand evaluations of the integrand. Finally, in order to show the computational time of the new method more clearly, we prepared Table 1 listing the actual CPU times spent for the gravitational potential integration of several

In order to show the performance of the new method, we integrate the gravitational field of an elliptic annular disc as a practical example of infinitely thin asymmetric objects. Assume that the surface mass density of the disc is expressed as ( ) 2  a 1 − e2 +   −1 * Σ0 / , Σ(x, y) ≡ exp  2 . R − (25) 1 − e cos Θ 1 − e cos Θ   h  ,   where Σ0 is a nominal value of the surface mass density, R ≡ √ x 2 + y 2 and Θ = tan−1 (y/x) are the global planar polar coordinates on the x–y plane, h is a Gaussian scale height on the x–y plane, and a and e are the semi major axis and the eccentricity of the central ellipse (Danby 1988). This functional form means that (i) a limit case of the annular disc when its width becomes zero is a Keplerian ellipse on the x– y plane where its apocenter is toward the positive x-axis, (ii) the density value along the ellipse is in proportion to the radius from the coordinate center being a focus of the ellipse, (iii) the density profile across the ellipse follows a Gaussian damping, and (iv) the scale length of the Gaussian damping is constant. For simplicity, we MNRAS 000, 1–23 (2016)

Gravitational field of infinitely thin object

9

Φ of Elliptic Annular Disc ρ of Elliptic Annular Disc

ρ/ρ0

Φ/|Φ0| 0

2 1.5 1 0.5 0

-0.5 2 1 -1

0

x

1

2

y

0

Figure 19. Bird’s-eye view of surface mass density profile: elliptic annular disc. Displayed is the bird’s-eye view of an elliptic annular disc located on the x–y plane. The area was restricted such that y > 0 in order to illustrate the y-cross section clearly.

ρ of Elliptic Annular Disc 2

y

1 0 -1 -2 -1

0

1

2

x Figure 20. Contour map of surface mass density: elliptic annular disc. Depicted is the contour map of the surface mass density of an elliptic annular disc.

MNRAS 000, 1–23 (2016)

2

-1 1 -1

0

x

1

2

y

0

Figure 21. Bird’s-eye view of gravitational potential: elliptic annular disc on x–y plane. Same as Fig. 19 but for the gravitational potential on the x–y plane.

set the parameters as h = 0.3, a = 4/3, e = 0.5.

(26)

Refer to Figs 19 and 20 showing the bird’s-eye view of the surface mass density and the corresponding contour map for this specific choice of the parameters. The functional form and the chosen set of parameters were designed to mimic the observed profile of the protoplanetary disc around HD 142527 (Fukagawa et al. 2013). Utilizing the new method described in Section 2 and validated in Section 3 while setting the input relative error tolerance moderately as δ = 10−9 , we obtained the gravitational potential and the associated acceleration vector of the elliptic annular disc. The bird’s-eye views and the corresponding contour maps of Φ, the gravitational potential, are depicted in Figs 21–26. On the other hand, as for the acceleration vector, F, we show the behavior of its magnitude in Figs 27 and 28 displaying the bird’s-eye view and contour map of |F| on the x–y plane. Also, we prepared its vector map on the x–y plane in Fig. 29. Basically, the gravitational potential map on the object plane faithfully follows that of the surface mass density. As a result, on the object plane, the direction of the acceleration vector is not exactly perpendicular to the central ellipse but slightly inclined toward the density peak. On the other hand, the vertical feature of the gravitational field is significantly flattened as indicted in Figs 23–26. These are mainly caused by the assumption of infinite thinness. If an appropriate vertical structure is introduced, the result would exhibit a more rounded feature although it will cost a labor of volume integrations to confirm this conjecture. At any rate, the computed gravitational field will mimic that acting on a planet embryo if also taken into account is that of the central star approximated by a point mass located at the coordinate center.

T. Fukushima

Φ of Elliptic Annular Disc 2

Φ of Elliptic Annular Disc 2

1

1

0

0

z

y

10

-1

-1

-2

-2 -1

0

1

2

-1

0

x

Figure 24. Contour map of gravitational potential: elliptic annular disc on x–z plane. Same as Fig. 23 but extracted is its contour map.

Φ of Elliptic Annular Disc

Φ of Elliptic Annular Disc

Φ/|Φ0| 0

Φ/|Φ0| 0

-0.5

-0.5 2

-1 1 0

x

1

2

x

Figure 22. Contour map of gravitational potential: elliptic annular disc on x–y plane. Same as Fig. 21 but extracted is its contour map.

-1

1

2

z

0

Figure 23. Bird’s-eye view of gravitational potential: elliptic annular disc on x–z plane. Same as Fig. 21 but on the x–z plane. Notice that the vertical profile of the potential is not analytic when crossing the x–y plane.

2

-1 1 -2

-1 y

0

1

z

2 0

Figure 25. Bird’s-eye view of gravitational potential: elliptic annular disc on y–z plane. Same as Fig. 21 but on the y–z plane.

MNRAS 000, 1–23 (2016)

Φ of Elliptic Annular Disc 2

|F| of Elliptic Annular Disc 2

1

1

0

0

y

z

Gravitational field of infinitely thin object

-1

-1

-2

-2 -2

-1

0

1

2

-1

0

y

1

11

2

x

Figure 26. Contour map of gravitational potential: elliptic annular disc on y–z plane. Same as Fig. 25 but extracted is its contour map.

Figure 28. Contour map of gravitational acceleration: elliptic annular disc on x–y plane. Same as Fig. 27 but extracted is its contour map.

F of Elliptic Annular Disc 2

|F| of Elliptic Annular Disc |F|/|F0| 1

1 y

0.5 2

0 1 -1

0

x

1

2

y

0 -1

0

-2 -1 Figure 27. Bird’s-eye view of gravitational acceleration: elliptic annular disc on x–y plane. Same as Fig. 21 but for the magnitude of the gravitational acceleration.

0

1

2

x Figure 29. Vector map of acceleration vector: elliptic annular disc on x–y plane. Displayed is the vector map of F of the elliptic annular disc on the x–y plane.

MNRAS 000, 1–23 (2016)

12

T. Fukushima

5 CONCLUSION By adopting the local planar polar coordinates centered at the foot of the evaluation point on the object plane, we developed a numerical method to integrate the gravitational potential and the associated acceleration vector for general two-dimensional objects located on a flat plane. Comparison with several rigorous solutions confirms the 11-15 digits accuracy of the numerical integration. This is far more enough than the practical needs. By using the new method, we obtained the detailed feature of the gravitational field of an elliptic annular disc, which was designed to resemble an asymmetric protoplanetary disc observed around HD 142527. We notice that not only the acceleration component across the central ellipse but also those along it toward the figure center is prominent. The new method will be useful in the study of the gravitational field of general infinitely thin objects such as lenticular and spiral galaxies as well as protoplanetary discs. Sample Fortran 90 programs are electronically available at the following web site https://www.researchgate.net/profile/Toshio_Fukushima/

ACKNOWLEDGEMENTS The author appreciates the referee’s appropariate pointing and valuable advices to improve the quality and readability of the present article.

+π|z|H (a − r)] , for the uniform disc (Fukushima 2010a), ΦH (R, z) ≡ −2πGaΣC α,

(A4)

for the homoeoid disc (Cuddeford 1993), ( ) ΦM (R, z) ≡ − (πGaΣC /4) AM α + β − 3γ ,

(A5)

for the Maclaurin disc, ( ) ΦD (R, z) ≡ − (πGaΣC /64) AD α + BD β − CD γ ,

A1

Surface mass density

As an example of the finite objects, we choose a one-parameter family of the circular finite disc (Schulz 2009): ( )   ΣC 1 − R2 /a2 j (R < a) Σ j (x, y) =  (A1)  0 (R ≥ a)  where (i) ΣC is the central √ surface mass density, (ii) a is the radius

of the disc, (iii) R ≡ + is the radial distance on the x-y plane, and (iv) j is a real-valued index, which is usually set as an integer or a half integer. In practice, we selected four cases: (i) the uniform disc where j = 0 (Durand 1953), (ii) the infinitely flattened homoeoid where j = −1/2 (Cuddeford 1993), (iii) the Maclaurin disc where j = 1/2 (Kalnajs 1972), and (iv) the so-called D2 disc where j = 3/2 (Schulz 2009). On the other hand, as an illustration of infinitely extended object, we selected the Kuzmin disc (Kuzmin 1956). / (√ )3 Σ(x, y) = ΣC 1 + R2 /a2 , (A2) x2

ΦK (x, y, z) = −2πGa2 ΣC /P,

(A7)

for the Kuzmin disc (Kuzmin 1956). As for the expressions of the Maclaurin and D2 discs, we rewrote the original expressions (Schulz 2009) into the present forms producing less round-off errors. In the above expressions, (i) K (m), E(m), and Π(n|m) are the complete elliptic integral of the first, the second, and the third kind (Byrd & Friedman 1971) defined as ∫ π/2 dφ K (m) ≡ , (A8) ∆(φ|m) 0 E(m) ≡

∫ π/2

Π(n|m) ≡

∆(φ|m) dφ,

(A9)

0

∫ π/2 0

[

dφ , ] ∆(φ|n) 2 ∆(φ|m)

(A10)

where ∆(φ|m) is Jacobi’s Delta function defined as √ ∆(φ|m) ≡ 1 − m sin2 φ, (ii) H (s) is the Heaviside step function defined as { 1 (s > 0) H (s) ≡ 0 (s ≤ 0) (iii) P± and P are pseudo distances defined as √ P± ≡ (R ± a) 2 + z 2,

(A11)

(A12)

(A13)

y2

where a is the scale length of the Kuzmin disc. A2

(A6)

for the D2 disc, and

APPENDIX A: REFERENCE SOLUTIONS In order to examine the computational accuracy of the new method, we gathered some analytical solutions of the density-potentialacceleration trio of infinitely thin objects as shown below.

(A3)

Gravitational potential

The analytic solution of the gravitational potential caused by these discs are expressed as ΦU (R, z) ≡ 2GΣC [P+ E(m) − CK K (m) − CΠ Π(n|m)

√ P≡

R2 + (a + |z|) 2 .

(A14)

(iv) n and m are the characteristic and the parameter of the complete elliptic integrals defined as n ≡ 4aR/(R + a) 2,

(A15)

m ≡ 4aR/P+2 ,

(A16)

(v) CK and CΠ are coefficients defined as ( ) CK ≡ R2 − a2 /P+,

(A17)

CΠ ≡ (R − a)z 2 / [P+ (R + a)] ,

(A18)

(vi) α, β, and γ are auxiliary functions defined as α ≡ sin−1 [2a/ (P+ + P− )] ,

(A19) MNRAS 000, 1–23 (2016)

Gravitational field of infinitely thin object

13

A3 Gravitational acceleration vector

√ β ≡ 2aQ−,

(A20)

√ γ ≡ 2|z|Q+,

(A21)

while (vii) Q± are another pseudo distances computed conditionally as √ Q+ = P+ P− + T−−, (A22)

We move to the gravitational acceleration vector. Since the objects discussed here are all axisymmetric, it is sufficient to provide the expressions of the radial and vertical components. Once the radial component of the acceleration vector, FR (R, z), is given, then the x- and y-components are automatically computed as Fx = (x/R)FR (R, z),

(A35)

Fy = (y/R)FR (R, z).

(A36)

Q− = 2a|z|/Q+,

(A23)

when T−− ≥ 0, and √ Q− = P+ P− − T−−,

In general, the acceleration vector is obtained by the partial differentiations of the analytical expressions of the corresponding gravitational potential. The results are

(A24)

FR,U (R, z) = −16Ga2 ΣC S(m)R/P+3 ,

(A25)

Fz,U (R, z) = −

[ Q+ = 2a|z|/Q−,

(A37)

] 2GΣC z [(R − a)nJ (n|m) − 2aK (m)] P+ (R + a)

otherwise, (viii) T±± is a quadratic polynomial defined as T±± ≡ a2 ± R2 ± z 2,

and (ix) AM , AD , BD , and CD are auxiliary polynomials of R and z defined as AM ≡ 2a2 − R2 + 2z 2, 4

2 2

(A27)

2 2

4

2 2

4

AD ≡ 48a − 48a R + 96a z + 18R − 144R z + 48z , (A28) BD ≡ 18a2 − 9R2 + 26z 2,

(A29)

CD ≡ 58a2 − 55R2 + 50z 2 .

(A30)

The precise and fast computation of K (m) and E(m) in the IEEE 754 double precision environment are realized by the programs ceik and ceis (Fukushima 2015). Also, Π(n|m) is efficiently computed as Π(n|m) = K (m) + nJ (n|m).

(A31)

Here J (n|m) is an associate complete elliptic integral of the third kind (Fukushima 2009). It is defined as ∫ π/2 cos2 φ J (n|m) ≡ dφ. (A32) [ ] 0 ∆(φ|n) 2 ∆(φ|m) The precise and fast computation of J (n|m) in the IEEE 754 double precision environment is realized by the program celj (Fukushima 2013b). Meanwhile, the computation of J (n|m) internally requires B(m) and D(m), two associate complete elliptic integrals of the second kind (Fukushima 2010a). They are defined as ∫ π/2 cos2 φ B(m) ≡ dφ, (A33) ∆(φ|m) 0 D(m) ≡

∫ π/2 sin2 φ dφ. ∆(φ|m) 0

(A34)

Their precise and fast computation in the IEEE 754 double precision environment are realized by the programs ceib and ceid (Fukushima 2015). MNRAS 000, 1–23 (2016)

−2πGΣC sign(z)H (a − R),

(A26)

(A38)

for the uniform disc (Fukushima 2010a), ( ) −πGaΣC β − γ FR,H (R, z) = , RP+ P− Fz,H (R, z) =

−πGaΣC γ , zP+ P−

(A40)

for the homoeoid disc (Schulz 2009), ( )( ) πGΣC T−+ β − T++ γ FR,M (R, z) = − 2R2 α + , 2Ra P+ P− ( Fz,M (R, z) = −

πGΣC a

(A39)

)( −2zα +

(A41)

) 2z β + sign(z)T−− γ/z , P+ P− (A42)

for the Maclaurin disc (Schulz 2009), ( ) ) πGΣC ( FR,D (R, z) = − A R,D α + gA + g B − gC , 64a3 ( Fz,D (R, z) = −

πGΣC 4a3

)( Az,D α +

) Bz,D β + Cz,D γ/z , P+ P−

(A43)

(A44)

for the D2 disc (Schulz 2009) and FR,K (R, z) = −2πGa2 ΣC R/P3,

(A45)

Fz,K (R, z) = −2πGa2 ΣC (a + |z|) sign(z)/P3,

(A46)

for the Kuzmin disc (Kuzmin 1956), respectively. During the comparison study, we learn that the expression of FR,D (R, z) given in the literature (Schulz 2009, equation (26)) was completely incorrect. Thus, we (i) derived the present expression, equation (A43), analytically by the hand calculation1 , (ii) checked by Mathematica 10 (Wolfram Res. 2015), and (iii) confirmed its 1

Unfortunately, Mathematica 10 could not handle the solution branching properly and failed to simplify the result of the partial differentiation such as in the present form.

14

T. Fukushima

correctness numerically by the numerical partial differentiation of the potential expression, equation (A6), in the IEEE 754 quadruple precision environment. In the above, S(m) is a special complete elliptic integral of the second kind (Fukushima 2010a). It is defined as ∫ −1 π/2 cos 2φ dφ. (A47) S(m) ≡ m 0 ∆(φ|m)

complete elliptic integral precisely (Bulirsch 1965). Refer to Appendix D for its Fortran 90 program listing. By using the program qcel, we computed K (m), E(m), S(m), Π(n|m), and J (n|m) in the IEEE 754 quadruple precision environment as K (m) = qcel (k c , 1, 1, 1, ierr) ,

(A57)

E(m) = qcel (k c , 1, 1, mc , ierr) ,

(A58)

The precise and fast computation of S(m) in the IEEE 754 double precision environment is realized by the program ceis (Fukushima 2016c). Also, gA , g B , and gC are auxiliary functions we introduced as √ 2AD hA + gA ≡ * H (a − R), (A48) , Q− (P+ + P− ) -

S(m) = qcel (k c , 1, −1, 1, ierr) /m,

(A59)

Π(n|m) = qcel (k c , nc , 1, 1, ierr) ,

(A60)

( √ g B ≡ 2RQ− 18 −

(A49)

J (n|m) = qcel (k c , nc , 0, 1, ierr) ,

(A61)

(A50)

where ierr is an integer-valued error indicator, and k c , mc , and nc are complementary quantities defined as √ k c ≡ mc , mc ≡ 1 − m, nc ≡ 1 − n. (A62)

) BD , P+ + P−

{ √ 2|z| [110RQ+ + CD hC / (2Q+ )] gC ≡ 0

(z , 0) (z = 0)

Here AD , BD , and CD are already specified in equations (A28), (A29), and (A30), respectively. Meanwhile, hA and hC are additional functions defined as R+a R−a hA ≡ + , (A51) P+ P− hC ≡ 2R −

(R + a)P− (R − a)P+ − . P+ P−

mc = P−2 /P+2 ,

(A63)

nc = (R − a) 2 /(R + a) 2 .

(A64)

(A52)

Furthermore, A R,D , Az,D , Bz,D , and Cz,D are auxiliary polynomials defined as A R,D ≡ 96a2 − 72R2 + 288z 2,

(A53)

Az,D ≡ −12a2 z + 18R2 z − 12z 3,

(A54)

Bz,D ≡ 13a2 z − 13R2 z + 2z 3,

(A55)

Cz,D ≡ 4a4 − 8a2 R2 − 3a2 z 2 + 4R4 − 7R2 z 2 − 11z 4 .

(A56)

Thus, the solution expressions are completed.

A4

The last two expressions suffer from the rounding-off errors. Thus, we compute them by their cancellation-free forms as

Quadruple precision computation

Many of the terms in the above expressions, especially those of (i) the homoeoid disc, (ii) the Maclaurin disc, and (iii) the D2 disc, suffer from the round-off errors amounting to 2-4 digits. This is due to the cancellation among several terms with similar magnitudes and different signs such as the evaluation of auxiliary polynomials. In order to avoid the unnecessary accuracy degrade in the exact solution computation, except for the case of the uniform disc which will be separately described below, we fully employed the IEEE 754 quadruple precision computation in the process of the numerical comparison with the results obtained by the new method in Section 3. As for the uniform disc, we newly developed qcel, a quadruple precision extension of the program cel to compute the general

APPENDIX B: INTEGRATION OF ACCELERATION VECTOR ON OBJECT PLANE Section 2.2 explained the numerical integration of the gravitational acceleration for evaluation points off the object plane, namely when z , 0. If z = 0 exactly, however, there is a possibility that an algebraic singularity remains in the integral expressions of the acceleration vector components, Fx (x, y, z), Fy (x, y, z), and/or Fz (x, y, z), presented in equations (11)–(15), and therefore a chance exists such that they may not be well-defined. Thus, when z = 0, we consider their substitute by their limit values onto the x–y plane as ( ) ( ) (B1) Fx∗ x, y ≡ lim Fx x, y, z , z→0

( ) ( ) Fy∗ x, y ≡ lim Fy x, y, z ,

(B2)

( ) Fz∗ x, y ≡ lim Fz (x, y, z).

(B3)

z→0

z→0±0

Notice that the limit value of Fz (x, y, z) may depend on the vertical direction of approach to the x-y plane. Let us begin with Fz∗ (x, y). In principle, Fz (x, y, 0) is not a well-defined quantity because of the vertical discontinuity of the surface mass density on the x–y plane. Refer to Fukushima (2010a) illustrating its example for an infinitely thin uniform disc of a finite radius. At any rate, the introduced substitute is mathematically expressed as ( )] [ ( ) (B4) Fz∗ x, y = −2πG lim lim lim L(z; a, b) , z→0±0 a→0 b→∞

MNRAS 000, 1–23 (2016)

Gravitational field of infinitely thin object where L(z; a, b) is a line integral over a finite interval defined as ∫ b ( ) L(z; a, b) ≡ SA (p; x, y) zp/q3 dp, (B5) a

while q is the abbreviation defined as √ q ≡ p2 + z 2,

(B6)

and SA (p; x, y) is the angular integral introduced in equation (6). Since the exchange of these three limit operations are not guaranteed in general, there is a possibility that Fz∗ (x, y) diverges or becomes indeterminate. To be more specific, we split the integration interval of L(z; a, b) as ( ) ( ) L(z; a, b) = L z; a, p0 + L z; p0, b , (B7) where p0 is a certain fixed value satisfying the condition a ≤ p0 ≤ b, say p0 = 1 if a ≪ 1 ≪ b. Then, Fz∗ (x, y) is rewritten in a summed form as ] [ ( ) ( ) ( ) Fz∗ x, y = −2πG lim lim L z; a, p0 + lim L z; p0, b . z→0±0 a→0+0

b→∞

(B8) Let us consider the contribution of the second term first. Assume that (i) SA (p; x, y) = 0 if p > p1 for a sufficiently large value p1 , or (ii) SA (p; x, y) > 0 for arbitrary large value of p but SA (p; x, y)/p monotonically decreases when p → ∞. Then, ( ) limb→∞ L z; p0, b /z remains to be finite for a finite value of z. As a result, the second term in equation (B8) vanishes. Next, we calculate the first term in equation (B8). Assume that SA (p; x, y) is analytic with respect to p at p = 0 for the given x and y so as to be expanded as SA (p; x, y) =

∞ ∑ Sn (x, y) n p , n!

(B9)

n=0

where Sn (x, y) is the n-th coefficient of the Maclaurin series of SA (p; x, y). Then, the first term is expanded as ∞ ( ) ( ) ∑ Sn (x, y) lim L z; a, p0 = L n z, p0 n! a→0+0

(

)

where L n z, p0 is a definite integral defined as ∫ p 0 ( n+1 ) ( ) zp L n z, p0 ≡ dp. (n = 0, 1, 2, . . . ) q3 0

) ] p p+q L 1 (z, p) = z ln − , |z| q L n (z, p) =

(B16) ( ) At any rate, in the limit z → 0 ± 0, all L n z, p0 but L 0 z, p0 ( ) vanish. Also, only the first term of L 0 z, p0 survives. As a result, we obtain the expression of Fz∗ (x, y) as (

(B11)

(B13)

( n ) 1 zp − nz 2 L n−2 (z, p) . (n = 2, 3, . . . ) (B14) n−1 q

The correctness of these formulas are confirmed by (i) the partial differentiation of L n (z, p) with respect to p as ( ) ∂L n (z, p) zpn+1 , (B15) = ∂p q3 z

)

Fz∗ (x, y) = −2πGΣ(x, y)sign(z),

(B17)

where we used the relation lim SA (p; x, y) = Σ(x, y),

(B18)

p→0

which holds when Σ(x, y) is analytic at (x, y). By assumptions, this expression is valid inside or outside the object, namely except on the boundary curve of the object. Consequently, on the boundary curve, Fz∗ (x, y) becomes indeterminate unless Σ(x, y) = 0. More precisely speaking, we must say that its value also depends on the radial direction approaching to the boundary. This is a natural result because the surface mass density profile is not analytic on the boundary. A similar situation occurs for the horizontal components of the acceleration vector on the object plane: ∫ ∞ ( ) SC (p; x, y) Fx∗ x, y = −2πG dp, (B19) p 0 Fy∗

(

∫ ∞ SS (p; x, y) x, y = −2πG dp. p 0 )

(B20)

The apparent singularities of the integrands of these integrals at p = 0 become harmless (i) if SC (p; x, y) and SS (p; x, y) vanish when p = 0, or more specifically speaking, if |SC (p; x, y)| ≈ pν and/or |SS (p; x, y)| ≈ pν when p → 0 for positive values of power indices, ν > 0, then (ii) the singularity of the integrand at p = 0 is weakened, and therefore (iii) the integral becomes integrable. For example, if Σ(x, y) is analytic at (x, y), then we may expand the integrand of equation (15) around it and take the limit of p → 0 such that ∫ 2π Σ(x, y) cos θdθ = 0, (B21) SC∗ (x, y) ≡ lim SC (p; x, y) = 2π p→0 0

p→0

(

MNRAS 000, 1–23 (2016)

L n (z, 0) = 0.

SS∗ (x, y) ≡ lim SS (p; x, y) =

The integrals L n (z, p) are analytically integrable and computed by a forward recursion using the elementary functions as z L 0 (z, p) = sign(z) − , (B12) q [

and (ii) the examination of the boundary condition,

(B10)

n=0

15

Σ(x, y) 2π

∫ 2π 0

sin θdθ = 0.

(B22)

Thus, when p → 0, the integrand of equations (B19) and (B20) (i) approaches to a finite value including zero or (ii) blows up but slower than 1/p, and therefore, the integral becomes integrable. In fact, by adopting the double exponential quadrature rules (Takahashi and Mori 1973), we successfully conduct the numerical integration of such cases without difficulty as confirmed in Section 3. On the other hand, if Σ(x, y) is not analytic at (x, y) such as on the boundary of a finite object, SC (p; x, y) and/or SS (p; x, y) may not vanish when p → 0 in general. Imagine a case when the evaluation point is exactly on the analytic boundary part of the object such as an edge of a finite uniform circular disc, say at the point (x, y) = (0, −a). Then, Σ(p cos θ, −a + p sin θ) (i) takes a constant value, ΣC , when approaching from the inside of the object, namely when 0 ≤ θ ≤ π, and (ii) vanishes if approaching from the outside, namely when π < θ ≤ 2π. Consequently, SC∗ (0, −a) accidentally vanishes as ∫ π ΣC ∗ SC (0, −a) = cos θdθ = 0, (B23) 2π 0

16

T. Fukushima

while SS∗ (0, −a) becomes finite as ∫ π ΣC ΣC SS∗ (0, −a) = sin θdθ = , 0. 2π 0 2

(B24)

where f 2 (p; η) is either (i) SA (p; x, y), (ii) SA (p; x, y)p/q, (iii) SC (p; x, y)p2 /q3 , (iv) SS (p; x, y)p2 /q3 , or (v) SA (p; x, y)zp/q3 , and η denotes√the parameters of the integral such as x and y. Mean-

The explanation below is a modification of the hints in the previous work of the numerical integration of the gravitational field of the general three-dimensional objects (Fukushima 2016e) adapted to the two-dimensional case discussed here. These are merely the suggestions based on our experience about the actual computer programs to evaluate numerically the integrals displayed in equations (4)–(7) and equations (11)–(15).

while, q ≡ p2 + z 2 and SA (p; x, y), SC (p; x, y), or SS (p; x, y) takes one of the expressions explained in Appendix C1. On the other hand, the end points of the integral, pL (η) and pU (η), take the following variations; (i) pL (η) = 0 and pU (η) = ∞, (ii) pL (η) = p0 (η) and pU (η) = ∞, (iii) pL (η) = 0 and pU (η) = p1 (η), and (iv) pL (η) = p0 (η) and pU (η) = p1 (η) where p0 (η) and p1 (η) are certain positive definite constants or functions of the parameters in general. The first case appears when the object is infinitely extended in any direction such as the Kuzmin disc. The second deals with a special situation when the object is semi-open and infinitely extended in certain directions such as the semi-plane where x > 0. Meanwhile, the third and last options describe the situations when the evaluation point is inside or outside the finite object. For the numerical quadrature of line integrals, we recommend the usage of intde or intdei, Ooura’s excellent implementation of the DE quadrature rule for line integrals over a finite and semiinfinite intervals, respectively, depending on the finiteness of the upper end point (Ooura 2006). Sample Fortran program codes utilizing intde and/or intdei are available (Fukushima 2016d, section 2.8 and appendix B). Also, a plain tutorial of the DE rule itself is in the literature (Press et al. 2007, section 4.5).

C1

C3 Care for integrable endpoint singularity

Furthermore, consider the case when the evaluation point is precisely located at a continuous but non-analytic boundary point of the object such as a vertex of a polygon. Then, SC∗ (x, y) and/or SS∗ (x, y) will take more complicated expressions. Both of them are not guaranteed to vanish simultaneously in general. In any case, the integral in equations (B19) and/or (B20) are not integrable, and therefore Fx∗ (x, y) and/or Fy∗ (x, y) becomes indeterminate. In summary, the acceleration vector on the object plane becomes indefinite on the boundary of the object. Otherwise, namely whether inside or outside the object, the vector is computable.

APPENDIX C: IMPLEMENTATION NOTE

Angular integration

We begin with the numerical quadrature of the inner line integrals. They are expressed as definite integrals as ∫ θ U (ξ) I1 (ξ) ≡ f 1 (θ; ξ)dθ, (C1) θ L (ξ)

where f 1 (θ; ξ) is either (i) Σ(x + p cos θ, y + p sin θ), (ii) Σ(x + p cos θ, y + p sin θ) cos θ, or (iii) Σ(x + p cos θ, y + p sin θ) sin θ, and ξ denotes the parameters such as p, x, and y. Meanwhile, θ L (ξ) and θ U (ξ) are the lower and upper endpoints of the angular integral, which depend on the location of the evaluation point and on the boundary curve of the object, and therefore on ξ in general. If the evaluation point is well inside the object such that the whole circle of radius p centered at the evaluation point is within the object, we may assume that θ U (ξ) = θ L (ξ) + 2π.

(C2)

Then, the integrand f 1 (θ; ξ) is a periodic function of θ with the known period, 2π. Therefore, the simple trapezoidal rule may be appropriate in its integration over [0, 2π] such as the Romberg quadrature method (Press et al. 2007). However, in order to deal with the general case when the integration interval may be a partial arc of the whole circle, and especially when the surface mass density profile has a non-analytic but integrable singularities at the endpoints, we recommend the usage of the double exponential (DE) quadrature rule (Takahashi and Mori 1973) as will be explained in the next subsection.

The DE rule is so powerful that it can correctly evaluate the integrals with integrable singularities if they are located at the endpoints of the integration interval. For example, consider the evaluation of the following line integral: ∫ θ1 [ ] I3 ≡ σ(θ) f 3 (θ) µ dθ, (C4) θ0

where (i) f 3 (θ) is a function which linearly approaches to zero when θ → θ 0 and/or θ → θ 1 , namely f 3 (θ) ≈ c0 (θ − θ 0 ) , and/or f 3 (θ) ≈ c1 (θ − θ 1 ) ,

where c0 and c1 are certain constants, (ii) µ is a general real value satisfying the condition, µ > −1, and (iii) σ(θ) is a sufficiently smooth function in the integration interval, θ 0 ≤ θ ≤ θ 1 . An example appears in the angular integral of the homoeoid disc expressed as, ∫ θ1 dθ I4 ≡ , (C6) √ θ0 1 − Q(θ)/a2 where (i) Q(θ) is the squared distance from the disc center to (x, y), the foot of the evaluation point on the object plane, and expressed as a quadratic form of p, x, and y expressed as Q(θ) ≡ (x + p cos θ) 2 + (y + p sin θ) 2,

Radial integration

Consider the outer line integrals expressed as ∫ p U (η) I2 (η) ≡ f 2 (p; η)dp, p L (η)

(C3)

(C7)

(ii) p is the radial distance from the foot, and (iii) θ 0 is a root of the equation Q(θ) = a2 .

C2

(C5)

(C8)

Of course, one may apply the DE quadrature rule directly to this integral. However, we experimentally learn that a catastrophic loss of information occurs in the subtraction of the factor inside the square root, 1 − Q(θ)/a2 . This phenomenon significantly degrades the accuracy of the numerical quadrature as illustrated in Fig. C1. MNRAS 000, 1–23 (2016)

Gravitational field of infinitely thin object

Integration Error of Φ: Homoeoid Disc -6.6 -6.8

Behavior of Angular Integral: R = 1/2, a = 1 18

a=1, δ=10-15

Without Linear Transformation

16 14 SA(p;x,y)/S0

log10 |δΦ|

-7 -7.2 -7.4 -7.6

Homoeoid

12 10 8 6 4

-7.8 -8

Uniform

Maclaurin

2

D2

0 0

0.2 0.4 0.6 0.8

1

1.2 1.4 1.6 1.8

2

0

0.25

0.5

r

The figures show that 7–8 effective digits are lost despite setting the relative error tolerance as tiny as δ = 10−15 . Also, prominent is the error increase near the edge of the disc on the disc plane, namely those indicated by filled circles in Fig. C1 when r ≈ a = 1. In order to resolve this issue, we change the integration variable by a linear transformation as (C9)

and rewrite the inside of the square root in a cancellation-free form as ( ) 1 − Q(θ)/a2 = 4p/a2 u(ψ) sin ψ, (C10) where u(ψ) is an auxiliary function defined as ( ) ( ) u(ψ) ≡ x sin ψ + θ 0 − y cos ψ + θ 0 . As a result, the original integral is transformed as ∫ (θ 1 −θ 0 )/2 a dψ I4 = √ , √ p 0 u(ψ)s(ψ)

(C11)

(C12)

where s(ψ) is defined as s(ψ) ≡ sin ψ.

(C13)

The problematic factor, s(ψ), can be accurately computed even when ψ is as tiny as 10−16 if employing a truncated Maclaurin series expansion conditionally such as ( ) ( )  ψ 1 − ψ 2 /6 + ψ 4 /120 |ψ| < 10−4   ( ) s(ψ) =  (C14) sin ψ |ψ| ≥ 10−4  If θ 1 is also a root of the equation, Q(θ) = a2 , then this transformation causes an information loss at the upper end of the transformed integral. In such cases, we (i) split the integral into two parts as ∫ θ∗ ∫ θ1 dθ dθ I4 = + , (C15) √ √ ∗ θ0 θ 1 − Q(θ)/a2 1 − Q(θ)/a2 MNRAS 000, 1–23 (2016)

0.75

1

1.25

1.5

p

Figure C1. Integration error of gravitational potential of homoeoid disc without linear transformation of angle variable. Same as Fig. 8 but obtained without the linear transformation of the angle variable in the inner line integral. Notice a prominent increase of the errors on the x–y plane indicated by filled circles and centered at r = 1.

ψ ≡ (θ − θ 0 ) /2,

17

Figure C2. Behaviour of angular integral: gravitational potential of finite discs. Plotted are the normalized values of SA (p; x, y) as a function of p √ for four finite discs of the unit radius, namely a = 1, when R ≡ x 2 + y 2 = 1/2. Clearly seen is the non-analyticity at p = a − R = 1/2.

where θ ∗ is a certain intermediate angle, and then (ii) apply the variable transformation separately. For example, by setting θ ∗ as the mid point of the integration interval, θ M ≡ (θ 0 + θ 1 ) /2, we rewrite the integral as ∫ (θ 1 −θ 0 )/4 a * √ 1 + √ 1 + √dψ . I4 = √ (C16) p 0 v(ψ) - s(ψ) , u(ψ) where v(ψ) is defined as ( ) ( ) v(ψ) ≡ −x sin θ 1 − ψ + y cos θ 1 − ψ . (C17) The integrand of the rewritten integral still √ contains an integrable algebraic singularity due to the divisor, s(ψ). However, the DE quadrature rule can handle this kind of integrable singularities properly (Takahashi and Mori 1973). The combination of (i) the linear argument transformation, (ii) the cancellation-free rewriting of small factors, and/or (iii) the splitting quadrature is a simple trick. Nevertheless, it does work as already seen in Section 3. C4 Split radial integration In the case of finite objects, there is a possibility that the integrand of the radial integration, f 2 (p; η) in equation (C3), is not analytic but piecewise continuous even if the surface mass density is analytic inside the object. This is caused by the difference in the integration interval of the angular integral such as explained in Appendix C1. Let us show an example: a circular disc of the radius, a. Assume that the √ foot of P, the evaluation point, is inside the disc. Denote by R ≡ x 2 + y 2 the radial distance of the foot from the disc center such that R < a. Then, the interval of the angular integral becomes [0, 2π] when p, the radial coordinate in the planar polar coordinates centered at the foot, is less than a − R, and therefore the whole circle of radius p centered at the foot is inside the object disc. Otherwise, namely when p > a − R, the interval is restricted such as [θ C − ω, θ C + ω] where θ C ≡ atan2(−y, −x),

(C18)

18

T. Fukushima

is the azimuthal angle of the disc center in the planar polar coordinate system centered at the evaluation point and ω is an offset angle defined as ( 2 ) a − R2 − p2 ω ≡ cos−1 , (a − R ≤ p ≤ a + R). (C19) 2pR

Φ(x, y, z) = Φinner (x, y, z) + Φouter (x, y, z),

(C21)

where the inner and outer components are defined as ∫ a−R Φinner (x, y, z) ≡ −2πG SA (p; x, y)(p/q)dp,

(C22)

-2 Without Radial Splitting -4

a=1, δ=10-15

-6 log10 |δΦ|

This defining expression of ω suffers from round-off errors when the argument of the arc cosine is close to zero. In order to avoid this phenomenon, we use its rewriting as √ (R + p − a)(R + p + a) + −1 * /. ω = 2 sin . (C20) 4pR , Refer to Fig. C2 illustrating the behavior of the angular integral as functions of p for the four test discs. Obviously, the angular integral is not analytic at the point p = a − R. Therefore, it is natural to separate the integration interval of the radial integrals at this point. For example, the gravitational potential is split as

Integration Error of Φ: Uniform Disc, z > 0

-8 -10 -12 -14

With Radial Splitting

-16 0

0.2 0.4 0.6 0.8

1

1.2 1.4 1.6 1.8

2

r Figure C3. Effect of splitting of radial integration: gravitational potential of uniform finite disc off disc plane. Same as Fig. ?? but compared are the results for the evaluation points off the disc plane with and without the splitting of the radial integration.

0

Φouter (x, y, z) ≡ −2πG

∫ a+R a−R

+ SA (p; x, y)(p/q)dp,

(C23)

while SA (p; x, y) in the integrand of Φinner (x, y, z) is already defined + (p; x, y) in the integrand of Φ in equation (6) but SA outer (x, y, z) is its restricted version expressed as ∫ θ C +ω 1 + SA Σ(x + p cos θ, y + p sin θ)dθ. (C24) (p; x, y) ≡ 2π θ C −ω Similar splitting must be applied to the evaluation of gravitational acceleration vector as Fx (x, y, z) = Fx,inner (x, y, z) + Fx,outer (x, y, z),

(C25)

Fy (x, y, z) = Fy,inner (x, y, z) + Fy,outer (x, y, z),

(C26)

Fz (x, y, z) = Fz,inner (x, y, z) + Fz,outer (x, y, z),

(C27)

where the separated integrals are written as ∫ a−R ( ) Fx,inner (x, y, z) ≡ −2πG SC (p; x, y) p2 /q3 dp,

(C28)

Fy,inner (x, y, z) ≡ −2πG

Fy,outer (x, y, z) ≡ −2πG

Fz,inner (x, y, z) ≡ 2πGz

∫ a+R a−R

∫ a−R 0

∫ a+R a−R

∫ a−R

a−R

( ) + SA (p; x, y) p/q3 dp,

(C33)

while SC (p; x, y) and SS (p; x, y) are already defined in equations (14) and (15), respectively, and SC+ (p; x, y) and SS+ (p; x, y) are their restricted versions expressed as ∫ θ C +ω 1 Σ(x+p cos θ, y+p sin θ) cos θ dθ. (C34) SC+ (p; x, y) ≡ 2π θ C −ω SS+ (p; x, y) ≡

1 2π

∫ θ C +ω θ C −ω

Σ(x + p cos θ, y + p sin θ) sin θ dθ. (C35)

( ) SC+ (p; x, y) p2 /q3 dp,

(C29)

( ) SS (p; x, y) p2 /q3 dp,

(C30)

(C31)

Fx (x, y, z) = −2πG

SS+ (p; x, y)

(

(

2

p /q

SA (p; x, y) p/q 0

∫ a+R

One may think that these split integrals can be formally combined into a single integral and numerically integrated. However, the discontinuity of the integrand at p = a − R caused by the intrinsic difference in the integration interval would hinder a proper convergence of the numerical quadrature of the combined integral. Refer to Fig. C3 comparing the integration error of Φ(x, y, z) of the finite uniform disc off the object plane with and without the splitting of the radial integration. Therefore, we recommend the separate integration of the inner and outer integrals. Notice that the split quadrature is not needed if the foot of P is outside the object, namely when R > a. In fact, one only has to evaluate the outer integrals as ∫ R+a + Φ(x, y, z) = −2πG SA (p; x, y)(p/q)dp, (C36)

0

Fx,outer (x, y, z) ≡ −2πG

Fz,outer (x, y, z) ≡ 2πGz

3

3

)

)

dp,

dp,

(C32)

R−a

Fy (x, y, z) = −2πG

∫ a+R a−R

∫ a+R a−R

( ) SC+ (p; x, y) p2 /q3 dp,

(C37)

( ) SS+ (p; x, y) p2 /q3 dp,

(C38)

MNRAS 000, 1–23 (2016)

Gravitational field of infinitely thin object

Integration Cost: Uniform Disc, Φ, z = 0

Integration Error of FR: Kuzmin Disc, z = 0 -13.5 -14

log10 |δFR|

log10 Neval

Not Reflected

-14.5

Reflected

-15 -15.5 -16 -16.5 -17 0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

5

6.5 6 5.5 5 4.5 4 3.5 3 2.5 2

-15

δ = 10 Angular Integrals Integrated Numerically

Angular Integrals Evaluated Analytically

0

0.2 0.4 0.6 0.8

r

C5

∫ a+R

( ) + SA (p; x, y) p/q3 dp.

a−R

(C39)

When the interval of the angular integrals, SA (p; x, y), SC (p; x, y), or SS (p; x, y), is [0, 2π], we may rewrite the integrals in a reflected form as ∫ θ C +π [ 1 SA (p; x, y) = Σ(x + p cos θ, y + p sin θ) 2π θ C

SC (p; x, y) =

1 2π

∫ θ C +π [ θC

−Σ(x − p cos θ, y − p sin θ) cos θdθ, SS (p; x, y) =

1 2π

∫ θ C +π [ θC

Figure C5. Computational cost of numerical integration of gravitational potential of uniform disc on object plane. Same as Fig. C5 but of the uniform disc compared with the result when the angular integrals are evaluated numerically.

SC (p; x, y), and SS (p; x, y), are analytically evaluated. For instance, if the circle of radius p is wholly inside the object, then they are simplified as (C43)

As a result, the inner part of the potential and acceleration integrals are also analytically integrated in a closed form as Φinner (x, y, z) =

−2πGΣC (a − R) 2 , P− + |z|

Fx,inner (x, y, z) = Fy,inner (x, y, z) = 0,

Fz,inner (x, y, z) =

(C41)

Σ(x + p cos θ, y + p sin θ)

] −Σ(x − p cos θ, y − p sin θ) sin θdθ.

2

(C44)

(C45)

(C40)

Σ(x + p cos θ, y + p sin θ) ]

1.2 1.4 1.6 1.8

SA (p; x, y) = ΣC, SC (p; x, y) = SS (p; x, y) = 0.

Reflection of angular integral

] +Σ(x − p cos θ, y − p sin θ) dθ,

1 r

Figure C4. Effect of reflection of angular integral. Same as Fig. 2 but for the case of the radial components when z = 0 and compared with the results obtained when the angular integral is not reflected.

Fz (x, y, z) = 2πGz

19

(C42)

−2πGΣC (a − R) 2 sign(z) , P− (P− + |z|)

(C46)

√ where P− ≡ (a − R) 2 + z 2 . These are essentially the same as the well-known expression of the gravitational potential and the associated acceleration vector of an infinitely thin uniform circular disc along its symmetric axis (Kellogg 1929). Also, even if the circle is not fully inside the object, the integrals can be evaluated since they reduce to the calculation of a constant or a trigonometric function over the length of circular arc. In fact, the integrals for the uniform circular disc in this case become

This may look a trivial rewriting to save the computational amount by repeatedly using the trigonometric functions, cos θ or sin θ. Nevertheless, it does improve also the accuracy of the new method significantly as shown in Fig. C4. This was an unexpected phenomenon.

SA (p; x, y) = ω/π, (0 ≤ ω ≤ π)

(C47)

SC (p; x, y) = (cos θ C sin ω) /π, (0 ≤ ω ≤ π)

(C48)

C6

SS (p; x, y) = (sin θ C sin ω) /π, (0 ≤ ω ≤ π)

(C49)

Analytical integration of line integrals

In some occasions, the line integrals dealt in the new method can be integrated analytically. For example, in the case of objects with a uniform density where Σ(x, y) = ΣC , the angular integrals, SA (p; x, y), MNRAS 000, 1–23 (2016)

where θC and ω are already defined in equations (C18) and (C19), respectively. This time, however, the radial integration is not analytically conducted in a closed form. At any rate, the evaluation of

20

T. Fukushima

Cost Performance of Numerical Quadrature: Φ, z = 0 0

Table D1. Quadruple precision Fortran 90 function to compute cel, Bulirsch’s general complete elliptic integral (Bulirsch 1965).

D2 disc, R/a=1/2

-2

log10 |δΦ|

-4 -6

|δΦ|=10-7(Neval/104)-9

-8 -10

|δΦ|=10

-12

-10

4 -9

(Neval/10 )

-14 -16 3

3.2 3.4 3.6 3.8 4 4.2 4.4 4.6 4.8 log10 Neval

5

Figure C6. Cost performance of numerical integration of gravitational potential: D 2 disc, z = 0. Same as Fig. 18 but plotted are the cases of D 2 disc with and without the amplification of δ inner , the relative error tolerance to be specified for the DE quadrature rule in integrating the inner line integrals. In achieving the same integration accuracy, the latter case requires 10–20 per cent fewer number of integrand evaluations. This appears as a slight leftward shift from the results without the amplification indicated by the filled triangles to those with the amplification marked by the open triangles.

some part of the surface integrals reduces to that of the line integrals. This results a dramatic acceleration of their computational speed as indicated in Fig. C5. In principle, the same treatment can be applied to the homoeoid, the Maclaurin, the D2 , and the Kuzmin discs. In fact, the angular integrals can be expressed in terms of the complete and incomplete elliptic integrals. Refer to Appendix E. These elliptic integrals are accurately and quickly computed in the IEEE 754 double precision environment by the recently developed methods (Fukushima 2009, 2010a,b, 2011a,b, 2012a,b, 2013a,b). However, this analytical integration is feasible because their surface mass density distribution takes a special form, namely half integer powers of a quadratic polynomial of the on-plane coordinates. Apart from the case of a homogenous surface mass density distribution, such a situation can not be expected in general applications. Therefore, we stop here and shall not seek for the further modification of the computational procedures by introducing the analytic evaluations in these cases.

C7

Amplification of relative error tolerance

In computing a double integral by the repeated utilization of an automatic integrator for line integrals, one may not have to set δinner , the relative error tolerance for the inner integrals, the same as δ, the relative error tolerance of the outer integral. This is because I, the magnitude of each inner line integral, changes significantly such that it is overacting to keep the same error tolerance even if the integral value to be obtained is relatively small. Refer to the example of CPU time saving by this technique in the efficient evaluation of general integrals of the Fermi-Dirac distribution (Fukushima 2014). At any rate, without a precision degrade of the double integral, one may set δinner being different from δ by multiplying an

1

9

real*16 function qcel(kc0,nc0,a0,b0,ierr) integer ierr real*16 kc0,nc0,a0,b0,a,b,e,em,kc,n,nc,ni,nci,m,mc ierr=0; kc=kc0 if(kc.eq.0.q0) then if(b.ne.0.q0) then ierr=1; qcel=1.q99; return else kc=1.q-32 endif endif kc=qabs(kc); a=a0; b=b0; nc=nc0; e=kc; em=1.q0 if(nc.gt.0.q0) then nc=qsqrt(nc); b=b/nc else mc=kc*kc; m=1.q0-mc; n=1.q0-nc; mc=mc-nc m=m*(b-a*nc); ni=1.q0/n; nc=qsqrt(mc*ni) a=(a-b)*ni; b=a*nc-m/(n*n*nc) endif continue mc=a; nci=1.q0/nc; a=a+b*nci; n=e*nci; b=b+mc*n b=2.q0*b; nc=nc+n; n=em; em=em+kc if(qabs(n-kc).lt.1.q-16*kc) goto 9 kc=2.q0*qsqrt(e); e=kc*em goto 1 continue qcel=1.5707963267948966192313216916397514421q0 *(b+a*em)/(em*(em+nc)) return;end

amplification factor as ( ∗ ) δinner = Imax /I ∗ δ,

&

(C50)

where I ∗ is an estimate of the magnitude of the inner integral value ∗ and Imax is its maximum value. In the case of the finitely bounded circular disc, a simple but appropriate estimate of the factor is [ ] ∗ Imax /I ∗ = 2π/ θ U (ξ) − θ L (ξ) , (C51) where θ U (ξ) and θ L (ξ) are the upper and lower end points of the inner line integral already introduced in equation (C1). We may expect that, the larger δinner is, the smaller the computational cost of the inner integral computation. In fact, this anticipation is confirmed by Fig. C6 comparing the cost performance of the two approaches for the gravitational potential integration of the D2 disc: (i) that with the amplification indicated by open triangles, and (ii) that without it marked by filled triangles. Obviously, the introduction of the amplification contributes around 10–20 per cent reduction of the computational amount for assuring the same computational accuracy.

APPENDIX D: QUADRUPLE PRECISION PROGRAM TO COMPUTE GENERAL COMPLETE ELLIPTIC INTEGRAL Table D1 shows qcel, our quadruple precision Fortran 90 function implementation to compute cel, Bulirsch’s generalized complete elliptic integral (Bulirsch 1965) defined as cel (k c , nc , a, b) MNRAS 000, 1–23 (2016)

Gravitational field of infinitely thin object



∫ π/2 0

(

φ+ φ dφ. (D1) )√ cos2 φ + nc sin2 φ cos2 φ + k c2 sin2 φ a cos2

b sin2

We confirmed the 33 digit accuracy of the program through a detailed check with the 40 digit calculation employing Mathematica 10 (Wolfram Res. 2015).

APPENDIX E: ANALYTICAL EXPRESSION OF ANGULAR INTEGRALS Here, we show some examples that the angular integrals, SA (p; x, y), SC (p; x, y), and/or SS (p; x, y), are analytically integrable. The surface mass density function of the homoeoid, Maclaurin, D2 , and Kuzmin discs is of the form of a simple square root of quadratic polynomial of x and y, the on-plane rectangular coordinates of the foot of the evaluation point. Therefore, the angular integrals are expressed in terms of elliptic integrals.

21

where K (m) is the complete elliptic integral of the first kind (Byrd & Friedman 1971) already expressed in equation (A8).

E2

SA (p; x, y) of other discs

By using the similar manipulations, we obtain the analytical expression of SA (p; x, y) for the Maclaurin disc as ( ) 2ΣC µ− SAM (p; x, y) = E (m− ) , (E10) π where E(m) is the complete elliptic integral of the second kind (Byrd & Friedman 1971). Also, SA (p; x, y) for the D2 disc is expressed as SAD (p; x, y) = * ,

2ΣC µ3− + [(4 − 2m− ) E (m− ) 3π -

− (1 − m− ) K (m− )] .

(E11)

Furthermore, SA (p; x, y) for the Kuzmin disc is expressed as E1

SA (p; x, y) of homoeoidal disc

Let us begin with SA (p; x, y) when its integration interval is [0, 2π], and therefore the elliptic integrals are all complete (Byrd & Friedman 1971). Consider a circular disc of the radius a. Assume that the circle of the radius p centered at the foot of the evaluation point √ (x, y) is entirely inside the object such that p ≤ a − R where R ≡ written as

x 2 + y 2 . Then, SA (p; x, y) for the homoeoid disc is

SAH (p; x, y) =

ΣC 2π

∫ 2π 0

dθ , √ T (θ)

(E1)

where ΣC is the central value of the surface mass density and T (θ) is a function defined as [ ] T (θ) ≡ 1 − (x + p cos θ) 2 + (y + p sin θ) 2 /a2 . (E2) We rewrite a2T (θ) as a2T (θ) = a2 − R2 − p2 − 2xp cos θ − 2yp sin θ.

(E3)

Introduce the variable transformation from θ to ψ defined as ψ ≡ (θ C − θ) /2,

(E4)

m− ≡

4pR . (a − R + p)(a + R − p)

Consequently, we rewrite the integral as ∫ π/2 ΣC dψ SAH (p; x, y) = . √ π −π/2 µ− 1 − m− sin2 ψ Thus, we finally arrive at the expression as ) ( 2ΣC K (m− ) , SAH (p; x, y) = π µ− MNRAS 000, 1–23 (2016)

(E6)

(E7)

(E8)

(E12)

where µ+ and m+ are additional auxiliary functions defined as √ a2 + (R + p) 2 µ+ ≡ , (E13) a 4pR m+ ≡ 2 . a + (R + p) 2

(E14)

In deriving the expressions of SAD (p; x, y) and SAK (p; x, y), we used the following integral formulas (Byrd & Friedman 1971, equation (310.04) and the last line of equation (111.06)) as ∫ π/2 sin4 φ dφ (2 + m)K (m) − 2(1 + m)E(m) = , (E15) ∆(φ|m) 3m2 0 ∫ π/2

E(m) ] 3 = Π(m|m) = 1 − m . 0 ∆(φ|m) √ where ∆(φ|m) ≡ 1 − m sin2 φ is Jacobi’s Delta function. [

where θ C is already defined in equation (C18). Then, we further rewrite a2T (θ) as ( ) a2T (θ) = a2 −(R+p) 2 −4pR sin2 ψ = a2 µ2− 1 − m− sin2 ψ , (E5) where µ− and m− are auxiliary functions defined as √ (a − R + p)(a + R − p) µ− ≡ , a

2ΣC E (m+ ) SAK (p; x, y) = * 3 + . π , µ+ - 1 − m+

E3



(E16)

SC (p; x, y) and SS (p; x, y)

Let us move to SC (p; x, y) and SS (p; x, y). Their integrands are different from that of SA (p; x, y) only by the multiplication factor, namely cos θ or sin θ. Therefore, it is natural that their analytical expressions become similar to those of SA (p; x, y). For example, SC (p; x, y) and SS (p; x, y) of the homoeoidal disc are written as ∫ 2π ΣC cos θ SCH (p; x, y) = dθ, (E17) √ 2π 0 T (θ) SSH (p; x, y) =

ΣC 2π

∫ 2π sin θ dθ. √ T (θ) 0

(E18)

By using the relation θ = θ C − 2ψ, we decompose cos θ and sin θ into the trigonometric functions of ψ as (E9)

cos θ = cos θ C cos 2ψ + sin θ C sin 2ψ.

(E19)

22

T. Fukushima

sin θ = sin θ C cos 2ψ − cos θ C sin 2ψ.

(E20)

Integration Error of SA(p;x,y), SC(p;x,y), SS(p;x,y)

The second terms, namely the terms containing sin 2ψ, vanish after the integration over [−π/2, π/2]. Thus, we obtain a rewriting of SCH (p; x, y) and SSH (p; x, y) as

where TH is an auxiliary function defined as ) ( 2ΣC TH ≡ [B (m− ) − D (m− )] , π µ−

while B(m) and D(m) are the associate complete elliptic integrals of the second kind (Fukushima 2010b) and expressed in equations (A33) and (A34), respectively. In a similar manner, we derive the analytical expressions of SC (p; x, y) and SS (p; x, y) for the other discs as SCM (p; x, y) = TM cos θ C, SSM (p; x, y) = TM sin θ C,

(E23)

SCD (p; x, y) = TD cos θ C, SSD (p; x, y) = TD sin θ C,

(E24)

SCK (p; x, y) = TK cos θ C, SSK (p; x, y) = TK sin θ C,

(E25)

where TM , TD , and TK are defined as ) ( 2ΣC µ− TM ≡ [B (m− ) − (1 − m− ) D (m− )] , 3π TD ≡ * ,

(E26)

-13.5 -14 -14.5 -15 -15.5 -16 0

0.1

0.2

0.3

0.4

0.5

p Figure E1. Numerical integration error of angular integrals. Shown are the relative errors of the angular integrals, namely SA (p; x, y), SC (p; x, y), and SS (p; x, y), integrated by the double exponential rule. The errors are obtained as the difference from the analytical solutions in terms of the complete elliptic integrals computed in the quadruple precision environment. √ The results when x = y = 1/ 2 and a = 1. are displayed for the five test discs by (i) crosses for the uniform disc, (ii) filled squares for the homoeoid disc, (iii) open circles for the Maclaurin disc, (iv) filled circles for the D 2 disc, and (v) open squares for the Kuzmin disc. Overlapped are the results for SA (p; x, y), SC (p; x, y), and SS (p; x, y) because there is no difference among their error distributions.

2ΣC µ3− + [(1 + m− ) B (m− ) 5π -

( ) ] 2 − 1 − 3m− + 2m− D (m− ) ,

(E27)

( ) 2ΣC B (m+ ) TK ≡ * 3 + D (m+ ) − . (E28) 1 − m+ , π µ+ In deriving these expressions, we used the integral formulas (i) obtained from the recursive relation (Byrd & Friedman 1971, equation (310.06)), with the help of equations (A34) and (E15), as ∫ π/2 ) sin6 φ dφ 1 [( 8 + 3m + 4m2 K (m) = 3 ∆(φ|m) 15m 0 ( ) ] − 8 + 7m + 8m2 E(m) ,

(E29)

and (ii) obtained from an identity relation sin2 φ

1 1 1 ]3 = m * [ ] 3 − ∆(φ|m) + , ∆(φ|m) , ∆(φ|m) and equaions (A8) and (E16) as ( ) ∫ π/2 1 E(m) sin2 φ dφ = − K (m) , [ ] m 1−m 0 ∆(φ|m) 3 [

-13

(E21)

(E22)

-15

R=1/2, a=1, δ=10

-12.5

log10 |δS|

SCH (p; x, y) = TH cos θ C, SSH (p; x, y) = TH sin θ C,

-12

(E30)

Table E1. Averaged CPU time of angular integral computation. Compared are the averaged CPU time (i) to integrate SA (p; x, y) numerically by intde, the double precision program to execute the double exponential quadrature rule, with a tiny relative error δ = 10−15 (Ooura 2006), and (ii) to compute it analytically by ceik and ceie, the double precision programs to evaluate the complete elliptic integrals K (m) and E (m) (Fukushima 2015). The average is taken over 106 or 109 sampling points of p in the range 0 < p ≤ a − R when R = 1/2 and a = 1. The unit of the CPU time is micro second at a PC with an Intel Core i7-4600U CPU running at 2.10 GHz clock. The CPU time of the analytical evaluation for the uniform disc is not measurable since the answer is a constant.

object uniform disc homoeoid disc Maclaurin disc Kuzmin disc D2 disc

CPU Time (µs) numerical analytical 9.5 27.9 29.2 29.3 29.3

— 0.0617 0.0617 0.0629 0.0661

E4 Numerical integration of angular integrals (E31)

and the relations between K (m), E(m), B(m), and D(m) as K (m) = B(m) + D(m),

(E32)

E(m) = B(m) + (1 − m)D(m).

(E33)

Let us examine the cost performance of the analytical evaluation of the angular integrals. For this purpose, we first prepared Fig. E1 showing the relative errors of the numerical integration of SA (p; x, y), SC (p; x, y), and SS (p; x, y) by the double exponential quadrature rule with a tiny relative error tolerance, δ = 10−15 . The figure indicates that the computational accuracy of the numerical integration is sufficiently high. Then, we next compare the averaged CPU times of the numerical integration of SA (p; x, y) with its anaMNRAS 000, 1–23 (2016)

Gravitational field of infinitely thin object lytical evaluation. Table E1 illustrates that the numerical integration costs roughly 400 times more than the analytical evaluation. This is because the averaged CPU time of calling ceik and ceie is slightly less than those of typical functions in the standard mathematical library such as the exponential function. The result of the averaged CPU time comparison is not significantly dependent on the type of angular integrals whether SA (p; x, y), SC (p; x, y), or SS (p; x, y). Based on these results, we conclude that the introduction of the analytical evaluation of the angular integrals will drastically reduce the computational time but not improve the computational accuracy significantly.

E5 Case of restricted angular interval So far, we have assumed that the integration interval of the angular integrals is full, namely [0, 2π]. Here, we consider the case when it is restricted as [θ C − ω, θ C + ω], where θ C and ω are already introduced in equations (C18) and (C19), respectively. In the restricted case, the elliptic integrals appeared in the above subsections become incomplete. More specifically speaking, we replace K (m± ), E (m± ), B (m± ), and D (m± ) in the above expressions by F (ω/2|m± ), E (ω/2|m± ), B (ω/2|m± ), and D (ω/2|m± ), respectively. Here F (φ|m) and E(φ|m) are the incomplete elliptic integral of the first and the second kind, respectively, with the argument φ and the parameter m (Byrd & Friedman 1971) defined as ∫ φ dψ F (φ|m) ≡ , (E34) 0 ∆(ψ|m) E(φ|m) ≡

∫ φ ∆(ψ|m) dψ.

This paper has been typeset from a TEX/LATEX file prepared by the author.

Meanwhile, B(φ|m) and D(φ|m) are two associate incomplete elliptic integrals of the second kind (Fukushima 2010a) defined as

B(φ|m) ≡

∫ φ cos2 ψ dψ, 0 ∆(ψ|m)

(E36)

D(φ|m) ≡

∫ φ sin2 ψ dψ. 0 ∆(ψ|m)

(E37)

The precise and fast computation of F (φ|m) is available (Fukushima 2010b). Meanwhile, that of E(φ|m) is realized as (E38)

where the precise and fast computation of B(φ|m) and D(φ|m) are also available (Fukushima 2012a).

REFERENCES Bulirsch, R. 1965, Numer. Math., 7, 78 Byrd, P. F., Friedman, M. D. 1971, Handbook on Elliptic Integrals for Engineers and Physicists, 2nd ed., Springer-Verlag, Berlin Chandrasekhar, S. 1995, Newton’s Principia for the Common Reader, Oxford Univ. Press, Oxford Cuddeford, P. 1993, MNRAS, 262, 1076 Danby, J. M. A. 1988, Fundamentals of Celestial Mechanics, 2nd rev. & enlarged ed., Willmann-Bell, Richmond Durand, E. 1953, Electrostatique et Magnetostatique, Masson et Cie, Paris MNRAS 000, 1–23 (2016)

Fukagawa, M., Tsukagoshi, T., Momose, M., Saigo, K., Ohashi, N., Kitamura, Y., Inutsuka, S., Muto, T., Nomura, H., Takeuchi, T., Kobayashi, H., Hanawa, T., Akiyama, E., Honda, M., Fujiwara, H., Kataoka, A., Takahashi, S. Z., Shibai, H. 2013, PASJ, 65, L14 Fukushima, T. 2009, CMDA, 105, 305 Fukushima, T. 2010a, CMDA, 108, 339 Fukushima, T. 2010b, Numer. Math., 116, 687 Fukushima, T. 2011a, Math. Comp., 80, 1725 Fukushima, T. 2011b, J. Comp. Appl. Math., 235, 4140 Fukushima, T. 2012a, Math. Comp., 81, 957 Fukushima, T. 2012b, J. Comp. Appl. Math., 236, 1961 Fukushima, T. 2013a, Numer. Math., 123, 585 Fukushima, T. 2013b, J. Comp. Appl. Math., 253, 142 Fukushima, T. 2014, Appl. Math. Comp., 238, 485 Fukushima, T. 2015, J. Comp. Appl. Math., 282, 71 Fukushima, T. 2016a, MNRAS, 456, 3702 Fukushima, T. 2016b, MNRAS, 459, 3825 Fukushima, T. 2016c, AJ, 152, 35 Fukushima, T. 2016d, MNRAS, 462, 2138 Fukushima, T. 2016e, MNRAS, doi:10.1093/mnras/stw2078 Fukushima, T. 2016f, Nucl. Fusion, submitted Kalnajs, A. J. 1972, ApJ, 175, 63 Kellogg, O. D. 1929, Foundations of Potential Theory, Springer, Berlin Kuzmin, G. 1956, Astr. Zh., 33, 27 Ooura, T. 2006. Numerical Integration (Quadrature) – DE Formula (Almighty Quadrature) http://www.kurims.kyoto-u.ac.jp/∼ ooura/intde.html Press W.H., Teukolsky S.A., Vetterling W.T., Flannery B.P. 2007, Numerical Recipes: the Art of Scientific Computing, 3rd ed., Cambridge Univ. Press, Cambridge Schulz, E. 2009, ApJ, 693, 1310 Takahashi, H., Mori, M. 1973, Numer. Math., 21, 206 Wolfram Res. 2015, Mathematica 10, https://www.wolfram.com/mathematica/

(E35)

0

E(φ|m) = B(φ|m) + (1 − m)D(φ|m),

23