1 Introduction

The goal of this research is to develop high-fidelity, computationally-efficient gravity field representations for large celestial bodies, with a particular focus on the Moon.\(^{3}\)Footnote 1 Nonspherical gravity is especially important at the Moon for two main reasons: first, the lunar gravity field is uneven compared to the gravity fields of other large celestial bodies. Second, because the Moon has a negligible atmospheric density, objects can orbit extremely close to the lunar surface, where localized anomalies in the gravity field are especially impactful on motion. Nonspherical gravity is a critical effect to include in cislunar dynamics models, and is therefore useful for applications where such dynamics models are required, including mission design, orbit determination, and guidance navigation and control.

Spherical harmonics (SH) models are the most common representations for gravity fields in astrodynamics. Kaula provides a foundational text on the application of SH models to gravity modeling [11], and Fantino and Casotto survey a variety of modern SH model evaluation techniques [2]. SH models can be used in analytic orbit theories for trajectory prediction, such as the recent technique presented by Mahajan and Alfriend [13]. SH models are also commonly used to compute accelerations due to nonspherical gravity for numerically propagated trajectories. SH gravity models have a few notable drawbacks. The fidelity of a SH model is quantified by its truncation degree L, and the quantity of terms in the SH series increases quadratically with increasing degree. In the context of this work, SH models are referred to by their degree only, with the understanding that the full order is used in all cases. A study on appropriate SH truncation degree at the Moon presented in McArdle, et. al. [17] indicates that the appropriate SH truncation degree can be substantially greater than \(L=100\) at low lunar altitudes. This large recommended SH truncation degree agrees with analysis from a recent mission design study for the Sustained Low-Altitude Lunar Orbiter Mission (SLALOM), where a degree 400 SH truncation is found to be necessary for sufficient trajectory prediction accuracy in a 10 km lunar altitude orbit [19]. A degree \(L=400\) SH series contains about 160,000 terms. SH models require many recursive associated Legendre function calculations, and mitigating this large processing burden is non-trivial.

Interpolated gravity representations have been developed as more runtime-efficient alternatives to SH models. Junkins applied weighting functions to smoothly combine adjacent local gravity models [8,9,10]. Jones, Born, and Belkyn applied the cubed-sphere discretization and local B-splines to develop interpolated gravity models [7]. Arora and Russell adapted the Junkins weighting function approach with adaptive local polynomials for their Fetch interpolated gravity models [1]. One drawback of these interpolated gravity model approaches is that the memory footprints for high-resolution interpolated models are quite large, with the Fetch models (for the Earth) requiring more than two gigabytes to represent a gravity fidelity equivalent to a degree \(L=360\) SH truncation.

As another alternative to SH models, point mascon, or mass concentration, models reproduce the gravity field using an ensemble of point mass potentials buried under the surface of the celestial body. Earlier investigations, such as the study by Woodburn, et. al. successfully applied geometrically simple mass objects to model Earth’s gravity [22]. One advantage of point mascon models is that they are easy to parallelize, since the contribution from each mascon can be computed independently at the evaluation point. Preceeding articles in this series present fixed-mass models, where all the masses are equal and the gravity field is reproduced by selecting mascon locations [15], and free-mass models, where the gravity field is reproduced by selecting mascon masses [16]. Weighted cubed-sphere (WCS) mascon models are introduced in this current work as runtime-efficient gravity representations that incur a smaller memory cost than previous interpolated gravity models for the same fidelity. WCS models divide the sphere into local patches using the cubed-sphere discretization, and use Junkins weighting functions to smoothly join locally-accurate point mascon models. By concentrating mascons in the local region and distributing mascons more sparsely in distant locations, the local gravity field can be accurately modeled with significantly fewer mascons than would be required to model the global gravity field to the same fidelity.

Using mascons as the basis function for each local patch also has a physical significance: the inverse-squared law of gravity naturally dissipates in the radial direction, avoiding the need to discretize the space in the radial direction. The same set of mascons can achieve a desired level of accuracy over a range of altitudes, allowing the WCS mascon models to use a two-dimensional, rather than three-dimensional, discretization. The gravitational potential and its gradients can be recovered from a mascon model up to an arbitrary derivative order, so there is no need to represent the gradients with separate sets of parameters: only the potential function is modeled. For each evaluation of the WCS mascon model, four local mascon models are combined using Junkins weighting functions to ensure global smoothness [9]. As a serendipitous statistical result, combining four local models reduces error in the overall result, which allows fewer mascons to be used than would be necessary to represent the local gravity field using a single model.

During the development of the WCS gravity modeling technique, early design iterations were inspired by large-scale N-body gravity modeling methods for simulating large cosmological structures [5]. Fast multipole method (FMM) techniques were applied to consolidate mascons distant from a local region-of-interest. For the particular gravity field application presented in this current work, consolidating distant mascons into their center of mass caused unacceptably high errors in the region-of-interest, due mainly to a different scale of parallax when compared to the galaxy modelling application. Using higher-order multipole expansions of distant mascons did reduce the errors in the region-of-interest, but required a complicated two-step process: First the global gravity field would be modeled using mascons and then this global mascon model would be consolidated at each local patch using multipole expansions. The final configuration chosen for the local mascon modeling technique uses a simpler approach, where the local mascon models are fit directly to a reference SH model.

The organization of this paper is as follows: First the structure of the WCS point mascon models is explained in detail, including a description of the cubed-sphere discretization, the Junkins weighting functions, and the WCS model generation method. Then a set of three WCS demonstration models is presented, with a comparison of the accuracy of accelerations derived from the WCS models and SH models, an evaluation runtime analysis, and a trajectory propagation error study using the new WCS models. Finally concluding remarks are made with suggestions for future work and recommendations for use cases of all three types of lunar mascon models: global free-mass, global fixed-mass, and local WCS models. All the mascon models developed in this series, including demonstration WCS mascon models are publicly disseminated with Fortran driver code in an online database. Footnote 2

2 Methods

In this section, the cubed-sphere discretization and the Junkins weighting function technique are explained, and the structure and generation technique for the local point mascon models are presented.

2.1 Cubed-Sphere Discretization

Locally-valid models are defined in regions of the sphere segmented by a cubed-sphere discretization [20]. The cubed-sphere discretization splits the sphere into patches with nearly equal areas. This discretization does not exhibit the severe distortions that arise from a naive spherical coordinate grid due to the singularities at the poles. The cubed-sphere patches are aligned across face boundaries, so it is possible to obtain smooth transitions between patches on adjacent faces.

Fig. 1
figure 1

Cube-sphere discretization

The cubed-sphere discretization defines a grid on each of the six faces of a cube and projects these grids onto the surface of the sphere. The areas between grid lines are denoted patches, and the intersections of grid lines are denoted nodes. A location on the sphere can be fully defined in terms of cubed-sphere coordinates, where f is the face index, h is the horizontal patch index, v is the vertical patch index, \(x_p\in [0, 1]\) is the local horizontal coordinate within the patch, and \(y_p\in [0, 1]\) is the local vertical coordinate within the patch.

Figure 1 illustrates the patches defined by the cubed-sphere discretization. Figure 1a shows coarse patches to accentuate the shape of the cubed-sphere discretization, and Fig. 1b shows a much finer discretization representative of the gravity models presented in the current work. The parameter \(n_{cs}\) defines the discretization level. The number of patches spanning a face horizontally or vertically is

$$\begin{aligned} m_{cs}=2(n_{cs}+1). \end{aligned}$$
(1)

The number of patches on a single face is \(m_{cs}^2\), and the total number of patches on the sphere is \(6m_{cs}^2\). One node is assigned to each corner of a patch. Adjacent patches share nodes. The full sphere has \(6m_{cs}^2+2\) unique nodes.

Algorithm 1
figure a

Mapping from Cartesian to cubed-sphere coordinates

Algorithm 1 describes the procedure to map a point in Cartesian coordinates to a point in cubed-sphere coordinates. Starting with a position vector \(\textbf{r}\) in Cartesian space, the face index is located by finding the nearest neighbor to six points defined in the positive and negative directions along each of the three axes. Once the face index is determined, the position vector is rotated into a coordinate frame aligned with the current face. Then the horizontal \(\beta _h\) and vertical \(\beta _v\) angles are calculated between the rotated position vector and the \(x_B\) axis. The horizontal and vertical angles are scaled such that the grid lines are located at integer distances from the edge of the face.

The specific implementation outlined in Algorithm 1 does include relatively expensive operations, including inverse trigonometric functions, and could likely be replaced with a faster alternative implementation in applications where the Cartesian to cubed-sphere mapping becomes a bottleneck. In the context of the WCS mascon models presented here, the implementation shown in Algorithm 1 has a negligible runtime compared to the local mascon model summation runtime.

Fig. 2
figure 2

Cube-sphere indices in Cartesian space (\(n_{cs}=1\))

Fig. 3
figure 3

Cube-sphere indices in spherical coordinates (\(n_{cs}=1\))

Figures 2 and 3 illustrate the cubed-sphere discretization indices. The cubed-sphere indices are shown on a sphere in Cartesian space and on a longitude/latitude map for comparison. The colors on the Cartesian and longitude/latitude representations are consistent. The global index

$$\begin{aligned} c = m_{cs}^2f + m_{cs}v + h \end{aligned}$$
(2)

is calculated for visualization purposes. The node locations are indicated by black dots. Figures 2 and 3 demonstrate the alignment of the cube-sphere patch edges across each of the six faces. Each patch has eight adjacent patches, other than the patches abutting the cube corners, which have seven adjacent patches.

2.2 Local Model Evaluation Frame

A different local point mascon gravity model is assigned to each node. The gravitational parameters for the local mascon models are defined uniquely for each node, but each node shares a single set of local mascon locations in the evaluation frame. The evaluation frame is defined by rotation matrices from each node. The rotation matrix to rotate node center location \(\hat{n} = [n_x, n_y, n_z]^T\) to the evaluation frame is provided by Frisvald [3]:

$$\begin{aligned} R_{cs} =\begin{bmatrix} 1 - \frac{n_x^2}{1+n_z} &{} -\frac{n_x n_y}{1 + n_z} &{} -n_x \\ -\frac{n_x n_y}{1 + n_z} &{} 1 - \frac{n_y^2}{1+n_z} &{} -n_y \\ n_x &{} n_y &{} n_z \end{bmatrix}. \end{aligned}$$
(3)

The single set of mascon locations shared by all nodes is aligned with a notional North Pole in the evaluation frame.

The rotation matrix for each node is precomputed and stored when generating the model. This rotation matrix is valid for all node locations other than the node location at the South Pole, where the diagonal rotation matrix \(R_{cs} = \text {diag}(1, 1, -1)\) is used. For an arbitrarily-fine discretization (very large \(n_{cs}\)) the evaluation of the points closest to the South Pole may experience numerical instability due to the singularity in the \(1/(1+n_z)\) factors of \(R_{cs}\). This issue is not observed with the WCS models generated in this work.

Earlier iterations of the WCS mascon model technique stored unique positions for the mascons at each node. However, this approach resulted in an extreme memory cost, with finely-discretized models occupying memory footprints on the order of gigabytes. The mascon locations are consolidated to a single point distribution in the evaluation frame in order to dramatically reduce memory consumption.

2.3 Junkins Weighting Functions

The Junkins weighting functions are defined such that the modeled global function and its derivatives up to a specified order are continuous across patch and face boundaries [6, 9]. The Junkins weighting function method allows for an arbitrary number of dimensions, but the WCS mascon model approach only requires two dimensions.

Each weighting function is defined using the same base weight function, with transformed inputs based on which corner node the weighting function corresponds,

$$\begin{aligned} w^{(d)}_0(x_p,y_p)&= w^{(d)}(x_p, y_p), \end{aligned}$$
(4)
$$\begin{aligned} w^{(d)}_1(x_p,y_p)&= w^{(d)}(1-x_p, y_p), \end{aligned}$$
(5)
$$\begin{aligned} w^{(d)}_2(x_p,y_p)&= w^{(d)}(1-x_p, 1-y_p), \end{aligned}$$
(6)
$$\begin{aligned} w^{(d)}_3(x_p,y_p)&= w^{(d)}(x_p, 1-y_p). \end{aligned}$$
(7)

Figure 4 shows the placement of the node locations on a single patch and illustrates the local horizontal and vertical coordinates \(x_p\) and \(y_p\). The local horizontal and vertical coordinates \(x_p\) and \(y_p\) span the valid patch area. The local horizontal and vertical coordinates are \(x_p=0\) and \(y_p=0\) at the origin and \(x_p=1\) and \(y_p=1\) at the top right corner of the patch area, as oriented in Fig. 4. The four weighting functions are defined such that the sum of the weighting functions is unity over the entire area of the patch and that the weighting functions and their derivatives up to the specified continuity order d are zero at the two edges opposite to the weighting functions’ corners.

Fig. 4
figure 4

Diagram of locally-valid region for Junkins weighting functions

The weighting function for continuity order d in one dimension is [6],

$$\begin{aligned} w^{(d)}(\tilde{x}) = \frac{(2d+1)!(-1)^d}{(d!)^2}\sum _{r=0}^{d}\frac{(-1)^r {\left( {\begin{array}{c}d\\ r\end{array}}\right) }}{2d - r + 1}\tilde{x}^{2d-r+1}, \end{aligned}$$
(8)

where the relation between \(\tilde{x}\) and \(x_p\) is node-dependent according to the input transformations specified in Eqs. 4-7, or:

$$\begin{aligned} \text {Node 0:} \quad&\tilde{x} = x_p, \end{aligned}$$
(9)
$$\begin{aligned} \text {Node 1:} \quad&\tilde{x} = 1-x_p, \end{aligned}$$
(10)
$$\begin{aligned} \text {Node 2:} \quad&\tilde{x} = 1-x_p, \end{aligned}$$
(11)
$$\begin{aligned} \text {Node 3:} \quad&\tilde{x} = x_p. \end{aligned}$$
(12)

Eq. 8 has a corresponding equation for \(\tilde{y}\), where the relation between \(\tilde{y}\) and \(y_p\) is similarly node-dependent according to the input transformations specified in Eqs. 47, or:

$$\begin{aligned} \text {Node 0:} \quad&\tilde{y} = y_p, \end{aligned}$$
(13)
$$\begin{aligned} \text {Node 1:} \quad&\tilde{y} = y_p, \end{aligned}$$
(14)
$$\begin{aligned} \text {Node 2:} \quad&\tilde{y} = 1-y_p, \end{aligned}$$
(15)
$$\begin{aligned} \text {Node 3:} \quad&\tilde{y} = 1-y_p. \end{aligned}$$
(16)

The weighting function for continuity order d in two dimensions is simply the product of the one-dimensional weighting functions,

$$\begin{aligned} w^{(d)}(\tilde{x},\tilde{y}) = w^{(d)}(\tilde{x}) w^{(d)}(\tilde{y}). \end{aligned}$$
(17)

The four contour plots in Fig. 4 illustrate the Junkins weighting functions for the four nodes of a patch. Note how the value of the weighting function is unity at each weighting function’s corner, and the value of the weighting function is zero at the opposite edges from each weighting functions’ corner. The consequence of this weighting approach is that the global function is exactly equivalent to each local function when the evaluation point is coincident with the local function node. Also, the modeled function and its gradients up to order d smoothly transition across patch and face boundaries. The smooth transitions across patch and face boundaries also occur at the cubed-sphere face corners, as demonstrated in Sect. 3.2.

Table 1 shows explicit formulas for two-dimensional Junkins weighting functions with various continuity orders d. In the context of WCS mascon gravity models, the runtime overhead from evaluating the Junkins weighting functions is negligible compared to the runtime required to evaluate the local mascon model summations. The maximum derivative order desired for applications of the weighted cubed sphere model is three, so the \(d=3\) continuity level is used unless otherwise specified.

Table 1 Weighting functions for various continuity orders d

2.4 Evaluating the Global Gravity Field

The global gravitational potential within a patch is expressed as a weighted sum of four local potential functions \(V_i(x, y, z)\), with each local potential function assigned to one of the four corners of the patch,

$$\begin{aligned} V(x, y, z) = \sum _{i=0}^3 w^{(d)}_i(x_p, y_p) V_i(x, y, z). \end{aligned}$$
(18)

For the WCS mascon models, the local potential function is computed for each node using the summation for individual mascon models presented in References [14] and [16]. This local potential computation is performed after rotating into the evaluation frame using \(R_{cs}\):

$$\begin{aligned} V_i({\varvec{r}}) = V^e_i(R_{cs}{\varvec{r}}), \end{aligned}$$
(19)

where \(V^e_i(\cdot )\) is the local potential computed in the evaluation frame.

The gradient of the global potential is found by applying the chain rule to Eq. (18),

$$\begin{aligned} \frac{dV}{dx}&= \sum _{i=0}^3 \left[ \frac{d w_i^{(d)}}{d x} V_i + w^{(d)}_i \frac{\partial V_i}{\partial x} \right] , \end{aligned}$$
(20)
$$\begin{aligned} \frac{dV}{dy}&= \sum _{i=0}^3 \left[ \frac{d w_i^{(d)}}{d y} V_i + w^{(d)}_i \frac{\partial V_i}{\partial y} \right] , \end{aligned}$$
(21)
$$\begin{aligned} \frac{dV}{dz}&= \sum _{i=0}^3 \left[ \frac{d w_i^{(d)}}{d z} V_i + w^{(d)}_i \frac{\partial V_i}{\partial z} \right] . \end{aligned}$$
(22)

Expressions for higher-order gradients of WCS models are found in Ref. [14] and included in the online code (see footnote in the introduction). The higher order gradients are useful for applications requiring first and second order partials of the acceleration. As with the computation of the local potential function, the computation of the local gradient function must be preceded by rotating the position into the node evaluation frame using \(R_{cs}\). Additionally, the local gradient must be rotated from the node evaluation frame back to the original frame using \(R_{cs}^T\):

$$\begin{aligned} \begin{bmatrix} \frac{\partial V_i}{\partial x}&\frac{\partial V_i}{\partial y}&\frac{\partial V_i}{\partial z} \end{bmatrix}^T = R_{cs}^T \nabla V^e_i(R_{cs}{\varvec{r}}). \end{aligned}$$
(23)

The first-order total derivatives of the weighting functions in terms of the global coordinates are

$$\begin{aligned} \frac{d w_i^{(d)}}{d x}&= \frac{\partial w^{(d)}_i}{\partial x_p} \frac{\partial x_p}{\partial x} + \frac{\partial w^{(d)}_i}{\partial y_p} \frac{\partial y_p}{\partial x}, \end{aligned}$$
(24)
$$\begin{aligned} \frac{d w_i^{(d)}}{d y}&= \frac{\partial w^{(d)}_i}{\partial x_p} \frac{\partial x_p}{\partial y} + \frac{\partial w^{(d)}_i}{\partial y_p} \frac{\partial y_p}{\partial y}, \end{aligned}$$
(25)
$$\begin{aligned} \frac{d w_i^{(d)}}{d z}&= \frac{\partial w^{(d)}_i}{\partial x_p} \frac{\partial x_p}{\partial z} + \frac{\partial w^{(d)}_i}{\partial y_p} \frac{\partial y_p}{\partial z}. \end{aligned}$$
(26)

Table 2 shows the values of the first-order partial derivatives for the weighting functions in terms of the local coordinates.

Table 2 First-order \(\tilde{x}\) derivatives of weighting functions

The derivatives in Table 2 are shown in terms of the local horizontal coordinates. The corresponding expressions for the local vertical coordinates are similar, switching \(\tilde{x}\) and \(\tilde{y}\). In order to obtain the full derivatives of the weighting function, the chain rule must be applied to each node:

$$\begin{aligned} \frac{\partial w^{(d)}_i}{\partial x_p} = \frac{\partial w^{(d)}(\tilde{x}, \tilde{y})}{\partial \tilde{x}} \frac{\partial \tilde{x}}{\partial x_p}, \end{aligned}$$
(27)

where the relationship between \(\tilde{x}\), \(\tilde{y}\) and \(x_p\), \(y_p\) depends on node index i, specified in Eqs. (47).

Table 3 First-order derivatives of local coordinates, f is face index

Table 3 shows the partial derivatives of the local coordinates with respect to the global Cartesian coordinates. Since each face is oriented differently, the derivatives of the local coordinates are different depending on the current face index f. All the derivative expressions in this section are verified using complex step differentiation.

2.5 Local Point Mascon Model Generation

The local mascon model generation technique presented here leads to models that perform well in terms of evaluation runtime compared to SH models with equivalent fidelity. However, this particular approach to mascon placement and weighting requires a moderate amount of manual tuning and is not guaranteed to be the most efficient allocation of mascons.

Fig. 5
figure 5

Local mascon (blue) and measurement locations (red) (Color figure online)

The positions of the mascons are defined such that there is a dense concentration of mascons on a spherical cap centered on the node location and a sparse concentration of mascons outside this spherical cap. Figure 5 illustrates the layout of the local mascon distribution. Note that the hypothetical model shown in Fig. 5 uses exaggerated spherical cap sizes to better illustrate the setup. Many variations of the final placement strategy were considered, including multiple levels of decreasing density. In the end, the selected two- level approach performed well and was the simplest to implement.

The size of the mascon spherical cap is defined by angle

$$\begin{aligned} \theta _{K} = \cos ^{-1} \left( 1 - \frac{\alpha _{K}}{3m_{cs}^2} \right) . \end{aligned}$$
(28)

This heuristic method to choose the spherical cap size adjusts the area of the spherical cap based on the cubed-sphere patch size. The quantity \(\alpha _{K}\) is a tuning parameter that determines how much area to occupy with the spherical cap. Choosing \(\alpha _{K}=4.0\) sizes the spherical cap such that it will cover roughly the same area as four patches, which is the locally-valid area for each node (other than the corner nodes). The mascon positions within the spherical cap are chosen according to a spiral distribution with \(K_{\text {near}}\) total points, and the mascon positions outside the spherical cap are chosen according to a spiral distribution with \(K_{\text {far}}\) points. The spiral distribution is a nearly-uniform distribution of points on a sphere [21].

The local mascon masses are defined by solving a minimum-norm linear system consisting of simulated gravitational potential measurements and direct-fit Stokes coefficients as outlined in Ref. [14]. The gravitational potential measurements are evaluated at specified locations using the GRGM1200A [4, 12] SH model with truth degree \(L_{t,gen}\) and a selection of Stokes coefficients up to degree \(L_f\). The truth degree \(L_t\) is used to perform the altitude vs. error and trajectory error studies.

The first set of gravitational potential measurement locations are distributed on the surface according to a spiral distribution with \(M_{\text {near}}\) total points. Similar to the local mascon placement, the simulated measurements are placed on a dense spherical cap defined by an angle \(\theta _{M}\) defined by Eq. (28), substituting and \(\alpha _M\) for \(\alpha _K\) as a tuning parameter, and \(\theta _{M}\) for \(\theta _{K}\) as the resulting angle. Additional sets of gravitational potential measurement locations are placed on \(n_h\) spherical caps with altitudes from \(h_{\text {min}}\) to \(h_{\text {max}}\) using equal log-spacing. The measurement locations above the surface are distributed using spiral distributions with

$$\begin{aligned} M_h=\text {floor}\left( \frac{M_{\text {near}}}{(h/1738.0+1)^{\nu _h}}\right) \end{aligned}$$
(29)

total points where h is the altitude measured in kilometers, and \(\nu _h\) is a tuning parameter that controls how quickly the number of measurements is reduced with increasing altitude.

The mascon and measurement locations for each node are determined by rotating the base mascon and measurement locations to center on the node location using Eq. (3). The minimum-norm systems at each node are solved using the Intel Math Kernel Library (MKL) implementation of LAPACK’s dgelsd, which solves the system using singular value decomposition. The effective rank of the system is defined using a minimum singular value of rcond=\(1.0\times 10^{-16}\). The solution process is parallelized over each node using Message Passing Interface (MPI) parallelization, allowing even the largest of the three demonstration models to be completed within one hour of wall-clock time.

2.6 Model Naming Convention

The WCS model naming convention is given by,

$$\begin{aligned} \left\{ \text {Reference Model} \right\} \_\text {WCS}\_\left\{ L_e \right\} , \end{aligned}$$
(30)

where \(L_e\) refers to the degree of the equivalent SH model. For example, a WCS model corresponding to a degree 70 truncation of the GRGM1200A reference model would be denoted GRGM1200A_WCS_70.

The equivalent size of SH model is determined using the error analysis described in Ref.  [17] and Sect. 3.3 of Ref. [14]. This error analysis includes the acceleration error from the published uncertainties of the included Stokes coefficients, denoted commission error, and the acceleration error from the Stokes coefficients that have been truncated from the full model, denoted omission error. The WCS model’s acceleration error averaged over the reference sphere is less than the averaged commission and omission error of its equivalent SH model truncation.

3 Results

Three example WCS gravity models for the Moon are presented and compared to equivalent SH models in sequential and CPU-parallelized computing environments.

3.1 Demonstration Models

Table 4 shows the tuning parameters selected for each of the three WCS models presented in this work. The discretization level \(n_{cs}=17\) is selected for all three models.

Table 4 Tuning parameters for weighted cubed-sphere models
Fig. 6
figure 6

Weighted cubed-sphere mascons (blue) and measurements (red) (Color figure online)

The three demonstration models are configured to have equivalent fidelity to \(L_e=70\), 300, and 550 degree SH models. For the three demonstration models, Table 5 reports the number of mascons and gravitational potential measurements used by the local mascon representations. The number of equivalent SH coefficients divided by four times the number of local mascons is a rough proxy for the WCS runtime improvement over SH if no overhead existed for the WCS models. Figure 6 shows the actual distributions of the mascons and gravitational potential measurement locations for each demonstration model in the evaluation frame.

Table 5 Weighted cubed-sphere model summary

3.2 Smoothness Demonstration

Figures 7, 8, 9, 10 demonstrate the continuity across patch boundaries enabled using the Junkins weighting function approach by showing the value of the gravitational potential and its derivatives evaluated along the surface of the reference sphere. Figure 7 shows the transition across a vertical face boundary, Fig. 8 shows the transition across a horizontal face boundary, Fig. 9 shows the transition across a corner boundary between three faces, and Fig. 10 shows the transition across a patch boundary at the South Pole.

Fig. 7
figure 7

Smoothness across vertical face boundary

Fig. 8
figure 8

Smoothness across horizontal face boundary

In the line illustrations, the line of evaluation locations is red and the faces are colored according to their face indices consistent with Fig. 3. The zoomed line illustration in Fig. 10b includes black lines of constant latitude (− 85 deg, − 80 deg, and − 75 deg) and longitude (45 deg, 135 deg, 225 deg, and 315 deg) to show that the smoothness test line passes directly through the South Pole. On the plots of the gravitational potential and its gradients, the horizontal axes represent the angular distance from the first point on each line and vertical dashed lines are shown at patch boundaries. The visualized model is GRGM1200A_WCS_70. The other two models demonstrate similar smoothness behavior.

The results from Figs. 7, 8, 9, 10 show that continuity is achieved up to order d. Above order d, continuity is not guaranteed by the Junkins weighting functions. Fig. 7 is a particularly striking example of a case where the \(d=0\) Junkins weighting functions do not enforce continuity in the derivatives, with a noticeable kink in the curve for the gravitational potential. The \(d=3\) Junkins weighting functions yield smooth curves, because the curves shown are only up to the second-order gradients.

Fig. 9
figure 9

Smoothness across corner

Fig. 10
figure 10

Smoothness across South Pole

3.3 Gravity Potential and Acceleration

Figures 11, 12, and 13 show the RMS acceleration errors for the degree \(L_e=70\), \(L_e=300\), and \(L_e=550\) WCS models over a range of altitudes, as compared to the RMS acceleration errors of their equivalent SH models. The RMS acceleration errors for Figs. 11, 12, 13 are computed using evaluation points spanning the full sphere in spiral distributions. The number of RMS evaluation points in the spiral distributions are 78,400, 1,440,000, and 4,840,000 for the \(L_e=70\), \(L_e=300\), and \(L_e=550\) models, respectively. For all three demonstration models, the RMS acceleration error curves for the WCS models are close to the corresponding curves for their equivalent SH models. Achieving such closely tracking curves across all altitude ranges in Figs. 11, 12, 13 required significant tuning efforts, resulting in the parameters provided in Table 4.

Fig. 11
figure 11

Weighted cubed-sphere altitude vs. error study, \(L_e=70\)

Fig. 12
figure 12

Weighted cubed-sphere altitude vs. error study, \(L_e=300\)

Fig. 13
figure 13

Weighted cubed-sphere altitude vs. error study, \(L_e=550\)

Fig. 14
figure 14

GRGM1200A_WCS_300 potential, 50 km altitude

Fig. 15
figure 15

GRGM1200A_WCS_300 acceleration, 50 km altitude

Figures 14 and 15 shows the gravitational potential and acceleration magnitude for GRGM1200A_WCS_300 over all longitudes/latitudes at 50 km altitude. The figures also show the residuals between the WCS model and its \(L_e=300\) equivalent SH model. The WCS model reproduces the potential and acceleration values smoothly.

3.4 Trajectory Error Study

A trajectory propagation error study is performed by integrating several example trajectories with the WCS model, with the equivalent-fidelity SH model truncation, and with the truth SH model truncated to the specified \(L_t\) value from Table 4. The Stokes coefficients for the truth SH model are perturbed using their published uncertainties to simulate the gravity modeling error in the Stokes coefficients. The differences between the final positions of the trajectory computed using the WCS model and using the truth SH model are considered the WCS position error. Corresponding differences between trajectories computed using the equivalent-fidelity SH model and using the truth SH model are considered the equivalent-fidelity SH position error.

Six classes of example trajectories are used, including four sets of polar orbits with initial altitudes ranging from 25 to 300 km, a Near Rectilinear Halo Orbit (NRHO), and a Distant Retrograde Orbit (DRO). The sets of polar orbits include orbits with varying initial longitude of the ascending node \(\Omega _0\) values to ensure that the polar orbits cover all latitudes and longitudes. Table 6 summarizes the six sets of orbits used in the trajectory error study. See Chapter 4 in Ref. [14] for more details on the trajectory error study setup. Some minor typos in the time-of-flight (TOF) values from Table 6 have been corrected since the corresponding table appeared in Ref. [14].

Table 6 Summary of trajectories used for error study

Figures 16 and 17 show the results of the trajectory error study performed on the WCS mascon models. The horizontal lines in Fig. 16 span the range of values for the final position error, the box spans the 25th to 75th percentiles, and the vertical lines indicate the median values, which are also reported in the vertical axis labels. The red boxes in Fig. 16 represent the WCS models and the blue boxes represent the eqiuvalent SH models.

Fig. 16
figure 16

WCS trajectory error study final position errors compared to the truth (see \(L_t\) in Table 4 for size of SH truth field)

Fig. 17
figure 17

WCS trajectory error study final position differences

The same box plot format is used for Fig. 17, except this figure shows the differences between the WCS models and their equivalent SH models instead of the errors against the truth model.

The errors for the WCS models are comparable or lower than their equivalent-fidelity SH models in all orbital regimes, in agreement with the acceleration error vs. altitude curves shown in Figs. 11, 12, 13. The highest-fidelity \(L_e=550\) WCS model is extremely accurate, with centimeter-level final position errors in the lowest 25 km altitude polar orbits.

3.5 Evaluation Runtime Benchmarking

Tables 7 and 8 show the sequential evaluation runtime speedup for the WCS models compared to their equivalent SH models. The runtime analysis is performed using Fortran driver routines on the same Linux workstation and Stampede2 Skylake compute node as the runtime analysis presented in Ref. [14].

Table 7 WCS sequential runtime analysis on Linux workstation
Table 8 WCS sequential runtime analysis on Stampede2

The evaluations for the runtime analysis are performed at random locations on the sphere to avoid a possible unfair advantage for the WCS models that would arise from repeatedly accessing the same local mascon model in the CPU cache. Note that for many applications, such as trajectory propagation, the same local model would in fact be accessed repeatedly, potentially granting better runtime improvements than presented here.

Table 9 WCS OpenMP parallel runtime analysis on Linux workstation
Table 10 WCS OpenMP parallel runtime analysis on Stampede2

Tables 9 and 10 show the parallel evaluation runtime speedups for the WCS models compared to their equivalent SH models when using OpenMP parallelization. The speedup from the best choice of OMP_NUM_THREADS is shown and the selected value for the number of threads is reported in parentheses. As indicated by the entries where zero threads are found to be optimal, the 70 degree equivalent WCS model does not benefit from OMP parallelization on Stampede2. The larger models only benefit from a modest number of processors, since the local models are not large enough to justify the overhead from managing a large amount of threads.

Figures 18, 19, 20, 21 report the evaluation runtimes and parallel runtime analyses for the degree 300 and degree 550 equivalent WCS models. The WCS models demonstrate favorable runtime performance compared to their equivalent SH models when evaluated using both sequential and CPU-parallelized code (using a modest number of processors). With parallelization, the WCS mascon models achieve a two order of magnitude speedup for the second- and third-order gradients.

Fig. 18
figure 18

WCS OpenMP parallel runtimes, Linux workstation

Fig. 19
figure 19

WCS OpenMP parallelization analysis, Linux workstation

Fig. 20
figure 20

WCS OpenMP parallel runtimes, Stampede2

Fig. 21
figure 21

WCS OpenMP parallelization analysis, Stampede2

Notably, the speedup performance is comparable on the Linux personal workstation and Stampede2 for the WCS models. The WCS models reduce the large global model down into relatively small local models, so the high-performance AVX512 registers on Stampede2 have a smaller influence on the runtime performance. The effect of OpenMP parallelization is also somewhat diminished by the small local model sizes, which is especially apparent in the relatively low parallel speedup values reported in Fig. 21.

3.6 Comparison with Previous Mascon Models

Figure 22 illustrates a runtime and memory benchmarking analysis carried out for highlighted fixed-mass models from Ref. [15] (square: GRGM1200A_PMC_EQM), free-mass models from Ref. [16] (circle: GRGM1200A_PMC), and WCS models from this work (diamond: GRGM1200A_WCS). All three types of mascon models are compared to their equivalent SH models (triangle: GRGM1200A). Table 11 shows the recommended model types used for different levels of fidelity. Memory indicates the ratio of the memory occupied by the suggested model divided by the memory occupied by its equivalent-fidelity SH model. Speedup indicates the ratio of the acceleration evaluation runtime speed for the equivalent-fidelity SH model divided by the runtime speed for the suggested model.

Fig. 22
figure 22

Memory footprint and evaluation runtime, filled markers are Pareto-optimal, dashed lines connect models of the same type, colors discriminate resolution

Table 11 Recommended point mascon models from database

4 Conclusion

This paper introduces the WCS mascon modeling technique, enabling a more widespread use of higher-fidelity gravity models for the Moon. The WCS demonstration models presented in this work yield similar runtime speedups to previous interpolated gravity representations with lower memory footprints (on the order of hundreds of megabytes, rather than gigabytes, for high-resolutions). The presented WCS models are useful for astrodynamics practitioners who require high-fidelity gravity models with low evaluation runtime costs. Using CPU multithreading parallelization yields additional runtime advantages, typically not available to SH models. The \(L_e=550\) WCS model achieves a nearly two order of magnitude faster acceleration evaluation runtime than SH. As the final of three papers in a series on mascon models at the moon, a comprehensive comparison is also performed, leading to various recommendations for models depending on the desired resolution of gravity field and computer architecture. As a rule of thumb, the global fixed-mass models are ideal for low fidelity in non-parallel computing environments, the global free-mass models are ideal for medium fidelity when parallelization is available, and the WCS mascon models are ideal for the highest fidelity as well as medium fidelity when parallelization is not available.

One potential disadvantage of mascon gravity formulations over the standard SH formulation is that it is more straightforward to adjust the fidelity of a SH model than a mascon model. Since the terms in a SH model are orthogonal to each other, the fidelity of a SH model can be reduced by simply truncating Stokes coefficients. Adding and removing arbitrary mascons from an existing mascon model does not result in an accurate representation of the gravity field. As the required gravity model fidelity varies with changing altitudes, the user of a mascon model would need to switch between models to use the most runtime-efficient model for the current accuracy needs.

There are a number of opportunities for future work. The generation process for the local mascon models could be improved, with a more systematic selection of mascon positions and masses. The demonstration models presented here are not necessarily the most efficient models possible in terms of the quantity of mascons used to represent gravity with a given level of fidelity.

The WCS models generated in this work are based on the existing GRGM1200A lunar gravity model, however it may be preferable to generate WCS models using direct measurements of the gravity field, rather than using a SH reference model. Generating WCS mascon models using direct measurements of the gravity field would resolve two disadvantages of the current approach: first, an additional source of error from the necessarily imperfect fit to the SH model would be avoided. Second, the uncertainty of the WCS model parameters could be computed during model generation, given the known errors in the gravity field measurements. This quantification of WCS model parameter uncertainty could be then mapped to the resulting orbital state uncertainty when using the WCS model to propagate trajectories.

The WCS representation could be applied to other gravity models besides the Moon, with the Earth, Mars, and Venus being the prime candidates. The WCS interpolation method could be immediately applied with basis functions other than point mascons to smoothly combine locally-valid models into a global function for gravity or other functions of interest. The models and runtime drivers presented in this paper are available online.