Is it possible to make realistic n-body solar system simulation in matter of size and mass?

前端 未结 2 686
半阙折子戏
半阙折子戏 2020-11-21 22:19

Important note: this question has utterly no relation to \"PhysX\", which is a computer-game-physics system (useful for the physics in arcade games

2条回答
  •  日久生厌
    2020-11-21 22:58

    Scaling things down will not necessarily help, as you have discovered. Here is some good reading on things to consider when using floating point numbers: http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html

    Basically doing a simulation from first principles (Newton's laws) is bad for numerical accuracy, because you don't imbue the numerical methods with an idea of the scale of important effects, so you end up throwing a whole bunch of different effects at different scales together and the result is low accuracy.

    Usually things like ephemerides for planets, satellites etc don't start with Newton's law, They start by assuming that the orbits are keplerian, then and small perturbative corrections.

    Here is an algo that calculate the position of the planets (semi-imperically). http://ssd.jpl.nasa.gov/txt/aprx_pos_planets.pdf

    If you want to do an N-body simulation you it seems like will need more precision. If unity prevents you from using double precision, then I suggest doing the calculations in plain C#, then convert to single precision when the job is done.

提交回复
热议问题