1) In test_EKF_GEOS3, we define global variables: const (astronomical and mathematical constants), CS (unnormalized gravity field coefficients), AuxParam (struct that represents model parameters and time for orbit propagator), eopdata (Earth orientation parameters), PC (planetary coefficients for JPL ephemerides computation).
2) Download Earth orientation parameters from the following link, remove the header and texts like eop19620101.txt, and then rename it (if it is out of date).
3) Earth orientation parameters are read from eop19620101.txt.
4) Observations are read from GEOS3.txt, and biases from table 4-4 of the book “Fundamentals of Astrodynamics and Applications, 4th Edition, 2013,” are subtracted. Then measurement noises are set from table 4-4. After that, the station ecef position is calculated using Position.m, and two sets of observations (azimuth, elevation, and range) are selected. Afterward, LTC matrix (transformation from Greenwich meridian system to local tangent coordinates) is computed by LTCMatrix.m, and the initial guess of the satellite state vector at the epoch (first measurement’s time) is found by Elements.m and State.m.
5) The Extended Kalman Filter’s initial parameters and parameters for orbit propagator (AuxParam.Mjd_UTC = Mjd_UTC; AuxParam.n = 20; AuxParam.m = 20; AuxParam.sun = 1; AuxParam.moon = 1; AuxParam.planets = 1;) are set.
6) The epoch’s state vector is propagated to the second measurement's time and updated. After that, the updated state vector is propagated to the next measurement's time and updated. This procedure continues until the time of the last measurement. Finally, the updated state vector at the time of the last measurement is propagated to the time of the first measurement. The result is converted from the TOD to the ECI coordinate system and compared with the true state vector.
Please note that numerical integration is done in TOD coordinate system. So, only Earth rotation is considered in Accel.m and VarEqn.m.
O. Montenbruck, E. Gill, "Satellite Orbits: Models, Methods, and Applications," Springer Verlag, Heidelberg, 2005.
D. Vallado, "Fundamentals of Astrodynamics and Applications," 4th Edition, 2013.