What are some algorithms that will allow me to simulate planetary physics?

前端 未结 12 550
离开以前
离开以前 2021-01-30 17:37

I\'m interested in doing a \"Solar System\" simulator that will allow me to simulate the rotational and gravitational forces of planets and stars.

I\'d like to be able t

12条回答
  •  盖世英雄少女心
    2021-01-30 18:14

    In physics this is known as the N-Body Problem. It is famous because you can not solve this by hand for a system with more than three planets. Luckily, you can get approximate solutions with a computer very easily.

    A nice paper on writing this code from the ground up can be found here.

    However, I feel a word of warning is important here. You may not get the results you expect. If you want to see how:

    1. the mass of a planet affects its orbital speed around the Sun, cool. You will see that.
    2. the different planets interact with each other, you will be bummed.

    The problem is this.

    Yeah, modern astronomers are concerned with how Saturn's mass changes the Earth's orbit around the Sun. But this is a VERY minor effect. If you are going to plot the path of a planet around the Sun, it will hardly matter that there are other planets in the Solar System. The Sun is so big it will drown out all other gravity. The only exceptions to this are:

    1. If your planets have very elliptical orbits. This will cause the planets to potentially get closer together, so they interact more.
    2. If your planets are almost the exact same distance from the Sun. They will interact more.
    3. If you make your planets so comically large they compete with the Sun for gravity in the outer Solar System.

    To be clear, yes, you will be able to calculate some interactions between planets. But no, these interactions will not be significant to the naked eye if you create a realistic Solar System.

    Try it though, and find out!

提交回复
热议问题