Programming the forces the sun applies on earth

In summary, Salim is trying to create a 2D simulation of the Earth going around the sun. He is facing an issue however, he isn't sure what are the forces that apply on the Earth in a 2D aspect. He knows there is the gravitational pull GM1M2/R^2. He also knows there is momentum, which is P = V * R, but he has questions regarding it. Salim outlines a method of integrating equations numerically in order to gain a better understanding of the forces at work.
  • #1
salimwtf
1
0
Hey guys,

I am trying to create a 2d simulation of the Earth going around the sun. However I am facing an issue. I am not sure what are the forces that apply on the Earth in a 2d aspect.

I know there is the gravitational pull GM1M2/R^2.

I know there is momentum, which is P = V * R, but I have questions regarding it. How do I break it down to a vector? Pi + Pj.. I realize I could probably do something like calculating P and then just doing Pcose(theta)i + Psin(theta)J but what is theta? how do I calculate it? or more like which angle is it?

Also does angular velocity have to do with anything here? if so how do I calculate it?.


Sorry for the many questions. Its sad to admit.. but I took all the calculus based physics classes like 1.5 years ago plus a quantum mechanics class.. And I forgot most of the stuff after I got a job..
 
Physics news on Phys.org
  • #2
What you do is you choose an initial position and velocity, x and y components for both, and a small timestep [itex] \Delta t [/itex]

Then you update the position

[tex] x = x + v_x \Delta t [/tex]

same for y.

update the velocity:

[tex] v_x = v_x + a_x \Delta t [/tex]
Where
[tex] a_x = \frac {F_x} {m} [/tex]

now [itex] F_x = F cos { \phi } [/itex]

F is what you wrote, and

[tex] cos {\phi} = \frac {x_s - x_e} {R} [/tex]

updating v_y is identical except that F_y = F sin(phi) and

[tex] sin {\phi} = \frac {y_s - y_e} {R} [/tex]

you can find R with pythagoras.

Of course you'll be making error, because the position and velocity will change during the timestep.
This is a rather primitive method (euler method) where the error is proportional to the timestep.
Look up runge-kutta method
 
  • #3
In 2D, the position, the velocity and the force are vectors with 2 components. It is convenient to set up your coordinate system so that the Sun is at its origin. The position of the Earth is then simply ##x## and ##y##, its velocity is ##v_x## and ##v_y##, and the force is ##F_x## and ##F_y##. The magnitude of the force depends on ##r##, the distance from the Sun, which is given by Pythagoras ## r = \sqrt {x^2 + y^2} ##; thus the magnitude of the force is $$ F = G {mM \over x^2 + y^2 }. $$ The direction of the force is the direction opposite to the position vector, so the direction cosines are obtained from the position vector: $$ \cos \alpha = - {x \over \sqrt{x^2 + y^2}}, \cos \beta = - {y \over \sqrt{x^2 + y^2}} $$ so the components of the force are $$ F_x = F \cos \alpha = - {x \over \sqrt{x^2 + y^2}} G {mM \over x^2 + y^2 } = - G mM x \left(x^2 + y^2 \right)^{-{3 \over 2}} $$ and $$ F_y = F \cos \beta = - G mM y \left(x^2 + y^2 \right)^{-{3 \over 2}} $$ This can be re-formulated in polar coordinates, but that will probably confuse you rather than help at this stage. Stick with the Cartesian coordinates for now, take a stab at integrating your equations numerically with the simple method (Euler's), then things will starting making a lot more sense.
 
  • #4
Hello Salim,

Depending on the purposes of your simulation you want to put an adequate amount of advance knowledge in it. Just integrating in x and y may be fine for a short period, but if you need something that is stable for a few centuries of simulated time, it would be better to first study and understand Kepler's[/PLAIN] laws. You can then decide to ignore or take into account the eccentricity of Earth's orbit.

If your simulation is a start towards something that includes the moon and perhaps also other planets, do some more research, or be prepared to throw away lots of rapid prototypes...

I came upon this thread via willem2
 
Last edited by a moderator:
  • #5


Hi there,

It sounds like you are on the right track with your understanding of the forces at play in a 2D simulation of the Earth orbiting the sun. As you mentioned, the main force acting on the Earth is the gravitational pull from the sun, which can be calculated using the equation GM1M2/R^2. This force acts as a centripetal force, keeping the Earth in its orbit around the sun.

In terms of momentum, you are correct in thinking that it can be broken down into a vector using the formula P = mv. In this case, v would represent the velocity of the Earth, and m would be its mass. The direction of the velocity vector would depend on the direction of the Earth's motion at any given point in its orbit. As for theta, it would represent the angle between the velocity vector and the x-axis in your simulation. This angle can be calculated using trigonometry, taking into account the Earth's position and velocity at a specific point in time.

Angular velocity can also play a role in your simulation, as it represents the rate at which the Earth is rotating around the sun. It can be calculated using the formula v = rw, where v is the linear velocity, r is the distance from the Earth to the sun, and w is the angular velocity. This can help you determine how quickly the Earth is moving around the sun and how it changes over time.

I hope this helps answer some of your questions and gives you a better understanding of the forces at play in your simulation. Don't worry about forgetting some of the concepts from your physics classes – it's perfectly normal, and it's great that you are taking the initiative to refresh your knowledge and continue learning. Keep up the good work!
 

FAQ: Programming the forces the sun applies on earth

1. What is the force of gravity between the sun and the earth?

The force of gravity between the sun and the earth is approximately 3.54 x 10^22 Newtons. This force is what keeps the earth in orbit around the sun.

2. How does the distance between the sun and the earth affect the force of gravity?

The force of gravity is inversely proportional to the square of the distance between two objects. This means that as the distance between the sun and the earth increases, the force of gravity decreases.

3. What other forces besides gravity does the sun exert on the earth?

In addition to gravity, the sun also exerts electromagnetic forces, such as radiation and solar wind, on the earth. These forces can have a significant impact on the earth's atmosphere and magnetic field.

4. How does the tilt of the earth's axis affect the forces exerted by the sun?

The tilt of the earth's axis causes variations in the amount of solar radiation that reaches different parts of the earth's surface. This can impact the distribution of heat and energy on the earth's surface, leading to changes in weather patterns and climate.

5. How do scientists measure and study the forces exerted by the sun on the earth?

Scientists use a variety of instruments, such as satellites and telescopes, to measure and study the forces exerted by the sun on the earth. They also use mathematical models and simulations to better understand the complex interactions between the sun and the earth.

Back
Top