Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Astro simulation program problem - program bugs?

  1. Mar 1, 2007 #1
    Hello all,

    for the past few weeks my friend and me have been working on a project involving simulation of orbital objects interaction. For example, one could see how everything looks if he/she entered all the details about the objects (that is: mass, position and velocity vector). The simulation is based on timesteps, that is, the system calculates new positions of objects after a timestep (default is one day). One can see how everything looks by "timestepping".

    The problem is, the calculations are bogus!
    Moreover, the formulas used MUST be right and this puts us into confusion:
    the problem lies not in the program but in the principle used.

    We pick each two objects, calculate the distance between them, the gravitational force between the objects, the average of speed gained ant the latter is added to objects' speed (obj.speed.x += accel.x * time_step / 2). After all that we move all the objects (like obj.place.x += obj.speed.x * time_step).
    Everything is calculated in the SI.

    We tested the system with the Earth and the Sun and it results in Earth going out of the orbit! So something's certainly wrong...

    We would appreciate any help. If there is any interest, we can send you the sources (C++, GPL license) which compile great on Win32 and Linux (OpenGL is used for displaying 3D graphics).

    Thanks in advance.
     
    Last edited: Mar 1, 2007
  2. jcsd
  3. Mar 1, 2007 #2
    aren't you supposed to sum all the forces and then divide by object mass and multiply that by delta_t and add that to speed?
     
  4. Mar 1, 2007 #3
    What difference does that make if we sum the forces or the delta_speed? :?
     
  5. Mar 1, 2007 #4
    I thought you were saying you averaging them
     
  6. Mar 1, 2007 #5
    Yes, that was a mistake, there should be accel * time / 2... Though it doesn't help :/.
     
    Last edited: Mar 2, 2007
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Astro simulation program problem - program bugs?
  1. Astro pic (Replies: 3)

  2. Mathematica in astro (Replies: 1)

  3. Astro physics research (Replies: 15)

Loading...