Gravity Equations - Two Bodies - 2024.2 English - XD100

Vitis Tutorials: AI Engine Development (XD100)

Document ID
XD100
Release Date
2024-12-06
Version
2024.2 English

When the force on body i is caused by its gravitational attraction to body j, that force is calculated by the following gravity equation:

alt text

Where G is the gravitational constant, and r is the distance between body i and body j. Combining Newton’s second law motion with the gravity equation gives the following equation for calculating the acceleration of body i due to body j.

alt text

We multiply by the unit vector of r to maintain the direction of the force.

If given an initial velocity (vt) and position (xt), we can calculate our particle’s new position, acceleration, and velocity in the next timestep (t+1).

  • Position Equation: xt+1=xt+v*ts

  • Aceleration Equation: (from above)

  • Velocity Equation: vt+1=vt+a*ts