# How Does Universal Gravitation Apply in Planetary Simulation Errors?

• m3the01
In summary, the conversation discusses creating a planetary simulator and calculating the force between two objects using the formula F = G*M_1*M_2/d^2, where G is the gravitational constant, M_1 and M_2 are the masses of the objects, and d is the distance between them. The speaker also mentions using the Forward Euler update method to calculate the velocity of the objects, but runs into a problem and asks for help. It is later revealed that the mistake was in using days instead of seconds in the calculation.
m3the01
Most likely a basic question to most, been awhile since I've done any of this.

If i remember right the formula states, F = G*M_1*M_2/d^2

where d = distance between M_1 and M_2

Im creating a planetary simulator for fun, i get the initial position of the Earth using the 7 variable Astrological Guides technique.

iniPos

I then get a position + 1 day in the future call it pos2;

Velocity = pos2-iniPos;
Im using the grav-constant 6.67E-20 km^3/kg*s^2

1)So grav_constant*M_1*M_2 = grav_const*5.9742E24*1.988435E35
= 7.923498687E35

2)The distance between the the two is approx 150 000 000, according to the formula then d^2 = 2.25E16

Force = grav_constant*M_1*M_2/d^2 = 3.52155E19 km*Kg/s^2

Huge number!

Forward Euler update shows us that the 'unit_vector' pointing towards the sun multiplied by the force should give us our update method.

updateVelVector = oldVelVector + unit_vector*force*dt

Where dt = change in time

However this doesn't work worth a damn,

Somewhere I've made a mistake and i just can't see it,

PS i tried reducing the problem space to some number which i thought would be easier to use. I decided to decrease the distance to 1 km, basically this turns the problem into earth_mass/1.125E16 and sun_mass/1.125E16. This is wrong too, I am very stuck!

Last edited:
m3the01 said:
updateVelVector = oldVelVector + unit_vector*force*dt

force * dt is the impulse of the force during the interval dt, which equals the change in the object's momentum (mv), not the change in velocity.

Could u explain a little further?

I thought the update form for velocity was

vel = oldVel + unit_vec*force*dt;
pos = oldPos + vel*dt;

Hmmm, arggg.

thanks for the help,

Sorry guys my mistake,

For my initial velocity i forgot,

V_i/(24*3600)

Seconds not days, arggggg!

thanks for the help,

Great forum!

Steven

## 1. What is universal gravitation?

Universal gravitation is the force of attraction between all objects in the universe. It is the force that causes objects to be pulled towards each other.

## 2. Who discovered universal gravitation?

Sir Isaac Newton is credited with discovering universal gravitation in the 17th century. His famous law of gravitation states that every object in the universe attracts every other object with a force proportional to their masses and inversely proportional to the square of the distance between them.

## 3. What is the difference between universal gravitation and gravity?

Universal gravitation is a scientific theory that explains the force of attraction between all objects in the universe, while gravity is the actual force itself. Gravity is a natural phenomenon that is caused by the curvature of space and time by massive objects, according to Einstein's theory of general relativity.

## 4. How does the mass and distance between objects affect the force of universal gravitation?

The force of universal gravitation is directly proportional to the mass of the objects and inversely proportional to the square of the distance between them. This means that the greater the mass of the objects, the greater the force of attraction between them. Similarly, the further apart the objects are, the weaker the force of attraction between them.

## 5. How does universal gravitation affect the motion of planets?

Universal gravitation is responsible for keeping planets in orbit around the sun. The gravitational force between the sun and the planets causes them to continuously move in a circular or elliptical path. This force also keeps the planets from flying off into space due to their inertia.