مطلب درخواستي يكي از  بازديدكنندگان محترم وبلاگ


Moving the Planets


© Adam Hughes

In simulating the behavior of a real physical system, one of the earliest steps is, by necessity, defining the model which will be used. Usually, because of resource limitations, some assumptions must be made. In the case of a system of planets and other galactic bodies, we will make the assumption that there is enough space between the entities that they will, for the most part, see each other as single points on the horizon. This is obviously a large simplification, but there are other approximations that can be made later on, if need be, to correct our picture of reality.

Each of our planets, then, can be represented by a set of Cartesian coordinates, such as x=0.0, y=1.0, and z=2.0. Because there are generally more than one planet, we turn these coordinates into vectors, so that (x[1],y[1],z[1]) would be the coordinate set representing Earth, for instance, while (x[2],y[2],z[2]) could represent Venus. Corresponding to these components are velocities which describe how fast and which direction the planet moves. Like the position, an objects velocity is also defined by three quantities: vx, vy, vz. We say that vx is the component of the velocity in the x direction, vy is the component of the velocity in the y direction, and vz is the component of the velocity in the z direction. As with the coordinates, the velocities become vectors when considering the complete system, and we have vx[1], vy[1], and vz[1] for Earth, and so on down the line.

We can assign initial velocities and positions to our planets, methods of which we'll discuss at a later point. However, the real meat of the simulation comes when we start moving these objects around. Planets and suns and such are very large, definite objects. Because of this, their motions are dictated by the laws of classical mechanics, which makes our lives a little easier than if we had to consider quantum mechanics, too. Classical objects can be described using Sir Isaac Newton's equations of motion. For a particle residing at (x,y,z) with velocity (vx, vy, vz), Newton's equations tell us that

dx/dt = (vx), dy/dt = (vy), dz/dt = (vz)

and

d(vx)/dt = - (Fx)/m, d(vy)/dt = - (Fy)/m, d(vz)/dt = - (Fz)/m,

where a set of forces (Fx, Fy, Fz) has been introduced. This is a set of differential equations that we will attempt to solve in order to evolve the system from one time to another and another. The trick is that these equations are not exactly solvable, and so some approximate method must be used. Next time, we'll look at some of the algorithms used