File Exchange

## SGP4

version 1.1.1.0 (9.72 MB) by Meysam Mahooti

### Meysam Mahooti (view profile)

The SGP4 model to calculate orbital state vectors of near-Earth satellites

Updated 02 Apr 2020

Simplified perturbations models are a set of five mathematical models (SGP, SGP4, SDP4, SGP8 and SDP8) used to calculate orbital state vectors of satellites and space debris relative to the Earth-centered inertial coordinate system. This set of models is often referred to collectively as SGP4 due to the frequency of use of that model particularly with two-line element sets produced by NORAD and NASA. These models predict the effect of perturbations caused by the Earth’s shape, drag, radiation, and gravitation effects from other bodies such as the sun and moon. Simplified General Perturbations (SGP) models apply to near earth objects with an orbital period of less than 225 minutes. Simplified Deep Space Perturbations (SDP) models apply to objects with an orbital period greater than 225 minutes, which corresponds to an altitude of 5,877.5 km, assuming a circular orbit.
The SGP4 model was developed by Ken Cranford in 1970. This model was obtained by simplification of the more extensive analytical theory of Lane and Cranford which uses the solution of Brouwer for its gravitational model and a power density function for its atmospheric model.

### Cite As

Meysam Mahooti (2020). SGP4 (https://www.mathworks.com/matlabcentral/fileexchange/62013-sgp4), MATLAB Central File Exchange. Retrieved .

Kazuko Hagiwara

Murat Bulut

Feng Xuefeng

Josue Pareja

Andy Williams

Hung Nguyen

### Hung Nguyen (view profile)

If I want "tsince" to be in seconds, what do I need to change in the code? So far, the results (in ECEF) seem to be consistent with an orbital tool we're using for one-day run on a GPS TLE, within (-0.7,+0.6) in range, and (-3e-4,+5e-4) in velocity magnitude. Thanks for the code.

Hung Nguyen

### Hung Nguyen (view profile)

Hi Meysam, do you have MATLAB code for SDP4 (orbital period greater than 225 minutes) model? If not can you give some pointers? Thanks

Meysam Mahooti

### Meysam Mahooti (view profile)

Dear Charith,
https://celestrak.com/publications/AIAA/2008-6770/AIAA-2008-6770.pdf
Best regards,

Charith Ranatunga

### Charith Ranatunga (view profile)

Dear Meysam, I just used your code and its work accordingly amazing work, and thank you. How do I interpret the equinox coordinate system it has provided me? Im trying to get some rough calculations done for a CubeSat comms subsystem and I'm unsure how to use the result of the SGP4 code.

Meysam Mahooti

### Meysam Mahooti (view profile)

Dear Zhang,
http://celestrak.com/SpaceData/
Best regards,

Star ZHANG

Shuangxi

xiupeng Jiang

A good job!

Meysam Mahooti

### Meysam Mahooti (view profile)

The output of SGP4 by Vallado is based on equator mean equinox (TEME) coordinate system. Please compare your results with STK. Moreover, I am not sure STK has considered what type of coordinate system. I suggest use my version rather than Vallado's version.

Changyong He

### Changyong He (view profile)

Clear code! However, note that the output of spg4 is different from the sgp4 propagator written by Vallado. I cannot find the reason because there are no comments in your code.

Reid McCargar

### Reid McCargar (view profile)

Nowhere in code, comments, or (absent) readme are units or coordinate systems specified, which creates a tremendous amount of unnecessary work for any user.

shahin darvish

### shahin darvish (view profile)

Dear Meysam, do you know why the results of sgp4 and STK are different?
(i tried sgp4 in Matlab,Python and C++ all of them had same result but different from STK!)

Muzammil Khan

### Muzammil Khan (view profile)

Dear Meysam kindly tell me what tsince actually is? is it the time since epoch of the satellite or something else and also how to calculate tsince for a particular yy/mm/dd h:m:s
Thanks

Meysam Mahooti

### Meysam Mahooti (view profile)

tsince in test_sg4.m is amount of time in minutes which you are going to propagate satellite's state vector forward (+) or backward (-).

Aakash Deep

### Aakash Deep (view profile)

Can you explain what is tsince in your code?

Wouter Huisman

### Wouter Huisman (view profile)

Thanks for the upload! I was wondering why the sgp4 function does not work when I use an eccentricity of zero? In order to get it to work for circular orbits, should I just use a very small eccentricity to approximate a circular orbit? My inclination, RAAN, eccentricity, argument of perigee, mean anomaly, mean motion, and revolution number at epoch are:
96.8500 217.5000 0000001 0.00000 0.000000 15.68820425 000

hackermancappie

Meisam Ashraf

### Meisam Ashraf (view profile)

Darren DeBattista

### Darren DeBattista (view profile)

Hi,

Thanks for the upload. How can I take time in consideration in order to propagate the satellite orbital position and velocity?

Michael Sampol