Issue 16: Fix example of rotating galaxy
Status:  WontFix
Owner:
Closed:  Aug 23
Project Member Reported by ejrh00@gmail.com, Nov 14, 2011
It's very hard to set the initial conditions for it to be stable.  I probably need to track down some examples from the internet.

One idea is that each star has a velocity vector that is a tangent to its orbit.  The size of that vector should be sufficient to maintain the orbit.  Assuming all the mass is concentrated in the centre, that should be proportional to the the inverse-square of the distance.  We could make an example with negligible-mass stars around a massive body to test this.

In practice of course the mass is distributed through the galaxy.  A http://en.wikipedia.org/wiki/Galaxy_rotation_curve describes how the velocity should relate to the orbital radius.  N.B. The galaxy program does not implement the effects of dark matter (or even relativity, on the galactic scale).

An alternative idea is to create the system with no velocity, and let gravity do the work, with variations in the positions eventually resulting in a non-zero angular momentum.  You typically end up with a rotating galaxy much smaller than the initial set though.  On the other hand if this works, some basic analysis of the result could yield a template for constructing the rotating galaxy directly in future.
Nov 15, 2011
Project Member #1 ejrh00@gmail.com
Actually the orbital velocity of a small mass around an a object of mass M is:   sqrt(MG/r) where G is the gravitational constant and r is the radius of orbit.  (See
http://en.wikipedia.org/wiki/Orbital_speed .)

Applying this rule gets us a galaxy (of insignificantly-massed stars) that maintains its shape, with the loss of occasional stars due to close encounters.

Status: Started
Nov 16, 2011
Project Member #2 ejrh00@gmail.com
And for a larger orbiting body of mass m, it's:   sqrt(M^2*G/((M+m)*r))

Need to see if that helps.  (It's unlikely to be perfectly correct for multiple bodies interacting with each other; the equation for that probably depends on the distribution.)
Aug 23, 2015
Project Member #3 ejrh00@gmail.com
(No comment was entered for this change.)
Status: WontFix