[关闭]
@feipai11 2016-06-12T00:09:39.000000Z 字数 1766 阅读 2057

The Planet model: inverse square law

郭帅斐


The summary:

The motion of planets is described by Newton's law of motion and Newton's law of gravitation. It is also a kind of trajectory problem, so we can get the trajectory of a planet through an ODE. The Inverse-Square law of the gravitation keeps the planet move stably, this law is also applied in electric field. In this program, I confirmed the Inverse-Square law keeps the motion stable, and plot a simple configuration of three planets' orbits. Also, a gif figure was plotted as an 3_D model of the motion of planets.

The psudocode:

Since this is a periodic problem, so we use the Euler-Cromer method to solve it. As all the trajectory problems, we use the velocity and position of step to calculate that of step . The looping statement are as follows:






This is a single planet motion equation, we can use this class and define different object as different 'Planets'. As for the motion of planet that different obey the Inverse-Square law, we just change the number 3 to other numbers.

The result:

The conclusion:

In this program, some configurations are drawn, and the Inverse-Square law is proved.

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注