10  Gravitational attraction of a prism

10.1 Problem description

Recall that the vertical component of the gravitational attraction caused by an elongated prismatic body of cross section \(S\) is

\[ g_z(x,z) = \frac{\partial}{\partial z}V(x,z) = -2 f \Delta \rho \int\limits_S \frac{(z - z')\, dx' \,dz'}{\sqrt{(x-x')^2 + (z-z')^2}}. \]

If the point of observation is at the origin, we obtain

\[ g_z(0,0) = \frac{\partial}{\partial z}V(0,0) = 2 f \Delta \rho \int\limits_S \frac{z\, dx \, dz}{\sqrt{x^2 + z^2}}. \]

It can be shown that this surface integral can be equivalently replaced by a line integral taken along the periphery of \(S\).

10.2 Line integral

The Stokes theorem states that, for any vector field \(\mathbf A = (A_x, 0, A_z)^\top\) there holds

\[ \int\limits_S (\nabla \times \mathbf A) \cdot d\mathbf s = \oint\limits_C \mathbf A \cdot d\mathbf \ell, \]

where \(d\mathbf\ell = \mathbf e_x dx + \mathbf e_z dz\) is the oriented line element tangential to the curve \(C\), and \(d\mathbf s = dx \,dz \, \mathbf e_y\) the oriented surface element normal to the cross section \(S\). It follows by inspection that

\[ \partial_z A_x - \partial_x A_z = 2 f \Delta \rho \frac{z}{x^2 + z^2} \]

such that, after making the ansatz (Zhou (2008))

\[ A_x = 0, \qquad A_z = -2 f \Delta\rho \, z \left(\frac{1}{z} \, \tan^{-1}\frac{x}{z}\right) = -2 f \Delta \rho \, \theta \]

The angle \(\theta\) is taken from the positive \(x\)-axis towards the positive \(z\)-axis.

Talwani et al. (1959) have shown that the vertical component of the gravitational attraction of a two-dimensional prismatic body is, at the origin, equal to

\[ g_z(0, 0) = 2 f \Delta \rho \oint\limits_C z \, d\theta, \]

i.e., a line integral taken along its periphery.

The following sketch illustrates the situation (taken from the original Talwani paper).

Let \(ABCDEF\) be a given polygon with \(n\) sides and let \(P\) be the point at which the gravitational attraction due to this body has to be computed.

Further, let \(z\) be defined positive downwards and let \(\theta\) be measured from the positive \(x\)-axis towards the positive \(z\)-axis.

Let us evaluate the integral \(\oint z\, d\theta\) for the above polygon.

We consider here the contribution from the side \(BC\). The remaining sides have to be added to obtain the total gravitational attraction of the complete prism.

At the point \(Q\) the line \(BC\) meets the \(x\)-axis at an angle \(\phi_i\).

Let \(PQ = a_i\). For any arbitrary point \(R = R(x,z)\) on the side \(BC\) there hold the two equivalent equations

\[ z = x \tan\theta \]

and

\[ z = (x - a_i) \tan\phi_i. \]

After eliminating \(x\) we obtain an expression for \(z = z(\theta)\):

\[ z = \frac{a_i \tan\phi_i \tan\theta}{\tan\phi_i - \tan\theta} \]

The contribution of the segment \(BC\) to the above line integral can now be rewritten as

\[ \int_{BC} z \, d\theta = \int\limits_B^C \frac{a_i \tan\phi_i \tan\theta}{\tan\phi_i - \tan\theta} \, d\theta =: Z_i. \]

The vertical component of the gravitational attraction is

\[ g_z(0, 0) = 2 f \Delta \rho \sum_{i=1}^n Z_i. \]

It remains to solve the integral in the expression for \(Z_i\). To this end, we use Sympy.

10.3 Implementation

Show the code
a, x, z, phi, theta, Z = symbols('a x z phi theta Z', real=True)
Z = solve(
    [tan(theta) * x - z, (x - a) * tan(phi) - z], 
    [x, z], dict=True)
# Z[0][z]
simplify(integrate(Z[0][z], theta))

\[\begin{equation}\frac{a \left(- 2 \theta - 2 \log{\left(- \tan{\left(\phi \right)} + \tan{\left(\theta \right)} \right)} \tan{\left(\phi \right)} + \log{\left(\frac{1}{\cos^{2}{\left(\theta \right)}} \right)} \tan{\left(\phi \right)}\right) \cos^{2}{\left(\phi \right)} \tan{\left(\phi \right)}}{2}\end{equation}\]

Note that with \[ \log\left( \frac{1}{\cos^2\theta}\right) = - 2 \log \cos\theta \] and after combining the \(\log\) terms we obtain the desired integral taken in the limit of integration, i.e., \(\theta_i\) and \(\theta_{i+1}\) \[ Z_{i} =a_{1} \sin \phi_{i} \cos \phi_{i} \left[ \theta_{i}-\theta_{i+1} +\tan \phi_{i} \log _{s} \frac{\cos \theta_{i}\left(\tan \theta_{i}-\tan \phi_{j}\right)}{\cos \theta_{i+1}\left(\tan \theta_{i+1}-\tan \phi_{i}\right)}\right] \] which is the equation for \(Z_i\) given in Talwani et al. (1959), p. 50.