MATLAB: Do I get the warning “Radial position is less than equatorial radius of planetary model” when using the “gravitysp​hericalhar​monic” function

Aerospace Toolbox

The aerospace toolbox function "gravitysphericalharmonic" issues a warning when the radius of the ecef coordinates is less than the equatorial axis.
"Warning: Radial position is less than equatorial radius of planetary model, 6.37814e+06."
What is the reason for the warning?

Best Answer

The warning message states that the radius used in error handling is the equatorial radius, and provides the numerical value for the radius used in the validation:
>> gx = gravitysphericalharmonic( [-6378.1363e3 0 0] )
"Warning: Radial position is less than equatorial radius of planetary model, 6.37814e+06."
The documentation page for the function provides additional information in the following limitation:
"Spherical harmonic gravity model is valid for radial positions greater than the planet equatorial radius. Minor errors might occur for radial positions near or at the planetary surface. The spherical harmonic gravity model is not valid for radial positions less than planetary surface."
This limitation is derived from the underlying gravity models outlined in the block's references. You can look at the references in the link below:
You can pass the function an "action" input set to "None" to suppress this warning. This is the recommended action if you would like to calculate gravitational acceleration between R_e and R_p.