Date  File  Comment by  Comment  Rating 

21 Feb 2015  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Manu  I think the routine is wrong. As mentioned by drake in 2012, there needs to be a precession matrix to go from J2000 to current epoch of ECEF, and that involves a change of the zaxis. The routine computes the new position through a simple rotation around the zaxis. I have compared the results from this routine to conversions using other algorithms (in particular JPL NAIF SPICE routines) and I find differences of ~ 20 km in x, y and z coordinates for times in the year 2015. I am not sure where the differences come from, but the absence of precession is likely the problem. 

19 Feb 2015  Vectorized Solar Azimuth and Elevation Estimation Predict the topocentric solar position defined by geodetic lat, lon, Alt, and a universal time  L. He  very nice program. I compare it with
the result is almost same. That one is more accurate,but not Vectorized yet. Note: please change this line


15 Dec 2014  2000 ASTM Standard Extraterrestrial Spectrum Reference E49000 Vectorized MATLAB code which will compute the solar flux given a wave length.  Tang  
15 Dec 2014  2000 ASTM Standard Extraterrestrial Spectrum Reference E49000 Vectorized MATLAB code which will compute the solar flux given a wave length.  Tang  
12 Dec 2014  GaussJackson EighthOrder ODE Solver (Fixed Step Size) GaussJackson EightOrder MultiStep PredictorCorrector using ODE113 in its startup procedure.  Christophe Lauwerys  Nice contribution. One remark: number of states is hardcoded to 3. Please replace these references to a variable number of states that you, for instance, can get from y0 at run time. Thanks Christophe 

11 Aug 2014  Convert Azimuth and Elevation to Right Ascension and Declination Algorithm will convert Az/El angles to RA /DEC using a topocentric coordinate frame  Darin Koblick  You should reference Vallado pg. 162 for additional information on "topocentric coordinate frame". It is a Geocentric equatorial coordinate system with the origin translated from the center of the Earth to the origin of the observer. 

08 Aug 2014  Convert Azimuth and Elevation to Right Ascension and Declination Algorithm will convert Az/El angles to RA /DEC using a topocentric coordinate frame  Mehdi  What is 'topocentric coordinate frame'? Is it the same as spherical celestial frame? 

08 May 2014  Lunar Azimuth and Altitude Estimation Algorithm Predict the Lunar Azimuth and Altitude within +/ .2 deg of any lat and lon for a given UTC  Leo  
23 Apr 2014  Efficient Vector Rotation Matrix Routine Efficient Method to Determine a Matrix Needed to Rotate One Vector to Another  Darin Koblick  Alexander, you are correct. I went ahead and changed the vector angle check to be closer to 1 instead of 0.99. Also, I found that I needed to add the case where vectors where close to parallel (i.e. abs(c) > 11e13) and two or more components had the same values. Thank you for pointing out the problem to me. 

22 Apr 2014  Efficient Vector Rotation Matrix Routine Efficient Method to Determine a Matrix Needed to Rotate One Vector to Another  Alexander  Thank you for submission. But if cosine of angle between vectors is >.99 (by module), calculation is incorrect.


05 Dec 2013  Vectorized ClohessyWiltshire Hill Linear Propagation A Demonstration of Linear Satellite Orbit Propagation Using ClohessyWiltshire Equations of Motion.  juyoung Son  
01 Sep 2013  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Darin Koblick  Chad, The two code lines you are referencing are trying to find the midnight that occurs before the provided Julian Date. As written, the first check will be true if the Julian date occurs after midnight and 12+ hours before the time. As written, the second check will be true if the Julian date occurs after midnight and less than 12 hours before the time. If both checks are true, the code will use the last midnight that occurred. This is the desired functionality. Because I am rounding down on the Julian date and subtracting a half day, there is no possible way that jd could be less than jdMin. Darin 

29 Aug 2013  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Chad Hawes  
29 Aug 2013  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Chad Hawes  Darin,
jd0(jd>jdMin) = jdMin(jd>jdMin);
This appears to be limiting the Julian day between a lower bound and an upper bound. Don't you want the first line to be: jd0(jd<jdMin) = jdMin(jd<jdMin); Otherwise, it would appear that no actual lower bounding occurs... Chad 

31 Jul 2013  Vectorized PicardChebyshev Method Vectorized PicardChebyshev Method used for the analysis of the 2012 ASME Conference paper 87878  Chris Binz  
31 Jul 2013  Vectorized ClohessyWiltshire Hill Linear Propagation A Demonstration of Linear Satellite Orbit Propagation Using ClohessyWiltshire Equations of Motion.  Chris Binz  
08 Apr 2013  Vectorized Solar Azimuth and Elevation Estimation Predict the topocentric solar position defined by geodetic lat, lon, Alt, and a universal time  Per  Very useful function. With a few updates it can handle vector time input. I would prefer the use of matlab UTC time input in order to speed up. 

27 Mar 2013  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  JoÃ£o Carneiro  Darin,
In MATLAB I am using your functions to transform ECI to ECEF and then using the MATLAB function, ecef2geodetic to transform into normal azimuth/elevation/height coordinate space. The weird behavior is that despite having smooth ECI data (smooth as in no jumps in the data) as inputs, I am getting discontinuous ECEF data (graph for r_ECEF(1,:) and r_ECEF(2,:) looks like saw). This is happening for GOES8 and GOES15 satellite data. What is weirder is that on a macro scale (ignoring variations, including the sudden discontinuities), the position of the satellite in the mapa mundi seems to be correct. 

10 Jan 2013  Efficient Vector Rotation Matrix Routine Efficient Method to Determine a Matrix Needed to Rotate One Vector to Another  Jan Simon  There is some potential for accelerations:


20 Oct 2012  Convert UTC to Solar Apparent Time Convert a time given in UTC to Solar Apparent or Solar Mean Time  Darin Koblick  Brandon, Also, if you are trying to compare the Solar Apparent Time, (SAT) be sure to input the longitude in degrees (W < 0, E > 0). You can see that this function will match the solutions (almost exactly ... depending on the year) to those solutions in Example 4 of the ASTRONOMICAL INFORMATION SHEET No. 58 http://astro.ukho.gov.uk/nao/services/ais58.pdf 

20 Oct 2012  Convert UTC to Solar Apparent Time Convert a time given in UTC to Solar Apparent or Solar Mean Time  Darin Koblick  Brandon, Latitude and Longitude are needed to determine the input time value to the equation of time (UT). They aren't needed to determine the equation of time ... it has nothing to do with latitude and longitude. Perhaps you should compare to a location with a 0hr local time offset. See this document for a description of what the equation of time is, you can also compare results to this as an "example". I don't guarantee any specific accuracy with EoT as it depends on the mean anomaly of the sun which is obviously a first/second order approximation. http://www.ips.gov.au/Educational/2/1/14 

18 Oct 2012  Convert UTC to Solar Apparent Time Convert a time given in UTC to Solar Apparent or Solar Mean Time  Brandon  The code does not appear to be working properly for me. I am trying to calculate the solar time of the ISS, and the solar day takes about 2.75 hours instead of 1.5 as expected. I further checked my results by plugging time and longitude into a converter on the NOAA website. It returned an Equation of Time that differed by 4%. Any ideas? Do you have some examples of where it works. 

11 Aug 2012  Convert ECEF to ECI Coordinates Take any vector or series of vectors in the ECEF Coordinate frame and convert them to ECI.  Darin Koblick  John, 35 leap seconds since 1972 sounds like that is indeed what you are seeing in STK. As you know, ECEFtoECI.m takes in a Julian date, so the correction would not be internal to this particular conversion routine. In fact, I don't think Mathworks attempts to address this issue with their juliandate.m routine. You would more than likely want to make the leap second correction when converting UTC to Julian date. Are you able to check for the estimated position differences using Julian date in STK instead of UTC? Perhaps this should make the comparisons a little more accurate as well. Truthfully, unless you are trying to use this routine in highprecision satellite mission operations, as long as you are consistent with your coordinate frame conversions (i.e. always using these conversion routines), it really shouldn't matter if there are minor discrepancies with STK (it is all relative motion anyway). Darin 

03 Aug 2012  Convert ECEF to ECI Coordinates Take any vector or series of vectors in the ECEF Coordinate frame and convert them to ECI.  John  Correction: JDate above should be: 2455728.92361111 

03 Aug 2012  Convert ECEF to ECI Coordinates Take any vector or series of vectors in the ECEF Coordinate frame and convert them to ECI.  John  Hello Darin,
I noticed that if I offset my time by 35 sec. in your function I get a much better agreement. That looks like it may be a leap second issue?


28 Jun 2012  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Darin Koblick  Drake, J2000 is factored into the ECI to ECEF conversion routine through the call to JD2GAST.m (converts Julian Date to Greenwhich Apparent Sidereal Time). In order to do this, the effects of nutation are considered, and depend on the correct number of Julian centuries since J2000. 

25 Jun 2012  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  drake  Dear Darin, It seems that this code considers the rotaion about Zaxis, or the earth's rotation axis only. However, the most commonly used ECI frame is J2000 which is defined at 1 January 2000, so I believe the effects of precession and nutation should be considered in the conversion between ECI(J2000) and ECEF.


28 May 2012  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Darin Koblick  Johan, You are correct, thank you for spotting that mistake. I should have left everything in degrees since the mean obliquity of the ecliptic is referenced directly in the final computation.
EPSILONm = 23.4392910.0130111.*T  1.64E07.*(T.^2) + 5.04E07.*(T.^3); This corresponds to the estimates contained in Vallado, Fundamentals of Astrodynamics and Applications, Second edition, (EQ 353). 2001. Thank you again for double checking my work. 

22 May 2012  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Johan  This function is great.


25 Apr 2012  Convert Keplerian Orbital Elements to a State Vector Convert orbital elements to a state vector, or a state vector back to orbital elements.  vlas  oops, forgot the comment, here it goes:


25 Apr 2012  Convert Keplerian Orbital Elements to a State Vector Convert orbital elements to a state vector, or a state vector back to orbital elements.  vlas  
15 Apr 2012  Convert Right Ascension and Declination to Azimuth and Elevation Algorithm will convert topocentric RA/DEC Angles to Azimuth and Elevation  Artik Crazy  
11 Apr 2012  Vectorized Analytic Two Body Propagator (Kepler Universal Variables) Analytic propagation routine uses universal variables to solve a single formula for all orbit types  Darin Koblick  John, The zip file seems to unzip without problems. Try using either the default windows zip utility, the MATLAB command unzip(), or the free 7zip utility. If all else fails, you can view the source code here: http://www.mathworks.com/matlabcentral/fileexchange/35566vectorizedanalytictwobodypropagatorkepleruniversalvariables/content/keplerUniversal.m 

11 Apr 2012  Vectorized Analytic Two Body Propagator (Kepler Universal Variables) Analytic propagation routine uses universal variables to solve a single formula for all orbit types  John Fuller  Downloaded but can't seem to unzip. Not sure if the file is corrupted, may want to check. 

08 Apr 2012  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Darin Koblick  The following ECI coordinate information rECI = [2392.11241452386
vECI = [3.27682054057320
t = 2453937.82777778; Will yield an ECEF position and velocity of rECEF = [15615.6915464865
vECEF = [0.253618011215938
This was obtained using the routines provided by CelesTrak found from http://www.celestrak.com/software/valladosw.asp The ECItoECEF.m routine I posted on the FileExchange comes very close to this with the following vectors: rECF = [ 15618.7911316673
vECF = [0.253618011215938
The problem is your ECEF position and velocity vectors do not correspond to each other. A very easy way to check this is to compute the magnitude of your position vectors. The magnitude of the first ECI position vector you have provided is: 26,366.726420485 km The magnitude of the ECEF solution should be exactly the same as the magnitude in the ECI reference frame. The magnitude of your ECEF position vector is 31,124.2960748149 km. Hopefully this solves your problem. 

08 Apr 2012  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Muhammad Shaikh  I am only posting here first five values of each of the vectors you asked for. They are actually long arrays of more than 1000 values. GPS XYZ Position in ECI:
GPS XYZ Velocity in ECI:
GPS XYZ Position in ECEF:
GPS XYZ Velocity in ECEF:
Juliandate Vector:


07 Apr 2012  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Darin Koblick  The MATLAB function juliandate.m should be fine. Can you please post the epoch, the position/velocity vector in ECI coordinates, and your ECF solution? 

07 Apr 2012  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Muhammad Shaikh  Thanks Darin for your reply.


05 Apr 2012  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Darin Koblick  Check to make sure your time vector is in J2000 format, not Unix Time (epoch should be starting 01/01/2000 12:00:00). 

04 Apr 2012  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Muhammad Shaikh  I am having some problems in calculating ECEF data. In my calculations, the satellite positions are calculated at the wrong side of Earth (globe) in the same plan they are now being calculated. Can you guide me for this please? Note, the data I am giving to the function is verified and I can easily say that my calculations can wrong, the data can't be. Please help. 

27 Feb 2012  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Martin Fuchs  Maybe something like this but I am not sure ??? if (~isempty(a_ECEF) && (~isempty(r_ECEF)) a_ECI = MultiDimMatrixTranspose(T3D(THETA))*a_ECEF' + 2*MultiDimMatrixTranspose(Tdot3D(THETA,omega_e))*v_ECEF' + MultiDimMatrixTranspose(Tdotdot3D(THETA,omega_e))*r_ECEF'; else a_ECI = []; end function Tdot = Tdotdot3D(THETA,omega_e)


27 Feb 2012  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Martin Fuchs  Could you also provide accelerations ? 

10 Jan 2012  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Syed Zohaib Ali  Hi Darin Now its working fine. I was passing JD argument in a wrong way. Thanks


09 Jan 2012  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Darin Koblick  Syed, Send me your test case and I will take a look at it. Thanks,


09 Jan 2012  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Syed Zohaib Ali  Hi I am facing problem in converting 1441 values of position and velocity vectors from ECI to ECEF. It seems that function works fine. When 93 out of 1441 values were passed to the function it gave values for x,y & z components which I thought are correct but when 186 out of 1441 values were passed to the function, the initial 93 x & y values were different from the one that I got by passing only 93 values, z components were the same. similarly when more values were passed the x&y were different except the zcomponent.


26 Nov 2011  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  lin yue  
17 Oct 2011  Convert Azimuth and Elevation to Right Ascension and Declination Algorithm will convert Az/El angles to RA /DEC using a topocentric coordinate frame  Artik Crazy  Nice code, thank you :)


17 Dec 2010  Julian Date to Greenwich Mean Sidereal Time Convert a given Julian Date to Greenwich Mean Sidereal Time (GMST) in degrees.  7ate9  
17 Dec 2010  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  7ate9  Excellent function  fast, and I verified a limited number of test cases. Thank you! 

01 Nov 2010  Convert ECI to ECEF Coordinates Transform ECI position, velocity and acceleration to ECEF position, velocity & acceleration.  Ismail  Ok .. now it works fine !

