Problems with WGS84 Gravity Model in Simulink
6 views (last 30 days)
Show older comments
Okay, I've been having a pretty significant issue with the WGS84 block in simulink.
In order to test it out I've been using an ISS orbit (taken from a TLE a few weeks ago).
WGS84 takes in LLA coordinates and outputs the acceleration due to gravity at that point in NED coordinates. Throughout the simulation, I keep track of the Julian Date (years) based on the epoch time and use it to find the Greenwich Mean Sidereal Time so I convert from between LLA, ECF, and ECI coordinates.
I'm very confident of my implementation of these as I've been doing that for a few years, though I have been double and triple checking just in case.
However I when rotating the acceleration due to gravity from NED to ECI and then integrating to get velocity and then once more for position, I get some very, very odd results.
While I can see the periodic nature of the elliptical orbit, there is an increasing linear trend that makes no sense. Over the course of 10 orbits or so the orbit increases by about 200 kilometers.
I've compared against STK results as well to double check and the WGS84 outputs make no sense.
I've considered everything from incorrectly calculating GMST, accidentally reversing the coordinate frame rotations (using quaternions), incorrectly implementing WGS84, issues with initial conditions, as well as issues with units.
At this point I have no idea what is going on. I've attached a plot to this post.
X-axis is time in seconds. Y-axis is radial magnitude of the orbit in kilometers. The blue line is the WGS84 output and the green is the STK output.
Settings being used in the WGS84 model:
WGS84 Exact MKS units INCLUDE Earth's Atmosphere EXLCUDE Precessing Reference Frame No centrifugal effects
Any ideas on what I might be doing wrong on my implementation?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/148092/image.jpeg)
2 Comments
Eric
on 30 May 2013
This is all a bit over my head, but I wonder if there is anything in
that can help you double-check what's going on.
Answers (1)
See Also
Categories
Find more on Gravitation, Cosmology & Astrophysics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!