Physics Simulation: Calculating Gravitational Force between Earth and Sun

In summary, the conversation discussed the process of writing a program to simulate the motion of planets and moons in our solar system using Newton's laws of gravity and motion. The initial values and results were shared and checked for accuracy. The idea of using Verlet integration for orbiting systems was also suggested. It was also mentioned that the force due to gravity is not constant and should be recalculated at each time step. The discussion also included the concept of centrifugal force and its role in the simulation.
  • #1
braindeaduser
1
0
I've written a couple of small physics simulations in the past (hey, everyone has to have a hobby) and now I'm trying to write something a little more complex so decided to attempt to write an program that simulates the motion of the planets and moons in our solar-system entirely procedurally - initially I'm starting off with just the Earth and the Sun.

With the initial values as follows:
Mass Sun: 1.989x10^30kg
Mass Earth: 5.976x10^24kg
Mean distance between the Earth and the Sun: 1.496x10^8km

I'm using Newton's law of Universal Gravitation to calculate the gravitational force between the sun and the Earth as 3.54476x10^28N

I then use F=ma to calculate the Earth's acceleration towards the sun and visa versa:
Earth towards Sun: 5.93166x10^3ms-1
Sun towards Earth: 1.78218x10^-2ms-1

My problem is, I'm not sure if these results are correct and after a good hour of scouring google and a small pile of physics textbooks I can't seem to find the correct values for my calculations to check these with. If anyone can check the math for me or point me to a site with these values i'd appreciate it greatly.

cheers
 
Physics news on Phys.org
  • #3
Did u check for the centrifual force?
And one more thing u will obviously get a very small accelaration of sun towards earth.
 
  • #4
They seem okay. Btw, for orbiting systems, Verlet integration is a very good way to go, as it preserves energy in this case.
 
  • #5
No you went wrong somewhere you should have got 3.54476E22N

Did you remember to convert the kilometers to meters? 1.496E8km = 1.496E11m

The easiest way to do it is in scientific notation simple do the maths on the number and add and subtract the exponentials


Mass Sun: 1.989E30 kg
Mass Earth: 5.976E24 kg
Mean distance between the Earth and the Sun: 1.496E11 m
Gravitational constant 6.673E-11 m3 kg-1 s-2

F = G x M1 x M2 / (R x R)

= 6.673E-11 x 1.989E30 x 5.976E24 / (1.496E11 x 1.496E11)

= 79.317E43 / 2.238E22

= 35.441E21 Newtons

(now correct to 1 decimal place for proper scientific notation)
= 3.5441E22 Newtons

If you want to cheat and not do the maths :-)
http://www.ajdesigner.com/phpgravity/Newtons_law_gravity_equation_force.php
 
  • #6
Strictly speaking, the force due to gravity is not constant because the distance between a planet and the sun is not constant. The planets do not travel in perfect circles, but in ellipses. So it is best to recalculate the gravitational forces at every time step. This is especially true when you start adding other planets to the simulation, because they exert gravitational forces on each other and do not have constant separations. If you approach the problem generally and apply total forces and find total accelerations for each body (don't treat the sun as special), then you can use the same code to simulate beautiful binary star system trajectories.

By the way, you don't have to program in centrifugal force because it is a fictional force. If you program the gravitational accelerations properly, the apparent effect that we can centrifugal force will appear automatically.
 
  • #7
cephron said:
I'm interested in any input.(and to the original poster, let me know if you consider this to be hijacking your thread beyond your purposes; I'll apologize and start a new one...)
Note well: The hijack isn't your fault, cephron.

The last time the OP was here was September 3 in 2007, so close to 4 years ago.

This thread is now locked. The continued discussion on velocity verlet et al is [thread=513844]here[/thread].
 
Last edited:

FAQ: Physics Simulation: Calculating Gravitational Force between Earth and Sun

How is the gravitational force between Earth and Sun calculated?

The gravitational force between Earth and Sun is calculated using Newton's Law of Universal Gravitation, which states that the force of gravity between two objects is directly proportional to the product of their masses and inversely proportional to the square of the distance between them.

What are the masses of Earth and Sun used in the calculation?

The mass of Earth used in the calculation is approximately 5.972 x 10^24 kilograms, while the mass of the Sun is approximately 1.989 x 10^30 kilograms.

How far apart are Earth and Sun when calculating gravitational force?

The distance between Earth and Sun used in the calculation varies depending on the specific context. The average distance between Earth and Sun, known as an astronomical unit (AU), is approximately 149.6 million kilometers. However, for more precise calculations, the distance may be measured in meters or other units.

What is the formula for calculating gravitational force between Earth and Sun?

The formula for calculating gravitational force between Earth and Sun is F = G * (m1 * m2) / r^2, where F is the force of gravity, G is the gravitational constant (approximately 6.674 x 10^-11 N*m^2/kg^2), m1 and m2 are the masses of Earth and Sun respectively, and r is the distance between them.

How does the gravitational force between Earth and Sun affect the motion of objects?

The gravitational force between Earth and Sun is responsible for keeping Earth in orbit around the Sun and maintaining the stability of our solar system. It also affects the motion of objects on Earth's surface, causing objects to accelerate towards the center of the Earth. The strength of the gravitational force decreases as the distance between objects increases, which is why objects on Earth's surface do not experience the same gravitational force as objects in orbit.

Similar threads

Replies
7
Views
1K
Replies
4
Views
1K
Replies
37
Views
4K
Replies
7
Views
4K
Replies
9
Views
2K
Replies
1
Views
1K
Back
Top