Subject: N body silumations - way cool

From: scott james ( undc) <[email-masked]>
Date: Fri, 14 Apr 1995 12:30:54 -0400 (EDT)

Jimmy the Moose
X-Mailer: ELM [version 2.4 PL24]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 9683      

Heya -

I ran some number's last night to do some orbits.

Note that all numbers are in MKS (meter,kilogram,seconds) and
that G=6.67x10^(-11)

case 1:  One satellite around the Sun
============================================

To get an orbit, the tangential velocity of a satellite is:
    
                 sqrt(G*Mass/R)    (1)

where Mass is the mass of the central object.  Note that the
mass of the satellite is irrelevent.  This tangential velocity
is such that the force on the satellite from the central object
is balanced EXACTLY by the centripidal force.  So if you want an
object to orbit use equation (1).

So let's say the central object is at position (100,100).  That
is the origin.  Put the satellite due north at (100,200) -- 100
units north of the central mass, on the Y=0 axis.  Let the
central Mass be 1.0x10^30kg (the sun), and lets keep going with
real astronomy to make 100 of our units (R, radius from central mass
 to sattelite) equal 50AU.  1 AU(Astronomical Unit) is about 
2x10^11 m, so 100 units will be 10^13 m. 

Then the velocity of the satellite should be, from equation (1), 
            
                   V =  2582.6 m/s.  

Now, the velocity must be all in the negative (leftwards) 
direction to be tangential, so:
 
               Vx = -2582.6  Vy = 0.0.  

Note that if you put the satellite anywhere but ON the X or Y axis 
that while the TANGENTIAL velocity will still be 2582.6 m/s, the 
components will no longer be so simple: ie, neither Vx nor Vy will 
be exactly zero.  Infact, the componants will be V*sin(theta) and
V*cos(theta).

Case 2:  3 satellites in orbit
==============================

So lets do three satellites in orbit around the central mass.
(And then make them spin down into the central mass, hehe!)

Conditions
----------
A) The masses must all be equadistant from each other (so that
   the forces from each other all cancel out in component-wise 
   fashion, and will orbit nicely instead of heading toward each other
   and making a grand mess!).

B) All three masses must be equal.

C) And the R radius from the central mass must be the same for 
   all three masses.

B) and C) require tha all 3 satellites have the same 
 V = 2582.6 m/s tangentially. 

A) implies that each object is 120degrees away from each other in the
 orbit.  From that the positions are

Satellite 1 is the first body we did above.  (At 90 degrees on orbit.)

Satellite 2:  Vx = 1291.3           (V*sin(30deg))  
              Vy = -2236.6          (V*cos(30deg) and sign inspection)  
              position = (13.4,50)  (at 210 degrees on orbit.)

Satellite 3:  Vx = 1291.3           (V*sin(30deg))  
              Vy = 2236.6           (V*cos(30deg) and sign inspection)  
              position = (186.6,50)  (at 330 degrees on orbit.)

>>  Positions are found similarly to Vx and Vy.  I.E., 
             R = 100 
        =>   x = Rsin(30) ; y = Rcos(30); then subract or add to 
                 the origin of (100,100).

Okay.  These orbit.  How about spiraling in?  Cut the tangential
velocity below the critical V from eqaution (1).  We cut it enough
to be felt, but not enough to have the satellites hit each other.
Say 25%.  So for a new tangential velocity, V = 2000.0 m/s :

Satellite 1:  Vx = -2000.0  Vy = 0.0
Satellite 2:  Vx =  1000.0  Vy = -1732.0  
Satellite 3:  Vx =  1000.0  Vy =  1732.0

NOTE that the components here are the new V*sin(30) and new V*cos(30),

Okay.  So they'll spiral in.  Remember, though, that they won't 
CRASH.  Nothing EVER crashes in Astronomy.  The only way to get
things to crash using gravity is to have one object head toward
another with both force vectors heading right toward each other.
Anytime there is just a slight velocity off in one of the components
you get a hyperbole and zooooom, they miss.  This IS what happens.

Even when you throw a ball parallel to the ground.  The ball keeps
the same velocity parallel to the earth the entire time.  One of
the qualifying exam questions in Astronomy was to prove that if one 
guy just standing around drops a ball, and one guy next to him fires 
a rifle  with the barrel exactly parelell to the ground, both the ball 
and the bullet hit the ground at the exact same time.  Why?  'Cause while 
both have a velocity tangential to the earth of differing speeds, the 
velocity in the perpindicular (toward the center of the Earth) is 
exaclty the same for ball and bullet!  And then the follow up 
question:  *why* do they hit the ground?  Because "the Earth gets 
in the way of the  hyperbolic orbit of the bullet, but the ball heads
straight for an elastic collision!"  Ha!

Then the next followup:  the guys are on the moon, not the Earth.
What happens?  Keeping the muzzel velocity of the gun the same,
the bullet now goes into a highly elliptical orbit of the moon!
The bullet is a sattelite!!  (Why they let these Physics Profs. attend
qualifying exams in the Astronomy dept at Stony Brook was to
certain you could do math!)

A buddy of mine at NASA a few years ago was on a project:  Is it
economically feasible to mine the moon and send back ore.  Yes.
Why?  Just shoot buckets of the ore out of magnetic rail guns
which is a cheap one time cost to build!

That same group is now working on a Space Shuttle prototype that the
Russians started.  The idea is not to 'launch' a shuttle, but 
fire it from a 'gun' into orbit.  Unfortunatly, with the mass of the
Earth 10 times that of the moon, it ain't so easy.  But they're
working on it!

Case 3: Another cool case
=========================

Take the case of the three bodies obiting at the critical V.
Now enter one or more intruder bodies!!

Make the 3 satellite masses = 1x10^25kg.  Make the intruder(s)
masses 1x10^23kg and make thier velocities about 1000m/s.
Make a swarm!  Amuse your friends!  Be the first on your block to
screw up a perfectly good orbiting system in a funky way!
With masses only 1/100 of the satellites this is more than a swarm
of asteroids!  It's a swarm of Jupiters!

Case 4: Bad news
================

I can't find my IDL code for the galaxy mergers.  It's on a tar tape
from Space Telescope.  I think I left it with my collaborator when
I left.  There is a reference to our galaxy collision models in
our paper "On the Environment of IRAS Galaxies" (see my WWW home page
at UMBC for reference.)  We never got the collision stuff published.
Damn referees thought we didn't do enough bodies!   If only we had had
a MasPar instead of a Sun 3/50!!!!

The idea, though, is this:
It's JUST LIKE case 2.  Like three bodies orbiting a central mass.
But now the central mass is the galactic core, and we have 10^12 bodies
orbiting!

BUT remember in case 2 how all the masses of the co-orbiters was the 
same, and all the bodies were equidistant.  What gives in the galaxy?
Well, the density FUNCTION is a constant.  So the co-orbiter's forces
still MOSTLY cancel out.  When they don't cancel exactly, you get
density waves -- spiral structure!  Anyway, you CAN make an elliptical
galaxy as long as the masses are random in space and have a tight
constraint, say two or three orders of magnitude (true in the galaxies).
But, as I say, I can't find my code which generates points with an
even mass distribution radially from the core.

After generating the shells of stars in concentric rings
radially from the galactic core, give them a random velocity.
But even tighter constraints on the velocity - set of velocities 
distributed around the critical velocity to get them orbiting the 
core. So you need two random generators, one for mass and one for 
velocity.  With constraints!!!!!

I'll try and get that program this summer, or write another (I want to
run it on the MasPar!!  After all that work on that paper which 
was never published ... )

Maybe I can get you two colliding galaxies that merge and create
two spiral galaxies.  It's cool as hell!  Stars fly all over (and
don't collide, mind you) as the galaxies collide, then they relax
with streams of stars trailing them as they emerge from the collision.
Spirals!  Some rogue stars that got catupulted out of one or the
other original galaxies too much to become part of the  resultant
spiral galaxies form irregular clumps which orbit the spirals (Hey,
that's what the Magallenic Clouds are!)

Better than two stars smacking into each other.  Way more cool looking.
And it's real science.

OKAY.  Enough.  But one more word on this subject.
STOP USING G=1 !!!!!!!!!!!

That's fine in relativistic astrophysics, but not in Newtonian Mechanics!
What you've done is decreased gravity's effect by 10^22 !! (1/G sqaured)
Look at equation (1) again!

Wonder why your objects are diffusing and ignoring each other?

To scale everything to G=1 you'd need to divide velocities by 10^22,
and divide radii the same way.
Use real numbers.  It's easier.

jim

PS - if you try these number's and they don't all work out, note
     that I've done all this on a hand calculator (trusty HP23c!)
     I could stop by tuesday at noon and with MatLab we could 
     do some touch up....?

---------------------------------------------------------------
jim scott                    |  [email-masked]
Computer Science Dept.       |  http://umbc8.umbc.edu/~jscott3/
University of Maryland, B.C. |  [email-masked]
Baltimore, Md.               |
                             |  BREWER
                             |         PATRIOT
                             |                PROPELLORHEAD
---------------------------------------------------------------
"When you have eliminated the improbable, look to the impossible."
                                           -- A. C. Doyle