Tuesday, March 14, 2006

Galaxy Simulation

Hi all, welcome to my galaxy simulator.

What is going on here? Well, I guess, I have too much free time, so I decided to spend a weekend witting a Java applet to simulate the effects of gravity.

Let me know what you think.

There is a lot of math going on. Have you practiced your algebra, geometry, trigonometry, and calculus lately?

Check out this math web site. http://mathforum.org/dr.math/
I found many great ideas there.

Some Calculations I use:
Area of a Circle: PI * r^2
Distance Formula: d = sqrt( (x2-x1)^2+(y2-y1)^2)
Pythagorean Theorem: a^2 + b^2 = c^2
Newton Gravity: Fg = G ((M1*M2)/d^2)
Newton Conservation of Momentum: m1*v1 + m2*v2 = m3*v3
Heron: Area of triangle given 3 non-equal sides (a,b,c) = sqrt(s(s-a)(s-b)(s-c)) where s = (a+b+c) / 2

Some things I'm working on or thinking about:
1) Orbital Decay: Have you noticed that when a planet is orbiting close to a large Planet (Star), the orbit decays until the object spirals into a collision with the Star. My belief is that the major factor is due to rounding errors caused by so many calculations. I'd be interested to hear ways that I can predict the amount of precision that is lost, and perhaps add it back in. All my calculations use doubles.

2) Super Novas: When a object gets large enough it should explode. Simulate the Big Bang? Now it is getting serious. HEHE.

3) My current conservation of momentum calculations assume the impact is dead on. This is rarely the case so I wonder what the math looks like for that; to calculate the new velocity vector.

4) 3D. Yikes! Now the math gets fun.

More details to come.
Jason

No comments: