Gravity Simulator
General >> Discussion >> new user

Message started by Valareos on 08/06/05 at 10:28:53

Title: new user
Post by Valareos on 08/06/05 at 10:28:53

THANK YOU! you have NO idea how long ive searched for a program like this.  Only trouble Im having is actually imputing items in it with the correct information.

Do you have a tutorial to do this from raw data?

My attempt is actually to begin mapping out the sun on its path through the galaxy, and its interaction with the nearby stars over a period of time.

I know I need to start with the galatic core (and treat it as one large object though it has millions of stars) plot the sun in relation to the galatic core, then the rest of the stars in relation to the sun starting from the closest out.

What is the best way of approaching this?

And how do I adjust for the fact that where we see Alpha Centari now is where it was four years ago (worse as you get further out)

Further more, will that even matter? (yes if gravity is instantaneous, no if it propegates at the speed of light, and lets NOT go to if it goes slower or faster than light)

errf. have I made your head hurt yet? :P

hmm and how do I tilt the point of view so I can see if a path is crossing or not

one scenario I ran btw, just for fun, was putting pluto with one solar mass in the planet only set.  Surprisingly, the inner planets survived a LONG time in the same orbit around the sun, jupiter and neptune were the only ones to stay in for any amount of time, though a HIGHlY irregular orbit that got them kicked out.  FInalyy the star pluto got too close to the Sun and inner solar system, but stabalized with pluto being flung out completly, taking mercury and venus with it, leaving earth and mars around the sun.  I thought that gave a great imagry on the havok a sun like star would have if it got within pluto's orbit of our sun. Again, great program!

Title: Re: new user
Post by Tony on 08/06/05 at 13:00:08


I'll show you how to do that, then I'll suggest an alternative approach.

The Sun orbits the center of the galaxy much the same way it would orbit a single object whose mass equaled the mass of the galaxy interior to the Sun's orbit.  The mass of the galaxy interior to the Sun's orbit is ~ 1011 MSun.  The Sun's distance from the galaxy's center is ~27,000 light years, and its orbit is not very eccentric.

To create this:

menu File> New
This creates a universe with 1 object.  It is a 1 solar mass, red object.  Now edit it to represent the center of the galaxy.

menu Objects> Edit Object
Change its name to "Galactic Center" or a different name of your choice.
Change its mass to 1e11 and choose the "Sun Mass option"
Change its color if you prefer.

Use the [-] button on the Screen Scale window to zoom out until it reads ~75,000 light years.  Depending on your screen resolution, you're probably going to have to click that button about 60 times.  The galaxy is huge!

Create the Sun and other stars
menu Objects> Create Objects
Change its name from Object1 to Sun
Give it a mass of 1.  Choose the Sun Mass option
Give it a semi-major axis of 27000 and choose the Light Years option.

Press Create.

Save your simulation.
menu File>Save As...
Give it a name.

You now have a simulation of the Sun orbiting the center of the galaxy.  You can use this as a starting point for creating more simulations.

Try speeding up the simulation with the [+] button on the time step window until it is about 8716 years. so you can actually watch the Sun orbit the galactic center.  Keep your eye on the Time and Date window and time how long it takes the Sun to complete 1 orbit.  If you set things up correctly, it should take the Sun about 220 million years.

Now you can add additional stars using the same method.  To add a bunch at once, change the "Number of Objects" from 1 to whatever you want.  Don't get too crazy or your simulation will run very slow.  Try somewhere between 10-50 objects.  For semi-major axis, put 27000 light years and put a value like +/- 1% in the box below the semi-major axis.  This will give you a range of semi-major axes at the Sun's distance +/- 1%.

Now the bad news...
You'll never be able to simulate stars orbiting the galactic center and planets orbiting stars in the same simulation.  When you sped up the simulation to about 8716 years per time step, this is much too fast to simulate orbits of planets.  Anything above about 65000 seconds per time step causes the planets, beginning with Mercury and working out to Pluto with additional increases in time, to get flung out of the solar system.  If you ran the simulation slow enough for the planets to be happy, you'd have to let your computer run for years to notice a change in the Sun's position with respect to the center of the galaxy.

A new approach...
The problem with your method of changing Pluto to 1 solar mass and using this to simulate a star passing close to the Sun is that Pluto is travelling very slow compared with the velocity that an incoming star would have.  Also, being in solar orbit, Pluto will stay around forever rather than make a quick pass through the solar system.  It will affect the orbits of the other planet much more than a visiting star.  Instead, try this:

To make a star pass close to the Sun and disrupt the planets orbits

Start with the simulation "onlyplanet.gsim" or "fullsystem.gsim".  If you use fullsystem, delete any objects you feel are unnecessary (use the Objects > Edit Objects to delete objects), or your simulation may run slow.

Choose the distance you would like your star to pass from the Sun.  Also, choose the angle it will pass through the planetary plane (ecliptic).  Then,
menu Objects > Create Objects
Number of Objects: 1
Mass : 0 (don't give it mass yet)
Semi-major axis: Choose a value that is about 20% larger than the sun passage distance you choose earlier.
Inclination: your choice.  0 degrees puts it in the ecliptic plane, 90 makes it pass through the ecliptic plane from above.
Leave all other values at their default settings.
Press Create.

Make time run backwards:
menu Time> Time Backwards

Now give your new object solar escape velocity:
menu View > Add Orbital Elements Box
Choose your new object in the top dropdown list, and choose the Sun in the bottom dropdown list.
Click on the ecc number to highlight it (eccentricity)

Open a thrust box:
View> Add Thrust Box
Choose your new object in the top dropdown list and choose the Sun in the bottom dropdown list and press OK.

Press the 1K button under the Prograde Boost.  This adds 1 kilometer / second of velocity to your object's orbital velocity.  Watch the ecc value in the Orbital Elements Box.  Keep pressing the 1K prograde button until ecc exceeds 1.0.  Then press it a few more times to give your object extra velocity.

Close your Thrust Box and your Orbital Elements Box.

Zoom out using the Screen Scale window until your screen scale is about 1400 AU.

Speed up time with the Time Step box.  Do not exceed 65536 seconds if you started with "onlyplanets.gsim". Do not exceed 4096 if you started with "fullsystem.gsim" and have moons orbiting the planets.   Watch as your object distances itself from the solar system.  Once it is near the edge of the screen:

Pause the simulation using the || button on the Time Step window.
Set time running forward again:
menu Time> Time Forward

Give your object a mass:
menu Objects> Edit Objects
choose a mass.  Use 0.1 - 10 for stellar massed objects, less for brown dwarfs or rougue planets.

If you like, at this point you can turn your new object into a binary star by using Objects> Create Objects, choose your object as the Reference object and add a companion star or planets to it.

Unpause your simulation and watch your new star approach the solar system.  Zoom in as it gets close and watch the chaos that ensues.

To answer your other questions:
Gravity Simulator assumes that the speed of gravity is instant.  Although this assumption is not correct, its effects are negligable in these types of simulations.

Pluto, when given a solar mass should have remained in the solar system indefinately.  You may have taken too large of a time step and introduced error in the simulation that way.

To change the viewing angle, use the scroll bar on the right of the screen.

Let me know if you have any other questions.  I'm glad you like the program  :).

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