Discussion Improved (Tesseral) Gravity Model

Ajaja

Active member
Joined
Apr 20, 2008
Messages
226
Reaction score
93
Points
28
It should be recording FlightData.log every ~100 simulated seconds and there were two gaps:
Code:
...
 121789.83   170.3096
 121890.15   170.1104
 122111.46   169.8282
 122211.78   169.7923
...
 128134.28   169.9225
 128234.44   169.5184
 128771.03   168.9129
 128879.17   169.1444
...
which seemingly caused the deviation.
Maybe it just "Orbit stabilization" kicked in because of some freezes.
I will try to do more tests turning on/off this option.
 
Last edited:

n72.75

Move slow and try not to break too much.
Orbiter Contributor
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
2,696
Reaction score
1,353
Points
128
Location
Saco, ME
Website
mwhume.space
Preferred Pronouns
he/him
Excellent job!
I did some test and compared the new improved gravity model in OpenOrbiter with GMAT's models (even made a script for converting *.tab files to GMAT's *.cof files).
Orbiter and GMAT are very close now.
An orbit around Mars for example:
View attachment 33604


But once, only once, I got a strange issue. And wasn't able to reproduce this:
View attachment 33605

View attachment 33606

I don't know what the hell it was. I made tests in the console mode, no fuel in the ship (the script and FlightData.log in attachments), so it wasn't some misclick. I used jgmro_120f_sha.tab model.
Next test - all ok.
Any idea what it might be?

When I did my tests I locked Orbiter to using:

RK8
Fixed Timesteps at 5 seconds.
Disabled Orbit Stabilization.

Am I reading it correctly that your timesteps were around 100 second long? The right conditions may have been met for a brief moment to enable Orbit Stabilization which might have been the case. I've never seen anything like this.

You are using the 32 bit build right?
 

Ajaja

Active member
Joined
Apr 20, 2008
Messages
226
Reaction score
93
Points
28
It was "tacc 1000" with 10 Hz in FlightData settings. Without graphics engines it gives relatively small steps < 1s and I didn't expect any problems.
Looks like the step increased due to unknown reasons and that affected precision (just huge step itself or with Orbit Stabilization).
I test both builds, x86 and x64. The problem appeared in x64.
 
Last edited:

n72.75

Move slow and try not to break too much.
Orbiter Contributor
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
2,696
Reaction score
1,353
Points
128
Location
Saco, ME
Website
mwhume.space
Preferred Pronouns
he/him
It was "tacc 1000" with 10 Hz in FlightData settings. Without graphics engines it gives relatively small steps < 1s and I didn't expect any problems.
Looks like the step increased due to unknown reasons and that affected precision (just huge step itself or with Orbit Stabilization).
I test both builds, x86 and x64. The problem appeared in x64.
Do you have Phobos and Diemos disabled in your 64bit session?
 

Ajaja

Active member
Joined
Apr 20, 2008
Messages
226
Reaction score
93
Points
28
No, I use SPICE with x64. BTW, it may be a reason of the freezes. Needs investigation too.
 

Ajaja

Active member
Joined
Apr 20, 2008
Messages
226
Reaction score
93
Points
28
I wasn't able to find file with spherical harmonic coefficients in correct format for Earth, so I made one from egm96_to360.ascii (EGM96 360x360 model) that is available on the Internet. The file is in the attachment.
Did a comparison with GMAT. Fits perfectly:
Figure_5.png
 

Attachments

  • egm96_to360.tab.zip
    1.5 MB · Views: 2

n72.75

Move slow and try not to break too much.
Orbiter Contributor
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
2,696
Reaction score
1,353
Points
128
Location
Saco, ME
Website
mwhume.space
Preferred Pronouns
he/him
I wasn't able to find file with spherical harmonic coefficients in correct format for Earth, so I made one from egm96_to360.ascii (EGM96 360x360 model) that is available on the Internet. The file is in the attachment.
Did a comparison with GMAT. Fits perfectly:
View attachment 33625
I can add that if you'd like, I was going to get around to making one eventually but hadn't found the time yet. Thank you for doing this!
 
Last edited:

Ajaja

Active member
Joined
Apr 20, 2008
Messages
226
Reaction score
93
Points
28
I conducted more test with different orders/degrees, inclinations, altitudes. Didn't find problems. Simulates definitely much closer to GMAT than with default Orbiters' model based on JCoeffs. For example, a polar orbit with EGM96:
F3.pngF4.png
And the default model:
F1.pngF2.png
An Impressive difference.
 

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,917
Reaction score
2,921
Points
188
Website
github.com
Could you also post charts with the delta between Orbiter and GMAT? That would probably show the difference much better than the overlay (which has value, of course).
 

Ajaja

Active member
Joined
Apr 20, 2008
Messages
226
Reaction score
93
Points
28
@GLS
I can't get the FlightData plugin to write with fixed intervals, so some additional data processing is required to calculate and plot the difference of two datasets with completely different x-values. It's just much easier to plot the data and zoom.
 
  • Like
Reactions: GLS

n72.75

Move slow and try not to break too much.
Orbiter Contributor
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
2,696
Reaction score
1,353
Points
128
Location
Saco, ME
Website
mwhume.space
Preferred Pronouns
he/him
@GLS
I can't get the FlightData plugin to write with fixed intervals, so some additional data processing is required to calculate and plot the difference of two datasets with completely different x-values. It's just much easier to plot the data and zoom.
I can do it in Matlab (Octave) is you send it to me.
 
  • Like
Reactions: GLS

Ajaja

Active member
Joined
Apr 20, 2008
Messages
226
Reaction score
93
Points
28
@n72.75
ReportFile1.txt generated by GMAT with e4.script and FlightData.log generated from e4.scn are in the attachments.
It's the polar orbit from the graph above.
Earth atmosphere should be turned off in Orbiter to reproduce FlightData.log. I've used fixed step 1s in Orbiter this time with x1000 and 10 Hz in FlightData.
grav.py is a simple Python script to plot the graphs.
 

Attachments

  • e4.scn
    355 bytes · Views: 0
  • ReportFile1.txt
    893.2 KB · Views: 3
  • FlightData.log
    233.8 KB · Views: 0
  • grav.py.txt
    984 bytes · Views: 3
  • Like
Reactions: GLS

n72.75

Move slow and try not to break too much.
Orbiter Contributor
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
2,696
Reaction score
1,353
Points
128
Location
Saco, ME
Website
mwhume.space
Preferred Pronouns
he/him
I finally got around to adding a pull request to add this gravity model for Earth. Now all the planets and moons we have good data for have models.

I never got around to, properly calculating downrange residuals, I suspect there is a bit of a butterfly effect going on, if we're seeing sight differences between GMAT and Orbiter. Radial differences have always looked good over long periods, and it's worth noting that Orbiter and GMAT don't agree 100% even when using only point masses.
 

n72.75

Move slow and try not to break too much.
Orbiter Contributor
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
2,696
Reaction score
1,353
Points
128
Location
Saco, ME
Website
mwhume.space
Preferred Pronouns
he/him
Vesta has a cute little 20x20 SHADR model. Very fun to fly in.

View attachment 31248
If anyone was curious what this looks like through the lens of OrbitMFD:

I was just having some fun flying around Vesta and thought I'd share. Lower orbits are...interesting and "brief".
 

Boxx

Mars Addict
Addon Developer
Donator
Joined
Nov 15, 2009
Messages
184
Reaction score
125
Points
58
Location
Paris Area
What is interesting here is the eccentricity value: it goes down to zero and increases again, then back to zero... i.e. pulsating somehow between a circular and moderately elliptical orbit... I'm also wandering if the "kill rot" is on, because it's hard to interpret the outside view (with x1000 acceleration).
 

n72.75

Move slow and try not to break too much.
Orbiter Contributor
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
2,696
Reaction score
1,353
Points
128
Location
Saco, ME
Website
mwhume.space
Preferred Pronouns
he/him
I'm also wandering if the "kill rot" is on, because it's hard to interpret the outside view (with x1000 acceleration).
Nope, free rotation only. Rotation starting and stopping is due to oscillating gravity gradient torque.
 

misha.physics

Well-known member
Joined
Dec 22, 2021
Messages
399
Reaction score
515
Points
108
Location
Lviv
Preferred Pronouns
he/him
Excuse me, I've just seen the new OpenOrbiter builds on github (released 5 days ago). Do I understand correctly that the ephemirides problem of x64 build isn't solved yet, so ships remain unstable on the surface/orbit of Mars, etc? Or maybe some ideas/work are in progress?
 

n72.75

Move slow and try not to break too much.
Orbiter Contributor
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 21, 2008
Messages
2,696
Reaction score
1,353
Points
128
Location
Saco, ME
Website
mwhume.space
Preferred Pronouns
he/him
Excuse me, I've just seen the new OpenOrbiter builds on github (released 5 days ago). Do I understand correctly that the ephemirides problem of x64 build isn't solved yet, so ships remain unstable on the surface/orbit of Mars, etc? Or maybe some ideas/work are in progress?
Stick with x86 builds for now. I have an idea on how to fix this, but I will post that in another thread.
 
Top