I have a very quick question, and I figured because this is an algorithmic question, perhaps someone would be able to answer this for me here. I've done a small algorithm in c++ to calculate the coordinates of planets based on the force applied to them, which gives the acceleration, velocity, and finally position (all in components)
I'll explain my issue first and attach my code at the bottom. I'm not sure if this is an issue or not, but the sun is moving (in meters) quite far away from the origin. I'm aware that the sun is supposed to move a small distance due to the pull of the larger planets, but the coordinates are reaching into the tens of thousands of meters - which does not seem to be logical to me.
The processing for my algorithm is as follows: -Reset force to 0; -Get the sum of all forces by F += GM(x[j]-x[i])/r^3 -calculate specific planet's acceleration by the equation a = F/m -calculate specific planet's velocity by V = Vinitial + a*t -calculate specific planet's position by X = Xinitial + v*t -loop
To me, this sounds like this should make sense - and so I figured it was an algorithmic error.
Anyone who's good in physics or algorithm have any idea?
Sorry to everybody trying to join PlanetPhysics, but our server is currently not sending out new account emails to verify your account. We are working the problem. Sorry for the inconvenience.
Sorry for the downtime, we had a server and database issue. It is fixed for now, but be aware I think there is another underlying problem. I'll be looking at it closely the next few days. Thank you for your patience.