Logo Tesseroids 1.0: User Manual and API Documentation

src/c/grav_tess.c File Reference

Functions that calculate the gravitational potential and its first and second derivatives for the tesseroid. More...

#include <math.h>
#include "utils.h"
#include "glq.h"
#include "constants.h"
#include "grav_tess.h"

Functions

double calc_tess_model (TESSEROID *model, int size, double lonp, double latp, double rp, GLQ *glq_lon, GLQ *glq_lat, GLQ *glq_r, double(*field)(TESSEROID, double, double, double, GLQ, GLQ, GLQ))
 Calculates the field of a tesseroid model at a given point.
double calc_tess_model_adapt (TESSEROID *model, int size, double lonp, double latp, double rp, GLQ *glq_lon, GLQ *glq_lat, GLQ *glq_r, double(*field)(TESSEROID, double, double, double, GLQ, GLQ, GLQ))
 Adaptatively calculate the field of a tesseroid model at a given point by splitting the tesseroids if necessary to maintain GLQ stability.
double tess_pot (TESSEROID tess, double lonp, double latp, double rp, GLQ glq_lon, GLQ glq_lat, GLQ glq_r)
 Calculates potential caused by a tesseroid.
double tess_gx (TESSEROID tess, double lonp, double latp, double rp, GLQ glq_lon, GLQ glq_lat, GLQ glq_r)
 Calculates gx caused by a tesseroid (Grombein et al., 2010).
double tess_gy (TESSEROID tess, double lonp, double latp, double rp, GLQ glq_lon, GLQ glq_lat, GLQ glq_r)
 Calculates gy caused by a tesseroid (Grombein et al., 2010).
double tess_gz (TESSEROID tess, double lonp, double latp, double rp, GLQ glq_lon, GLQ glq_lat, GLQ glq_r)
 Calculates gz caused by a tesseroid (Grombein et al., 2010).
double tess_gxx (TESSEROID tess, double lonp, double latp, double rp, GLQ glq_lon, GLQ glq_lat, GLQ glq_r)
 Calculates gxx caused by a tesseroid (Grombein et al., 2010).
double tess_gxy (TESSEROID tess, double lonp, double latp, double rp, GLQ glq_lon, GLQ glq_lat, GLQ glq_r)
 Calculates gxy caused by a tesseroid (Grombein et al., 2010).
double tess_gxz (TESSEROID tess, double lonp, double latp, double rp, GLQ glq_lon, GLQ glq_lat, GLQ glq_r)
 Calculates gxz caused by a tesseroid (Grombein et al., 2010).
double tess_gyy (TESSEROID tess, double lonp, double latp, double rp, GLQ glq_lon, GLQ glq_lat, GLQ glq_r)
 Calculates gyy caused by a tesseroid (Grombein et al., 2010).
double tess_gyz (TESSEROID tess, double lonp, double latp, double rp, GLQ glq_lon, GLQ glq_lat, GLQ glq_r)
 Calculates gyz caused by a tesseroid (Grombein et al., 2010).
double tess_gzz (TESSEROID tess, double lonp, double latp, double rp, GLQ glq_lon, GLQ glq_lat, GLQ glq_r)
 Calculates gzz caused by a tesseroid (Grombein et al., 2010).

Detailed Description

Functions that calculate the gravitational potential and its first and second derivatives for the tesseroid.

References

Author:
Leonardo Uieda
Date:
27 Jan 2011

Function Documentation

double calc_tess_model ( TESSEROID model,
int  size,
double  lonp,
double  latp,
double  rp,
GLQ glq_lon,
GLQ glq_lat,
GLQ glq_r,
double(*)(TESSEROID, double, double, double, GLQ, GLQ, GLQ field 
)

Calculates the field of a tesseroid model at a given point.

Uses a function pointer to call one of the apropriate field calculating functions:

To pass a function pointer to a function use something like:

calc_tess_model(my_model, 10, 0, 10, 1, glqlon, glqlat, glqr, &tess_gx);

This would calculate the gx effect of the model my_model with 10 tesseroids at lon=0 lat=10 r=1.

Will re-use the same GLQ structures, and therefore the same order, for all the tesseroids.

Parameters:
model TESSEROID array defining the model
size number of tesseroids in the model
lonp longitude of the computation point P
latp latitude of the computation point P
rp radial coordinate of the computation point P
glq_lon pointer to GLQ structure used for the longitudinal integration
glq_lat pointer to GLQ structure used for the latitudinal integration
glq_r pointer to GLQ structure used for the radial integration
field pointer to one of the field calculating functions
Returns:
the sum of the fields of all the tesseroids in the model
double calc_tess_model_adapt ( TESSEROID model,
int  size,
double  lonp,
double  latp,
double  rp,
GLQ glq_lon,
GLQ glq_lat,
GLQ glq_r,
double(*)(TESSEROID, double, double, double, GLQ, GLQ, GLQ field 
)

Adaptatively calculate the field of a tesseroid model at a given point by splitting the tesseroids if necessary to maintain GLQ stability.

See calc_tess_model() for more details.

Will re-use the same GLQ structures, and therefore the same order, for all the tesseroids.

Parameters:
model TESSEROID array defining the model
size number of tesseroids in the model
lonp longitude of the computation point P
latp latitude of the computation point P
rp radial coordinate of the computation point P
glq_lon pointer to GLQ structure used for the longitudinal integration
glq_lat pointer to GLQ structure used for the latitudinal integration
glq_r pointer to GLQ structure used for the radial integration
field pointer to one of the field calculating functions
Returns:
the sum of the fields of all the tesseroids in the model
double tess_gx ( TESSEROID  tess,
double  lonp,
double  latp,
double  rp,
GLQ  glq_lon,
GLQ  glq_lat,
GLQ  glq_r 
)

Calculates gx caused by a tesseroid (Grombein et al., 2010).

\[ g_x(r_p,\phi_p,\lambda_p) = G \rho \displaystyle\int_{\lambda_1}^{\lambda_2} \displaystyle\int_{\phi_1}^{\phi_2} \displaystyle\int_{r_1}^{r_2} \frac{r'K_{\phi}}{\ell^3}\kappa \ d r' d \phi' d \lambda' \]

The derivatives of the potential are made with respect to the local coordinate system x->North, y->East, z->out

Input values in SI units and degrees and returns values in mGal!

Use function glq_new() to create the GLQ parameters required. The integration limits should be set to:

  • glq_lon: lower = tess.w and upper = tess.e (in degrees)
  • glq_lat: lower = tess.s and upper = tess.n (in degrees)
  • glq_r: lower = tess.r1 and upper = tess.r2
Parameters:
tess data structure describing the tesseroid
lonp longitude of the computation point P
latp latitude of the computation point P
rp radial coordinate of the computation point P
glq_lon GLQ structure with the nodes, weights and integration limits set for the longitudinal integration
glq_lat GLQ structure with the nodes, weights and integration limits set for the latitudinal integration
glq_r GLQ structure with the nodes, weights and integration limits set for the radial integration
Returns:
field calculated at P
double tess_gxx ( TESSEROID  tess,
double  lonp,
double  latp,
double  rp,
GLQ  glq_lon,
GLQ  glq_lat,
GLQ  glq_r 
)

Calculates gxx caused by a tesseroid (Grombein et al., 2010).

\[ g_{xx}(r_p,\phi_p,\lambda_p) = G \rho \displaystyle\int_{\lambda_1}^{\lambda_2} \displaystyle\int_{\phi_1}^{\phi_2} \displaystyle\int_{r_1}^{r_2} \frac{3(r' K_{\phi})^2 - \ell^2}{\ell^5}\kappa \ d r' d \phi' d \lambda' \]

The derivatives of the potential are made with respect to the local coordinate system x->North, y->East, z->out

Input values in SI units and degrees and returns values in Eotvos!

Use function glq_new() to create the GLQ parameters required. The integration limits should be set to:

  • glq_lon: lower = tess.w and upper = tess.e (in degrees)
  • glq_lat: lower = tess.s and upper = tess.n (in degrees)
  • glq_r: lower = tess.r1 and upper = tess.r2
Parameters:
tess data structure describing the tesseroid
lonp longitude of the computation point P
latp latitude of the computation point P
rp radial coordinate of the computation point P
glq_lon GLQ structure with the nodes, weights and integration limits set for the longitudinal integration
glq_lat GLQ structure with the nodes, weights and integration limits set for the latitudinal integration
glq_r GLQ structure with the nodes, weights and integration limits set for the radial integration
Returns:
field calculated at P
double tess_gxy ( TESSEROID  tess,
double  lonp,
double  latp,
double  rp,
GLQ  glq_lon,
GLQ  glq_lat,
GLQ  glq_r 
)

Calculates gxy caused by a tesseroid (Grombein et al., 2010).

\[ g_{xy}(r_p,\phi_p,\lambda_p) = G \rho \displaystyle\int_{\lambda_1}^{\lambda_2} \displaystyle\int_{\phi_1}^{\phi_2} \displaystyle\int_{r_1}^{r_2} \frac{3{r'}^2 K_{\phi}\cos\phi'\sin(\lambda' - \lambda_p)}{\ell^5} \kappa \ d r' d \phi' d \lambda' \]

The derivatives of the potential are made with respect to the local coordinate system x->North, y->East, z->out

Input values in SI units and degrees and returns values in Eotvos!

Use function glq_new() to create the GLQ parameters required. The integration limits should be set to:

  • glq_lon: lower = tess.w and upper = tess.e (in degrees)
  • glq_lat: lower = tess.s and upper = tess.n (in degrees)
  • glq_r: lower = tess.r1 and upper = tess.r2
Parameters:
tess data structure describing the tesseroid
lonp longitude of the computation point P
latp latitude of the computation point P
rp radial coordinate of the computation point P
glq_lon GLQ structure with the nodes, weights and integration limits set for the longitudinal integration
glq_lat GLQ structure with the nodes, weights and integration limits set for the latitudinal integration
glq_r GLQ structure with the nodes, weights and integration limits set for the radial integration
Returns:
field calculated at P
double tess_gxz ( TESSEROID  tess,
double  lonp,
double  latp,
double  rp,
GLQ  glq_lon,
GLQ  glq_lat,
GLQ  glq_r 
)

Calculates gxz caused by a tesseroid (Grombein et al., 2010).

\[ g_{xz}(r_p,\phi_p,\lambda_p) = G \rho \displaystyle\int_{\lambda_1}^{\lambda_2} \displaystyle\int_{\phi_1}^{\phi_2} \displaystyle\int_{r_1}^{r_2} \frac{3 r' K_{\phi}(r' \cos\psi - r_p)}{\ell^5}\kappa \ d r' d \phi' d \lambda' \]

The derivatives of the potential are made with respect to the local coordinate system x->North, y->East, z->out

Input values in SI units and degrees and returns values in Eotvos!

Use function glq_new() to create the GLQ parameters required. The integration limits should be set to:

  • glq_lon: lower = tess.w and upper = tess.e (in degrees)
  • glq_lat: lower = tess.s and upper = tess.n (in degrees)
  • glq_r: lower = tess.r1 and upper = tess.r2
Parameters:
tess data structure describing the tesseroid
lonp longitude of the computation point P
latp latitude of the computation point P
rp radial coordinate of the computation point P
glq_lon GLQ structure with the nodes, weights and integration limits set for the longitudinal integration
glq_lat GLQ structure with the nodes, weights and integration limits set for the latitudinal integration
glq_r GLQ structure with the nodes, weights and integration limits set for the radial integration
Returns:
field calculated at P
double tess_gy ( TESSEROID  tess,
double  lonp,
double  latp,
double  rp,
GLQ  glq_lon,
GLQ  glq_lat,
GLQ  glq_r 
)

Calculates gy caused by a tesseroid (Grombein et al., 2010).

\[ g_y(r_p,\phi_p,\lambda_p) = G \rho \displaystyle\int_{\lambda_1}^{\lambda_2} \displaystyle\int_{\phi_1}^{\phi_2} \displaystyle\int_{r_1}^{r_2} \frac{r'\cos\phi'\sin(\lambda'-\lambda)}{\ell^3}\kappa \ d r' d \phi' d \lambda' \]

The derivatives of the potential are made with respect to the local coordinate system x->North, y->East, z->out

Input values in SI units and degrees and returns values in mGal!

Use function glq_new() to create the GLQ parameters required. The integration limits should be set to:

  • glq_lon: lower = tess.w and upper = tess.e (in degrees)
  • glq_lat: lower = tess.s and upper = tess.n (in degrees)
  • glq_r: lower = tess.r1 and upper = tess.r2
Parameters:
tess data structure describing the tesseroid
lonp longitude of the computation point P
latp latitude of the computation point P
rp radial coordinate of the computation point P
glq_lon GLQ structure with the nodes, weights and integration limits set for the longitudinal integration
glq_lat GLQ structure with the nodes, weights and integration limits set for the latitudinal integration
glq_r GLQ structure with the nodes, weights and integration limits set for the radial integration
Returns:
field calculated at P
double tess_gyy ( TESSEROID  tess,
double  lonp,
double  latp,
double  rp,
GLQ  glq_lon,
GLQ  glq_lat,
GLQ  glq_r 
)

Calculates gyy caused by a tesseroid (Grombein et al., 2010).

\[ g_{yy}(r_p,\phi_p,\lambda_p) = G \rho \displaystyle\int_{\lambda_1}^{\lambda_2} \displaystyle\int_{\phi_1}^{\phi_2} \displaystyle\int_{r_1}^{r_2} \frac{3(r'\cos\phi'\sin(\lambda' - \lambda_p))^2 - \ell^2}{\ell^5} \kappa \ d r' d \phi' d \lambda' \]

The derivatives of the potential are made with respect to the local coordinate system x->North, y->East, z->out

Input values in SI units and degrees and returns values in Eotvos!

Use function glq_new() to create the GLQ parameters required. The integration limits should be set to:

  • glq_lon: lower = tess.w and upper = tess.e (in degrees)
  • glq_lat: lower = tess.s and upper = tess.n (in degrees)
  • glq_r: lower = tess.r1 and upper = tess.r2
Parameters:
tess data structure describing the tesseroid
lonp longitude of the computation point P
latp latitude of the computation point P
rp radial coordinate of the computation point P
glq_lon GLQ structure with the nodes, weights and integration limits set for the longitudinal integration
glq_lat GLQ structure with the nodes, weights and integration limits set for the latitudinal integration
glq_r GLQ structure with the nodes, weights and integration limits set for the radial integration
Returns:
field calculated at P
double tess_gyz ( TESSEROID  tess,
double  lonp,
double  latp,
double  rp,
GLQ  glq_lon,
GLQ  glq_lat,
GLQ  glq_r 
)

Calculates gyz caused by a tesseroid (Grombein et al., 2010).

\[ g_{yz}(r_p,\phi_p,\lambda_p) = G \rho \displaystyle\int_{\lambda_1}^{\lambda_2} \displaystyle\int_{\phi_1}^{\phi_2} \displaystyle\int_{r_1}^{r_2} \frac{3 r' \cos\phi' \sin(\lambda' - \lambda_p)(r'\cos\psi - r_p)}{\ell^5} \kappa \ d r' d \phi' d \lambda' \]

The derivatives of the potential are made with respect to the local coordinate system x->North, y->East, z->out

Input values in SI units and degrees and returns values in Eotvos!

Use function glq_new() to create the GLQ parameters required. The integration limits should be set to:

  • glq_lon: lower = tess.w and upper = tess.e (in degrees)
  • glq_lat: lower = tess.s and upper = tess.n (in degrees)
  • glq_r: lower = tess.r1 and upper = tess.r2
Parameters:
tess data structure describing the tesseroid
lonp longitude of the computation point P
latp latitude of the computation point P
rp radial coordinate of the computation point P
glq_lon GLQ structure with the nodes, weights and integration limits set for the longitudinal integration
glq_lat GLQ structure with the nodes, weights and integration limits set for the latitudinal integration
glq_r GLQ structure with the nodes, weights and integration limits set for the radial integration
Returns:
field calculated at P
double tess_gz ( TESSEROID  tess,
double  lonp,
double  latp,
double  rp,
GLQ  glq_lon,
GLQ  glq_lat,
GLQ  glq_r 
)

Calculates gz caused by a tesseroid (Grombein et al., 2010).

\[ g_z(r_p,\phi_p,\lambda_p) = G \rho \displaystyle\int_{\lambda_1}^{\lambda_2} \displaystyle\int_{\phi_1}^{\phi_2} \displaystyle\int_{r_1}^{r_2} \frac{r'\cos\psi - r_p}{\ell^3}\kappa \ d r' d \phi' d \lambda' \]

The derivatives of the potential are made with respect to the local coordinate system x->North, y->East, z->out

Input values in SI units and degrees and returns values in mGal!

Use function glq_new() to create the GLQ parameters required. The integration limits should be set to:

  • glq_lon: lower = tess.w and upper = tess.e (in degrees)
  • glq_lat: lower = tess.s and upper = tess.n (in degrees)
  • glq_r: lower = tess.r1 and upper = tess.r2
Parameters:
tess data structure describing the tesseroid
lonp longitude of the computation point P
latp latitude of the computation point P
rp radial coordinate of the computation point P
glq_lon GLQ structure with the nodes, weights and integration limits set for the longitudinal integration
glq_lat GLQ structure with the nodes, weights and integration limits set for the latitudinal integration
glq_r GLQ structure with the nodes, weights and integration limits set for the radial integration
Returns:
field calculated at P
double tess_gzz ( TESSEROID  tess,
double  lonp,
double  latp,
double  rp,
GLQ  glq_lon,
GLQ  glq_lat,
GLQ  glq_r 
)

Calculates gzz caused by a tesseroid (Grombein et al., 2010).

\[ g_{zz}(r_p,\phi_p,\lambda_p) = G \rho \displaystyle\int_{\lambda_1}^{\lambda_2} \displaystyle\int_{\phi_1}^{\phi_2} \displaystyle\int_{r_1}^{r_2} \frac{3(r'\cos\psi-r_p)^2 - \ell^2}{\ell^5}\kappa \ d r' d \phi' d \lambda' \]

The derivatives of the potential are made with respect to the local coordinate system x->North, y->East, z->out

Input values in SI units and degrees and returns values in Eotvos!

Use function glq_new() to create the GLQ parameters required. The integration limits should be set to:

  • glq_lon: lower = tess.w and upper = tess.e (in degrees)
  • glq_lat: lower = tess.s and upper = tess.n (in degrees)
  • glq_r: lower = tess.r1 and upper = tess.r2
Parameters:
tess data structure describing the tesseroid
lonp longitude of the computation point P
latp latitude of the computation point P
rp radial coordinate of the computation point P
glq_lon GLQ structure with the nodes, weights and integration limits set for the longitudinal integration
glq_lat GLQ structure with the nodes, weights and integration limits set for the latitudinal integration
glq_r GLQ structure with the nodes, weights and integration limits set for the radial integration
Returns:
field calculated at P
double tess_pot ( TESSEROID  tess,
double  lonp,
double  latp,
double  rp,
GLQ  glq_lon,
GLQ  glq_lat,
GLQ  glq_r 
)

Calculates potential caused by a tesseroid.

\[ V(r_p,\phi_p,\lambda_p) = G \rho \displaystyle\int_{\lambda_1}^{\lambda_2} \displaystyle\int_{\phi_1}^{\phi_2} \displaystyle\int_{r_1}^{r_2} \frac{1}{\ell}\kappa \ d r' d \phi' d \lambda' \]

Input and output values in SI units and degrees!

Use function glq_new() to create the GLQ parameters required. The integration limits should be set to:

  • glq_lon: lower = tess.w and upper = tess.e (in degrees)
  • glq_lat: lower = tess.s and upper = tess.n (in degrees)
  • glq_r: lower = tess.r1 and upper = tess.r2
Parameters:
tess data structure describing the tesseroid
lonp longitude of the computation point P
latp latitude of the computation point P
rp radial coordinate of the computation point P
glq_lon GLQ structure with the nodes, weights and integration limits set for the longitudinal integration
glq_lat GLQ structure with the nodes, weights and integration limits set for the latitudinal integration
glq_r GLQ structure with the nodes, weights and integration limits set for the radial integration
Returns:
field calculated at P
Generated on Tue Apr 26 12:17:07 2011 for Tesseroids 1.0: User manual and API documentation by doxygen 1.6.3