# System Earth Sun Moon

1. Apr 26, 2009

### azulbleu

Hello.

I would like to know if these formulas are correct cause I'm trying to trace the moon-earth trajectory around the sun on fortran 90 and I just cant get it correctly. So this is the first set of equations I would like to check.

1. Gravitational attraction force that the moon and the sun exert on the earth

2. Gravitational attraction force that the earth and the sun exert on the moon

Variables

xt= x-component of the earth's position
yt= y-component of the earth's position

xl = x-component of the moon's position
yl = y-component of the moon's position

G = Gravitational constant
mt = mass of the earth ; ml = mass of the moon; ms = mass of the sun

1. Fearth(Total force exerted on the earth) = Fsun, earth(force sun exerts on earth) + Fmoon, earth(force moon exerts on earth)

**FX earth: x-component of Fearth :

=> FX sun, earth = - G*ms*mt*xt / SQRT( (xt)² + (yt²) )**3

=> FX moon, earth = - G*ml*mt*(xt - xl) / SQRT( (xt - xl) )² + (yt - yl)² )**3

**FY earth: x-component of Fearth :

=> FY sun, earth = - G*ms*mt*yt / SQRT( (xt)² + (yt²) )**3

=> FY moon, earth = - G*ml**ms(yt - yl) / SQRT( (xt - xl) )² + (yt - yl)² )**3

So the total gravitational force exerted on the earth due to the sun and the moon is

FX sun, earth + FX moon, earth + FY sun, earth + FY moon, earth

2.Fmoon(Total force exerted on the moon) = Fsun, moon(force sun exerts on moon) + Fearth, moon(force earth exerts on moon)

**FX moon: x-component of Fmoon :

=> FX sun, moon = - G*ms*ml*xl / SQRT( (xl)² + (yl²) )**3

=> FX earth, moon = - G*mt*ml(xl - xt) / SQRT( (xl - xt) )² + (yl - yt)² )**3

**FY moon: y-component of Fmoon :

=> FY sun, moon = - G*ms*ml*yl / SQRT( (xl)² + (yl²) )**3

=> FY earth, moon = - G*mt*ml*(yl - yt) / SQRT( (xl - xt) )² + (yl - yt)² )**3

So the total gravitational force exerted on the moon due to the sun and the earth is

FX sun, moon + FX earth, moon + FY sun, moon + FY earth, moon