Implement 1984 World Geodetic System (WGS84) representation of Earth's gravity

`g = gravitywgs84(h, lat)`

g = gravitywgs84(h, lat, lon, method,
[noatm, nocent, prec, jd], action)

gn = gravitywgs84(h, lat, lon, 'Exact',
[noatm, nocent, prec, jd], action)

[gn gt] = gravitywgs84(h, lat, lon,
'Exact', [noatm, nocent, prec, jd], action)

`g = gravitywgs84(h, lat)`

implements
the mathematical representation of the geocentric equipotential ellipsoid
of WGS84. Using `h`

, an array of `m`

altitudes
in meters, and `lat`

, an array of `m`

geodetic
latitudes in degrees, calculates `g`

, an array of `m`

gravity
values in the direction normal to the Earth's surface at a specific
location. The default calculation method is Taylor Series. Gravity
precision is controlled via the `method`

parameter.

```
g = gravitywgs84(h, lat, lon, method,
[noatm, nocent, prec, jd], action)
```

lets you specify both
latitude and longitude, as well as other optional inputs, when calculating
gravity values in the direction normal to the Earth's surface. In
this format, `method`

can be either `'CloseApprox'`

or`'Exact'`

.

```
gn = gravitywgs84(h, lat, lon, 'Exact',
[noatm, nocent, prec, jd], action)
```

calculates an array
of total gravity values in the direction normal to the Earth's surface.

```
[gn gt] = gravitywgs84(h, lat, lon,
'Exact', [noatm, nocent, prec, jd], action)
```

calculates
gravity values in the direction both normal and tangential to the
Earth's surface.

Inputs for `gravitywgs84`

are:

| An array of `m` altitudes, in meters, with respect to the WGS84
ellipsoid. |

| An array of |

| An array of |

| Method to calculate gravity: |

| A logical value specifying the exclusion of Earth's atmosphere.
Set to |

| A logical value specifying the removal of centrifugal
effects. Set to |

| A logical value specifying the presence of a precessing
reference frame. Set to |

| A scalar value specifying Julian date used to calculate
Julian Centuries from Epoch J2000.0. This input is available only
with |

| Action for out-of-range input. Specify if out-of-range
input invokes a |

Outputs calculated for the Earth's gravity include:

| An array of |

| An array of |

| An array of |

Calculate the normal gravity at 5000 meters and 55 degrees latitude using the Taylor Series approximation method with errors for out-of-range inputs:

g = gravitywgs84( 5000, 55, 'TaylorSeries', 'Error') g = 9.7997

Calculate the normal gravity at 15,000 meters, 45 degrees latitude, and 120 degrees longitude using the Close Approximation method with atmosphere, centrifugal effects, and no precessing, with warnings for out-of-range inputs:

g = gravitywgs84( 15000, 45, 120, 'CloseApprox') g = 9.7601

Calculate the normal and tangential gravity at 1000 meters, 0 degrees latitude, and 20 degrees longitude using the Exact method with atmosphere, centrifugal effects, and no precessing, with warnings for out-of-range inputs:

[gn, gt] = gravitywgs84( 1000, 0, 20, 'Exact') gn = 9.7772 gt = 0

Calculate the normal and tangential gravity at 1000 meters, 0 degrees latitude, and 20 degrees longitude and 11,000 meters, 30 degrees latitude, and 50 degrees longitude using the Exact method with atmosphere, centrifugal effects, and no precessing, with no actions for out-of-range inputs:

h = [1000; 11000]; lat = [0; 30]; lon = [20; 50]; [gn, gt] = gravitywgs84( h, lat, lon, 'Exact', 'None' ) gn = 9.7772 9.7594 gt = 1.0e-04 * 0 -0.7751

Calculate the normal gravity at 15,000 meters, 45 degrees latitude, and 120 degrees longitude and 5000 meters, 55 degrees latitude, and 100 degrees longitude using the Close Approximation method with atmosphere, no centrifugal effects, and no precessing, with warnings for out-of-range inputs:

h = [15000 5000]; lat = [45 55]; lon = [120 100]; g = gravitywgs84( h, lat, lon, 'CloseApprox', [false true false 0]) g = 9.7771 9.8109

Calculate the normal and tangential gravity at 1000 meters, 0 degrees latitude, and 20 degrees longitude using the Exact method with atmosphere, centrifugal effects, and precessing at Julian date 2451545, with warnings for out-of-range inputs:

[gn, gt] = gravitywgs84( 1000, 0, 20, 'Exact', ... [ false false true 2451545 ], 'Warning') gn = 9.7772 gt = 0

Calculate the normal gravity at 15,000 meters, 45 degrees latitude, and 120 degrees longitude using the Close Approximation method with no atmosphere, with centrifugal effects, and with precessing at Julian date 2451545, with errors for out-of-range inputs:

g = gravitywgs84( 15000, 45, 120, 'CloseApprox', ... [ true false true 2451545 ], 'Error') g = 9.7601

Calculate the total normal gravity at 15,000 meters, 45 degrees latitude, and 120 degrees longitude using the Exact method with no atmosphere, with centrifugal effects, and with precessing at Julian date 2451545, with errors for out-of-range inputs:

gn = gravitywgs84( 15000, 45, 120, 'Exact', ... [ true false true 2451545 ], 'Error') gn = 9.7601

The WGS84 gravity calculations are based on the assumption of a geocentric equipotential ellipsoid of revolution. Since the gravity potential is assumed to be the same everywhere on the ellipsoid, there must be a specific theoretical gravity potential that can be uniquely determined from the four independent constants defining the ellipsoid.

Use of the WGS84 Taylor Series model should be limited to low geodetic heights. It is sufficient near the surface when submicrogal precision is not necessary. At medium and high geodetic heights, it is less accurate.

Use of the WGS84 Close Approximation model should be limited to a geodetic height of 20,000.0 meters (approximately 65,620.0 feet). Below this height, it gives results with submicrogal precision.

To predict and determine a satellite orbit with high accuracy, use the EGM96 through degree and order 70.

NIMA TR8350.2: “Department of Defense World Geodetic System 1984, Its Definition and Relationship with Local Geodetic Systems.”