# planetEphemeris

Position and velocity of astronomical objects

## Syntax

``position= planetEphemeris(ephemerisTime,center,target)``
``position = planetEphemeris(ephemerisTime,center,target,ephemerisModel)``
``position = planetEphemeris(ephemerisTime,center,target,ephemerisModel,units)``
``position= planetEphemeris(ephemerisTime,center,target,ephemerisModel,units,action)``
``````[position,velocity] = planetEphemeris(___)``````

## Description

example

````position= planetEphemeris(ephemerisTime,center,target)` implements the position of the target object relative to the specified center object for a given Julian date `ephemerisTime`. By default, the function implements the position based on the DE405 ephemerides in units of km.The function uses the Chebyshev coefficients that the NASA Jet Propulsion Laboratory provides.This function requires that you download ephemeris data with the Add-On Explorer. For more information, see `aeroDataPackage`.`position = planetEphemeris(ephemerisTime,center,target,ephemerisModel)` uses the `ephemerisModel` coefficients to implement these values.`position = planetEphemeris(ephemerisTime,center,target,ephemerisModel,units)` specifies the units for these values. `position= planetEphemeris(ephemerisTime,center,target,ephemerisModel,units,action)` uses `action` to determine error reporting.```

example

``````[position,velocity] = planetEphemeris(___)``` implements the position and velocity of a the target object relative to the specified center for a given Julian date `ephemerisTime` using any of the input arguments in the previous syntaxes.```

## Examples

collapse all

Implement the position of the Moon with respect to the Earth for December 1, 1990 with DE405:

`position = planetEphemeris(juliandate(1990,12,1),'Earth','Moon')`
```position = 1.0e+05 * 2.3112 2.3817 1.3595```

Implement the position and velocity for Saturn with respect to the Solar System barycenter for noon on January 1, 2000 using DE421 and AU units:

```[position,velocity] = planetEphemeris([2451544.5 0.5],... 'SolarSystem','Saturn','421','AU')```
```position = 6.3993 6.1720 2.2738 velocity = -0.0043 0.0035 0.0016```

## Input Arguments

collapse all

Julian date for which the positions are calculated, specified as one of the following:

• Scalar

Specify one fixed Julian date.

• 2-element vector

Specify the Julian date in multiple parts. The first element is the Julian date for a specific epoch that is the most recent midnight at or before the interpolation epoch. The second element is the fractional part of a day elapsed between the first element and epoch. The second element must be positive. The value of the first element plus the second element cannot exceed the maximum Julian date.

• Column vector

Specify a column vector with M elements, where M is the number of fixed Julian dates.

• M-by-2 matrix

Specify a matrix, where M is the number of Julian dates and the second column contains the elapsed days (Julian epoch date/elapsed day pairs).

Data Types: `double`

Reference body (astronomical object) or point of reference from which to measure the target barycenter position and velocity.

Data Types: `char`

Target body (astronomical object) or point of reference of the barycenter position and velocity measurement.

Data Types: `char`

Ephemerides coefficients, specified as one of these ephemerides defined by the Jet Propulsion Laboratory:

• `'405'`

Released in 1998. This ephemerides takes into account the Julian date range 2305424.50 (December 9, 1599 ) to 2525008.50 (February 20, 2201).

This function calculates these ephemerides with respect to the International Celestial Reference Frame version 1.0, adopted in 1998.

• `'421'`

Released in 2008. This ephemerides takes into account the Julian date range 2414992.5 (December 4, 1899) to 2469808.5 (January 2, 2050).

This function calculates these ephemerides with respect to the International Celestial Reference Frame version 1.0, adopted in 1998.

• `'423'`

Released in 2010. This ephemerides takes into account the Julian date range 2378480.5 (December 16, 1799) to 2524624.5 (February 1, 2200).

This function calculates these ephemerides with respect to the International Celestial Reference Frame version 2.0, adopted in 2010.

• `'430'`

Released in 2013. This ephemerides takes into account the Julian date range 2287184.5 (December 21, 1549) to 2688976.5 (January 25, 2650).

This block implements these ephemerides with respect to the International Celestial Reference Frame version 2.0, adopted in 2010.

• `'432t'`

Released in April 2014. This ephemerides takes into account the Julian date range 2287184.5, (December 21, 1549 ) to 2688976.5, (January 25, 2650).

This block implements these ephemerides with respect to the International Celestial Reference Frame version 2.0, adopted in 2010.

Data Types: `char`

Output units for position and velocity, specified as `'km'` for km and km/s or `'AU'` for astronomical units or AU/day.

Data Types: `char`

Function behavior when inputs are out of range.

ValueDescription
`'None'`No action.
`'Warning'`Warning in the MATLAB® Command Window, model simulation continues.
`'Error'`MATLAB returns an exception, model simulation stops.

Data Types: `char`

## Output Arguments

collapse all

Barycenter position of the `target` object relative to the barycenter of the `center` object, returned as an M-by-3 vector, where M is the number of Julian dates. The 3 vector contains the x, y, and z of the position along the International Celestial Reference Frame (ICRF). Units are km or astronomical units (AU). If input arguments include multiple Julian dates or epochs, this vector has the same number of rows as the `ephemerisTime` input.

Barycenter velocity of the `target` object relative to the barycenter of the `center` object, returned as an M-by-3 vector, where M is the number of Julian dates. The 3 vector contains the velocity in the x, y, and z directions along the ICRF. Velocity of the Units are km or astronomical units (AU). If the input includes multiple Julian dates or epochs, this vector has the same number of rows as the `ephemerisTime` input.

## References

[1] Folkner, W. M., J. G. Williams, D. H. Boggs, “The Planetary and Lunar Ephemeris DE 421,” JPL Interplanetary Network Progress Report 24-178, 2009.

[2] Ma, C. et al., “The International Celestial Reference Frame as Realized by Very Long Baseline Interferometry,” Astronomical Journal, Vol. 116, 516–546, 1998.

[3] Vallado, D. A., Fundamentals of Astrodynamics and Applications, McGraw-Hill, New York, 1997.