Gravity Simulator
General >> Discussion >> Excel Export

Message started by MichaelVronsky on 01/04/14 at 12:40:33

Title: Excel Export
Post by MichaelVronsky on 01/04/14 at 12:40:33

I would like to export data to excel. When I do, I see the numbers, but I have no idea what they are. I tried matching them up with sum numbers from Wikipedia to see if I can find similarities (I was trying to make an eccentricity graph for Mercury). How do I know what the numbers mean?

Title: Re: Excel Export
Post by Tony on 01/04/14 at 13:41:05

The latest version works better for data export.  This file will install it for you:

Open an existing solar system simulation.  Begin with the simulation paused.
Use the File menu.. Save As to rename the simulation and create a new folder for it.  This is just a suggestion to help you keep your stuff in manageable order.

For best results, use the Integrator Menu and choose Runge Kutta 4th order (this is also only in the newest version).  Set your time step to 2048.  Any faster, and you'll be introducing numerical error to Mercury.

Under the File Menu, choose Output File.
Select "Create Data File"
Select "Create Data File Copy" (this way you can play with this file while the simulation is running)
Select 87.9691 days for "sample every". This number is Mercury's orbital period, so you won't be graphing any small repetitive changes that occur during a Mercury year.
Choose Maximum data samples: 1000 (or any number you want.  Keep it under 64K or Excel can't open it.
Select Mercury from the list (and any other objects you want data for).
Select e from the leftmost column of choices, and any other element you want.  If you hover the mouse over each, it tells you what they are.  The last 6 are the position, x,y,z, and the velocity, x,y,z of the object.
Press OK.

Unpause the sim.  It will run fastest if you do not plot the graphics while it is running.  Press the P button on the Graphics Option interface.  If you want to watch it, open the Preferences Menu.  Under "Update Graphics Interval" enter 50.  Now it will plot the simulation almost as fast as if you completely turn off plot.

The data file is a .txt file in the same folder as your simulation. Open it in Excel as a comma-deliminated text file.  The top row should have a heading telling you which orbital element or position or velocity vector it represents.

Let me know if this helps!

Title: Re: Excel Export
Post by MichaelVronsky on 01/04/14 at 14:21:04

Wow. I was not expecting that fast of a reply or for this forum to be so active. Most other cool programs that I find are obsolete. Anyways, thanks for the response, I'll try it when I get home.

Title: Re: Excel Export
Post by MichaelVronsky on 01/04/14 at 16:26:01

I just started the simulation, I'm going to let it run for an hour or two before exporting, but so gar everything looks good. I didn't even know that version existed!

Title: Re: Excel Export
Post by Tony on 01/04/14 at 17:42:16

If you checked both boxes, Create Data File and Create Data File Copy, you can play with the copy immediately.  It works like this:

When you open a file in Excel, Excel keeps the file open.

Keeping the file open prevents Gravity Simulator from appending data to the file.

So I programmed Gravity Simulator to give you a warning box if the first file is open and it can not append data to it.  

That gives you the opportunity to close Excel and let Gravity Simulator continue accumulating data.

I also programmed Gravity Simulator to not care if the Copy version is open.  If it is not open, Gravity Simulator clones the main copy.  If not, Gravity Simulator does nothing.  The moment you close the Copy version in Excel, Gravity Simulator can write to it again, it clones the main copy.  That way it doesn't have any chunks of missing data.

I did this, because as you're about to find out, simulating hundreds or even low thousands of years is easy in Gravity Simulator.  But simulating hundreds of thousands to millions of years requires you leave the program running for days or even weeks.  I didn't want to wait weeks to discover I set up the "output data" dialog box wrong.  So the Copy version lets me play with my data-to-date immediately.

Just for fun, encouraged by you, I also started a Mercury eccentricity sim.  I'm currently at year 6000 now and counting.  I probably should have deleted all my TNO's and most of my asteroids and other things that will not significantly effect Mercury to make the sim run faster.  When you get some meaningful data, post it here and we'll compare!

Title: Re: Excel Export
Post by MichaelVronsky on 01/04/14 at 17:57:36

I'm using the default full system file, so I'm only on year 200-300ish.
I'm doing a data point every Mercurial year, so I'm a bit less than halfway through (2000 data points max)

Deleted most minor moons of the Gas Giants and all spacecraft to increase speed.

Title: Re: Excel Export
Post by MichaelVronsky on 01/04/14 at 22:44:34

I think the spike in the middle is when I deleted the minor objects...
Tell me if you see similar results. These results are over about 3500 earth years.

Title: Re: Excel Export
Post by Tony on 01/05/14 at 10:28:02

Your capture of Mercury's ecc doesn't look like mine.

I show it rising, on a long-term linear trend after a few thousand years.  Over longer periods of time, its probably just on the upslope of a sinusoidal path.
Unfortunately, you can't delete objects in the middle of a sim without messing up the data file.  It doesn't see the objects as "Mercury", "Venus", etc. It sees them as 1st object, 2nd object, etc, and when you delete objects, you change that order and the data output routine doesn't take that into account.

Attached is a simulation of comet ISON.  It is a good starting point for any solar system sims.  It was set up for the newer version.  The positions and velocities and masses of the objects are more accurate.  IIRC, I put together fullsystem.gsim with data from the table of a book.  All sims made in the last few years were made from data directly from JPL Horizons.  These sims are much more accurate.  They correctly predict solar eclipses hundreds of years into the past and future.  Using this sim instead (delete comet ISON, and all other irrelevant objects, including all TNO's, even Pluto, before starting to collect data, and resave the sim under  a new name.)

The problem with deleting moons in fullsystem.gsim is that by deleting them, you're removing significant mass from the system, and you slightly alter the velocities of their parent planets.  In the comet ISON file, all the moons mass and momentum is added to their parent planet.  That is why Jupiter is called "Jupiter barycenter".  It isn't Jupiter, rather its the barycenter of the Jovian system, which from a distance will gravitationally behave the same as Jupiter and all its moons, without having to waste CPU time on the moons.  Do not delete Earth's moon.  It's too significant to ignore.  If you're doing an outer solar system sim and you want to get rid of Earth's moon, you need to go to JPL Horizons website and get the data for Earth barycenter, and replace both Earth and Moon with this data.  There's instructions on the tutorial page on how to do this.  To access that help, go to the Help menu and choose Gravity Simulator Help online.

Title: Re: Excel Export
Post by MichaelVronsky on 01/05/14 at 16:51:01

New Simulation:
This is the old fullsystem file (with a few objects deleted, in retrospect I should have used the barycenter method...)
Left this overnight, so it has 50000 data points.

Title: Re: Excel Export
Post by Tony on 01/05/14 at 18:14:41

Yes, that looks like what I would have expected.  It looks like your slope will zero out at about 70,000 years before dropping again.

Gravity Simulator » Powered by YaBB 2.1!
YaBB © 2000-2005. All Rights Reserved.