Hello,
I'm currently working on a small educational program that illustrates how planets orbit the sun. I'm learning the neccesary math, physics and programming on the fly, which is very interestng but also quite frustrating! I hope you might help me with some problems...
When working with orbital mechanics (or celest mechanics) You often use the gravitational constant G and the total mass of the system M, beeing very close to just the mass of the sun. This have caused me a grat deal of worry: G is 6.673e-11 N*m^2/kg^2 and Msun is 1.989e+30 kg, but when I use these values my formulas go amok.
Just yesterday I found out that the two constants are often combned in th so called "standard gravitational parameter" which for the sun has the value 132,712,440,018 Km^3*s^-2, and when I used this value my program worked perfectly.
But when I multiply the two numbers I get 1.327e+20 rather than the actual value of 1.327e+11. What am I doing wrong?
Any other general or specific advice on how to program orbital mechanis will be received with gratitude.
Best regards,
Michael
(please note that I use SI units, not U.S. ones...)