Main Content

keplerian2ijk

Position and velocity vectors in geocentric equatorial coordinate system using Keplerian orbit elements

Description

[rijk,vijk] = keplerian2ijk(a,ecc,incl,RAAN,argp,nu) calculates the position and velocity vectors in the geocentric equatorial coordinate system (IJK) for given Keplerian orbit elements of noncircular, inclined orbits.

[rijk,vijk] = keplerian2ijk(___,Name,Value) specifies orbit element properties using one or more name-value pair arguments. For example, 'truelon','17' specifies the angle between the x-axis and spacecraft position vector. Specify name-value pair arguments after all other input arguments.

example

Examples

collapse all

This example shows how to convert Keplerian orbital elements to geocentric equatorial coordinate system (IJK) position and velocity.

a = 6786230;
ecc = .01;
incl = 52;
RAAN = 95;
argp = 93;
nu = 300;
[r_ijk, v_ijk] = keplerian2ijk(a, ecc, incl, RAAN, argp, nu)
r_ijk = 3×1
106 ×

   -2.7489
    5.4437
    2.8977

v_ijk = 3×1
103 ×

   -3.5694
   -4.5794
    5.0621

This example shows how to convert Keplerian orbital elements to geocentric equatorial coordinate system (IJK) position and velocity for equatorial orbit.

a = 6786230;
ecc = .1;
incl = 0;
RAAN = 95;
argp = 93;
nu = 300;
lonper = 45;
[r_ijk, v_ijk] = keplerian2ijk(a,ecc,incl,RAAN,argp,nu,lonper=lonper)
r_ijk = 3×1
106 ×

    6.1804
   -1.6560
         0

v_ijk = 3×1
103 ×

    1.4489
    7.9848
         0

Input Arguments

collapse all

Semimajor axis (half of the longest diameter) of the orbit, specified as a scalar, 1-by-n array, or n-by-1 array, in meters. This argument supports scalar expansion.

Data Types: double

Orbit eccentricity (deviation of orbital curve from circular), specified as a scalar, 1-by-n array, or n-by-1 array. This argument supports scalar expansion.

Data Types: double

Inclination (tilt angle) of the orbit, specified as a scalar, 1-by-n array, or n-by-1 array, in degrees. This argument supports scalar expansion.

Data Types: double

Angle in the equatorial plane from the x-axis to the location of the ascending node, point at which the satellite crosses the equator from south to north, specified as a scalar, 1-by-n array, or n-by-1 array, in degrees. This argument supports scalar expansion. The function does not use this value for equatorial orbits.

Data Types: double

Angle between the spacecraft ascending node and the periapsis (closest point of orbit to Earth), specified as a scalar, 1-by-n array, or n-by-1 array, in degrees. This argument supports scalar expansion. The function does not use this value for circular and equatorial orbits.

Data Types: double

Angle between the periapsis and the current position of spacecraft, specified as a scalar, 1-by-n array, or n-by-1 array, in degrees. This argument supports scalar expansion. The function does not use this value for circular orbits.

Data Types: double

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 45

Angle between the x-axis and the spacecraft position vector, specified as a scalar, 1-by-n array, or n-by-1 array, in degrees. This argument supports scalar expansion. The function uses this value only for circular equatorial orbits (where eccentricity and inclination are zero).

Data Types: double

Angle between the ascending node and the spacecraft position vector, specified as a scalar, 1-by-n array, or n-by-1 array, in degrees. This argument supports scalar expansion. The function uses this value only for circular inclined orbits (where eccentricity is zero and inclination is nonzero).

Data Types: double

Angle between the x-axis and the eccentricity vector, specified as a scalar, 1-by-n array, or n-by-1 array, in degrees. This argument supports scalar expansion. The function uses this value only for noncircular equatorial orbits (where eccentricity is nonzero and inclination is zero).

Data Types: double

Function behavior when rijk and vijk are parallel or if orbit is parabolic or hyperbolic.

ValueDescription
'None'Does not display warning or error. If orbit is parabolic, semimajor axis output a is set to periapsis radius.
'Warning'Warning in the MATLAB® Command Window indicating that the orbit is either parabolic or hyperbolic. If warning only applies to a subset of inputs, the first input index where the warning applies is displayed.
'Error'Error in the MATLAB Command Window indicating that the orbit is either parabolic or hyperbolic. If error only applies to a subset of inputs, the first input index where the error applies is displayed.

Celestial body around which the spacecraft orbits, specified as one of Earth, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, or Sun.

Dependencies

You can specify this name-value pair if you leave 'GravitationalParameter' unspecified.

Data Types: string

Gravitational parameter for a custom central body, specified as a positive scalar.

Dependencies

You can specify this name-value pair if you leave CentralBody unspecified.

Data Types: double

Output Arguments

collapse all

Geocentric equatorial position components, returned as a 3-by-1 array or 3-by-n array, in meters.

Geocentric equatorial velocity components, returned as a 3-by-1 array or 3-by-n array, in m/s.

More About

collapse all

References

[1] Vallado, D. A. Fundamentals of Astrodynamics and Applications. alg. 5. McGraw-Hill, 1997.

[2] NASA. "Planetary Fact Sheet." NASA National Space Science Data Center. https://nssdc.gsfc.nasa.gov/planetary/factsheet/.

Version History

Introduced in R2019a

expand all